Last active
March 29, 2021 10:34
-
-
Save webmaster128/d32a278d4037a72dd47a to your computer and use it in GitHub Desktop.
TooltipArea.qml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import QtQuick 2.4 | |
import QtQuick.Controls.Private 1.0 | |
// TooltipArea.qml | |
// This file contains private Qt Quick modules that might change in future versions of Qt | |
// Tested on: Qt 5.4.1 - Qt 5.6.1 | |
MouseArea { | |
property string text: "" | |
id: root | |
anchors.fill: parent | |
acceptedButtons: Qt.NoButton | |
hoverEnabled: root.enabled | |
onExited: Tooltip.hideText() | |
onCanceled: Tooltip.hideText() | |
Timer { | |
interval: 1000 | |
running: root.enabled && root.containsMouse && root.text.length | |
onTriggered: Tooltip.showText(root, Qt.point(root.mouseX, root.mouseY), root.text) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Can you please tell me how to change the color of a tool tip and background color of the rectangle?