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. Creating shared libarary
Forum Updated to NodeBB v4.3 + New Features

Creating shared libarary

Scheduled Pinned Locked Moved Solved QML and Qt Quick
9 Posts 2 Posters 2.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.
  • J Offline
    J Offline
    jayshetti
    wrote on last edited by A Former User
    #1

    How to create dll file which includes qml files and how to use the same in another qml file.

    raven-worxR 1 Reply Last reply
    0
    • J jayshetti

      How to create dll file which includes qml files and how to use the same in another qml file.

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @jayshetti
      Here you go

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      1
      • J Offline
        J Offline
        jayshetti
        wrote on last edited by
        #3

        @raven-worx i have seen this example i'm able to create dll file but unable to use it in other project,
        need some step by step guidelines.

        raven-worxR 1 Reply Last reply
        0
        • J jayshetti

          @raven-worx i have seen this example i'm able to create dll file but unable to use it in other project,
          need some step by step guidelines.

          raven-worxR Offline
          raven-worxR Offline
          raven-worx
          Moderators
          wrote on last edited by
          #4

          @jayshetti
          what is the error, what isn't working exactly?

          Note that you can only load dbeug libraries in debug builds and the same respectivly for release.
          Also when place the DLL and the qmldir file in the Qt dir (e.g. C:\Qt\Qt5.7.0-msvc2015\5.7\msvc2015\qml\MyModule) it will be loaded by Qt automatically.

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          1 Reply Last reply
          0
          • J Offline
            J Offline
            jayshetti
            wrote on last edited by jayshetti
            #5

            @raven-worx i'll tell you what i exactly want to do
            i have created QT quick2 extension plugin library project in this project i have to have one qml file that draws one simple circle
            i have to use the plugin i.e generated by extension plugin into other qt quick application to draw the circle
            How to achieve this task if you give me step by step guidelines it would be helpful.

            raven-worxR 1 Reply Last reply
            0
            • J jayshetti

              @raven-worx i'll tell you what i exactly want to do
              i have created QT quick2 extension plugin library project in this project i have to have one qml file that draws one simple circle
              i have to use the plugin i.e generated by extension plugin into other qt quick application to draw the circle
              How to achieve this task if you give me step by step guidelines it would be helpful.

              raven-worxR Offline
              raven-worxR Offline
              raven-worx
              Moderators
              wrote on last edited by
              #6

              @jayshetti
              did you read the link i've already posted? This actually contains everything to know.
              As i already said, once the plugin is built copy it to your Qt's qml directory and it can be loaded by other applications.

              I wont post a step-by-step guide, when there is everything already in the docs. If you have a specific question ask it.

              --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
              If you have a question please use the forum so others can benefit from the solution in the future

              1 Reply Last reply
              0
              • J Offline
                J Offline
                jayshetti
                wrote on last edited by
                #7

                @raven-worx i'm able to load the plugin successfully but i'm facing problem in loading qml component in this link they have used Clock.qml and plugins.qml how should i access that Clock.qml file in my application through plugin if i simply used Clock as component it showing me an erorr.

                raven-worxR 1 Reply Last reply
                0
                • J jayshetti

                  @raven-worx i'm able to load the plugin successfully but i'm facing problem in loading qml component in this link they have used Clock.qml and plugins.qml how should i access that Clock.qml file in my application through plugin if i simply used Clock as component it showing me an erorr.

                  raven-worxR Offline
                  raven-worxR Offline
                  raven-worx
                  Moderators
                  wrote on last edited by
                  #8

                  @jayshetti
                  in this example the Clock.qml is located in the file system.

                  Place your QML files in a qrc file and compile it into the plugin.
                  Then in your qmldir file you can also specify a qrc:// url, to make it look like this:

                  module MyModule
                  plugin mymodule
                  MyType 1.0 qrc:///path/to/MyType.qml
                  

                  or leave out the list of QML files in the qmldir file and register the types in the plugins registerTypes() method:

                  void registerTypes(const char *uri)
                   {
                          Q_ASSERT(uri == QLatin1String("MyModule"));
                          qmlRegisterType( QUrl::fromUserIntput("qrc:///path/to/MyType.qml"), uri, 1, 0, "MyType");
                   }
                  

                  Then use import MyModule 1.0 to load your plugin.

                  --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
                  If you have a question please use the forum so others can benefit from the solution in the future

                  1 Reply Last reply
                  0
                  • J Offline
                    J Offline
                    jayshetti
                    wrote on last edited by
                    #9

                    @raven-worx Thank you it worked nw

                    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