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. How to embed qml-files etc. in executable file? [solved]
Forum Updated to NodeBB v4.3 + New Features

How to embed qml-files etc. in executable file? [solved]

Scheduled Pinned Locked Moved QML and Qt Quick
22 Posts 5 Posters 27.3k Views 1 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.
  • Z Offline
    Z Offline
    ZapB
    wrote on 4 May 2011, 20:39 last edited by
    #13

    Ah, you cannot compile a dll into the resource system. I do not think the library loader supports using the resource system. Also it doesn't really make sense to place a shared library inside the binary as it loses any benefit of being a shared library.

    I think you'll need to remove your style plugin from the resource system and load that using the method I suggested above with QDeclarativeEngine::addImportPath().

    Nokia Certified Qt Specialist
    Interested in hearing about Qt related work

    1 Reply Last reply
    0
    • H Offline
      H Offline
      Hedge
      wrote on 4 May 2011, 20:55 last edited by
      #14

      Ah! I almost forget that libraries can't be resources.

      It works now when styleplugin.dll is inside the .exe-folder.

      I also placed a copy of styleplugin.dll inside the folder 'plugins' and added the following line in my main-function

      @QCoreApplication::addLibraryPath(QCoreApplication::applicationDirPath() + "/plugins");@

      but that doesn't work. What could be wrong here? applicationDirPath() returns the correct location.

      1 Reply Last reply
      0
      • Z Offline
        Z Offline
        ZapB
        wrote on 4 May 2011, 21:03 last edited by
        #15

        What category of plugin is it?

        Nokia Certified Qt Specialist
        Interested in hearing about Qt related work

        1 Reply Last reply
        0
        • H Offline
          H Offline
          Hedge
          wrote on 4 May 2011, 21:06 last edited by
          #16

          It's a qml-plugin.

          1 Reply Last reply
          0
          • Z Offline
            Z Offline
            ZapB
            wrote on 4 May 2011, 21:11 last edited by
            #17

            In that case I think that you need to use QDeclarativeEngine::addImportPath() as I mentioed earlier rather than addLibraryPath().

            Nokia Certified Qt Specialist
            Interested in hearing about Qt related work

            1 Reply Last reply
            0
            • H Offline
              H Offline
              Hedge
              wrote on 4 May 2011, 21:24 last edited by
              #18

              OK, but that returns an error (I placed it in the main-function)

              @QDeclarativeEngine::addImportPath(QCoreApplication::applicationDirPath() + "/plugins");@

              @error: incomplete type 'QDeclarativeEngine' used in nested name specifier@

              Adding it to the QmlApplicationViewer doesn't do anything

              @ QmlApplicationViewer viewer;
              viewer.addImportPath(QCoreApplication::applicationDirPath() + "/plugins");@

              Also the QtCreator-editor complains that it can't find both imports:
              @import "qrc:/desktop-components/components"
              import "qrc:/desktop-components/components/plugin"@

              1 Reply Last reply
              0
              • D Offline
                D Offline
                DamianMilo
                wrote on 30 Dec 2012, 16:08 last edited by
                #19

                You set it solved but i can't see solution.. Could you write me solution?

                Regards,
                Damian Czechowicz
                Junior Software Engineer

                Milo Solutions
                http://milosolutions.com

                1 Reply Last reply
                0
                • N Offline
                  N Offline
                  nib952051
                  wrote on 10 Jan 2013, 16:36 last edited by
                  #20

                  I think we can't load library in such way. For me problem solution was in modifying qstyleplugin and build rules. If needed I can share the code.

                  1 Reply Last reply
                  0
                  • D Offline
                    D Offline
                    DamianMilo
                    wrote on 27 Feb 2013, 11:39 last edited by
                    #21

                    Could you share code? thanks.

                    Regards,
                    Damian Czechowicz
                    Junior Software Engineer

                    Milo Solutions
                    http://milosolutions.com

                    1 Reply Last reply
                    0
                    • N Offline
                      N Offline
                      nib952051
                      wrote on 27 Feb 2013, 12:48 last edited by
                      #22

                      "look at cmake branch":https://github.com/nib952051/QtDesktopComponentsBackport/tree/cmake

                      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