diff options
author | Wang Chuan <ouchuanm@outlook.com> | 2019-12-13 21:50:03 +0800 |
---|---|---|
committer | ouchuan <ouchuanm@outlook.com> | 2020-01-11 22:13:09 +0800 |
commit | f4d5939ad613fda69aa750139ef929fac18b97ae (patch) | |
tree | 6de8482908da3e7d591ef506b927ba2aa3e0f455 /tests/auto/qquickpopup/data/invisibleToolTipOpen.qml | |
parent | 090eab86b05478572485b3086c087a846fbae7fd (diff) |
QQuickToolTip: prevent closing after invisible tooltip created
Since all items using ToolTip attached property share the same ToolTip
item, a dynamically created invisible Tooltip may unexpectedly close
the current visible ToolTip.
Fix this issue by checking the parent of ToolTip when trying to close
it
Fixes: QTBUG-78202
Change-Id: I0f6558040c6b8bf22240b0c94af912a43d525ed9
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'tests/auto/qquickpopup/data/invisibleToolTipOpen.qml')
-rw-r--r-- | tests/auto/qquickpopup/data/invisibleToolTipOpen.qml | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/auto/qquickpopup/data/invisibleToolTipOpen.qml b/tests/auto/qquickpopup/data/invisibleToolTipOpen.qml new file mode 100644 index 00000000..2e58bb97 --- /dev/null +++ b/tests/auto/qquickpopup/data/invisibleToolTipOpen.qml @@ -0,0 +1,28 @@ +import QtQuick 2.13 +import QtQuick.Window 2.13 +import QtQuick.Controls 2.13 + +Window { + width: 400 + height: 400 + property alias mouseArea: mouseArea + property alias loader: loader + MouseArea { + id: mouseArea + property bool isToolTipVisible: false + width: 200 + height: 200 + hoverEnabled: true + ToolTip.text: "static tooltip" + ToolTip.visible: containsMouse + ToolTip.onVisibleChanged: isToolTipVisible = ToolTip.visible + } + Loader { + id: loader + active: false + sourceComponent: Rectangle { + ToolTip.text: "dynamic tooltip" + ToolTip.visible: false + } + } +} |