diff options
author | Wang Chuan <ouchuanm@outlook.com> | 2019-09-19 18:04:55 +0800 |
---|---|---|
committer | Wang Chuan <ouchuanm@outlook.com> | 2019-09-23 20:07:46 +0000 |
commit | 8f1857f907153c4a98c73d572ea76c2b7ca33b5d (patch) | |
tree | 95b0c52974d07f535d3b23cacb52be6cb793f3f7 /src/quick | |
parent | e2df4233a77ce8a37d2c8ef26b7b42fc0d33a24b (diff) |
QQuickMouseArea: fix containsMouse when mousearea become visible
If enabled is false, then containsMouse will not become true when
hovering on mousearea, even if hoverEnabled is true. However when an
invisible mousearea become visible, the value of enabled isn't
checked. In this case, the value of containsMouse is not affected by
enabled.
[ChangeLog][QtQuick][QQuickMouseArea] containsMouse property will
not become true when the an invisible mousearea become visible, if
the enabled property is false or its parent item is not enabled
Fixes: QTBUG-77983
Change-Id: I923bdcf3eda813aea51a04515d530093d6eb77b2
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/quick')
-rw-r--r-- | src/quick/items/qquickmousearea.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/quick/items/qquickmousearea.cpp b/src/quick/items/qquickmousearea.cpp index a0c46d0bc6..ddf34798d7 100644 --- a/src/quick/items/qquickmousearea.cpp +++ b/src/quick/items/qquickmousearea.cpp @@ -1069,7 +1069,7 @@ void QQuickMouseArea::itemChange(ItemChange change, const ItemChangeData &value) Q_D(QQuickMouseArea); switch (change) { case ItemVisibleHasChanged: - if (acceptHoverEvents() && d->hovered != (isVisible() && isUnderMouse())) { + if (d->effectiveEnable && d->enabled && acceptHoverEvents() && d->hovered != (isVisible() && isUnderMouse())) { if (!d->hovered) { QPointF cursorPos = QGuiApplicationPrivate::lastCursorPosition; d->lastScenePos = d->window->mapFromGlobal(cursorPos.toPoint()); |