PDA

View Full Version : Custom Widget Plugin



alisami
21st January 2009, 08:11
Hi,

I have been trying to build the `customwidgetplugin` example given in Qt documentation but I am unable to see the built and installed plugin in Qt Designer.

I built static and debug version of the Qt libraries, I added the release and static flag to the CONFIG parameter of the .pro file. I successfully built the example. I ran make and make install but couldn't see the plugin in the designer.

Is there something I do wrong ?

The resulting output for make is as follows:


alisami@workbench1:~/pluginTest/customwidgetplugin$ make -j2
g++ -c -pipe -O2 -fPIC -D_REENTRANT -Wall -W -fPIC -DQT_NO_DEBUG -DQT_STATICPLUGIN -DQT_PLUGIN -DQT_SCRIPT_LIB -DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQDESIGNER_EXPORT_WIDGETS -I../../qt-x11-commercial-src-4.4.3/mkspecs/linux-g++ -I. -I../../qt-443-x11/include/QtDesigner -I../../qt-443-x11/include/QtCore -I../../qt-443-x11/include/QtCore -I../../qt-443-x11/include/QtGui -I../../qt-443-x11/include/QtGui -I../../qt-443-x11/include/QtXml -I../../qt-443-x11/include/QtXml -I../../qt-443-x11/include/QtScript -I../../qt-443-x11/include/QtScript -I../../qt-443-x11/include -I. -I. -o analogclock.o analogclock.cpp
g++ -c -pipe -O2 -fPIC -D_REENTRANT -Wall -W -fPIC -DQT_NO_DEBUG -DQT_STATICPLUGIN -DQT_PLUGIN -DQT_SCRIPT_LIB -DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQDESIGNER_EXPORT_WIDGETS -I../../qt-x11-commercial-src-4.4.3/mkspecs/linux-g++ -I. -I../../qt-443-x11/include/QtDesigner -I../../qt-443-x11/include/QtCore -I../../qt-443-x11/include/QtCore -I../../qt-443-x11/include/QtGui -I../../qt-443-x11/include/QtGui -I../../qt-443-x11/include/QtXml -I../../qt-443-x11/include/QtXml -I../../qt-443-x11/include/QtScript -I../../qt-443-x11/include/QtScript -I../../qt-443-x11/include -I. -I. -o customwidgetplugin.o customwidgetplugin.cpp
/home/alisami/qt-443-x11/bin/moc -DQT_NO_DEBUG -DQT_STATICPLUGIN -DQT_PLUGIN -DQT_SCRIPT_LIB -DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQDESIGNER_EXPORT_WIDGETS -I../../qt-x11-commercial-src-4.4.3/mkspecs/linux-g++ -I. -I../../qt-443-x11/include/QtDesigner -I../../qt-443-x11/include/QtCore -I../../qt-443-x11/include/QtCore -I../../qt-443-x11/include/QtGui -I../../qt-443-x11/include/QtGui -I../../qt-443-x11/include/QtXml -I../../qt-443-x11/include/QtXml -I../../qt-443-x11/include/QtScript -I../../qt-443-x11/include/QtScript -I../../qt-443-x11/include -I. -I. analogclock.h -o moc_analogclock.cpp
/home/alisami/qt-443-x11/bin/moc -DQT_NO_DEBUG -DQT_STATICPLUGIN -DQT_PLUGIN -DQT_SCRIPT_LIB -DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQDESIGNER_EXPORT_WIDGETS -I../../qt-x11-commercial-src-4.4.3/mkspecs/linux-g++ -I. -I../../qt-443-x11/include/QtDesigner -I../../qt-443-x11/include/QtCore -I../../qt-443-x11/include/QtCore -I../../qt-443-x11/include/QtGui -I../../qt-443-x11/include/QtGui -I../../qt-443-x11/include/QtXml -I../../qt-443-x11/include/QtXml -I../../qt-443-x11/include/QtScript -I../../qt-443-x11/include/QtScript -I../../qt-443-x11/include -I. -I. customwidgetplugin.h -o moc_customwidgetplugin.cpp
g++ -c -pipe -O2 -fPIC -D_REENTRANT -Wall -W -fPIC -DQT_NO_DEBUG -DQT_STATICPLUGIN -DQT_PLUGIN -DQT_SCRIPT_LIB -DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQDESIGNER_EXPORT_WIDGETS -I../../qt-x11-commercial-src-4.4.3/mkspecs/linux-g++ -I. -I../../qt-443-x11/include/QtDesigner -I../../qt-443-x11/include/QtCore -I../../qt-443-x11/include/QtCore -I../../qt-443-x11/include/QtGui -I../../qt-443-x11/include/QtGui -I../../qt-443-x11/include/QtXml -I../../qt-443-x11/include/QtXml -I../../qt-443-x11/include/QtScript -I../../qt-443-x11/include/QtScript -I../../qt-443-x11/include -I. -I. -o moc_analogclock.o moc_analogclock.cpp
g++ -c -pipe -O2 -fPIC -D_REENTRANT -Wall -W -fPIC -DQT_NO_DEBUG -DQT_STATICPLUGIN -DQT_PLUGIN -DQT_SCRIPT_LIB -DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQDESIGNER_EXPORT_WIDGETS -I../../qt-x11-commercial-src-4.4.3/mkspecs/linux-g++ -I. -I../../qt-443-x11/include/QtDesigner -I../../qt-443-x11/include/QtCore -I../../qt-443-x11/include/QtCore -I../../qt-443-x11/include/QtGui -I../../qt-443-x11/include/QtGui -I../../qt-443-x11/include/QtXml -I../../qt-443-x11/include/QtXml -I../../qt-443-x11/include/QtScript -I../../qt-443-x11/include/QtScript -I../../qt-443-x11/include -I. -I. -o moc_customwidgetplugin.o moc_customwidgetplugin.cpp
rm -f libcustomwidgetplugin.a
ar cqs libcustomwidgetplugin.a analogclock.o customwidgetplugin.o moc_analogclock.o moc_customwidgetplugin.o
alisami@workbench1:~/pluginTest/customwidgetplugin$

and the output of `make install` is as follows:


alisami@workbench1:~/pluginTest/customwidgetplugin$ make install
install -m 644 -p "libcustomwidgetplugin.a" "/home/alisami/qt-443-x11/plugins/designer/libcustomwidgetplugin.a"
install -m 644 -p /home/alisami/pluginTest/customwidgetplugin/analogclock.cpp /home/alisami/qt-443-x11/examples/designer/customwidgetplugin/
install -m 644 -p /home/alisami/pluginTest/customwidgetplugin/customwidgetplugin.cpp /home/alisami/qt-443-x11/examples/designer/customwidgetplugin/
install -m 644 -p /home/alisami/pluginTest/customwidgetplugin/analogclock.h /home/alisami/qt-443-x11/examples/designer/customwidgetplugin/
install -m 644 -p /home/alisami/pluginTest/customwidgetplugin/customwidgetplugin.h /home/alisami/qt-443-x11/examples/designer/customwidgetplugin/
install -m 644 -p /home/alisami/pluginTest/customwidgetplugin/customwidgetplugin.pro /home/alisami/qt-443-x11/examples/designer/customwidgetplugin/
alisami@workbench1:~/pluginTest/customwidgetplugin$ ~/qt-443-x11/bin/designer


sami

alisami
21st January 2009, 08:28
When I remove the `static` key from CONFIG and build the plugin in shared mode, in the designer's `about plugins` window, my plugin is displayed as `Failed Plugins` and the error is `Unknown Error`.

ches
16th March 2009, 14:33
Hi
I got the same message(plugin failed) when moving and building building my plugins from 4.3.4 to 4.5 . I dont know what the problem was, but I just started afresh from the customwidget plugin example and changed class names only. Maybe check what qmake u using. qmake -v

Also maybe show us ur .pro file.

enjoy!