Results 1 to 10 of 10

Thread: Integrating custom widgets in QtCreator(QtDesigner)

  1. #1
    Join Date
    Sep 2008
    Location
    Portugal
    Posts
    171
    Thanks
    57
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Integrating custom widgets in QtCreator(QtDesigner)

    Hi,
    I tried the "promotion aproach" described in the "C++ GUI Programming with Qt4" book and it works fine.
    Then tried the "plugin approach" and used the IconEditor example.
    After building the plugin i get a "libiconeditorplugin.so" file in this path:
    Qt Code:
    1. /usr/local/Trolltech/Qt-4.5.2/plugins/designer
    To copy to clipboard, switch view to plain text mode 
    Now what?
    I whant to open QtCreator and have that widget available as any other.
    What is the next step?
    Thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Integrating custom widgets in QtCreator(QtDesigner)

    There is no next step, it should work. If it doesn't, first see if it works from within Qt Designer. If not, it means the plugin is incorrect. Otherwise it means Creator can't see your plugin (it is probably setup to use another version of Qt).
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. The following user says thank you to wysota for this useful post:

    graciano (12th August 2009)

  4. #3
    Join Date
    Sep 2008
    Location
    Portugal
    Posts
    171
    Thanks
    57
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Integrating custom widgets in QtCreator(QtDesigner)

    It works in QtDesigner.
    I noticed that the Widget collections available in QtDesigner and QtCreator are quite diferent.
    I only have one version of Qt installed.
    I built Qt from source because i needed the MySql plugin.
    As for QtCreator i installed the binary version.
    Now i have to configure QtCreator in tools>options>qt4> Qt versions ... right?
    Or is there another option for configuring this?

  5. #4
    Join Date
    Mar 2009
    Posts
    98
    Thanks
    3
    Thanked 9 Times in 9 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Integrating custom widgets in QtCreator(QtDesigner)

    Try to put your .so at this path

    /usr/local/Trolltech/Qt-4.5.2/qt/plugins/designer

  6. #5
    Join Date
    Sep 2008
    Location
    Portugal
    Posts
    171
    Thanks
    57
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Integrating custom widgets in QtCreator(QtDesigner)

    But i don't have a qt folder!
    My QTDIR is something like:
    Qt Code:
    1. total 372
    2. drwxr-sr-x 2 root staff 4096 Jul 22 10:15 bin
    3. drwxr-sr-x 21 root staff 4096 Jul 22 10:14 demos
    4. drwxr-sr-x 5 root staff 4096 Jul 22 10:15 doc
    5. drwxr-sr-x 31 root staff 4096 Jul 22 10:14 examples
    6. drwxr-sr-x 21 root staff 4096 Jul 22 10:13 include
    7. drwxr-sr-x 3 root staff 4096 Jul 22 10:13 lib
    8. drwxr-sr-x 88 root staff 4096 Jul 22 10:15 mkspecs
    9. drwxr-sr-x 2 root staff 4096 Jul 22 10:13 phrasebooks
    10. drwxr-sr-x 11 root staff 4096 Jul 22 10:13 plugins
    11. -rw-r--r-- 1 root staff 333347 Jun 20 05:57 q3porting.xml
    12. drwxr-sr-x 2 root staff 4096 Jul 22 10:15 translations
    To copy to clipboard, switch view to plain text mode 

  7. #6
    Join Date
    Mar 2009
    Posts
    98
    Thanks
    3
    Thanked 9 Times in 9 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Integrating custom widgets in QtCreator(QtDesigner)

    Uhm... If you have got the Qt-4.5.2 why you have the reference to Trolltech.
    Now Qt is develop by Nokia.
    Anyway you need to check if Qt Creator was compiled on the same Qt version you use for your library.
    Help\About Qt Creator

    Also try if you have this path: lib/qtcreator/plugins/
    All the plug-in I can see in my QtCreator are in that subdir.

  8. The following user says thank you to PaceyIV for this useful post:

    graciano (12th August 2009)

  9. #7
    Join Date
    Sep 2008
    Location
    Portugal
    Posts
    171
    Thanks
    57
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Integrating custom widgets in QtCreator(QtDesigner)

    Uhm... If you have got the Qt-4.5.2 why you have the reference to Trolltech.
    Ask the Trolls
    About the path: lib/qtcreator/plugins/ ... i tried them already.
    I'll try removing QtCreator and install it in some other way.
    Thanks

  10. #8
    Join Date
    Sep 2008
    Location
    Portugal
    Posts
    171
    Thanks
    57
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Integrating custom widgets in QtCreator(QtDesigner)

    After i make a ./configure ...
    Qt Code:
    1. ...
    2. Qt is now configured for building. Just run 'make'.
    3. Once everything is built, you must run 'make install'.
    4. Qt will be installed into /usr/local/Trolltech/Qt-4.5.2
    5.  
    6. To reconfigure, run 'make confclean' and 'configure'.
    To copy to clipboard, switch view to plain text mode 

    I suppose it's some kind of default!

  11. #9
    Join Date
    Aug 2009
    Posts
    27
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Integrating custom widgets in QtCreator(QtDesigner)

    Quote Originally Posted by graciano View Post
    Ask the Trolls
    About the path: lib/qtcreator/plugins/ ... i tried them already.
    I'll try removing QtCreator and install it in some other way.
    Thanks
    Hi, I have the same prob to yours but I'm using Windows. I just don't want to use Visual Studio just because I'll have to develop on both Windows and Linux for the same code. I prefer available editor like QtCreator.

    I see this FAQ:

    My custom widgets are not loaded into the integrated form editor. But in standalone designer it works.

    Qt Creator doesn’t pull in custom widgets from the Qt version you use for development. You need to make sure that your custom widget plugins work with the Qt version that Qt Creator was built with (see the “About QtCreator” dialog, currently 4.5), and put your plugin libraries to Qt Creator’s designer plugin location (bin/designer on Windows and Linux, QtCreator.app/Contents/MacOS/designer on Mac).
    http://qt.gitorious.org/qt-creator/p...AskedQuestions

    I copy the custom widget to that directory (/bin/designer) but QtCreator still can't load.
    Qt Ver 4.5.2
    QtDesigner v4.5.2
    QtCreator v1.2.1 based on Qt 4.5.2 (32-bit).

    I have no idea what is wrong.
    Last edited by rockballad; 15th October 2009 at 02:08.

  12. #10
    Join Date
    Aug 2009
    Posts
    27
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Integrating custom widgets in QtCreator(QtDesigner)

    Now I know the reason why. We'll have to build the custom widget in VS2005 (an integration w/ Qt) to make QtCreator detect it. I'm not sure about Linux, but it may be easier.

Similar Threads

  1. Replies: 0
    Last Post: 15th May 2009, 15:38
  2. Replies: 0
    Last Post: 11th April 2009, 12:07
  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.