知识点:

自定义按钮:

import QtQuick 2.12
import QtQuick.Window 2.12
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4

Window {
    id: root
    visible: true
    title: qsTr("Hello World")
    width: 800
    height: 600

    Button {
        id:btn
        x: 0
        y: 62
        text: "Quit2"
        style:ButtonStyle {
            background: Rectangle {
                implicitWidth: 100
                implicitHeight: 25
                border.width: btn.pressed ? 2 : 1
            }
        }
    }

}
main.qml

相关文章: