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. loadin qml in engine load

loadin qml in engine load

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
6 Posts 2 Posters 620 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.
  • P Offline
    P Offline
    praveen_03
    wrote on 12 Jun 2023, 10:51 last edited by
    #1

    I'm creating one qml application in visual studio and if I give release folder to someone it's throwing error

    error.png

    I suspect engine load in cpp. currently I'm using this code to load main qml

    engine.load(("qrc:/main.qml"));
        if(engine.rootObjects().isEmpty())
        {
            return -1;
        }
    

    I tried of adding main qml in release folder

    J P 2 Replies Last reply 12 Jun 2023, 10:58
    0
    • P praveen_03
      12 Jun 2023, 10:51

      I'm creating one qml application in visual studio and if I give release folder to someone it's throwing error

      error.png

      I suspect engine load in cpp. currently I'm using this code to load main qml

      engine.load(("qrc:/main.qml"));
          if(engine.rootObjects().isEmpty())
          {
              return -1;
          }
      

      I tried of adding main qml in release folder

      J Offline
      J Offline
      J.Hilk
      Moderators
      wrote on 12 Jun 2023, 10:58 last edited by
      #2

      @praveen_03 said in loadin qml in engine load:

      I give release folder to someone

      what exactly did you do? This does not sound like you followed the release/deployment guide.
      https://doc.qt.io/qt-6/windows-deployment.html


      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
      2
      • P praveen_03
        12 Jun 2023, 10:51

        I'm creating one qml application in visual studio and if I give release folder to someone it's throwing error

        error.png

        I suspect engine load in cpp. currently I'm using this code to load main qml

        engine.load(("qrc:/main.qml"));
            if(engine.rootObjects().isEmpty())
            {
                return -1;
            }
        

        I tried of adding main qml in release folder

        P Offline
        P Offline
        praveen_03
        wrote on 13 Jun 2023, 06:08 last edited by
        #3

        @praveen_03 Release folder.png error.png

        i had deployed using windeployqt and i tried to run in stand alone application still i'm facing the issue

        can you please guide me what's going wrong here

        J P 2 Replies Last reply 13 Jun 2023, 06:11
        0
        • P praveen_03
          13 Jun 2023, 06:08

          @praveen_03 Release folder.png error.png

          i had deployed using windeployqt and i tried to run in stand alone application still i'm facing the issue

          can you please guide me what's going wrong here

          J Offline
          J Offline
          J.Hilk
          Moderators
          wrote on 13 Jun 2023, 06:11 last edited by
          #4

          @praveen_03 like I said before, it helps a lot id you tell es exactly what you did.

          It seems like you forgot to use or used the qmldir argument incorrectly

          --qmldir <directory> Scan for QML-imports starting from directory.


          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
          • P praveen_03
            13 Jun 2023, 06:08

            @praveen_03 Release folder.png error.png

            i had deployed using windeployqt and i tried to run in stand alone application still i'm facing the issue

            can you please guide me what's going wrong here

            P Offline
            P Offline
            praveen_03
            wrote on 13 Jun 2023, 06:28 last edited by praveen_03
            #5

            @J-Hilk , i had create project in VS and i need to deploy in another system that's my goal.
            In main cpp i'm loading this main qml like this

                const QUrl url(QStringLiteral("qrc:/main.qml"));
            	engine.load(url);
            	if(engine.rootObjects().isEmpty())
            	{
            		return -1;
            	}
            

            I'm new to this platform, sorry for inconvenient reply

            J 1 Reply Last reply 13 Jun 2023, 08:06
            0
            • P praveen_03
              13 Jun 2023, 06:28

              @J-Hilk , i had create project in VS and i need to deploy in another system that's my goal.
              In main cpp i'm loading this main qml like this

                  const QUrl url(QStringLiteral("qrc:/main.qml"));
              	engine.load(url);
              	if(engine.rootObjects().isEmpty())
              	{
              		return -1;
              	}
              

              I'm new to this platform, sorry for inconvenient reply

              J Offline
              J Offline
              J.Hilk
              Moderators
              wrote on 13 Jun 2023, 08:06 last edited by
              #6

              @praveen_03 said in loadin qml in engine load:

              sorry for inconvenient reply

              Don't worry as long as you try.

              Let me be more precise.

              "Please post the command you used to invoke the windeployqt tool. "

              if you also supply the absolute path to your main.qml we can actually give you the correct, copy&past-able, command.


              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

              3/6

              13 Jun 2023, 06:08

              • Login

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