Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Avoid manual rebuild after modifying qml files in Qt Creator

Avoid manual rebuild after modifying qml files in Qt Creator

Scheduled Pinned Locked Moved Solved QML and Qt Quick
qt creatorqmlrebuild
5 Posts 2 Posters 2.6k 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.
  • M Offline
    M Offline
    markugra
    wrote on last edited by
    #1

    Hi there,

    I am new to QML and I was wondering how I should include qml-files in the project in order to avoid having to rebuild the project manually every time I change some code in one of the qml files. So far I am basing myself on Qt examples such as qt quick controls 2 flatstyle, in which the qml files are listed under RESOURCES in the pro file. In Qt Creator they then appear in a subfolder of the qmqke_qmake_immediate.qrc file. Is there a recommended way how to include them best?

    raven-worxR 1 Reply Last reply
    0
    • M markugra

      Hi there,

      I am new to QML and I was wondering how I should include qml-files in the project in order to avoid having to rebuild the project manually every time I change some code in one of the qml files. So far I am basing myself on Qt examples such as qt quick controls 2 flatstyle, in which the qml files are listed under RESOURCES in the pro file. In Qt Creator they then appear in a subfolder of the qmqke_qmake_immediate.qrc file. Is there a recommended way how to include them best?

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @markugra
      since you added them to a Qt resource file they are included/compiled into the binary. Thus the necessary rebuild.
      The only way to avoid that is to load the qml files from the filesystem and avoid rebuilding this way. But this approach is more error prone IMO.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      M 1 Reply Last reply
      1
      • raven-worxR raven-worx

        @markugra
        since you added them to a Qt resource file they are included/compiled into the binary. Thus the necessary rebuild.
        The only way to avoid that is to load the qml files from the filesystem and avoid rebuilding this way. But this approach is more error prone IMO.

        M Offline
        M Offline
        markugra
        wrote on last edited by
        #3

        @raven-worx
        Thank you for your reply. I'm afraid I still don't understand why a simple "build" is not enough. Would you mind to elaborate on that?
        For now I take it that there is no better way and I have to live with cleaning the project before every run.

        raven-worxR 1 Reply Last reply
        0
        • M markugra

          @raven-worx
          Thank you for your reply. I'm afraid I still don't understand why a simple "build" is not enough. Would you mind to elaborate on that?
          For now I take it that there is no better way and I have to live with cleaning the project before every run.

          raven-worxR Offline
          raven-worxR Offline
          raven-worx
          Moderators
          wrote on last edited by
          #4

          @markugra
          all files in qrc file are read and converted to plain c++ code (binary arrays). Thus the corresponding cpp-file changes whenever a file in your qrc file changes.

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          M 1 Reply Last reply
          0
          • raven-worxR raven-worx

            @markugra
            all files in qrc file are read and converted to plain c++ code (binary arrays). Thus the corresponding cpp-file changes whenever a file in your qrc file changes.

            M Offline
            M Offline
            markugra
            wrote on last edited by
            #5

            @raven-worx
            Do I understand correctly that a simple "build" would not cause the conversion from qml to c++ if there are already existing binary arrays (even if the qml code has changed)? As a consequence the binaries need to be removed for a QML update to have an effect?

            1 Reply Last reply
            0

            • Login

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