赞
踩
在QML控件中,如果需要显示提示框,通常使用ToolTip,但是默认提示框的位置总是不符合使用习惯,使用ToolTip.toolTip即可获得当前控件提示框的实例,直接对其设置即可:
- Slider {
- anchors.verticalCenter: parent.verticalCenter
- anchors.horizontalCenter: parent.horizontalCenter
- ToolTip.text: qsTr("这是工具提示框")
- ToolTip.visible: hovered
- ToolTip.toolTip.x:10
- ToolTip.toolTip.y:-30
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。