Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-110629

Support "big resources" in qt_add_qml_module()

    XMLWordPrintable

Details

    Description

      As of Qt 6.5, the simplest way to use a big resource with a QML module – without needing Q_INIT_RESOURCE() – is as follows (credit to Mike Trahearn: https://www.linkedin.com/pulse/qt-qml-hot-tips-7-mike-trahearn )

      qt_add_executable(testApp
          main.cpp
      )
      
      qt_add_qml_module(testApp
          URI TestApp
          AUTO_RESOURCE_PREFIX   # ":/qt/qml"
          VERSION 1.0
          QML_FILES
              main.qml
      )
      
      qt_add_resources(testApp "testApp_large_resources"
          PREFIX /qt/qml/TestApp
          BIG_RESOURCES
          FILES
              MassiveUnicodeFont.otf
      )
      

       

      It would be nice if we could simplify it even further to something like this:

      qt_add_executable(testApp
          main.cpp
      )
      
      qt_add_qml_module(testApp
          URI TestApp
          AUTO_RESOURCE_PREFIX
          VERSION 1.0
          QML_FILES
              main.qml
          RESOURCES
              MassiveUnicodeFont.otf
          BIG_RESOURCE
      )
      

       

      jbornema's comment at https://bugreports.qt.io/browse/QTBUG-100268?focusedCommentId=670929&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-670929 suggests that it's preferable to have all-big or all-small, as opposed to differentiating between big resources and small resources within the same module.

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-110629
          # Subject Branch Project Status CR V

          Activity

            People

              qtbuildsystem Qt Build System Team
              skoh-qt Sze Howe Koh
              Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes