summaryrefslogtreecommitdiff
path: root/src/tutorials/Tooltip.qml
blob: 866de832d70a320144251ea4def5b5ca63395c0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import QtQuick 2.7


Rectangle {
  color: "#EE888888"
  width: childrenRect.width + 15
  height: childrenRect.height + 15
  z: 20000
  clip: false
  border.color: "black"
  border.width: 1
  property alias text: tooltipText.text
  Text {
    id: tooltipText
    font.pointSize: 11
    wrapMode: Text.WordWrap
    anchors.left: parent.left
    anchors.top: parent.top
    anchors.leftMargin: 7
    anchors.rightMargin: 7
    z: parent.z
    color: "black"
    onTextChanged: {
      if (width > 200)
        width = 200
    }
  }
  visible: false
}