Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. [SOLVED] Plugin migrated to Qt 5.0.0 build error will not generate lib file
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Plugin migrated to Qt 5.0.0 build error will not generate lib file

Scheduled Pinned Locked Moved 3rd Party Software
3 Posts 3 Posters 11.4k 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.
  • A Offline
    A Offline
    astodolski
    wrote on last edited by
    #1

    I am trying to migrate a working plug-in that works fine in Qt 4.8.4 which was obtained "here":http://qt-apps.org/content/show.php/QLedIndicator?content=118610. I am having issues in Qt 5.0.0 for MSVC2010. Specifically, the module which provides implementation of the plugin is in
    @Q_EXPORT_PLUGIN2(customwidgetplugin, QLedIndicatorPlugin)@

    which appears to have been deprecated and show an error:

    error C2338: Old plugin system used.

    If I just comment it out, the build doesn't generate a needed .lib file which is used by Qt designer.

    I'm reading that the replacement is to use Q_PLUGIN_METADATA but the examples I saw are not in the context of how I used the former.

    What's the right way to migrate this?

    I the header for the plug in, I edited the code to include the following, based on some of the plugin examples in the 5.0 build:

    @
    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QDesignerCustomWidgetInterface" FILE "qledindicator.json")
    @

    I get yet again an error "Plugin Metadata file "qledindicator.json" does not exist. Declaration will be ignored

    UPDATE:
    I fixed it it by removing the FILE keyword which was the second parameter in the macro. This allowed the LIB file to be generated.

    @
    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QDesignerCustomWidgetInterface" /* FILE "qledindicator.json" */)
    @

    1 Reply Last reply
    0
    • J Offline
      J Offline
      jrad
      wrote on last edited by
      #2

      Hi

      I was having the same problem when I tried to implement the CircleBar example from Thelin's book in QT5.

      After looking at the doc, I managed to get something working, but I'm not sure what exactly is going on.

      I inserted this in circlebarplugin.h:

      @class CircleBarPlugin : public QObject, public QDesignerCustomWidgetInterface
      {
      Q_OBJECT
      Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QDesignerCustomWidgetInterface" FILE "circlebar.json")
      Q_INTERFACES(QDesignerCustomWidgetInterface)@

      Then I created a new text file inside the project (right click on the project name in the sidebar->add new->general->text file, this puts it in the current directory so it can be seen) and renamed it circlebar.json. I simply put:

      @{ "Keys": [ "circlebaristhisplugin" ] }@

      In the file and it seemed to work. I'm not too sure what's going on in Q_PLUGIN_METADATA or the .json file but this is working for me at the moment.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mloskot
        wrote on last edited by
        #3

        I was having similar problem when I was trying to create sample Qt Creator plugin with Qt 5.2 and Qt Creator 3.0.8, both built from their Git repositories.

        After creating project with the Qt Creator Plugin wizard, I tweaked some file/class names and started getting this "“Plugin Metadata file ... does not exist."

        Turns out, FILE name used in Q_PLUGIN_METADATA was slightly different than QTC_PLUGIN_NAME in .pro file.

        1 Reply Last reply
        1

        • Login

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