Unsolved qmake undocumented functions?
-
We had the issue of qml files not being rebuilt into the application when we made changes. I vaguely remember searching for a solution and finally found this:
for_lupdate { SOURCES += qml/*.qml }
I wanted to understand what exactly for_lupdate is doing (I assume some linguistic thing) so I looked at the qmake reference:
https://doc.qt.io/qt-5/qmake-reference.htmlI don't see that command listed anywhere. Am I just not looking in the right place?
-
Hi
Oh and its not even listed in
https://wiki.qt.io/Undocumented_QMake
Nor does google seems to know it :)How are u using it after ?
-
This is how it appears in the file:
RESOURCES += \ qml.qrc \ images.qrc for_lupdate { SOURCES += qml/*.qml }
We don't do anything else with it. All I can guess is it somehow causes something to reevaluate the files somehow. I honestly don't know. I could be wrong, it might be related to lupdate, but I can't find anything in lupdate docs either. I just remember putting something in the pro file to force updates of qml files every time one changes.
-
I changed it to:
for_test { SOURCES += qml/*.qml }
It still seems to add the qml sources to the project when doing that. It adds them in the Source path of the project as qml with qml files beneath. So the command/condition doesn't seem to matter. Somehow it forces an evaluation.
-
@fcarney
Hehe had exactly same though.
Seems to make a scope where all the qml files are added to the SOURCES list.looks likes (from docs)
win32 {
SOURCES += paintwidget_win.cpp
} -
Also, I am not putting anything in CONFIG as that would cause the scope to be valid if I am reading this right:
https://doc.qt.io/qt-5/qmake-language.html#configuration-and-scopes -
Is this where I say, "Don't look a gift horse in the mouth?"
-
Hi
hehe well its always nice to know how the horse work.
Im also wondering why for_test also works, ruling out that for_lupdate would be defined
internally. -
@fcarney said in qmake undocumented functions?:
I wanted to understand what exactly for_lupdate is doing (I assume some linguistic thing)
This is for "lupdate" tool from Qt, to tell him which files it should parse to find strings which have to be translated.
lupdate is running "qmake" the find the files to parse, and "for_lupdate" is "true" is this case. So SOURCES will also include all qml files in sub-folder qml (in this case).take a look at:
Hope this helps
Just to complet my reply: I think it is equivalent to lupdate_only