Rebuilding again and again to view the imported QM

2019-06-04 03:00发布

I have imported a qml file say A in other qml say B. Whenever I make some changes in A , it doesn't reflect in the Application. I have to again clean and rebuild to view the changes i made, which is very time-consuming. Is there an easier and efficient way of doing this, so time could be saved .

Or another way of saying this is :
qrc files are not added to Makefile dependencies in debug_and_release mode

example

A.qml

 Rectangle {
        id:xyz
     Button
    {
    id: ButtonA
    }
 }

B.qml

Rectangle{
          A {
                id:abc
            }
         } 

I am using qt 4, qtquick 1.0.

2条回答
我想做一个坏孩纸
2楼-- · 2019-06-04 03:31

You can install the new qt creator, it will solve the problem. Worked for me. I installed QT creator 4.8.7.

查看更多
戒情不戒烟
3楼-- · 2019-06-04 03:35

You can make two independent qrc files, one for debug which is only includes resources like sounds, images, fonts and ... and another qrc for release which includes qml files too. Then you can use point to the qml files relatively with your current working directory (could be set in Build & Run pane) without need to include them in qrc which requires time consuming compilation and linkage. Also be aware, the root qml file should be pointed by relative (or absolute path) from C++ side, and no other changes are required to other qml files and they works perfectly on both release and debug mode

In your pro file :

debug {
    RESOURCES     = application_debug.qrc
}

!debug {
    RESOURCES     = application_release.qrc
}
查看更多
登录 后发表回答