![End to End GUI Development with Qt5](https://wfqqreader-1252317822.image.myqcloud.com/cover/196/36699196/b_36699196.jpg)
上QQ阅读APP看书,第一时间看更新
Creating views
In cm-ui, right-click on views.qrc and select Add New…. Select Qt > QML File and click on Choose...:
![](https://epubservercos.yuewen.com/7E0B13/19470385501524806/epubprivate/OEBPS/Images/5587e5a1-7bc7-4ea8-b1ce-8892e020a311.png?sign=1739043166-7ERpfoajyRTAWFd1JRKrERFVuecDXaju-0-113f1a8b20cfac4eaf1e4d45c82a7d3c)
Create the SplashView.qml file in cm-ui/ui/views. Repeat this process until you’ve created all the following views:
![](https://epubservercos.yuewen.com/7E0B13/19470385501524806/epubprivate/OEBPS/Images/001.jpg?sign=1739043166-HlFTMXZeXYq7vewSt5yTyqnUXcafS6fs-0-52ea7a855a997a22e385e45962053bef)
Edit views.qrc in the Plain Text Editor as we have done previously. You will see that our new views have been added to a new qresource block with the default prefix of the following:
<RCC> <qresource prefix="/views"> <file alias="MasterView">views/MasterView.qml</file> </qresource> <qresource prefix="/"> <file>views/SplashView.qml</file> <file>views/DashboardView.qml</file> <file>views/CreateClientView.qml</file> <file>views/EditClientView.qml</file> <file>views/FindClientView.qml</file> </qresource> </RCC>
Also note that the Projects navigator is a bit of a mess:
![](https://epubservercos.yuewen.com/7E0B13/19470385501524806/epubprivate/OEBPS/Images/d26acec9-6c1f-46d2-ab7a-773d00122b5b.png?sign=1739043166-Icu8y389ftCth2mN3Uf59uxYrzrOnjuZ-0-8faa368cfb6d22fd83e9b28e9f8613f8)
Move all the new files into the “/views” prefix block and remove the “/” block. Add an alias for each of the new files:
<RCC> <qresource prefix="/views"> <file alias="MasterView.qml">views/MasterView.qml</file> <file alias="SplashView.qml">views/SplashView.qml</file> <file alias="DashboardView.qml">views/DashboardView.qml</file> <file alias="CreateClientView.qml">views/CreateClientView.qml</file> <file alias="EditClientView.qml">views/EditClientView.qml</file> <file alias="CreateAppointmentView.qml">views/CreateAppointmentView.qml</file> <file alias="FindClientView.qml">views/FindClientView.qml</file> </qresource> </RCC>
As soon as you save these changes, you should see the navigator clean right up:
![](https://epubservercos.yuewen.com/7E0B13/19470385501524806/epubprivate/OEBPS/Images/da8e774c-c2a6-436b-994c-eb325b9472f6.png?sign=1739043166-nMrXYDdBFWeIC32CSD2PmppHSK2UavZ9-0-894e284c90bf727eefbfee1bdd76ef3b)