diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2016-05-20 13:50:28 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2016-05-20 12:30:02 +0000 |
commit | dab55aaaf1b25d93761d7be0766efb61b2e271b0 (patch) | |
tree | cccadd39daefc4305ac1a4437683f6d4633c1f8c | |
parent | aa468902b6c874a6c4a03bb2fc98edf93b1f5016 (diff) |
ComboBox: increase/decrease() => increment/decrementCurrentIndex()
ComboBox does not have a value-property, unlike Slider, SpinBox, Dial,
and ScrollBar.
Change-Id: I9832ef8df1532d4cb85b981b164c7c85e8a82135
Task-number: QTBUG-53519
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
-rw-r--r-- | src/imports/templates/plugins.qmltypes | 4 | ||||
-rw-r--r-- | src/quicktemplates2/qquickcombobox.cpp | 32 | ||||
-rw-r--r-- | src/quicktemplates2/qquickcombobox_p.h | 4 |
3 files changed, 20 insertions, 20 deletions
diff --git a/src/imports/templates/plugins.qmltypes b/src/imports/templates/plugins.qmltypes index 17c5117a..c96dd2dc 100644 --- a/src/imports/templates/plugins.qmltypes +++ b/src/imports/templates/plugins.qmltypes @@ -118,8 +118,8 @@ Module { name: "highlighted" Parameter { name: "index"; type: "int" } } - Method { name: "increase" } - Method { name: "decrease" } + Method { name: "incrementCurrentIndex" } + Method { name: "decrementCurrentIndex" } Method { name: "textAt" type: "string" diff --git a/src/quicktemplates2/qquickcombobox.cpp b/src/quicktemplates2/qquickcombobox.cpp index c41265a4..a5c94b48 100644 --- a/src/quicktemplates2/qquickcombobox.cpp +++ b/src/quicktemplates2/qquickcombobox.cpp @@ -166,8 +166,8 @@ public: void createdItem(int index, QObject *object); void countChanged(); void updateCurrentText(); - void increase(); - void decrease(); + void incrementCurrentIndex(); + void decrementCurrentIndex(); void setHighlightedIndex(int index); void createDelegateModel(); @@ -269,7 +269,7 @@ void QQuickComboBoxPrivate::updateCurrentText() } } -void QQuickComboBoxPrivate::increase() +void QQuickComboBoxPrivate::incrementCurrentIndex() { Q_Q(QQuickComboBox); if (isPopupVisible()) { @@ -285,7 +285,7 @@ void QQuickComboBoxPrivate::increase() } } -void QQuickComboBoxPrivate::decrease() +void QQuickComboBoxPrivate::decrementCurrentIndex() { Q_Q(QQuickComboBox); if (isPopupVisible()) { @@ -737,31 +737,31 @@ int QQuickComboBox::find(const QString &text, Qt::MatchFlags flags) const } /*! - \qmlmethod void QtQuick.Controls::ComboBox::increase() + \qmlmethod void QtQuick.Controls::ComboBox::incrementCurrentIndex() - Increases the current index of the combo box, or the highlighted + Increments the current index of the combo box, or the highlighted index if the popup list when it is visible. \sa currentIndex, highlightedIndex */ -void QQuickComboBox::increase() +void QQuickComboBox::incrementCurrentIndex() { Q_D(QQuickComboBox); - d->increase(); + d->incrementCurrentIndex(); } /*! - \qmlmethod void QtQuick.Controls::ComboBox::decrease() + \qmlmethod void QtQuick.Controls::ComboBox::decrementCurrentIndex() - Decreases the current index of the combo box, or the highlighted + Decrements the current index of the combo box, or the highlighted index if the popup list when it is visible. \sa currentIndex, highlightedIndex */ -void QQuickComboBox::decrease() +void QQuickComboBox::decrementCurrentIndex() { Q_D(QQuickComboBox); - d->decrease(); + d->decrementCurrentIndex(); } void QQuickComboBox::focusOutEvent(QFocusEvent *event) @@ -797,11 +797,11 @@ void QQuickComboBox::keyPressEvent(QKeyEvent *event) event->accept(); break; case Qt::Key_Up: - d->decrease(); + d->decrementCurrentIndex(); event->accept(); break; case Qt::Key_Down: - d->increase(); + d->incrementCurrentIndex(); event->accept(); break; default: @@ -874,9 +874,9 @@ void QQuickComboBox::wheelEvent(QWheelEvent *event) if (d->wheelEnabled && !d->isPopupVisible()) { const int oldIndex = d->currentIndex; if (event->angleDelta().y() > 0) - d->decrease(); + d->decrementCurrentIndex(); else - d->increase(); + d->incrementCurrentIndex(); event->setAccepted(d->currentIndex != oldIndex); } } diff --git a/src/quicktemplates2/qquickcombobox_p.h b/src/quicktemplates2/qquickcombobox_p.h index 8b25c616..26b7688e 100644 --- a/src/quicktemplates2/qquickcombobox_p.h +++ b/src/quicktemplates2/qquickcombobox_p.h @@ -112,8 +112,8 @@ public: Q_INVOKABLE int find(const QString &text, Qt::MatchFlags flags = Qt::MatchExactly) const; public Q_SLOTS: - void increase(); - void decrease(); + void incrementCurrentIndex(); + void decrementCurrentIndex(); Q_SIGNALS: void countChanged(); |