Button {
            id: btn
            text: "Tip"
            anchors.horizontalCenter: parent.horizontalCenter

//            ToolTip.timeout: 5000
//            ToolTip.visible: pressed
//            ToolTip.text: "This is a tool tip."

            ToolTip {
                id: control
                visible: btn.pressed
                ToolTip.timeout: 5000
                text: qsTr("A descriptive tool tip of what the button does")

                contentItem: Text {
                    text: control.text
                    font: control.font
                    color: "#21be2b"
                }

                background: Rectangle {
                    border.color: "#21be2b"
                }
            }

        }

posted on 2017-06-07 17:28  邶风  阅读(1787)  评论(0编辑  收藏  举报