diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2018-03-23 15:02:35 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2018-03-23 15:02:35 +0100 |
commit | 5178f6269418d731efe6bec7bc541f21fdd6d7f4 (patch) | |
tree | cd09fbc67c6e92652e92951cf9c91385ddce8564 /src/quicktemplates2 | |
parent | 2b0e33692b949ebaed034c72d0ea3da9f0ef6de2 (diff) | |
parent | 81f656eeac522532ff98a32aac68a1571ea54c99 (diff) |
Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
src/quickcontrols2/qquickstyle.cpp
tests/auto/controls/data/tst_popup.qml
Change-Id: I7b7bb5f9c63b32eef65c9b2e68f56baa3da69cff
Diffstat (limited to 'src/quicktemplates2')
-rw-r--r-- | src/quicktemplates2/qquickcombobox.cpp | 2 | ||||
-rw-r--r-- | src/quicktemplates2/qquickdialogbuttonbox.cpp | 30 | ||||
-rw-r--r-- | src/quicktemplates2/qquickshortcutcontext.cpp | 2 | ||||
-rw-r--r-- | src/quicktemplates2/qquickspinbox.cpp | 3 | ||||
-rw-r--r-- | src/quicktemplates2/qquickstackview.cpp | 8 | ||||
-rw-r--r-- | src/quicktemplates2/qquickstackview_p.h | 6 | ||||
-rw-r--r-- | src/quicktemplates2/qquickstackview_p_p.h | 2 |
7 files changed, 37 insertions, 16 deletions
diff --git a/src/quicktemplates2/qquickcombobox.cpp b/src/quicktemplates2/qquickcombobox.cpp index 3616bcc2..1238ec08 100644 --- a/src/quicktemplates2/qquickcombobox.cpp +++ b/src/quicktemplates2/qquickcombobox.cpp @@ -1639,12 +1639,10 @@ void QQuickComboBox::wheelEvent(QWheelEvent *event) Q_D(QQuickComboBox); QQuickControl::wheelEvent(event); if (d->wheelEnabled && !d->isPopupVisible()) { - const int oldIndex = d->currentIndex; if (event->angleDelta().y() > 0) d->decrementCurrentIndex(); else d->incrementCurrentIndex(); - event->setAccepted(d->currentIndex != oldIndex); } } #endif diff --git a/src/quicktemplates2/qquickdialogbuttonbox.cpp b/src/quicktemplates2/qquickdialogbuttonbox.cpp index a69b006f..7e178f2a 100644 --- a/src/quicktemplates2/qquickdialogbuttonbox.cpp +++ b/src/quicktemplates2/qquickdialogbuttonbox.cpp @@ -97,9 +97,33 @@ QT_BEGIN_NAMESPACE You can also mix and match normal buttons and standard buttons. When a button is clicked in the button box, the \l clicked() signal is - emitted for the actual button that is pressed. For convenience, if the - button has an \c AcceptRole, \c RejectRole, or \c HelpRole, the \l accepted(), - \l rejected(), or \l helpRequested() signals are emitted respectively. + emitted for the actual button that is pressed. In addition, the + following signals are automatically emitted when a button with the + respective role(s) is pressed: + + \table + \header + \li Role + \li Signal + \row + \li \c AcceptRole, \c YesRole + \li \l accepted() + \row + \li \c ApplyRole + \li \l applied() + \row + \li \c DiscardRole + \li \l discarded() + \row + \li \c HelpRole + \li \l helpRequested() + \row + \li \c RejectRole, \c NoRole + \li \l rejected() + \row + \li \c ResetRole + \li \l reset() + \endtable \sa Dialog */ diff --git a/src/quicktemplates2/qquickshortcutcontext.cpp b/src/quicktemplates2/qquickshortcutcontext.cpp index e94de722..4e4b46fa 100644 --- a/src/quicktemplates2/qquickshortcutcontext.cpp +++ b/src/quicktemplates2/qquickshortcutcontext.cpp @@ -77,7 +77,7 @@ bool QQuickShortcutContext::matcher(QObject *obj, Qt::ShortcutContext context) case Qt::WindowShortcut: while (obj && !obj->isWindowType()) { item = qobject_cast<QQuickItem *>(obj); - if (item) { + if (item && item->window()) { obj = item->window(); break; } else if (QQuickPopup *popup = qobject_cast<QQuickPopup *>(obj)) { diff --git a/src/quicktemplates2/qquickspinbox.cpp b/src/quicktemplates2/qquickspinbox.cpp index 75ba52a1..3dc10f34 100644 --- a/src/quicktemplates2/qquickspinbox.cpp +++ b/src/quicktemplates2/qquickspinbox.cpp @@ -955,8 +955,7 @@ void QQuickSpinBox::wheelEvent(QWheelEvent *event) if (d->wheelEnabled) { const QPointF angle = event->angleDelta(); const qreal delta = (qFuzzyIsNull(angle.y()) ? angle.x() : angle.y()) / QWheelEvent::DefaultDeltasPerStep; - if (!d->stepBy(qRound(d->effectiveStepSize() * delta), true)) - event->ignore(); + d->stepBy(qRound(d->effectiveStepSize() * delta), true); } } #endif diff --git a/src/quicktemplates2/qquickstackview.cpp b/src/quicktemplates2/qquickstackview.cpp index 1abc506b..6dae65c8 100644 --- a/src/quicktemplates2/qquickstackview.cpp +++ b/src/quicktemplates2/qquickstackview.cpp @@ -898,13 +898,13 @@ void QQuickStackView::clear(Operation operation) \sa push() */ -QVariant QQuickStackView::initialItem() const +QJSValue QQuickStackView::initialItem() const { Q_D(const QQuickStackView); return d->initialItem; } -void QQuickStackView::setInitialItem(const QVariant &item) +void QQuickStackView::setInitialItem(const QJSValue &item) { Q_D(QQuickStackView); d->initialItem = item; @@ -1081,9 +1081,9 @@ void QQuickStackView::componentComplete() QQuickStackElement *element = nullptr; QString error; int oldDepth = d->elements.count(); - if (QObject *o = d->initialItem.value<QObject *>()) + if (QObject *o = d->initialItem.toQObject()) element = QQuickStackElement::fromObject(o, this, &error); - else if (d->initialItem.canConvert<QString>()) + else if (d->initialItem.isString()) element = QQuickStackElement::fromString(d->initialItem.toString(), this, &error); if (!error.isEmpty()) { d->warn(error); diff --git a/src/quicktemplates2/qquickstackview_p.h b/src/quicktemplates2/qquickstackview_p.h index e347ba9d..ba6fe106 100644 --- a/src/quicktemplates2/qquickstackview_p.h +++ b/src/quicktemplates2/qquickstackview_p.h @@ -65,7 +65,7 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickStackView : public QQuickControl Q_PROPERTY(bool busy READ isBusy NOTIFY busyChanged FINAL) Q_PROPERTY(int depth READ depth NOTIFY depthChanged FINAL) Q_PROPERTY(QQuickItem *currentItem READ currentItem NOTIFY currentItemChanged FINAL) - Q_PROPERTY(QVariant initialItem READ initialItem WRITE setInitialItem FINAL) + Q_PROPERTY(QJSValue initialItem READ initialItem WRITE setInitialItem FINAL) Q_PROPERTY(QQuickTransition *popEnter READ popEnter WRITE setPopEnter NOTIFY popEnterChanged FINAL) Q_PROPERTY(QQuickTransition *popExit READ popExit WRITE setPopExit NOTIFY popExitChanged FINAL) Q_PROPERTY(QQuickTransition *pushEnter READ pushEnter WRITE setPushEnter NOTIFY pushEnterChanged FINAL) @@ -93,8 +93,8 @@ public: }; Q_ENUM(Status) - QVariant initialItem() const; - void setInitialItem(const QVariant &item); + QJSValue initialItem() const; + void setInitialItem(const QJSValue &item); QQuickTransition *popEnter() const; void setPopEnter(QQuickTransition *enter); diff --git a/src/quicktemplates2/qquickstackview_p_p.h b/src/quicktemplates2/qquickstackview_p_p.h index d86f35cd..7f1b77b1 100644 --- a/src/quicktemplates2/qquickstackview_p_p.h +++ b/src/quicktemplates2/qquickstackview_p_p.h @@ -96,7 +96,7 @@ public: bool busy; QString operation; - QVariant initialItem; + QJSValue initialItem; QQuickItem *currentItem; QSet<QQuickStackElement*> removing; QList<QQuickStackElement*> removed; |