截止2021 年 1月 ,Qt 6 的 qml功能还不完善,类似 Style ,Dialog等内容还在开发当中,无法使用,
以下只能在5.12上进行实验
import QtQuick 2.12
import QtQuick.Window 2.12
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.2
import QtQuick.Dialogs 1.2
import QtQml 2.12
Window
{
width: 1000
height: 1000
visible: true
Rectangle{
anchors.fill:parent
color: "#121212"
BusyIndicator{
id: busys
running: true
anchors.centerIn: parent
z:3
}
Text {
id: imagePath
visible: true
anchors.left: openfile.right
anchors.leftMargin: 5
anchors.verticalCenter: openfile.verticalCenter
font.pixelSize: 14
color: "white"
z:3
text: qsTr("text")
}
Button
{
id:openfile
text:"open"
anchors.left:parent.left
anchors.leftMargin: 7;
anchors.bottom: parent.bottom
anchors.bottomMargin: 5

本文介绍了在2021年1月时Qt 6的QML功能尚不完整,如Style和Dialog等功能还在开发中,因此实验仍需在Qt 5.12版本上进行。示例代码展示了导入不同模块创建窗口的应用。
最低0.47元/天 解锁文章
930

被折叠的 条评论
为什么被折叠?



