Custom widget plugin not shown on plugins list
-
wrote on 15 Feb 2023, 13:15 last edited by Dragoon
Hallo, I'm trying to create my first widget and a corrisponding plugin.
I followed official tutorials and some other sources and I finally managed to compile everything correctly, the widget works fine... When I try to open the 'About plugins' window in Qt Creator I got this error (in terminal window):qt.core.plugin.loader: In /opt/Qt/Tools/QtCreator/lib/Qt/plugins/designer/libvirtualpadplugin.so: Plugin uses incompatible Qt library (5.15.0) [debug]
Of course my widget is not shown in QtCreator widget palette.
I'm using Qt 5.15.2 , Qt Creator 9.0.0 under Linux 20.04.
Qt have been installed trough official Qt online installer. -
Hallo, I'm trying to create my first widget and a corrisponding plugin.
I followed official tutorials and some other sources and I finally managed to compile everything correctly, the widget works fine... When I try to open the 'About plugins' window in Qt Creator I got this error (in terminal window):qt.core.plugin.loader: In /opt/Qt/Tools/QtCreator/lib/Qt/plugins/designer/libvirtualpadplugin.so: Plugin uses incompatible Qt library (5.15.0) [debug]
Of course my widget is not shown in QtCreator widget palette.
I'm using Qt 5.15.2 , Qt Creator 9.0.0 under Linux 20.04.
Qt have been installed trough official Qt online installer.Hi,
You should check which version of Qt was used to build Qt Creator. That's the one you need to use to build your plugin.
-
Hi,
You should check which version of Qt was used to build Qt Creator. That's the one you need to use to build your plugin.
-
@SGaist I cannot update Qt... can I downgrade Qt Creator? Which version of Qt Creator is based on Qt 5.15.2 (if any)?
You can download the specific Qt Creator installer.
-
@SGaist I cannot update Qt... can I downgrade Qt Creator? Which version of Qt Creator is based on Qt 5.15.2 (if any)?
-
@Dragoon uhm... where I can find the version matching table?
Qt Creator 9.00 -> Qt 6.40
Qt Creator 4.11 -> Qt 5.12.8
Qt Creator ?.?? -> Qt 5.15.2Hope there's a version matrix somewhere ....
@Dragoon In QtCreator: "Help/About QtCreator...".
-
wrote on 16 Feb 2023, 08:41 last edited by Dragoon
@jsulm that's not what I asked. I meant... is there a compatibility matrix that tells which Qt Creator version is based on a specific Qt version? Of course the answer could be NOT (not nice but I will appreaciate the honesty).
As I stated Qt Creator 9.0.0 is based upon Qt 6.4
Qt Creator 4.11.0 is based on Qt 5.12.8
Qt Creator 4.5.2 is baed on Qt 5.9.5... at the moment I didn't found a version of Qt Creator based on Qt 5.15.2 and that means that plugins produced with Qt 5.15.2 are not usable.
Hope the only way to find this information is NOT to install each version of Qt Creator available and look into the About dialog box... (waste of time apart this could also ends with: none found). -
@jsulm that's not what I asked. I meant... is there a compatibility matrix that tells which Qt Creator version is based on a specific Qt version? Of course the answer could be NOT (not nice but I will appreaciate the honesty).
As I stated Qt Creator 9.0.0 is based upon Qt 6.4
Qt Creator 4.11.0 is based on Qt 5.12.8
Qt Creator 4.5.2 is baed on Qt 5.9.5... at the moment I didn't found a version of Qt Creator based on Qt 5.15.2 and that means that plugins produced with Qt 5.15.2 are not usable.
Hope the only way to find this information is NOT to install each version of Qt Creator available and look into the About dialog box... (waste of time apart this could also ends with: none found).@Dragoon Why don't you simply use Qt version which was used to build your version of QtCreator? Why does it have to be Qt 5.15.2?
-
@Dragoon Why don't you simply use Qt version which was used to build your version of QtCreator? Why does it have to be Qt 5.15.2?
-
Hi,
You should check which version of Qt was used to build Qt Creator. That's the one you need to use to build your plugin.
wrote on 16 Feb 2023, 13:04 last edited by Dragoon@SGaist I managed to compile the plugin under Qt 6.4.0 and then installed it inside
/opt/Qt/Tools/QtCreator/lib/Qt/plugins/designer/
But when I open QtCreator 9.0.0 (based on Qt 6.4.0) plugins window I still got this:
Plugin uses incompatible Qt library (5.15.0) [debug]
As an interesting sidenote this's
qtplugininfo
output:qtplugininfo: libvirtualpadplugin.so: No plug-in meta-data found: The shared library was not found.
Moreover if the qtplugininfo is run when the plugin is copied into plugin folder than the error become:
IID "org.qt-project.Qt.QDesignerCustomWidgetInterface" Qt 5.15.0 (debug) qtplugininfo: /opt/Qt/5.15.2/gcc_64/plugins/designer/libvirtualpadplugin.so: invalid metadata, user data is not a JSON object
-
wrote on 17 Feb 2023, 11:22 last edited by Dragoon
@SGaist I finally managed to make it work. I needed to downgrade the Qt version to 5.12.8 making a standard system wide installation on Ubuntu (trough apt of course).
Then I compiled the plugin and placed it into:/usr/lib/x86_64-linux-gnu/qt5/plugins/designer/
This works fine but I have a minor issue that's very annoying.
I would like to change the name of the widget in designer pallette from QTVirtualPad to Virtual Pad .
Changing pluginname()
return value will disrupt everything so this's not the way... but every standard Qt component shows a name different to that of its class so it should be possibile... but how? -
@SGaist I finally managed to make it work. I needed to downgrade the Qt version to 5.12.8 making a standard system wide installation on Ubuntu (trough apt of course).
Then I compiled the plugin and placed it into:/usr/lib/x86_64-linux-gnu/qt5/plugins/designer/
This works fine but I have a minor issue that's very annoying.
I would like to change the name of the widget in designer pallette from QTVirtualPad to Virtual Pad .
Changing pluginname()
return value will disrupt everything so this's not the way... but every standard Qt component shows a name different to that of its class so it should be possibile... but how?wrote on 17 Feb 2023, 12:49 last edited by@Dragoon I found a way to fix the name of the widget in Qt Creator palette: it's needed to add (or modify if already present) the tag
displayname
provided in the most external node of xml element returned by plugin'sdomXml()
method.
In my code :QString VirtualPadPlugin::domXml() const { return "<ui language=\"c++\" displayname=\"Virtual Pad\">\n" ...
-
1/12