Unsolved Problem with mouse cursor icon when snapping window to screen edge
-
Hi all!
I'm struggling with one weird problem. In my desktop app, I have a MouseArea which has a hover action that changes the mouse cursor icon whenever the mouse goes into it. When I resized the app window, the functionality still works. The problem arises when I drag&snap the app window to the edges/top of my screen (only tested in MacOS High Sierra). The window adapts itself to the predeterminated dimensions, but the hover action seems to stop working (even if I see in console that the mouse is in fact hovering the area an the onPositionChanged is being called).
Does anybody know the why of this behavior? Any idea what I'm possibly doing wrong or not taking into account?
Thanks in advance!
-
Hi and welcome to devnet,
Can you provide a minimal compilable example that shows that behaviour ?
-
Thanks SGaist to check it out! The content of the main.qml file of a simple project which suffers the same problem:
import QtQuick 2.9 import QtQuick.Window 2.2 Window { visible: true width: 640 height: 640 title: qsTr("Hello World") Rectangle { width: 500 height: 500 anchors.centerIn: parent Flickable { id: flickable width: parent.width height: parent.width anchors.fill: parent anchors.margins: 6 clip: true contentWidth: myImage.width contentHeight: myImage.height contentX: (myImage.width / 2) - (width / 2) contentY: (myImage.height / 2) - (height / 2) boundsBehavior: Flickable.StopAtBounds pressDelay: 1 Image { id: myImage cache: false source: "https://www.gravatar.com/avatar/07682a4fa2355ff3ecce1d522458e3e7?size=192&d=mm" MouseArea { id: myMouseArea anchors.fill: parent hoverEnabled: true onPositionChanged: { if (myMouseArea.containsPress) { myMouseArea.cursorShape = Qt.ClosedHandCursor; } else { myMouseArea.cursorShape = Qt.OpenHandCursor; } } onReleased: { myMouseArea.cursorShape = Qt.OpenHandCursor; } } } } } }
[edit: added missing coding tags SGaist]
-
What version of Qt are you using ?
-
Qt Creator 4.5.1
Qt 5.10.1 (Clang 7.0 (Apple), 64 bit)
Built on Feb 10 2018 04:23:48
From revision 24cd0b1cd6 -
Since Qt 5.11 just got released, can you check if you still have the same problem with it ?
-
Still the same error with:
Qt Creator 4.7.0-beta1 (4.6.82)
Based on Qt 5.11.0 (Clang 8.0 (Apple), 64 bit)
Built on Jun 4 2018 10:36:27
From revision f1881ac2fc -
I didn't realise, those are the information about Qt Creator itself, not the kit you are currently using to build your application.
-
Qt_5_11_0_clang_64bit