Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
TooltipArea.qml
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)
}
}
@mittal-n

This comment has been minimized.

Copy link

commented Jul 3, 2018

Can you please tell me how to change the color of a tool tip and background color of the rectangle?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.