Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. qmake undocumented functions?

qmake undocumented functions?

Scheduled Pinned Locked Moved Unsolved General and Desktop
9 Posts 3 Posters 764 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • fcarneyF Offline
    fcarneyF Offline
    fcarney
    wrote on last edited by
    #1

    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.html

    I don't see that command listed anywhere. Am I just not looking in the right place?

    C++ is a perfectly valid school of magic.

    KroMignonK 1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by mrjj
      #2

      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 ?

      1 Reply Last reply
      0
      • fcarneyF Offline
        fcarneyF Offline
        fcarney
        wrote on last edited by
        #3

        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.

        C++ is a perfectly valid school of magic.

        1 Reply Last reply
        0
        • fcarneyF Offline
          fcarneyF Offline
          fcarney
          wrote on last edited by
          #4

          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.

          C++ is a perfectly valid school of magic.

          mrjjM 1 Reply Last reply
          0
          • fcarneyF fcarney

            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.

            mrjjM Offline
            mrjjM Offline
            mrjj
            Lifetime Qt Champion
            wrote on last edited by mrjj
            #5

            @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
            }

            1 Reply Last reply
            0
            • fcarneyF Offline
              fcarneyF Offline
              fcarney
              wrote on last edited by
              #6

              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

              C++ is a perfectly valid school of magic.

              1 Reply Last reply
              0
              • fcarneyF Offline
                fcarneyF Offline
                fcarney
                wrote on last edited by
                #7

                Is this where I say, "Don't look a gift horse in the mouth?"

                C++ is a perfectly valid school of magic.

                1 Reply Last reply
                0
                • mrjjM Offline
                  mrjjM Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  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.

                  1 Reply Last reply
                  0
                  • fcarneyF fcarney

                    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.html

                    I don't see that command listed anywhere. Am I just not looking in the right place?

                    KroMignonK Offline
                    KroMignonK Offline
                    KroMignon
                    wrote on last edited by KroMignon
                    #9

                    @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:

                    • https://doc.qt.io/qt-5/linguist-manager.html#using-lupdate

                    Hope this helps

                    Just to complet my reply: I think it is equivalent to lupdate_only

                    It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

                    1 Reply Last reply
                    4

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved