TooltipArea.qml 529 Bytes
Newer Older
1 2
import QtQuick 2.7

3
// =============================================================================
4 5 6

MouseArea {
  property alias text: tooltip.text
7
  property var tooltipParent: this
8

9 10
  property bool _visible: false

11 12
  anchors.fill: parent
  hoverEnabled: true
13
  scrollGestureEnabled: true
14

15
  onContainsMouseChanged: _visible = containsMouse
16
  onPressed: mouse.accepted = false
17 18 19 20
  onWheel: {
    _visible = false
    wheel.accepted = false
  }
21 22 23 24

  Tooltip {
    id: tooltip

25
    parent: tooltipParent
26
    visible: _visible
27 28
  }
}