Unsolved Qt Designer cannot find my custom widget
-
@ChajusSaib In your plugin you're claiming to implement the
org.qt-project.Qt.QStyleFactoryInterface
interface. However, in yourQ_INTERFACES
macro you claim to implementQDesignerCustomWidgetInterface
.Honestly it has taken me quite some time to figure this out, it is not very well explained in the documentation, nor do I really understand why we need this duplication. However: the string-based interface you pass as argument to the
IID
parameter inQ_PLUGIN_METADATA
must match a previous call toQ_DECLARE_INTERFACE(InterfaceDefinition, IIDstring)
In other words: I strongly suspect your plugin will be loaded once you write:
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QDesignerCustomWidgetInterface" FILE "basictools.json")
-
@Jakob Thank you mate for the help but unfortunately still no luck. My .json file is empty by the way, is that the issue? I'm new to Qt so please excuse me. Thank you!
-
The question might be silly but since there's not mention of libiconEditorPlugin in your log, do you have it located in the right folder ?
-
@SGaist I think I'm the one being silly.
Let me explain everything I do, so I have two directories: iconEditor and iconEditorPlugin. I go to iconEditorPlugin and run qmake *.pro and sudo make.
This creates a .so file in my qt/plugins/designer folder. That's basically it, I launch Qt Creator to check if it's in the designer but it isn't.
I feel like I have missed out a very simple step that I have to add my code to my current project or something.
-
Why sudo ?
-
@SGaist Needs permission to move the .so file to Qt directory.
-
In your home folder ?
Are you sure you're not installing the plugin on some other part of the system ?
-
@SGaist Well qmake(command) uses /usr/lib/x86_64-linux-gnu/qt5/
While Qt Creator uses Qt in my home directory, I've placed the files in the following directories but no luck.
/home/chajussaib/Qt/5.5/gcc_64/plugins/designer/libiconEditorPlugin.so
/home/chajussaib/Qt/Tools/QtCreator/bin/plugins/designer/libiconEditorPlugin.so
/usr/lib/x86_64-linux-gnu/qt5/plugins/designer/libiconEditorPlugin.so
/usr/lib/i386-linux-gnu/qt4/plugins/designer/libiconEditorPlugin.so -
Check which version of Qt Qt Creator is using, you have to use the same (version and architecture)
Don't copy your plugin in your system's installed Qt.
-
@SGaist said:
Check which version of Qt Qt Creator is using, you have to use the same (version and architecture)
Don't copy your plugin in your system's installed Qt.
Qt Creator: ```
Based on Qt 5.5.1 (GCC 4.9.1 20140922 (Red Hat 4.9.1-10), 64 bit)
qmake: QMake version 3.0
Using Qt version 5.5.1 in /usr/lib/x86_64-linux-gnu/qt5/libI believe its the version of the compiler as my version is ``` gcc (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4