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. Install own C++ plugin (OSX)
Forum Updated to NodeBB v4.3 + New Features

Install own C++ plugin (OSX)

Scheduled Pinned Locked Moved Solved QML and Qt Quick
8 Posts 2 Posters 768 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.
  • H Offline
    H Offline
    HandzoHasashi
    wrote on last edited by
    #1

    Hello! I have custom c++ plugin libmyplugin.dylib. How can i install it to QtCreator and use it in my *.qml files?

    I've copied libmyplugin.dylib to ~/Qt/Qt Creator.app/Contents/PlugIns

    1 Reply Last reply
    0
    • hskoglundH Offline
      hskoglundH Offline
      hskoglund
      wrote on last edited by
      #2

      Hi, is your custom c++ plugin meant for helping Qt Creator with the editing of your *.qml files or for helping running them?

      If the plugin is an editor helper then the ~/Qt/Qt Creator.app/Contents/PlugIns is the right place. But also you need to design the plugin in a certain way for Qt Creator to recognize it, see more here

      H 1 Reply Last reply
      0
      • H Offline
        H Offline
        HandzoHasashi
        wrote on last edited by
        #3
        This post is deleted!
        1 Reply Last reply
        0
        • hskoglundH hskoglund

          Hi, is your custom c++ plugin meant for helping Qt Creator with the editing of your *.qml files or for helping running them?

          If the plugin is an editor helper then the ~/Qt/Qt Creator.app/Contents/PlugIns is the right place. But also you need to design the plugin in a certain way for Qt Creator to recognize it, see more here

          H Offline
          H Offline
          HandzoHasashi
          wrote on last edited by
          #4

          @hskoglund No, it extends qml library, adds new types.

          1 Reply Last reply
          0
          • hskoglundH Offline
            hskoglundH Offline
            hskoglund
            wrote on last edited by
            #5

            I see, you mean a QQmlExtensionPlugin?

            Qt Creator doesn't know or care about such plugins, so I think it's a bad idea to copy it into ~/Qt/Qt Creator.app/Contents/PlugIns

            You need to put in your project directory so that the QML import statement can find it, an example here

            H 1 Reply Last reply
            1
            • hskoglundH hskoglund

              I see, you mean a QQmlExtensionPlugin?

              Qt Creator doesn't know or care about such plugins, so I think it's a bad idea to copy it into ~/Qt/Qt Creator.app/Contents/PlugIns

              You need to put in your project directory so that the QML import statement can find it, an example here

              H Offline
              H Offline
              HandzoHasashi
              wrote on last edited by
              #6

              @hskoglund Then I need to store all the source code of my plugin in project. Is there any other way add plugin as a dependency?

              1 Reply Last reply
              0
              • hskoglundH Offline
                hskoglundH Offline
                hskoglund
                wrote on last edited by
                #7

                You mean your C++ source code? No, you compile the C++ code when you build the plugin, so the C++ source code is not needed by *.qml files, only the compiled plugin.

                (Sorry, I'm no expert, I only use Widgets in Qt, never QML. But there's a nice example of a QML plugin here)

                H 1 Reply Last reply
                1
                • hskoglundH hskoglund

                  You mean your C++ source code? No, you compile the C++ code when you build the plugin, so the C++ source code is not needed by *.qml files, only the compiled plugin.

                  (Sorry, I'm no expert, I only use Widgets in Qt, never QML. But there's a nice example of a QML plugin here)

                  H Offline
                  H Offline
                  HandzoHasashi
                  wrote on last edited by
                  #8

                  @hskoglund Thank you! I've made plugin as subproject and dependency for my main project. Build plugin as a static library and link to in from my main project.

                  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