函数Open显示tip,delay属性:延迟多久才显示,timeout显示的持续时间
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.0
import QtQuick.Controls.Material 2.0
ApplicationWindow {
visible: true
width: 640
height: 480
title: qsTr("Hello World")
ToolTip{
id:t
text: "按钮被点击咯"
delay: 500
timeout: 1000
x:parent.width/2 - width/2
y:parent.height/2 - height/2
}
Button{
id:btn
text:"按钮"
highlighted: true
Material.accent: Material.Green
Material.theme: Material.Dark
onClicked: {
t.open()
}
}
}