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. Loading qml binary in source code
Qt 6.11 is out! See what's new in the release blog

Loading qml binary in source code

Scheduled Pinned Locked Moved Solved QML and Qt Quick
7 Posts 3 Posters 1.1k 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.
  • S Offline
    S Offline
    Satyakaama
    wrote on last edited by
    #1

    Is it possible to use qml binary in source code to load component instead of .qml file ?

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      what do you mean by qml binary ? Can you add some more information ?

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      1 Reply Last reply
      0
      • S Offline
        S Offline
        Satyakaama
        wrote on last edited by
        #3

        I am rephrasing problem statement.

        Currently we are copying .qml file into Release build for compilation purpose on embedded device.
        We want to protect qml files since it is in readable format.Could you please suggest better way to load qml files in source code so that we can avoid copying those files on embedded device ?

        J.HilkJ 1 Reply Last reply
        0
        • S Satyakaama

          I am rephrasing problem statement.

          Currently we are copying .qml file into Release build for compilation purpose on embedded device.
          We want to protect qml files since it is in readable format.Could you please suggest better way to load qml files in source code so that we can avoid copying those files on embedded device ?

          J.HilkJ Offline
          J.HilkJ Offline
          J.Hilk
          Moderators
          wrote on last edited by
          #4

          Hi @Satyakaama

          are you aware of Qt's resource system?
          http://doc.qt.io/qt-5/resources.html

          you can add your qml files to one of those, than they get compiled and added to the binary file -> no need to copy the qml-files to the target device.


          Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


          Q: What's that?
          A: It's blue light.
          Q: What does it do?
          A: It turns blue.

          1 Reply Last reply
          0
          • dheerendraD Offline
            dheerendraD Offline
            dheerendra
            Qt Champions 2022
            wrote on last edited by
            #5

            In addition to what @J-Hilk suggested when you create default quick application it creates resource file. You can see Qml file in side resource file itself.

            Dheerendra
            @Community Service
            Certified Qt Specialist
            http://www.pthinks.com

            1 Reply Last reply
            0
            • S Offline
              S Offline
              Satyakaama
              wrote on last edited by
              #6

              @J-Hilk @dheerendra Thanks for information.App on Target device is working without copying qml files since all files are present in resource file system.

              J.HilkJ 1 Reply Last reply
              1
              • S Satyakaama

                @J-Hilk @dheerendra Thanks for information.App on Target device is working without copying qml files since all files are present in resource file system.

                J.HilkJ Offline
                J.HilkJ Offline
                J.Hilk
                Moderators
                wrote on last edited by
                #7

                @Satyakaama
                Great!
                Don't forget, when your question is sufficiently answered, to set the topic to solved ;-)


                Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                Q: What's that?
                A: It's blue light.
                Q: What does it do?
                A: It turns blue.

                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