diff options
Diffstat (limited to 'src/widgets/widgets/qcombobox.cpp')
-rw-r--r-- | src/widgets/widgets/qcombobox.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp index afe8f1c3f4..bdd06da7fc 100644 --- a/src/widgets/widgets/qcombobox.cpp +++ b/src/widgets/widgets/qcombobox.cpp @@ -2086,6 +2086,20 @@ QString QComboBox::currentText() const } /*! + \property QComboBox::currentData + \brief the data for the current item + \since 5.2 + + By default, for an empty combo box or a combo box in which no current + item is set, this property contains an invalid QVariant. +*/ +QVariant QComboBox::currentData(int role) const +{ + Q_D(const QComboBox); + return d->currentIndex.data(role); +} + +/*! Returns the text for the given \a index in the combobox. */ QString QComboBox::itemText(int index) const |