Results 1 to 3 of 3

Thread: Custom Widget Plugin

  1. #1
    Join Date
    May 2008
    Posts
    61
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Custom Widget Plugin

    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:

    Qt Code:
    1. alisami@workbench1:~/pluginTest/customwidgetplugin$ make -j2
    2. 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
    3. 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
    4. /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
    5. /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
    6. 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
    7. 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
    8. rm -f libcustomwidgetplugin.a
    9. ar cqs libcustomwidgetplugin.a analogclock.o customwidgetplugin.o moc_analogclock.o moc_customwidgetplugin.o
    10. alisami@workbench1:~/pluginTest/customwidgetplugin$
    To copy to clipboard, switch view to plain text mode 

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

    Qt Code:
    1. alisami@workbench1:~/pluginTest/customwidgetplugin$ make install
    2. install -m 644 -p "libcustomwidgetplugin.a" "/home/alisami/qt-443-x11/plugins/designer/libcustomwidgetplugin.a"
    3. install -m 644 -p /home/alisami/pluginTest/customwidgetplugin/analogclock.cpp /home/alisami/qt-443-x11/examples/designer/customwidgetplugin/
    4. install -m 644 -p /home/alisami/pluginTest/customwidgetplugin/customwidgetplugin.cpp /home/alisami/qt-443-x11/examples/designer/customwidgetplugin/
    5. install -m 644 -p /home/alisami/pluginTest/customwidgetplugin/analogclock.h /home/alisami/qt-443-x11/examples/designer/customwidgetplugin/
    6. install -m 644 -p /home/alisami/pluginTest/customwidgetplugin/customwidgetplugin.h /home/alisami/qt-443-x11/examples/designer/customwidgetplugin/
    7. install -m 644 -p /home/alisami/pluginTest/customwidgetplugin/customwidgetplugin.pro /home/alisami/qt-443-x11/examples/designer/customwidgetplugin/
    8. alisami@workbench1:~/pluginTest/customwidgetplugin$ ~/qt-443-x11/bin/designer
    To copy to clipboard, switch view to plain text mode 

    sami

  2. #2
    Join Date
    May 2008
    Posts
    61
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Custom Widget Plugin

    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`.

  3. #3
    Join Date
    Dec 2008
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Custom Widget Plugin

    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!

Similar Threads

  1. Replies: 5
    Last Post: 21st February 2007, 23:11
  2. Replies: 2
    Last Post: 25th August 2006, 12:35
  3. Custom Widget Plugin Analog Clock
    By kemp in forum Qt Programming
    Replies: 8
    Last Post: 11th August 2006, 14:22
  4. How to initialize properties to a custom plugin widget?
    By high_flyer in forum Qt Programming
    Replies: 2
    Last Post: 28th February 2006, 17:56
  5. Replies: 12
    Last Post: 15th February 2006, 11:46

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.