Results 1 to 5 of 5

Thread: Help with custom widgets!!

  1. #1
    Join Date
    Apr 2009
    Posts
    10
    Thanks
    5

    Default Help with custom widgets!!

    Hi!!!

    I am trying to create a custom widget following the example of "World Time Clock Plugin" from the qt5waybutton widget demo provide by with qt. I have compiled and created the .so from the sources, then i have checked if the .so was under /plugins/designer directory and after all, i started qtcreator to use it. When i load a .ui file or create a new qt form, the next error occurs:

    /usr/local/Trolltech/qt-creator-1.1.0-src/bin/qtcreator.bin: symbol lookup error: /usr/local/Trolltech/Qt-4.5.1/plugins/designer/libqt5waybutton.so: undefined symbol: _ZN16QtSvgPixmapCacheC1EP7QObject

    I dont know if i have to copy the .so library into another directory or if there is another step that i am missing.
    i put my .pro file.

    Qt Code:
    1. CONFIG += designer plugin
    2. TARGET = $$qtLibraryTarget($$TARGET)
    3. TEMPLATE = lib
    4. QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/designer
    5.  
    6. HEADERS = qt5waybutton.h \
    7. qt5waybuttonplugin.h
    8. SOURCES = qt5waybutton.cpp \
    9. qt5waybuttonplugin.cpp
    10.  
    11. # install
    12. target.path = $$[QT_INSTALL_PLUGINS]/designer
    13. sources.files = $$SOURCES $$HEADERS *.pro
    14. sources.path = $$[QT_INSTALL_EXAMPLES]/designer/qt5waybuttonplugin
    15. INSTALLS += target sources
    To copy to clipboard, switch view to plain text mode 


    Thanks for your help and sorry for the nuisance.

  2. #2
    Join Date
    Jan 2006
    Location
    Alingsås, Sweden
    Posts
    437
    Thanks
    3
    Thanked 39 Times in 39 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Help with custom widgets!!

    It seems to me that you are using SVGs?

    In that case you need to add a line reading QT += svg to include the QtSvg module.

  3. #3
    Join Date
    Apr 2009
    Posts
    10
    Thanks
    5

    Default Re: Help with custom widgets!!

    Thanks for your fast reply. Yes, the example uses svg and the "qt5waybutton.cpp" includes "qtsvgpixmapcache.h". I have tried to put the line that you told me in the .pro, and the result is the same. ¿Have i do something else with the svg module?The .pro is the next:

    Qt Code:
    1. CONFIG += designer plugin
    2. TARGET = $$qtLibraryTarget($$TARGET)
    3. TEMPLATE = lib
    4. QT += svg
    5. QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/designer
    6.  
    7.  
    8. HEADERS = qt5waybutton.h \
    9. qt5waybuttonplugin.h \
    10. SOURCES = qt5waybutton.cpp \
    11. qt5waybuttonplugin.cpp
    12.  
    13. # install
    14. target.path = $$[QT_INSTALL_PLUGINS]/designer
    15. sources.files = $$SOURCES $$HEADERS *.pro
    16. sources.path = $$[QT_INSTALL_EXAMPLES]/designer/qt5waybuttonplugin
    17. INSTALLS += target sources
    To copy to clipboard, switch view to plain text mode 

    Sorry, i am a bit new in this.

  4. #4
    Join Date
    Jan 2006
    Location
    Alingsås, Sweden
    Posts
    437
    Thanks
    3
    Thanked 39 Times in 39 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Help with custom widgets!!

    I had a look at the embedded widgets demo and it seems that the QtSvgPixmapCache is a part of that package. You will probably have to add those source and header files to your project to get it to work properly.

  5. #5
    Join Date
    Apr 2009
    Posts
    10
    Thanks
    5

    Thumbs up Re: Help with custom widgets!!

    hi again, thanks a lot again. i have doing some test and i have got to load the plugin in qt creator. you are right, finally a include QtSvgPixmapCache.h and cpp to my .pro and i thinks it works. The .pro is this:

    Qt Code:
    1. CONFIG += designer plugin
    2. TARGET = $$qtLibraryTarget($$TARGET)
    3. TEMPLATE = lib
    4. QT += svg
    5. QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/designer
    6.  
    7. HEADERS = qt5waybutton.h \
    8. qt5waybuttonplugin.h qtsvgpixmapcache.h
    9. SOURCES = qt5waybutton.cpp \
    10. qt5waybuttonplugin.cpp qtsvgpixmapcache.cpp
    11.  
    12. # install
    13. target.path = $$[QT_INSTALL_PLUGINS]/designer
    14. sources.files = $$SOURCES $$HEADERS *.pro
    15. sources.path = $$[QT_INSTALL_EXAMPLES]/designer/qt5waybuttonplugin
    16. INSTALLS += target sources
    To copy to clipboard, switch view to plain text mode 

    Now, i am going to try the plugin in the designer.
    Thanks a lot for your help.

Similar Threads

  1. Replies: 0
    Last Post: 11th April 2009, 12:07
  2. Replies: 7
    Last Post: 23rd March 2009, 21:01
  3. Custom Widgets and layout managers...
    By TemporalBeing in forum Qt Programming
    Replies: 6
    Last Post: 4th March 2009, 13:48
  4. Replies: 2
    Last Post: 16th May 2008, 14:39
  5. picking geometry in qt custom widgets
    By notsonerdysunny in forum Qt Programming
    Replies: 2
    Last Post: 17th July 2007, 23:01

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.