diff options
author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2019-02-01 22:39:43 +0100 |
---|---|---|
committer | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2019-02-12 17:12:55 +0000 |
commit | 0e82e1bd237fe295e0e30ec3613afd95142f3941 (patch) | |
tree | 16ba7733657633ec8b8b8284b81cc03f0903ec88 /src/widgets/widgets/qcombobox.cpp | |
parent | a7123de6c99b4949fb1b3affffcba3bf9a9d372f (diff) |
QComboBox: deprecate signal currentIndexChanged(const QString &)
QComboBox has two overloaded signals currentIndexChanged(). This results
in a need to use QOverload<>::of or similar when using the new
signal/slot syntax.
Since there is already a signal 'currentTextChanged()' which is
emitted too, deprecate 'currentIndexChanged(const QString &)'.
Change-Id: Iadac8930de1721b042fa1daea097c8ab5378738e
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/widgets/widgets/qcombobox.cpp')
-rw-r--r-- | src/widgets/widgets/qcombobox.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp index 2c478f364d..f3e6bd80f4 100644 --- a/src/widgets/widgets/qcombobox.cpp +++ b/src/widgets/widgets/qcombobox.cpp @@ -895,14 +895,21 @@ QStyleOptionComboBox QComboBoxPrivateContainer::comboStyleOption() const currentIndex was reset. */ +#if QT_DEPRECATED_SINCE(5, 13) /*! \fn void QComboBox::currentIndexChanged(const QString &text) \since 4.1 + \obsolete + + Use currentTextChanged(const QString &) or currentIndexChanged(int) + instead. + This signal is sent whenever the currentIndex in the combobox changes either through user interaction or programmatically. The item's \a text is passed. */ +#endif /*! \fn void QComboBox::currentTextChanged(const QString &text) @@ -1375,7 +1382,9 @@ void QComboBoxPrivate::_q_emitCurrentIndexChanged(const QModelIndex &index) Q_Q(QComboBox); const QString text = itemText(index); emit q->currentIndexChanged(index.row()); +#if QT_DEPRECATED_SINCE(5, 13) emit q->currentIndexChanged(text); +#endif // signal lineEdit.textChanged already connected to signal currentTextChanged, so don't emit double here if (!lineEdit) emit q->currentTextChanged(text); |