Rebuilding again and again to view the imported QML file changes
Asked Answered
P

2

1

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.

Pickaxe answered 17/5, 2017 at 15:53 Comment(1)
See bugreports.qt.io/browse/QTBUG-13334 and its many duplicates. It's likely that you're running into this if you're using qrc files. It's very annoying.Plumbery
P
0

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

Pickaxe answered 21/7, 2017 at 9:45 Comment(0)
M
1

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
}
Martini answered 18/5, 2017 at 4:55 Comment(0)
P
0

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

Pickaxe answered 21/7, 2017 at 9:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.