我有一个简单的 QML,里面有ApplicationWindow
,RowLayout
和一堆Buttons
。我已经按照文档Material
应用了 Qt Quick Controls 2主题,但没有任何改变。怎么了?
import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Controls.Material 2.0
import QtQuick.Layouts 1.3
ApplicationWindow {
Material.theme: Material.Dark
Material.accent: Material.Orange
id: window
visible: true
RowLayout {
anchors.horizontalCenter: window.horizontalCenter
anchors.bottomMargin: 32
Button {
text: "A"
}
Button {
text: "B"
}
Button {
text: "C"
}
}
}