[Interest] Qml Tooltips

Nicolas Kniebihler nicolas.kniebihler at dualo.org
Thu Oct 8 13:31:07 CEST 2015


  Hi Jerome,

I don't know if that answers your question, but I personally use the way 
QML shows tooltips above Buttons:

MyTooltip.qml:

importQtQuick2.3

importQtQuick.Controls1.2

importQtQuick.Controls.Private1.0

MouseArea{

id:behavior

propertystringtooltip

hoverEnabled:true

propagateComposedEvents:true

onExited:Tooltip.hideText()

onCanceled:Tooltip.hideText()

Timer{

interval:1000

running:behavior.containsMouse&&!behavior.pressed&&tooltip.length

onTriggered:Tooltip.showText(behavior,Qt.point(behavior.mouseX,behavior.mouseY),tooltip)

}

}


Example:

Label{

text:"Mylabel"

MyTooltip{

anchors.fill:parent

tooltip:qsTr("Mytooltip")

}

}


This way I can show a tooltip above any component (not just Buttons).

Nicolas

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20151008/456c2661/attachment.html>


More information about the Interest mailing list