Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. qml caching problem

qml caching problem

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
7 Posts 2 Posters 1.8k Views 2 Watching
  • 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
    Mark81
    wrote on last edited by
    #1

    I'm facing for the first time a weird problem. I added to my project a new resource file, called qml. Here how my pro file looks like:

    QT += core gui widgets sql serialbus svg network printsupport qml quickwidgets quick
    TARGET = MyProject
    TEMPLATE = app
    DESTDIR = bin
    CONFIG += c++11
    DEFINES += QT_DEPRECATED_WARNINGS
    
    SOURCES += \
            main.cpp \
            mainwindow.cpp \
            ...
    
    HEADERS += \
            mainwindow.h \
            ...
    
    FORMS += \
            mainwindow.ui \
            ...
    
    TRANSLATIONS = languages/translation_en.ts  languages/translation_it.ts
    
    RESOURCES += \
        qdarkstyle/style.qrc \
        resources.qrc \
        qml.qrc
    

    when I'm in debug mode, I see all the three resource files with all their contents. But when I switch to the release mode the qml.qrc file disappear, a new qml_qmlcache.qrc is shown. This contains a different file that is not available (?) and cannot be removed. I tried to clean, run qmake and rebuild but the behavior doesn't change.

    What can be trigger such a behavior? How to fix it?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      What if you change that .qrc file name to something else ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      M 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        What if you change that .qrc file name to something else ?

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

        @SGaist said in qml caching problem:

        What if you change that .qrc file name to something else ?

        In debug mode, renamed to foo.qrc (it contains about 25 files).
        Switched to release, it was replaced by foo_qmlcache.qrc with only 1 file.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Might be the QtQuick compiler kicking in.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          M 1 Reply Last reply
          0
          • SGaistS SGaist

            Might be the QtQuick compiler kicking in.

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

            @SGaist said in qml caching problem:

            Might be the QtQuick compiler kicking in.

            mmm, I didn't add qtquickcompiler to CONFIG . Would you please explain a bit more what should I do to avoid that?

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Check the content of the CONFIG variable and try CONFIG -= qtquickcompiler

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              M 1 Reply Last reply
              2
              • SGaistS SGaist

                Check the content of the CONFIG variable and try CONFIG -= qtquickcompiler

                M Offline
                M Offline
                Mark81
                wrote on last edited by
                #7

                @SGaist said in qml caching problem:

                Check the content of the CONFIG variable and try CONFIG -= qtquickcompiler

                Ok, I didn't understand from the docs that the option is enabled by default!
                After disabling it, it created a new qml_qmlcache.qrc file (without override the original) and it seems to work in both debug and release mode.

                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