summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qcombobox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/widgets/qcombobox.cpp')
-rw-r--r--src/widgets/widgets/qcombobox.cpp65
1 files changed, 3 insertions, 62 deletions
diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp
index df8e7b4a3f..47993b8f3b 100644
--- a/src/widgets/widgets/qcombobox.cpp
+++ b/src/widgets/widgets/qcombobox.cpp
@@ -905,20 +905,9 @@ QStyleOptionComboBox QComboBoxPrivateContainer::comboStyleOption() const
The item's \a index is passed. Note that this signal is sent even
when the choice is not changed. If you need to know when the
choice actually changes, use signal currentIndexChanged().
-
*/
/*!
- \fn void QComboBox::activated(const QString &text)
-
- This signal is sent when the user chooses an item in the combobox.
- The item's \a text is passed. Note that this signal is sent even
- when the choice is not changed. If you need to know when the
- choice actually changes, use signal currentIndexChanged().
-
- \obsolete Use QComboBox::textActivated() instead
-*/
-/*!
\fn void QComboBox::textActivated(const QString &text)
\since 5.14
@@ -936,14 +925,6 @@ QStyleOptionComboBox QComboBoxPrivateContainer::comboStyleOption() const
*/
/*!
- \fn void QComboBox::highlighted(const QString &text)
-
- This signal is sent when an item in the combobox popup list is
- highlighted by the user. The item's \a text is passed.
-
- \obsolete Use textHighlighted() instead
-*/
-/*!
\fn void QComboBox::textHighlighted(const QString &text)
\since 5.14
@@ -952,29 +933,6 @@ QStyleOptionComboBox QComboBoxPrivateContainer::comboStyleOption() const
*/
/*!
- \fn void QComboBox::currentIndexChanged(int index)
- \since 4.1
-
- 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.
-
- \obsolete Use currentIndexChanged(int index, const QString &text) instead
-*/
-
-/*!
- \fn void QComboBox::currentIndexChanged(const QString &text)
- \since 4.1
-
- 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
@@ -1438,12 +1396,6 @@ void QComboBoxPrivate::emitActivated(const QModelIndex &index)
QString text(itemText(index));
emit q->activated(index.row());
emit q->textActivated(text);
-#if QT_DEPRECATED_SINCE(5, 15)
-QT_WARNING_PUSH
-QT_WARNING_DISABLE_DEPRECATED
- emit q->activated(text);
-QT_WARNING_POP
-#endif
}
void QComboBoxPrivate::_q_emitHighlighted(const QModelIndex &index)
@@ -1454,25 +1406,12 @@ void QComboBoxPrivate::_q_emitHighlighted(const QModelIndex &index)
QString text(itemText(index));
emit q->highlighted(index.row());
emit q->textHighlighted(text);
-#if QT_DEPRECATED_SINCE(5, 15)
-QT_WARNING_PUSH
-QT_WARNING_DISABLE_DEPRECATED
- emit q->highlighted(text);
-QT_WARNING_POP
-#endif
}
void QComboBoxPrivate::_q_emitCurrentIndexChanged(const QModelIndex &index)
{
Q_Q(QComboBox);
const QString text = itemText(index);
-#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)
@@ -2129,6 +2068,9 @@ QAbstractItemDelegate *QComboBox::itemDelegate() const
Sets the item \a delegate for the popup list view.
The combobox takes ownership of the delegate.
+ Any existing delegate will be removed, but not deleted. QComboBox
+ does not take ownership of \a delegate.
+
\warning You should not share the same instance of a delegate between comboboxes,
widget mappers or views. Doing so can cause incorrect or unintuitive editing behavior
since each view connected to a given delegate may receive the
@@ -2143,7 +2085,6 @@ void QComboBox::setItemDelegate(QAbstractItemDelegate *delegate)
qWarning("QComboBox::setItemDelegate: cannot set a 0 delegate");
return;
}
- delete view()->itemDelegate();
view()->setItemDelegate(delegate);
}