图标文字上下排列:
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
Button {
id: diseaseVBtn
text: qsTr("test")
background: Rectangle {
implicitWidth: 30
implicitHeight: 40
}
contentItem: ColumnLayout {
spacing: 0
Image {
source: "qrc:/res/test.png"
scale: 0.7
}
Text {
text: parent.parent.text
font.pixelSize: 12
Layout.alignment: Qt.AlignHCenter
}
}
}
图标文字左右排列: