summaryrefslogtreecommitdiffstats
path: root/src/widgets/dialogs
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2020-04-15 16:55:41 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2020-04-16 11:05:28 +0200
commitfe4a5a27e09b8109381e52aa1b71135a916dff1a (patch)
tree40f74fe0bd96c1c56e266022cccb252b154a9965 /src/widgets/dialogs
parentf7284293359663f52d52e79f51ed2e1fe9e6f307 (diff)
Remove deprecated members from dialog classes
And a few cleanups of out-dated comments and dead code. Change-Id: I59c6b9129a21b8953626cb63c3ebbf9b6c49a657 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/widgets/dialogs')
-rw-r--r--src/widgets/dialogs/qcolordialog.cpp28
-rw-r--r--src/widgets/dialogs/qcolordialog.h4
-rw-r--r--src/widgets/dialogs/qdialog.cpp153
-rw-r--r--src/widgets/dialogs/qdialog.h11
-rw-r--r--src/widgets/dialogs/qfiledialog.cpp87
-rw-r--r--src/widgets/dialogs/qfiledialog.h42
-rw-r--r--src/widgets/dialogs/qinputdialog.cpp36
-rw-r--r--src/widgets/dialogs/qinputdialog.h21
8 files changed, 4 insertions, 378 deletions
diff --git a/src/widgets/dialogs/qcolordialog.cpp b/src/widgets/dialogs/qcolordialog.cpp
index f815f17d55..2d1bfa65d3 100644
--- a/src/widgets/dialogs/qcolordialog.cpp
+++ b/src/widgets/dialogs/qcolordialog.cpp
@@ -2167,34 +2167,6 @@ QColor QColorDialog::getColor(const QColor &initial, QWidget *parent, const QStr
return dlg.selectedColor();
}
-#if QT_DEPRECATED_SINCE(5, 12)
-/*!
- \obsolete
-
- Pops up a modal color dialog to allow the user to choose a color
- and an alpha channel (transparency) value. The color+alpha is
- initially set to \a initial. The dialog is a child of \a parent.
-
- If \a ok is non-null, \e {*ok} is set to true if the user clicked
- \uicontrol{OK}, and to false if the user clicked Cancel.
-
- If the user clicks Cancel, the \a initial value is returned.
-
- Use QColorDialog::getColor() instead, passing the
- QColorDialog::ShowAlphaChannel option.
-*/
-
-QRgb QColorDialog::getRgba(QRgb initial, bool *ok, QWidget *parent)
-{
- const QColor color = getColor(QColor::fromRgba(initial), parent, QString(),
- ShowAlphaChannel);
- QRgb result = color.isValid() ? color.rgba() : initial;
- if (ok)
- *ok = color.isValid();
- return result;
-}
-#endif
-
/*!
Destroys the color dialog.
*/
diff --git a/src/widgets/dialogs/qcolordialog.h b/src/widgets/dialogs/qcolordialog.h
index cdbe0e7fb4..271c25f2dc 100644
--- a/src/widgets/dialogs/qcolordialog.h
+++ b/src/widgets/dialogs/qcolordialog.h
@@ -92,10 +92,6 @@ public:
const QString &title = QString(),
ColorDialogOptions options = ColorDialogOptions());
-#if QT_DEPRECATED_SINCE(5, 12)
- QT_DEPRECATED_X("Use getColor()") static QRgb getRgba(QRgb rgba = 0xffffffff, bool *ok = nullptr, QWidget *parent = nullptr);
-#endif
-
static int customCount();
static QColor customColor(int index);
static void setCustomColor(int index, QColor color);
diff --git a/src/widgets/dialogs/qdialog.cpp b/src/widgets/dialogs/qdialog.cpp
index 906022a185..d5daedef3e 100644
--- a/src/widgets/dialogs/qdialog.cpp
+++ b/src/widgets/dialogs/qdialog.cpp
@@ -785,12 +785,6 @@ void QDialog::setVisible(bool visible)
return;
QWidget::setVisible(visible);
-#if QT_DEPRECATED_SINCE(5, 13)
-QT_WARNING_PUSH
-QT_WARNING_DISABLE_DEPRECATED
- showExtension(d->doShowExtension);
-QT_WARNING_POP
-#endif
QWidget *fw = window()->focusWidget();
if (!fw)
fw = this;
@@ -957,153 +951,6 @@ void QDialog::adjustPosition(QWidget* w)
move(p);
}
-#if QT_DEPRECATED_SINCE(5, 13)
-/*!
- \obsolete
-
- If \a orientation is Qt::Horizontal, the extension will be displayed
- to the right of the dialog's main area. If \a orientation is
- Qt::Vertical, the extension will be displayed below the dialog's main
- area.
-
- Instead of using this functionality, we recommend that you simply call
- show() or hide() on the part of the dialog that you want to use as an
- extension. See the \l{Extension Example} for details.
-
- \sa setExtension()
-*/
-void QDialog::setOrientation(Qt::Orientation orientation)
-{
- Q_D(QDialog);
- d->orientation = orientation;
-}
-
-/*!
- \obsolete
-
- Returns the dialog's extension orientation.
-
- Instead of using this functionality, we recommend that you simply call
- show() or hide() on the part of the dialog that you want to use as an
- extension. See the \l{Extension Example} for details.
-
- \sa extension()
-*/
-Qt::Orientation QDialog::orientation() const
-{
- Q_D(const QDialog);
- return d->orientation;
-}
-
-/*!
- \obsolete
-
- Sets the widget, \a extension, to be the dialog's extension,
- deleting any previous extension. The dialog takes ownership of the
- extension. Note that if \nullptr is passed, any existing extension will be
- deleted. This function must only be called while the dialog is hidden.
-
- Instead of using this functionality, we recommend that you simply call
- show() or hide() on the part of the dialog that you want to use as an
- extension. See the \l{Extension Example} for details.
-
- \sa showExtension(), setOrientation()
-*/
-void QDialog::setExtension(QWidget* extension)
-{
- Q_D(QDialog);
- delete d->extension;
- d->extension = extension;
-
- if (!extension)
- return;
-
- if (extension->parentWidget() != this)
- extension->setParent(this);
- extension->hide();
-}
-
-/*!
- \obsolete
-
- Returns the dialog's extension or \nullptr if no extension has been
- defined.
-
- Instead of using this functionality, we recommend that you simply call
- show() or hide() on the part of the dialog that you want to use as an
- extension. See the \l{Extension Example} for details.
-
- \sa showExtension(), setOrientation()
-*/
-QWidget* QDialog::extension() const
-{
- Q_D(const QDialog);
- return d->extension;
-}
-
-
-/*!
- \obsolete
-
- If \a showIt is true, the dialog's extension is shown; otherwise the
- extension is hidden.
-
- Instead of using this functionality, we recommend that you simply call
- show() or hide() on the part of the dialog that you want to use as an
- extension. See the \l{Extension Example} for details.
-
- \sa show(), setExtension(), setOrientation()
-*/
-void QDialog::showExtension(bool showIt)
-{
- Q_D(QDialog);
- d->doShowExtension = showIt;
- if (!d->extension)
- return;
- if (!testAttribute(Qt::WA_WState_Visible))
- return;
- if (d->extension->isVisible() == showIt)
- return;
-
- if (showIt) {
- d->size = size();
- d->min = minimumSize();
- d->max = maximumSize();
- if (layout())
- layout()->setEnabled(false);
- QSize s(d->extension->sizeHint()
- .expandedTo(d->extension->minimumSize())
- .boundedTo(d->extension->maximumSize()));
- if (d->orientation == Qt::Horizontal) {
- int h = qMax(height(), s.height());
- d->extension->setGeometry(width(), 0, s.width(), h);
- setFixedSize(width() + s.width(), h);
- } else {
- int w = qMax(width(), s.width());
- d->extension->setGeometry(0, height(), w, s.height());
- setFixedSize(w, height() + s.height());
- }
- d->extension->show();
-#if QT_CONFIG(sizegrip)
- const bool sizeGripEnabled = isSizeGripEnabled();
- setSizeGripEnabled(false);
- d->sizeGripEnabled = sizeGripEnabled;
-#endif
- } else {
- d->extension->hide();
- // workaround for CDE window manager that won't shrink with (-1,-1)
- setMinimumSize(d->min.expandedTo(QSize(1, 1)));
- setMaximumSize(d->max);
- resize(d->size);
- if (layout())
- layout()->setEnabled(true);
-#if QT_CONFIG(sizegrip)
- setSizeGripEnabled(d->sizeGripEnabled);
-#endif
- }
-}
-#endif
-
/*! \reimp */
QSize QDialog::sizeHint() const
{
diff --git a/src/widgets/dialogs/qdialog.h b/src/widgets/dialogs/qdialog.h
index ce2194a1de..8c50642a64 100644
--- a/src/widgets/dialogs/qdialog.h
+++ b/src/widgets/dialogs/qdialog.h
@@ -69,13 +69,6 @@ public:
void setVisible(bool visible) override;
-#if QT_DEPRECATED_SINCE(5, 13)
- QT_DEPRECATED_X("Use show/hide on the affected widget instead") void setOrientation(Qt::Orientation orientation);
- QT_DEPRECATED_X("Use show/hide on the affected widget instead") Qt::Orientation orientation() const;
- QT_DEPRECATED_X("Use show/hide on the affected widget instead") void setExtension(QWidget* extension);
- QT_DEPRECATED_X("Use show/hide on the affected widget instead") QWidget* extension() const;
-#endif
-
QSize sizeHint() const override;
QSize minimumSizeHint() const override;
@@ -97,10 +90,6 @@ public Q_SLOTS:
virtual void accept();
virtual void reject();
-#if QT_DEPRECATED_SINCE(5, 13)
- QT_DEPRECATED_X("Use show/hide on the affected widget instead") 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 a319361ad8..5b4d861b8d 100644
--- a/src/widgets/dialogs/qfiledialog.cpp
+++ b/src/widgets/dialogs/qfiledialog.cpp
@@ -1386,31 +1386,6 @@ void QFileDialog::setNameFilter(const QString &filter)
}
-#if QT_DEPRECATED_SINCE(5, 13)
-/*!
- \property QFileDialog::nameFilterDetailsVisible
- \obsolete
- \brief This property holds whether the filter details is shown or not.
- \since 4.4
-
- When this property is \c true (the default), the filter details are shown
- in the combo box. When the property is set to false, these are hidden.
-
- Use setOption(HideNameFilterDetails, !\e enabled) or
- !testOption(HideNameFilterDetails).
-*/
-void QFileDialog::setNameFilterDetailsVisible(bool enabled)
-{
- setOption(HideNameFilterDetails, !enabled);
-}
-
-bool QFileDialog::isNameFilterDetailsVisible() const
-{
- return !testOption(HideNameFilterDetails);
-}
-#endif
-
-
/*
Strip the filters by removing the details, e.g. (*.*).
*/
@@ -1898,68 +1873,6 @@ QFileDialog::AcceptMode QFileDialog::acceptMode() const
return static_cast<AcceptMode>(d->options->acceptMode());
}
-#if QT_DEPRECATED_SINCE(5, 13)
-/*!
- \property QFileDialog::readOnly
- \obsolete
- \brief Whether the filedialog is read-only
-
- If this property is set to false, the file dialog will allow renaming,
- and deleting of files and directories and creating directories.
-
- Use setOption(ReadOnly, \e enabled) or testOption(ReadOnly) instead.
-*/
-void QFileDialog::setReadOnly(bool enabled)
-{
- setOption(ReadOnly, enabled);
-}
-
-bool QFileDialog::isReadOnly() const
-{
- return testOption(ReadOnly);
-}
-
-/*!
- \property QFileDialog::resolveSymlinks
- \obsolete
- \brief whether the filedialog should resolve shortcuts
-
- If this property is set to true, the file dialog will resolve
- shortcuts or symbolic links.
-
- Use setOption(DontResolveSymlinks, !\a enabled) or
- !testOption(DontResolveSymlinks).
-*/
-void QFileDialog::setResolveSymlinks(bool enabled)
-{
- setOption(DontResolveSymlinks, !enabled);
-}
-
-bool QFileDialog::resolveSymlinks() const
-{
- return !testOption(DontResolveSymlinks);
-}
-
-/*!
- \property QFileDialog::confirmOverwrite
- \obsolete
- \brief whether the filedialog should ask before accepting a selected file,
- when the accept mode is AcceptSave
-
- Use setOption(DontConfirmOverwrite, !\e enabled) or
- !testOption(DontConfirmOverwrite) instead.
-*/
-void QFileDialog::setConfirmOverwrite(bool enabled)
-{
- setOption(DontConfirmOverwrite, !enabled);
-}
-
-bool QFileDialog::confirmOverwrite() const
-{
- return !testOption(DontConfirmOverwrite);
-}
-#endif
-
/*!
\property QFileDialog::defaultSuffix
\brief suffix added to the filename if no other suffix was specified
diff --git a/src/widgets/dialogs/qfiledialog.h b/src/widgets/dialogs/qfiledialog.h
index 790f52f2e7..3703e7be26 100644
--- a/src/widgets/dialogs/qfiledialog.h
+++ b/src/widgets/dialogs/qfiledialog.h
@@ -67,13 +67,6 @@ 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(QString defaultSuffix READ defaultSuffix WRITE setDefaultSuffix)
-#if QT_DEPRECATED_SINCE(5, 13)
- Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly DESIGNABLE false)
- Q_PROPERTY(bool confirmOverwrite READ confirmOverwrite WRITE setConfirmOverwrite DESIGNABLE false)
- 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)
@@ -92,13 +85,10 @@ public:
ShowDirsOnly = 0x00000001,
DontResolveSymlinks = 0x00000002,
DontConfirmOverwrite = 0x00000004,
-#if QT_DEPRECATED_SINCE(5, 14)
- DontUseSheet Q_DECL_ENUMERATOR_DEPRECATED = 0x00000008,
-#endif
- DontUseNativeDialog = 0x00000010,
- ReadOnly = 0x00000020,
- HideNameFilterDetails = 0x00000040,
- DontUseCustomDirectoryIcons = 0x00000080
+ DontUseNativeDialog = 0x00000008,
+ ReadOnly = 0x00000010,
+ HideNameFilterDetails = 0x00000020,
+ DontUseCustomDirectoryIcons = 0x00000040
};
Q_ENUM(Option)
Q_DECLARE_FLAGS(Options, Option)
@@ -124,13 +114,6 @@ public:
void selectUrl(const QUrl &url);
QList<QUrl> 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);
QStringList nameFilters() const;
@@ -156,29 +139,12 @@ public:
void setAcceptMode(AcceptMode mode);
AcceptMode acceptMode() const;
-#if QT_DEPRECATED_SINCE(5, 13)
- void setReadOnly(bool enabled);
- bool isReadOnly() const;
-
- 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<QUrl> &urls);
QList<QUrl> sidebarUrls() const;
QByteArray saveState() const;
bool restoreState(const QByteArray &state);
-#if QT_DEPRECATED_SINCE(5, 13)
- QT_DEPRECATED_X("Use setOption(DontConfirmOverwrite, !enabled) instead")
- void setConfirmOverwrite(bool enabled);
- QT_DEPRECATED_X("Use !testOption(DontConfirmOverwrite) instead")
- bool confirmOverwrite() const;
-#endif
-
void setDefaultSuffix(const QString &suffix);
QString defaultSuffix() const;
diff --git a/src/widgets/dialogs/qinputdialog.cpp b/src/widgets/dialogs/qinputdialog.cpp
index 836d3bc1de..7569367768 100644
--- a/src/widgets/dialogs/qinputdialog.cpp
+++ b/src/widgets/dialogs/qinputdialog.cpp
@@ -1322,42 +1322,6 @@ int QInputDialog::getInt(QWidget *parent, const QString &title, const QString &l
}
/*!
- \fn int QInputDialog::getInteger(QWidget *parent, const QString &title, const QString &label, int value, int min, int max, int step, bool *ok, Qt::WindowFlags flags)
- \deprecated use getInt()
-
- Static convenience function to get an integer input from the user.
-
- \a title is the text which is displayed in the title bar of the dialog.
- \a label is the text which is shown to the user (it should say what should
- be entered).
- \a value is the default integer which the spinbox will be set to.
- \a min and \a max are the minimum and maximum values the user may choose.
- \a step is the amount by which the values change as the user presses the
- arrow buttons to increment or decrement the value.
-
- If \a ok is nonnull *\a ok will be set to true if the user pressed \uicontrol OK
- and to false if the user pressed \uicontrol Cancel. The dialog's parent is
- \a parent. The dialog will be modal and uses the widget \a flags.
-
- On success, this function returns the integer which has been entered by the
- user; on failure, it returns the initial \a value.
-
- Use this static function like this:
-
- \snippet dialogs/standarddialogs/dialog.cpp 0
-
- \sa getText(), getDouble(), getItem(), getMultiLineText()
-*/
-
-#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && !defined(Q_QDOC)
-double QInputDialog::getDouble(QWidget *parent, const QString &title, const QString &label,
- double value, double min, double max, int decimals, bool *ok,
- Qt::WindowFlags flags)
-{
- return QInputDialog::getDouble(parent, title, label, value, min, max, decimals, ok, flags, 1.0);
-}
-#endif
-/*!
Static convenience function to get a floating point number from the user.
\a title is the text which is displayed in the title bar of the dialog.
diff --git a/src/widgets/dialogs/qinputdialog.h b/src/widgets/dialogs/qinputdialog.h
index a8696cb562..d3c95ccd23 100644
--- a/src/widgets/dialogs/qinputdialog.h
+++ b/src/widgets/dialogs/qinputdialog.h
@@ -56,7 +56,6 @@ class Q_WIDGETS_EXPORT QInputDialog : public QDialog
{
Q_OBJECT
Q_DECLARE_PRIVATE(QInputDialog)
-// Q_ENUMS(InputMode InputDialogOption)
QDOC_PROPERTY(InputMode inputMode READ inputMode WRITE setInputMode)
QDOC_PROPERTY(QString labelText READ labelText WRITE setLabelText)
QDOC_PROPERTY(InputDialogOptions options READ options WRITE setOptions)
@@ -177,35 +176,15 @@ public:
int minValue = -2147483647, int maxValue = 2147483647,
int step = 1, bool *ok = nullptr, Qt::WindowFlags flags = Qt::WindowFlags());
-#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) || defined(Q_QDOC)
static double getDouble(QWidget *parent, const QString &title, const QString &label, double value = 0,
double minValue = -2147483647, double maxValue = 2147483647,
int decimals = 1, bool *ok = nullptr, Qt::WindowFlags flags = Qt::WindowFlags(),
double step = 1);
-#else
- static double getDouble(QWidget *parent, const QString &title, const QString &label,
- double value = 0, double minValue = -2147483647,
- double maxValue = 2147483647, int decimals = 1, bool *ok = nullptr,
- Qt::WindowFlags flags = Qt::WindowFlags());
- static double getDouble(QWidget *parent, const QString &title, const QString &label,
- double value, double minValue, double maxValue, int decimals, bool *ok,
- Qt::WindowFlags flags, double step);
-#endif
-
-#if QT_DEPRECATED_SINCE(5, 0)
- QT_DEPRECATED static inline int getInteger(QWidget *parent, const QString &title, const QString &label, int value = 0,
- int minValue = -2147483647, int maxValue = 2147483647,
- int step = 1, bool *ok = nullptr, Qt::WindowFlags flags = Qt::WindowFlags())
- {
- return getInt(parent, title, label, value, minValue, maxValue, step, ok, flags);
- }
-#endif
void setDoubleStep(double step);
double doubleStep() const;
Q_SIGNALS:
- // ### emit signals!
void textValueChanged(const QString &text);
void textValueSelected(const QString &text);
void intValueChanged(int value);