diff --git a/src/widgets/dialogs/qdialog.cpp b/src/widgets/dialogs/qdialog.cpp index cc04110a30..efd2c2ffea 100644 --- a/src/widgets/dialogs/qdialog.cpp +++ b/src/widgets/dialogs/qdialog.cpp @@ -946,6 +946,7 @@ void QDialog::adjustPosition(QWidget* w) move(p); } +#if QT_DEPRECATED_SINCE(5, 13) /*! \obsolete @@ -1090,7 +1091,7 @@ void QDialog::showExtension(bool showIt) #endif } } - +#endif /*! \reimp */ QSize QDialog::sizeHint() const diff --git a/src/widgets/dialogs/qdialog.h b/src/widgets/dialogs/qdialog.h index 7f267dd939..ce57ce5de7 100644 --- a/src/widgets/dialogs/qdialog.h +++ b/src/widgets/dialogs/qdialog.h @@ -69,11 +69,12 @@ public: void setVisible(bool visible) override; - void setOrientation(Qt::Orientation orientation); - Qt::Orientation orientation() const; - - void setExtension(QWidget* extension); - QWidget* extension() const; +#if QT_DEPRECATED_SINCE(5, 13) + QT_DEPRECATED void setOrientation(Qt::Orientation orientation); + QT_DEPRECATED Qt::Orientation orientation() const; + QT_DEPRECATED void setExtension(QWidget* extension); + QT_DEPRECATED QWidget* extension() const; +#endif QSize sizeHint() const override; QSize minimumSizeHint() const override; @@ -96,7 +97,9 @@ public Q_SLOTS: virtual void accept(); virtual void reject(); - void showExtension(bool); +#if QT_DEPRECATED_SINCE(5, 13) + QT_DEPRECATED void showExtension(bool); +#endif protected: QDialog(QDialogPrivate &, QWidget *parent, Qt::WindowFlags f = Qt::WindowFlags()); diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp index edaa7854ba..f42cf89708 100644 --- a/src/widgets/dialogs/qfiledialog.cpp +++ b/src/widgets/dialogs/qfiledialog.cpp @@ -1359,6 +1359,7 @@ void QFileDialog::setNameFilter(const QString &filter) } +#if QT_DEPRECATED_SINCE(5, 13) /*! \property QFileDialog::nameFilterDetailsVisible \obsolete @@ -1380,6 +1381,7 @@ bool QFileDialog::isNameFilterDetailsVisible() const { return !testOption(HideNameFilterDetails); } +#endif /* @@ -1879,6 +1881,7 @@ bool QFileDialog::isReadOnly() const return testOption(ReadOnly); } +#if QT_DEPRECATED_SINCE(5, 13) /*! \property QFileDialog::resolveSymlinks \obsolete @@ -1899,6 +1902,7 @@ bool QFileDialog::resolveSymlinks() const { return !testOption(DontResolveSymlinks); } +#endif /*! \property QFileDialog::confirmOverwrite diff --git a/src/widgets/dialogs/qfiledialog.h b/src/widgets/dialogs/qfiledialog.h index a4d289a77a..8a99112081 100644 --- a/src/widgets/dialogs/qfiledialog.h +++ b/src/widgets/dialogs/qfiledialog.h @@ -65,11 +65,13 @@ class Q_WIDGETS_EXPORT QFileDialog : public QDialog Q_PROPERTY(FileMode fileMode READ fileMode WRITE setFileMode) Q_PROPERTY(AcceptMode acceptMode READ acceptMode WRITE setAcceptMode) Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly DESIGNABLE false) - Q_PROPERTY(bool resolveSymlinks READ resolveSymlinks WRITE setResolveSymlinks DESIGNABLE false) Q_PROPERTY(bool confirmOverwrite READ confirmOverwrite WRITE setConfirmOverwrite DESIGNABLE false) Q_PROPERTY(QString defaultSuffix READ defaultSuffix WRITE setDefaultSuffix) +#if QT_DEPRECATED_SINCE(5, 13) + Q_PROPERTY(bool resolveSymlinks READ resolveSymlinks WRITE setResolveSymlinks DESIGNABLE false) Q_PROPERTY(bool nameFilterDetailsVisible READ isNameFilterDetailsVisible WRITE setNameFilterDetailsVisible DESIGNABLE false) +#endif Q_PROPERTY(Options options READ options WRITE setOptions) Q_PROPERTY(QStringList supportedSchemes READ supportedSchemes WRITE setSupportedSchemes) @@ -117,8 +119,12 @@ public: void selectUrl(const QUrl &url); QList selectedUrls() const; +#if QT_DEPRECATED_SINCE(5, 13) + QT_DEPRECATED_X("Use setOption(HideNameFilterDetails, !enabled) instead") void setNameFilterDetailsVisible(bool enabled); + QT_DEPRECATED_X("Use !testOption(HideNameFilterDetails) instead") bool isNameFilterDetailsVisible() const; +#endif void setNameFilter(const QString &filter); void setNameFilters(const QStringList &filters); @@ -148,8 +154,12 @@ public: void setReadOnly(bool enabled); bool isReadOnly() const; +#if QT_DEPRECATED_SINCE(5, 13) + QT_DEPRECATED_X("Use setOption(DontResolveSymlinks, !enabled) instead") void setResolveSymlinks(bool enabled); + QT_DEPRECATED_X("Use !testOption(DontResolveSymlinks) instead") bool resolveSymlinks() const; +#endif void setSidebarUrls(const QList &urls); QList sidebarUrls() const; diff --git a/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp b/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp index ae8e4f7e04..9668c82ef2 100644 --- a/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp +++ b/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp @@ -854,9 +854,9 @@ void tst_QFiledialog::resolveSymlinks() // default QCOMPARE(fd.resolveSymlinks(), true); - fd.setResolveSymlinks(false); + fd.setOption(QFileDialog::DontResolveSymlinks, true); QCOMPARE(fd.resolveSymlinks(), false); - fd.setResolveSymlinks(true); + fd.setOption(QFileDialog::DontResolveSymlinks, false); QCOMPARE(fd.resolveSymlinks(), true); // the file dialog doesn't do anything based upon this, just passes it to the model @@ -1119,7 +1119,7 @@ void tst_QFiledialog::setNameFilter() QFileDialog fd; fd.setNameFilters(filters); - fd.setNameFilterDetailsVisible(nameFilterDetailsVisible); + fd.setOption(QFileDialog::HideNameFilterDetails, !nameFilterDetailsVisible); fd.selectNameFilter(selectFilter); QCOMPARE(fd.selectedNameFilter(), expectedSelectedFilter); } diff --git a/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp b/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp index 24ce598279..20fc7c9a6c 100644 --- a/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp +++ b/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp @@ -252,7 +252,7 @@ void tst_QFileDialog2::showNameFilterDetails() QFileDialog fd; QComboBox *filters = fd.findChild("fileTypeCombo"); QVERIFY(filters); - QVERIFY(fd.isNameFilterDetailsVisible()); + QVERIFY(!fd.testOption(QFileDialog::HideNameFilterDetails)); QStringList filterChoices; @@ -261,12 +261,12 @@ void tst_QFileDialog2::showNameFilterDetails() << "Any files (*.*)"; fd.setNameFilters(filterChoices); - fd.setNameFilterDetailsVisible(false); + fd.setOption(QFileDialog::HideNameFilterDetails, true); QCOMPARE(filters->itemText(0), QString("Image files")); QCOMPARE(filters->itemText(1), QString("Text files")); QCOMPARE(filters->itemText(2), QString("Any files")); - fd.setNameFilterDetailsVisible(true); + fd.setOption(QFileDialog::HideNameFilterDetails, false); QCOMPARE(filters->itemText(0), filterChoices.at(0)); QCOMPARE(filters->itemText(1), filterChoices.at(1)); QCOMPARE(filters->itemText(2), filterChoices.at(2)); diff --git a/tests/manual/dialogs/filedialogpanel.cpp b/tests/manual/dialogs/filedialogpanel.cpp index 9e3c761cff..e628dd2265 100644 --- a/tests/manual/dialogs/filedialogpanel.cpp +++ b/tests/manual/dialogs/filedialogpanel.cpp @@ -439,7 +439,7 @@ void FileDialogPanel::restoreDefaults() m_showDirsOnly->setChecked(d.testOption(QFileDialog::ShowDirsOnly)); m_allowedSchemes->setText(QString()); m_confirmOverWrite->setChecked(d.confirmOverwrite()); - m_nameFilterDetailsVisible->setChecked(d.isNameFilterDetailsVisible()); + m_nameFilterDetailsVisible->setChecked(!d.testOption(QFileDialog::HideNameFilterDetails)); m_resolveSymLinks->setChecked(d.resolveSymlinks()); m_readOnly->setChecked(d.isReadOnly()); m_native->setChecked(true);