From 223c1524a7693e2c0f2312dd738c6aeb484358a5 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 11 Apr 2017 15:22:35 +0200 Subject: QQuickPlatformMenu::open(): Scale target rectangle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The QPlatform* classes operate in native pixels. Task-number: QTBUG-55251 Change-Id: Ic9715bc062f7459054ed9735d133b1a5d05b60a2 Reviewed-by: Morten Johan Sørvig --- src/imports/platform/qquickplatformmenu.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/imports/platform/qquickplatformmenu.cpp b/src/imports/platform/qquickplatformmenu.cpp index 82adb6c3..ec5c4804 100644 --- a/src/imports/platform/qquickplatformmenu.cpp +++ b/src/imports/platform/qquickplatformmenu.cpp @@ -44,6 +44,7 @@ #include #include #include +#include #include #include #include @@ -705,8 +706,9 @@ void QQuickPlatformMenu::open(QQmlV4Function *args) targetRect.moveTo(pos); #endif } - - m_handle->showPopup(window, targetRect, menuItem ? menuItem->handle() : nullptr); + m_handle->showPopup(window, + QHighDpi::toNativePixels(targetRect, window), + menuItem ? menuItem->handle() : nullptr); } /*! -- cgit v1.2.3 From 7eb5f8a54bdcf0520a7aa0a2874a059060866097 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 1 Feb 2018 11:48:45 +0100 Subject: QQuickControl: respect click focus policy for focus scopes If a focus scope explicitly requests click focus, make it gain active focus by clearing the sub-focus child. Pane { focusPolicy: Qt.ClickFocus TextField { } } [ChangeLog][Controls][Control] Fixed focus scope controls, such as Frame, GroupBox, Page, and Pane, to respect click focus policy by clearing a potential sub-focus child. This makes it possible to close the virtual keyboard by clicking the background of a Pane that has Qt.ClickFocus set as its focusPolicy, for example. Task-number: QTBUG-66133 Change-Id: I582f3c66aa6f11e229d89c4f610fae3c6259104d Reviewed-by: Mitch Curtis --- src/quicktemplates2/qquickcontrol.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/quicktemplates2/qquickcontrol.cpp b/src/quicktemplates2/qquickcontrol.cpp index 8d571c34..020997b1 100644 --- a/src/quicktemplates2/qquickcontrol.cpp +++ b/src/quicktemplates2/qquickcontrol.cpp @@ -160,11 +160,19 @@ bool QQuickControlPrivate::acceptTouch(const QTouchEvent::TouchPoint &point) } #endif +static void setActiveFocus(QQuickControl *control, Qt::FocusReason reason) +{ + QQuickControlPrivate *d = QQuickControlPrivate::get(control); + if (d->subFocusItem && d->window && d->flags & QQuickItem::ItemIsFocusScope) + QQuickWindowPrivate::get(d->window)->clearFocusInScope(control, d->subFocusItem, reason); + control->forceActiveFocus(reason); +} + void QQuickControlPrivate::handlePress(const QPointF &) { Q_Q(QQuickControl); if ((focusPolicy & Qt::ClickFocus) == Qt::ClickFocus && !QGuiApplication::styleHints()->setFocusOnTouchRelease()) - q->forceActiveFocus(Qt::MouseFocusReason); + setActiveFocus(q, Qt::MouseFocusReason); } void QQuickControlPrivate::handleMove(const QPointF &point) @@ -181,7 +189,7 @@ void QQuickControlPrivate::handleRelease(const QPointF &) { Q_Q(QQuickControl); if ((focusPolicy & Qt::ClickFocus) == Qt::ClickFocus && QGuiApplication::styleHints()->setFocusOnTouchRelease()) - q->forceActiveFocus(Qt::MouseFocusReason); + setActiveFocus(q, Qt::MouseFocusReason); touchId = -1; } -- cgit v1.2.3 From 3c0f3ed5d5819a927d259e0dda7b3245cf43b110 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 5 Feb 2018 13:31:28 +0100 Subject: Add missing meta revision 3 for Label, TextArea, TextField Fixes: ".palette" is not available due to component versioning. Change-Id: I3687a5879bcdf8f1af36c1b32b796ce2fa7e879e Reviewed-by: Mitch Curtis --- src/imports/templates/qtquicktemplates2plugin.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/imports/templates/qtquicktemplates2plugin.cpp b/src/imports/templates/qtquicktemplates2plugin.cpp index 15a5f338..813ace40 100644 --- a/src/imports/templates/qtquicktemplates2plugin.cpp +++ b/src/imports/templates/qtquicktemplates2plugin.cpp @@ -299,6 +299,7 @@ void QtQuickTemplates2Plugin::registerTypes(const char *uri) qmlRegisterType(uri, 2, 3, "Dialog"); qmlRegisterType(uri, 2, 3, "DialogButtonBox"); qRegisterMetaType(); + qmlRegisterType(uri, 2, 3, "Label"); qmlRegisterType(uri, 2, 3, "Menu"); qmlRegisterType(uri, 2, 3, "MenuBar"); qmlRegisterType(uri, 2, 3, "MenuBarItem"); @@ -311,6 +312,8 @@ void QtQuickTemplates2Plugin::registerTypes(const char *uri) qmlRegisterType(uri, 2, 3, "ScrollIndicator"); qmlRegisterType(uri, 2, 3, "Slider"); qmlRegisterType(uri, 2, 3, "SpinBox"); + qmlRegisterType(uri, 2, 3, "TextArea"); + qmlRegisterType(uri, 2, 3, "TextField"); // NOTE: register the latest revisions of all template/control base classes to // make revisioned properties available to their subclasses (synced with Qt 5.10) -- cgit v1.2.3 From b9584b13d53f36da5585051346d03a86650961bc Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 5 Feb 2018 14:39:43 +0100 Subject: Editors: tweak placeholder text color Instead of using 50% translucent palette.text, use 50% translucent TextField::color (which defaults to palette.text) to make the placeholder text color follow the text color when changed directly without changing the palette. In the future, the placeholder text color should be exposed as a separate property to give users full control. Task-number: QTBUG-66176 Change-Id: I57153ff676be6518f9b48cdbd7da4089daa36853 Reviewed-by: Mitch Curtis --- src/imports/controls/TextArea.qml | 2 +- src/imports/controls/TextField.qml | 2 +- src/imports/controls/fusion/TextArea.qml | 2 +- src/imports/controls/fusion/TextField.qml | 2 +- src/imports/controls/imagine/TextArea.qml | 2 +- src/imports/controls/imagine/TextField.qml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/imports/controls/TextArea.qml b/src/imports/controls/TextArea.qml index 9021d558..2bda4ca9 100644 --- a/src/imports/controls/TextArea.qml +++ b/src/imports/controls/TextArea.qml @@ -66,7 +66,7 @@ T.TextArea { text: control.placeholderText font: control.font opacity: 0.5 - color: control.palette.text + color: control.color verticalAlignment: control.verticalAlignment visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter) elide: Text.ElideRight diff --git a/src/imports/controls/TextField.qml b/src/imports/controls/TextField.qml index 52125501..cbecd198 100644 --- a/src/imports/controls/TextField.qml +++ b/src/imports/controls/TextField.qml @@ -67,7 +67,7 @@ T.TextField { text: control.placeholderText font: control.font opacity: 0.5 - color: control.palette.text + color: control.color verticalAlignment: control.verticalAlignment visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter) elide: Text.ElideRight diff --git a/src/imports/controls/fusion/TextArea.qml b/src/imports/controls/fusion/TextArea.qml index 6d47e237..6fc74660 100644 --- a/src/imports/controls/fusion/TextArea.qml +++ b/src/imports/controls/fusion/TextArea.qml @@ -68,7 +68,7 @@ T.TextArea { opacity: 0.5 text: control.placeholderText font: control.font - color: control.palette.text + color: control.color verticalAlignment: control.verticalAlignment visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter) elide: Text.ElideRight diff --git a/src/imports/controls/fusion/TextField.qml b/src/imports/controls/fusion/TextField.qml index 686690bb..aef8475b 100644 --- a/src/imports/controls/fusion/TextField.qml +++ b/src/imports/controls/fusion/TextField.qml @@ -68,7 +68,7 @@ T.TextField { opacity: 0.5 text: control.placeholderText font: control.font - color: control.palette.text + color: control.color verticalAlignment: control.verticalAlignment visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter) elide: Text.ElideRight diff --git a/src/imports/controls/imagine/TextArea.qml b/src/imports/controls/imagine/TextArea.qml index ac212b95..a0e60230 100644 --- a/src/imports/controls/imagine/TextArea.qml +++ b/src/imports/controls/imagine/TextArea.qml @@ -70,7 +70,7 @@ T.TextArea { text: control.placeholderText font: control.font - color: control.palette.text + color: control.color verticalAlignment: control.verticalAlignment visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter) elide: Text.ElideRight diff --git a/src/imports/controls/imagine/TextField.qml b/src/imports/controls/imagine/TextField.qml index a6449884..024698f8 100644 --- a/src/imports/controls/imagine/TextField.qml +++ b/src/imports/controls/imagine/TextField.qml @@ -70,7 +70,7 @@ T.TextField { text: control.placeholderText font: control.font - color: control.palette.text + color: control.color verticalAlignment: control.verticalAlignment visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter) elide: Text.ElideRight -- cgit v1.2.3 From a5aa09dfd7e42f38545fe4640b0fa251bdd32be9 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Wed, 31 Jan 2018 16:28:07 +0100 Subject: Make AbstractButton's icon properties win over Action's when both are set Task-number: QTBUG-65193 Change-Id: Idff23dcc35f3c3fe41406678613b022098149318 Reviewed-by: J-P Nurmi --- src/quicktemplates2/qquickabstractbutton.cpp | 50 +++++++--------- src/quicktemplates2/qquickabstractbutton_p_p.h | 3 + src/quicktemplates2/qquickicon.cpp | 82 +++++++++++++++++++++++++- src/quicktemplates2/qquickicon_p.h | 14 +++-- 4 files changed, 115 insertions(+), 34 deletions(-) (limited to 'src') diff --git a/src/quicktemplates2/qquickabstractbutton.cpp b/src/quicktemplates2/qquickabstractbutton.cpp index b1522995..768b923b 100644 --- a/src/quicktemplates2/qquickabstractbutton.cpp +++ b/src/quicktemplates2/qquickabstractbutton.cpp @@ -306,6 +306,21 @@ void QQuickAbstractButtonPrivate::setText(const QString &newText, bool isExplici q->buttonChange(QQuickAbstractButton::ButtonTextChange); } +void QQuickAbstractButtonPrivate::updateEffectiveIcon() +{ + Q_Q(QQuickAbstractButton); + // We store effectiveIcon because we need to be able to tell if the icon has actually changed. + // If we only stored our icon and the action's icon, and resolved in the getter, we'd have + // no way of knowing what the old value was here. As an added benefit, we only resolve when + // something has changed, as opposed to doing it unconditionally in the icon() getter. + const QQuickIcon newEffectiveIcon = action ? icon.resolve(action->icon()) : icon; + if (newEffectiveIcon == effectiveIcon) + return; + + effectiveIcon = newEffectiveIcon; + emit q->iconChanged(); +} + void QQuickAbstractButtonPrivate::click() { Q_Q(QQuickAbstractButton); @@ -687,17 +702,14 @@ void QQuickAbstractButton::setIndicator(QQuickItem *indicator) QQuickIcon QQuickAbstractButton::icon() const { Q_D(const QQuickAbstractButton); - return d->icon; + return d->effectiveIcon; } void QQuickAbstractButton::setIcon(const QQuickIcon &icon) { Q_D(QQuickAbstractButton); - if (d->icon == icon) - return; - d->icon = icon; - emit iconChanged(); + d->updateEffectiveIcon(); } /*! @@ -759,7 +771,7 @@ void QQuickAbstractButton::setAction(QQuickAction *action) QObjectPrivate::disconnect(oldAction, &QQuickAction::triggered, d, &QQuickAbstractButtonPrivate::click); QObjectPrivate::disconnect(oldAction, &QQuickAction::textChanged, d, &QQuickAbstractButtonPrivate::actionTextChange); - disconnect(oldAction, &QQuickAction::iconChanged, this, &QQuickAbstractButton::setIcon); + QObjectPrivate::disconnect(oldAction, &QQuickAction::iconChanged, d, &QQuickAbstractButtonPrivate::updateEffectiveIcon); disconnect(oldAction, &QQuickAction::checkedChanged, this, &QQuickAbstractButton::setChecked); disconnect(oldAction, &QQuickAction::checkableChanged, this, &QQuickAbstractButton::setCheckable); disconnect(oldAction, &QQuickAction::enabledChanged, this, &QQuickItem::setEnabled); @@ -770,33 +782,11 @@ void QQuickAbstractButton::setAction(QQuickAction *action) QObjectPrivate::connect(action, &QQuickAction::triggered, d, &QQuickAbstractButtonPrivate::click); QObjectPrivate::connect(action, &QQuickAction::textChanged, d, &QQuickAbstractButtonPrivate::actionTextChange); - connect(action, &QQuickAction::iconChanged, this, &QQuickAbstractButton::setIcon); + QObjectPrivate::connect(action, &QQuickAction::iconChanged, d, &QQuickAbstractButtonPrivate::updateEffectiveIcon); connect(action, &QQuickAction::checkedChanged, this, &QQuickAbstractButton::setChecked); connect(action, &QQuickAction::checkableChanged, this, &QQuickAbstractButton::setCheckable); connect(action, &QQuickAction::enabledChanged, this, &QQuickItem::setEnabled); - QQuickIcon actionIcon = action->icon(); - - QString name = actionIcon.name(); - if (!name.isEmpty()) - d->icon.setName(name); - - QUrl source = actionIcon.source(); - if (!source.isEmpty()) - d->icon.setSource(source); - - int width = actionIcon.width(); - if (width > 0) - d->icon.setWidth(width); - - int height = actionIcon.height(); - if (height) - d->icon.setHeight(height); - - QColor color = actionIcon.color(); - if (color != Qt::transparent) - d->icon.setColor(color); - setChecked(action->isChecked()); setCheckable(action->isCheckable()); setEnabled(action->isEnabled()); @@ -807,6 +797,8 @@ void QQuickAbstractButton::setAction(QQuickAction *action) if (oldText != text()) buttonChange(ButtonTextChange); + d->updateEffectiveIcon(); + emit actionChanged(); } diff --git a/src/quicktemplates2/qquickabstractbutton_p_p.h b/src/quicktemplates2/qquickabstractbutton_p_p.h index 3b2a87f2..c82f8cf7 100644 --- a/src/quicktemplates2/qquickabstractbutton_p_p.h +++ b/src/quicktemplates2/qquickabstractbutton_p_p.h @@ -93,6 +93,8 @@ public: void actionTextChange(); void setText(const QString &text, bool isExplicit); + void updateEffectiveIcon(); + void click(); void trigger(); void toggle(bool value); @@ -119,6 +121,7 @@ public: QKeySequence shortcut; #endif QQuickIcon icon; + QQuickIcon effectiveIcon; QPointF pressPoint; Qt::MouseButtons pressButtons; QQuickDeferredPointer indicator; diff --git a/src/quicktemplates2/qquickicon.cpp b/src/quicktemplates2/qquickicon.cpp index 0b0127d3..79af62b1 100644 --- a/src/quicktemplates2/qquickicon.cpp +++ b/src/quicktemplates2/qquickicon.cpp @@ -44,7 +44,8 @@ public: QQuickIconPrivate() : width(0), height(0), - color(Qt::transparent) + color(Qt::transparent), + resolveMask(0) { } @@ -53,6 +54,18 @@ public: int width; int height; QColor color; + + enum ResolveProperties { + NameResolved = 0x0001, + SourceResolved = 0x0002, + WidthResolved = 0x0004, + HeightResolved = 0x0008, + ColorResolved = 0x0010, + AllPropertiesResolved = 0x1ffff + }; + + // This is based on QFont's resolve_mask. + int resolveMask; }; QQuickIcon::QQuickIcon() @@ -101,7 +114,17 @@ QString QQuickIcon::name() const void QQuickIcon::setName(const QString &name) { + if ((d->resolveMask & QQuickIconPrivate::NameResolved) && d->name == name) + return; + d->name = name; + d->resolveMask |= QQuickIconPrivate::NameResolved; +} + +void QQuickIcon::resetName() +{ + d->name = QString(); + d->resolveMask &= ~QQuickIconPrivate::NameResolved; } QUrl QQuickIcon::source() const @@ -111,7 +134,17 @@ QUrl QQuickIcon::source() const void QQuickIcon::setSource(const QUrl &source) { + if ((d->resolveMask & QQuickIconPrivate::SourceResolved) && d->source == source) + return; + d->source = source; + d->resolveMask |= QQuickIconPrivate::SourceResolved; +} + +void QQuickIcon::resetSource() +{ + d->source = QString(); + d->resolveMask &= ~QQuickIconPrivate::SourceResolved; } int QQuickIcon::width() const @@ -121,7 +154,17 @@ int QQuickIcon::width() const void QQuickIcon::setWidth(int width) { + if ((d->resolveMask & QQuickIconPrivate::WidthResolved) && d->width == width) + return; + d->width = width; + d->resolveMask |= QQuickIconPrivate::WidthResolved; +} + +void QQuickIcon::resetWidth() +{ + d->width = 0; + d->resolveMask &= ~QQuickIconPrivate::WidthResolved; } int QQuickIcon::height() const @@ -131,7 +174,17 @@ int QQuickIcon::height() const void QQuickIcon::setHeight(int height) { + if ((d->resolveMask & QQuickIconPrivate::HeightResolved) && d->height == height) + return; + d->height = height; + d->resolveMask |= QQuickIconPrivate::HeightResolved; +} + +void QQuickIcon::resetHeight() +{ + d->height = 0; + d->resolveMask &= ~QQuickIconPrivate::HeightResolved; } QColor QQuickIcon::color() const @@ -141,12 +194,39 @@ QColor QQuickIcon::color() const void QQuickIcon::setColor(const QColor &color) { + if ((d->resolveMask & QQuickIconPrivate::ColorResolved) && d->color == color) + return; + d->color = color; + d->resolveMask |= QQuickIconPrivate::ColorResolved; } void QQuickIcon::resetColor() { d->color = Qt::transparent; + d->resolveMask &= ~QQuickIconPrivate::ColorResolved; +} + +QQuickIcon QQuickIcon::resolve(const QQuickIcon &other) const +{ + QQuickIcon resolved = *this; + + if (!(d->resolveMask & QQuickIconPrivate::NameResolved)) + resolved.setName(other.name()); + + if (!(d->resolveMask & QQuickIconPrivate::SourceResolved)) + resolved.setSource(other.source()); + + if (!(d->resolveMask & QQuickIconPrivate::WidthResolved)) + resolved.setWidth(other.width()); + + if (!(d->resolveMask & QQuickIconPrivate::HeightResolved)) + resolved.setHeight(other.height()); + + if (!(d->resolveMask & QQuickIconPrivate::ColorResolved)) + resolved.setColor(other.color()); + + return resolved; } QT_END_NAMESPACE diff --git a/src/quicktemplates2/qquickicon_p.h b/src/quicktemplates2/qquickicon_p.h index 6e28f2a9..5eb18205 100644 --- a/src/quicktemplates2/qquickicon_p.h +++ b/src/quicktemplates2/qquickicon_p.h @@ -62,10 +62,10 @@ class QQuickIconPrivate; class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickIcon { Q_GADGET - Q_PROPERTY(QString name READ name WRITE setName FINAL) - Q_PROPERTY(QUrl source READ source WRITE setSource FINAL) - Q_PROPERTY(int width READ width WRITE setWidth FINAL) - Q_PROPERTY(int height READ height WRITE setHeight FINAL) + Q_PROPERTY(QString name READ name WRITE setName RESET name FINAL) + Q_PROPERTY(QUrl source READ source WRITE setSource RESET source FINAL) + Q_PROPERTY(int width READ width WRITE setWidth RESET width FINAL) + Q_PROPERTY(int height READ height WRITE setHeight RESET height FINAL) Q_PROPERTY(QColor color READ color WRITE setColor RESET resetColor FINAL) public: @@ -81,20 +81,26 @@ public: QString name() const; void setName(const QString &name); + void resetName(); QUrl source() const; void setSource(const QUrl &source); + void resetSource(); int width() const; void setWidth(int width); + void resetWidth(); int height() const; void setHeight(int height); + void resetHeight(); QColor color() const; void setColor(const QColor &color); void resetColor(); + QQuickIcon resolve(const QQuickIcon &other) const; + private: QSharedDataPointer d; }; -- cgit v1.2.3 From f301decbe39d253cc979774e2f32cde9c1212e4c Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 5 Feb 2018 16:17:31 +0100 Subject: Popup: fix restoring focus for popups that did not request focus When a popup closes, if it has active focus, it should restore focus back to where it was regardless of whether the popup originally requested focus. Even if a popup does not request focus on open, it may gain focus programmatically or when a control with click-focus is clicked, for example. Task-number: QTBUG-66113 Change-Id: I9a7c467abe781bbef390d74898d13b9a30b2695b Reviewed-by: Mitch Curtis --- src/quicktemplates2/qquickpopup.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/quicktemplates2/qquickpopup.cpp b/src/quicktemplates2/qquickpopup.cpp index bb5ce660..0ef4bd64 100644 --- a/src/quicktemplates2/qquickpopup.cpp +++ b/src/quicktemplates2/qquickpopup.cpp @@ -443,12 +443,11 @@ bool QQuickPopupPrivate::prepareExitTransition() return false; if (transitionState != ExitTransition) { - if (focus) { - // The setFocus(false) call below removes any active focus before we're - // able to check it in finalizeExitTransition. - hadActiveFocusBeforeExitTransition = popupItem->hasActiveFocus(); + // The setFocus(false) call below removes any active focus before we're + // able to check it in finalizeExitTransition. + hadActiveFocusBeforeExitTransition = popupItem->hasActiveFocus(); + if (focus) popupItem->setFocus(false); - } transitionState = ExitTransition; emit q->aboutToHide(); } -- cgit v1.2.3 From b3b079f1578527859aa1f5137ee8f2ec163923fb Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 6 Feb 2018 11:43:20 +0100 Subject: QQuickIcon: fix reset methods Task-number: QTBUG-65193 Change-Id: I6393d39add5c3643812084ef4702e843bac14702 Reviewed-by: Mitch Curtis --- src/quicktemplates2/qquickicon_p.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/quicktemplates2/qquickicon_p.h b/src/quicktemplates2/qquickicon_p.h index 5eb18205..2c95bc9d 100644 --- a/src/quicktemplates2/qquickicon_p.h +++ b/src/quicktemplates2/qquickicon_p.h @@ -62,10 +62,10 @@ class QQuickIconPrivate; class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickIcon { Q_GADGET - Q_PROPERTY(QString name READ name WRITE setName RESET name FINAL) - Q_PROPERTY(QUrl source READ source WRITE setSource RESET source FINAL) - Q_PROPERTY(int width READ width WRITE setWidth RESET width FINAL) - Q_PROPERTY(int height READ height WRITE setHeight RESET height FINAL) + Q_PROPERTY(QString name READ name WRITE setName RESET resetName FINAL) + Q_PROPERTY(QUrl source READ source WRITE setSource RESET resetSource FINAL) + Q_PROPERTY(int width READ width WRITE setWidth RESET resetWidth FINAL) + Q_PROPERTY(int height READ height WRITE setHeight RESET resetHeight FINAL) Q_PROPERTY(QColor color READ color WRITE setColor RESET resetColor FINAL) public: -- cgit v1.2.3 From cf719053689c32967084fdac54b118e44d0b7b67 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Fri, 2 Feb 2018 12:03:45 +0100 Subject: QQuickControl: respect wheel focus policy for focus scopes [ChangeLog][Controls][Control] Fixed focus scope controls to respect wheel focus policy. Task-number: QTBUG-66133 Change-Id: If963feba4b6e59b87ca54af5f6606805093eb0cc Reviewed-by: Mitch Curtis --- src/quicktemplates2/qquickcontrol.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/quicktemplates2/qquickcontrol.cpp b/src/quicktemplates2/qquickcontrol.cpp index 020997b1..4bf0a867 100644 --- a/src/quicktemplates2/qquickcontrol.cpp +++ b/src/quicktemplates2/qquickcontrol.cpp @@ -1459,7 +1459,7 @@ void QQuickControl::wheelEvent(QWheelEvent *event) { Q_D(QQuickControl); if ((d->focusPolicy & Qt::WheelFocus) == Qt::WheelFocus) - forceActiveFocus(Qt::MouseFocusReason); + setActiveFocus(this, Qt::MouseFocusReason); event->setAccepted(d->wheelEnabled); } -- cgit v1.2.3