Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-141516

Add an example that shows how how to define a plugin for a backing library that has NO_GENERATE_PLUGIN_SOURCE and NO_PLUGIN_OPTIONAL

XMLWordPrintable

      There can be cases where you need to define your own intializeEngine, to e.g. expose an enum to JS:

      https://doc-snapshots.qt.io/qt6-dev/qtquick-how-tos.html#use-a-c-enum-in-javascript

      https://doc.qt.io/qt-6/qtqml-writing-a-module.html almost shows how to do this in CMake, but:

      The plugin and the backing library both are in the same CMake target imageproviderplugin

      For the scenario where they are separate targets, the user needs to do something like this:

      https://code.qt.io/cgit/qt/qtdeclarative.git/tree/src/quick/CMakeLists.txt#n257

      Except they'll need to use target_sources to add the plugin's .cpp file to the plugin target:

      target_sources(MyModuleplugin PUBLIC
          Plugin.cpp
      )
      

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            qtqmlteam Qt Qml Team User
            mitch_curtis Mitch Curtis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes