From 11dc7b35c8c3957bd19087a5e3ae7cfc4f1a3343 Mon Sep 17 00:00:00 2001 From: Vitaly Fanaskov Date: Wed, 5 Feb 2020 10:53:19 +0100 Subject: QComboBox: deprecate currentIndexChanged(const QString&) Task-number: QTBUG-81845 Change-Id: Ia0ff5321423a5d3d4853bd425dd7236926f16047 Reviewed-by: Christian Ehrlicher Reviewed-by: Richard Moe Gustavsen --- src/widgets/widgets/qcombobox.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'src/widgets/widgets/qcombobox.cpp') diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp index bc9d01ac38..8c05c6de7a 100644 --- a/src/widgets/widgets/qcombobox.cpp +++ b/src/widgets/widgets/qcombobox.cpp @@ -959,6 +959,8 @@ QStyleOptionComboBox QComboBoxPrivateContainer::comboStyleOption() const changes either through user interaction or programmatically. The item's \a index is passed or -1 if the combobox becomes empty or the currentIndex was reset. + + \obsolete Use currentIndexChanged(int index, const QString &text) instead */ /*! @@ -968,6 +970,18 @@ QStyleOptionComboBox QComboBoxPrivateContainer::comboStyleOption() const This signal is sent whenever the currentIndex in the combobox changes either through user interaction or programmatically. The item's \a text is passed. + + \obsolete Use currentIndexChanged(int index, const QString &text) instead +*/ + +/*! + \fn void QComboBox::currentIndexChanged(int index, const QString &text) + \since 5.15 + + This signal is sent whenever the currentIndex in the combobox + changes either through user interaction or programmatically. The + item's \a index is passed or -1 if the combobox becomes empty or + the currentIndex was reset. The item's \a text is also passed. */ /*! @@ -1452,13 +1466,14 @@ 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) +#if QT_DEPRECATED_SINCE(5, 15) QT_WARNING_PUSH QT_WARNING_DISABLE_DEPRECATED + emit q->currentIndexChanged(index.row()); emit q->currentIndexChanged(text); QT_WARNING_POP #endif + emit q->currentIndexChanged(index.row(), text); // signal lineEdit.textChanged already connected to signal currentTextChanged, so don't emit double here if (!lineEdit) emit q->currentTextChanged(text); -- cgit v1.2.3