调整qml代码结构

This commit is contained in:
hewenfei 2022-12-12 09:33:27 +08:00
parent c806406eab
commit bf7362d85c
3 changed files with 23 additions and 13 deletions

18
qml/UkuiMenuUI.qml Normal file
View File

@ -0,0 +1,18 @@
import QtQuick 2.12
import QtQuick.Controls 2.0 as QQC2
import AppUI 1.0 as AppUI
import AppControls2 1.0 as AppControls2
Item {
AppUI.AppTest {
width: 200
height: 480
}
AppControls2.AppTest {
x: 400
width: 200
height: 480
}
}

View File

@ -1,24 +1,15 @@
import QtQuick 2.12 import QtQuick 2.12
import QtQuick.Window 2.12 import QtQuick.Window 2.12
import QtQuick.Controls 2.0
import AppUI 1.0 as AppUI
import AppControls2 1.0 as AppControls2
Window { Window {
id: mainWindow
visible: true visible: true
width: 600 width: 600
height: 480 height: 480
title: qsTr("Hello World") title: qsTr("Hello World")
AppUI.AppTest { Loader {
width: 200 anchors.fill: mainWindow.contentItem;
height: 480 source: "qrc:/qml/UkuiMenuUI.qml"
} }
AppControls2.AppTest {
x: 400
width: 200
height: 480
}
} }

View File

@ -1,6 +1,7 @@
<RCC> <RCC>
<qresource prefix="/qml"> <qresource prefix="/qml">
<file>main.qml</file> <file>main.qml</file>
<file>UkuiMenuUI.qml</file>
<file>AppUI/qmldir</file> <file>AppUI/qmldir</file>
<file>AppUI/App.qml</file> <file>AppUI/App.qml</file>
<file>AppControls2/qmldir</file> <file>AppControls2/qmldir</file>