Results 1 to 3 of 3

Thread: Custom widget directly from .ui

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

    Default Custom widget directly from .ui

    Hi there!

    I just would ask you guys, is there any possible way to create a custom plugin to Qt Designer using .ui file?
    I already know that if I want use some class in my plugin then I need to add macro QDESIGNER_WIDGET_EXPORT to such class.
    So here's a problem. Is it possible to do that in .ui file?

    Thanks in advance for any info.

  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: Custom widget directly from .ui

    You have two choices.

    If you want to make a real plugin, you need a real widget. So you have to provide a subclass of QWidget where you will call setupUi() from your Designer form.

    Another approach is to save a "snapshot" of your UI in Designer for future use. To do it, prepare a layout of widgets on a form, grab the whole construction (withouth the form itself) using the mouse and drop it over the Designer widget box. It will then appear at the end of the pane as a custom widget.

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

    blelump (1st September 2008)

  4. #3
    Join Date
    May 2008
    Posts
    7
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Custom widget directly from .ui

    Fortunately I figured it out and actually I did it as you said.
    and thanks for your reply.

Similar Threads

  1. Custom Widget - First Steps
    By sekatsim in forum Qt Programming
    Replies: 8
    Last Post: 26th June 2008, 17:19
  2. Replies: 5
    Last Post: 25th May 2008, 08:22
  3. Custom widget
    By zorro68 in forum Qt Programming
    Replies: 7
    Last Post: 28th January 2008, 14:06
  4. custom plug-in widget in another custom plug-in widget.
    By MrGarbage in forum Qt Programming
    Replies: 6
    Last Post: 27th August 2007, 15:38
  5. Simple custom widget won't size properly
    By MrGarbage in forum Qt Tools
    Replies: 2
    Last Post: 9th August 2007, 13:12

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.