diff options
| author | Gabriel de Dietrich <gabriel.dedietrich@digia.com> | 2013-08-02 17:21:37 +0200 |
|---|---|---|
| committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-08-02 17:52:05 +0200 |
| commit | 4fb189bb885c159125203f53128301dc220c7795 (patch) | |
| tree | c92c69a63bbf255cba55f6dec721a6d2e7c645d3 | |
| parent | f8facda0199726cb39875a74af713c1795aaadbe (diff) | |
| download | qtquickcontrols-4fb189bb885c159125203f53128301dc220c7795.tar.gz | |
ComboBox: Fix confusing example and documentation about 'currentText'
Change-Id: I2fece9db05429eda91b600c26b679b4fcd950f74
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
| -rw-r--r-- | src/controls/ComboBox.qml | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/controls/ComboBox.qml b/src/controls/ComboBox.qml index 1441040c..76a8442a 100644 --- a/src/controls/ComboBox.qml +++ b/src/controls/ComboBox.qml @@ -69,7 +69,7 @@ import QtQuick.Controls.Private 1.0 ListElement { text: "Coconut"; color: "Brown" } } width: 200 - onCurrentIndexChanged: console.debug(currentText + ", " + cbItems.get(currentIndex).color) + onCurrentIndexChanged: console.debug(cbItems.get(currentIndex).text + ", " + cbItems.get(currentIndex).color) } \endqml @@ -92,7 +92,11 @@ Control { property alias currentIndex: popup.__selectedIndex /*! \qmlproperty string ComboBox::currentText - The text of the currently selected item in the ComboBox. */ + The text of the currently selected item in the ComboBox. + + \note Since \c currentText depends on \c currentIndex, there's no way to ensure \c currentText + will be up to date whenever a \c onCurrentIndexChanged handler is called. + */ readonly property alias currentText: popup.selectedText /*! This property specifies whether the combobox should gain active focus when pressed. |
