Weird mouse behaviour in Qt 5.8
-
I have updated to Qt 5.8. I have a bunch of SplitViews and some special controls that change the mouse cursor when mouse goes over them. With Qt 5.7 everything worked fine, but now I see a weird behaviour:
-
If the mouse is within the area of the application at initial run, then none of the cursor changes work. I have to move the mouse to one of the borders, so the cursor once changes to resizing mode and after that everything works normally.
-
If the mouse is not within the area of the application at initial run, as I have to drag the mouse over the borders into the application, everything works fine.
Is it a known issue?
-
-
Hi! You can go to https://bugreports.qt.io and see there if this is a known issue. If it's not, then maybe you can post a minimal example here, so other users can try to reproduce it.
-
With more tests I noticed that, this bug occurs only when running the application from within the Qt Creator. If I build first and then run the app by double clicking the binary, it won't happen.
Reproducing is actually pretty easy, here is a simple example:ApplicationWindow { visible: true width: 500 height: 500 Item { Rectangle { x: 100 y: 100 width: 150 height: 150 color: "grey" MouseArea { id: rectmouse anchors.fill: parent hoverEnabled: true onEntered: { rectmouse.cursorShape = Qt.SizeHorCursor } onExited: { rectmouse.cursorShape = Qt.ArrowCursor } } } }
There is a rectangle in the main window on mouse enter/exit it is supposed to change the mouse cursor. If you run this, and remember the mouse cursor should be within the area of the app when the app opens. Then none of the cursor changes work. If the mouse is out of the app area and you bring it in, cursor changes work normally.
Anyway, as it is just reproducible when I run from Qt Creator and will not affect the end user, I don't count it as a critical bug. -
Hi,
Then are you sure that your application is loading the same version of Qt when you start it outside Qt Creator ?
What OS are you running ?
Did you do the deployment steps before starting your application ? -
Ok, then it's likely something else...
Just to be sure, can you run
otool -L
on your application executable ? -
Here is otool's output:
/System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate (compatibility version 1.0.0, current version 4.0.0) /System/Library/Frameworks/CoreMIDI.framework/Versions/A/CoreMIDI (compatibility version 1.0.0, current version 73.0.0) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1153.18.0) /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio (compatibility version 1.0.0, current version 1.0.0) /System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit (compatibility version 1.0.0, current version 1.0.0) @rpath/QtQuick.framework/Versions/5/QtQuick (compatibility version 5.8.0, current version 5.8.0) @rpath/QtQml.framework/Versions/5/QtQml (compatibility version 5.8.0, current version 5.8.0) @rpath/QtNetwork.framework/Versions/5/QtNetwork (compatibility version 5.8.0, current version 5.8.0) @rpath/QtCore.framework/Versions/5/QtCore (compatibility version 5.8.0, current version 5.8.0) /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration (compatibility version 1.0.0, current version 1.0.0) /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0) @rpath/QtGui.framework/Versions/5/QtGui (compatibility version 5.8.0, current version 5.8.0) @rpath/QtMultimedia.framework/Versions/5/QtMultimedia (compatibility version 5.8.0, current version 5.8.0) @rpath/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.8.0, current version 5.8.0) /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0) /System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility version 1.0.0, current version 1.0.0) /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
-
Ok looks good,
You don't have any other Qt 5 installed on your system ?
-
Then that looks even better.
Does it happen both in debug and release mode ?
-
Yes and I am not able to reproduce this.