Details
-
Bug
-
Resolution: Fixed
-
P3: Somewhat important
-
5.12.10, 5.15.2, 5.15.6
-
macOS Catalina
Description
I found a bug report on StackOverflow and I have the same thing (https://stackoverflow.com/questions/49324832/qt-hover-is-not-working-after-opening-external-link-on-macos).
This reproduces for QML and QWidget's, but my example is in QML.
So here is an example:
import QtQuick 2.12 import QtQuick.Window 2.12 import QtQuick.Controls 2.12 ApplicationWindow { id: rootWindow visible: true width: 640 height: 480 color: "gold" ListView { width: parent.width height: parent.height / 2 * 3 model: 5 spacing: 1 delegate: Rectangle { width: parent.width height: 50 color: ma.containsMouse ? "mediumvioletred" : "mintcream" border.color: "black" border.width: 1 Text { anchors.centerIn: parent text: "Click on me to open google.com" font.bold: true } MouseArea { id: ma anchors.fill: parent onClicked: Qt.openUrlExternally("https://www.google.com/"); hoverEnabled: true } } } Text { width: parent.width height: 200 anchors.bottom: parent.bottom color: "black" text: "1. Click on any list element (note color when hovered)\n2. Re-gain focus by click outside of the list (gold color area)\n3. Hover list element"; font.bold: true horizontalAlignment: Qt.AlignHCenter verticalAlignment: Qt.AlignVCenter } }
Do the following:
- Click on the list element to open external link in the browser.
- Close browser window so you can see this example app's window and click outside of a list (gold area).
- Immediately after this, try to hover list element. Result - hover stops working for some time. If you move mouse pointer outside of the main window and then return it back - hover starts working.
If you switch back to example app by using e.g. Dock - bug is not happening. It happens only in case you bring app's window to foreground by just clicking inside of its area.
This is NOT a macOS behavior because it can't be reproduced with a non-Qt application.