import QtQuick import QtQuick.Controls.Styles Component { ButtonStyle { background: Rectangle { implicitWidth: Math.max(lbText.width+10, 48) implicitHeight: 25 radius: 5 color: control.pressed ? "#005bac" : "#216eb4" Text { id: lbText x: (parent.width - width) / 2 y: (parent.height - height -2) / 2 text: control.text font.family: "微软雅黑" font.pointSize: 10 font.bold: true color: control.enabled ? "white" : "lightgray" } } label: Text {} } }