Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt Designer doesn't load my custom widget plugin

I'm reading the book "C++ GUI Programming with Qt4", and I've reached the topic of Integrating Custom Widgets with Qt Designer.

I've built the example project outlined there (the icon editor plugin), and I get a file called 'libiconeditorplugin.so', and I've copied it to '/usr/lib/qt4/plugins/designer/'. But when I start Qt Creator I don't see the icon editor widget in the widget box.

The only thing I've done differently from the book is I removed the DESTDIR from the .pro file because it had $QTDIR, and $QTDIR is not defined in my computer and I don't know where it should point. Instead, I copied the .so file manually.

I'm not sure if I've copied the plugin in the right directory, and if libiconeditorplugin.so is the only file that I needed to copy, the book was kind of sketchy on how it should work.

My OS is Ubuntu and I've installed Qt Creator with apt-get.

like image 927
sashoalm Avatar asked Apr 23 '12 19:04

sashoalm


People also ask

How do I install Qt plugins?

Note: You can install only plugins that are supported by your Qt Creator version. To install plugins: Select Help > About Plugins > Install Plugins. In the Source dialog, enter the path to the archive or library that contains the plugin.

Can you use Qt Designer with Pyside?

PySide2 Tutorial — Creating applications with Qt Designer The good news is that Qt comes with a graphical editor — Qt Designer — which contains a drag-and-drop UI editor. Using Qt Designer you can define your UIs visually and then simply hook up the application logic later.


1 Answers

Turns out I was copying libiconeditorplugin.so to the wrong directory. I was copying it to "/usr/lib/qt4/plugins/designer/", while Qt Designer was looking in "/usr/lib/x86_64-linux-gnu/qt4/plugins/designer/".

like image 146
sashoalm Avatar answered Oct 05 '22 03:10

sashoalm