开发者

How do i use existing qml file in qt creator?

开发者 https://www.devze.com 2023-03-16 17:55 出处:网络
I download some qml templeates from nokia\'s website. Now i want to test them. How can i import qml file into my empty project?

I download some qml templeates from nokia's website. Now i want to test them. How can i import qml file into my empty project?

Temp开发者_如何学Pythonleates are here https://projects.developer.nokia.com/QMLTemplates


  1. Create a new Qt Quick application;
  2. in the wizard choose option 'Import an existing .qml file' (second one) instead of 'Generate a main .qml file' (first one).
  3. Click on browse button and select your QML file you that downloaded.


i have solved it.

1) Create a new Qt Quick application;

2) in the wizard choose option 'Generate a main .qml file' (first one).

3) There is two folder for each demo in qml templates. Component and example. Then open and copy all data in main.qml under example folder and paste it to our new projects main.qml

4) Now edit main.qml in our new project -> delete 'import "../component" as Comp' and write 'import "component" as Comp' in second line.

5) Copy component folder in qml templates and paste it near to our project's main.qml file

6) Run

7)if there are extra file under example folder, copy all of them and paste near to main.qml file under our new project.

0

精彩评论

暂无评论...
验证码 换一张
取 消