diff options
| author | Shawn Rutledge <shawn.rutledge@qt.io> | 2021-12-02 23:34:44 +0100 |
|---|---|---|
| committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2021-12-03 18:25:59 +0100 |
| commit | 3e95a57dc1fb39b059b52e16fcce7b4262f88b61 (patch) | |
| tree | 7d7f858bf8df3f57bd7279c45b057ca55641e96b /src/quick/handlers/qquickhoverhandler.cpp | |
| parent | 58ff7aa4fed5b3a27b6a859fc02f9ee27dd1a6cc (diff) | |
HoverHandler: allow cursorShape binding before parentItem is set
When a HoverHandler is declared in a Window, the handler's bindings
are evaluated before QQuickItemPrivate::data_append() is called to
add the handler to the window's content item. So we need null pointer
checks again (as we have for a lot of calls to parentItem() already).
And to ensure that the declared cursorShape actually is shown, we need
to check again in componentComplete(). And don't forget to call the
parent class implementation whenever overriding any virtual function.
Fixes: QTBUG-98717
Pick-to: 6.2 5.15
Change-Id: Id0defac7a238df522e8eee69f71e83a3947560af
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/quick/handlers/qquickhoverhandler.cpp')
| -rw-r--r-- | src/quick/handlers/qquickhoverhandler.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/quick/handlers/qquickhoverhandler.cpp b/src/quick/handlers/qquickhoverhandler.cpp index e953a5b311..d72123bdcb 100644 --- a/src/quick/handlers/qquickhoverhandler.cpp +++ b/src/quick/handlers/qquickhoverhandler.cpp @@ -101,6 +101,7 @@ bool QQuickHoverHandler::event(QEvent *event) void QQuickHoverHandler::componentComplete() { + QQuickSinglePointHandler::componentComplete(); if (auto par = parentItem()) { par->setAcceptHoverEvents(true); QQuickItemPrivate::get(par)->setHasHoverInChild(true); |
