Results 1 to 7 of 7

Thread: Custom Widgets in Desinger

  1. #1
    Join Date
    Apr 2010
    Posts
    152
    Thanks
    5
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Question Custom Widgets in Desinger

    I want to create a custom widget that I can place and use from the Qt Designer like other built-in widgets...Simply this widget is actually derived from QWidget class and has additional initialization properties. What's the best way to do it?

  2. #2
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    687
    Thanks
    4
    Thanked 140 Times in 132 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Custom Widgets in Desinger

    Open Qt Assistant. In Contents tab choose:
    1. Qt Designer -> Manual -> Creating Custom Widgets for Qt Designer
    2. Qt Designer -> Examples -> Custom Widget Plugin Example

    To read how to create custom widgets for Qt Designer.

  3. #3
    Join Date
    Apr 2010
    Location
    Rostov-na-Donu, Russia
    Posts
    153
    Thanks
    2
    Thanked 26 Times in 23 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Custom Widgets in Desinger


  4. #4
    Join Date
    Apr 2010
    Posts
    152
    Thanks
    5
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Custom Widgets in Desinger

    Gr8t! Simple and informative. Thanks.

  5. #5
    Join Date
    Apr 2010
    Posts
    152
    Thanks
    5
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Wink Re: Custom Widgets in Desinger

    Oh one more thing...After I had successfully created a custom widget which I can now use from the Designer, it's still missing the boundaries (dashed outline) that indicates the widget placement and size...I use the analog clock example as a template, did not modify anything in the plygin module. Is there anything I need to do to show a guiding outline?

    Thnx

  6. #6
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    687
    Thanks
    4
    Thanked 140 Times in 132 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Custom Widgets in Desinger

    If you mean that your widget size is 0 in width or height, then implement sizeHint() in your widget.

  7. #7
    Join Date
    Apr 2010
    Posts
    152
    Thanks
    5
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Custom Widgets in Desinger

    Actually I mean the boundary outline that shows the widget in the designer forms...

Similar Threads

  1. Custom Widgets
    By walden02 in forum Qt Programming
    Replies: 3
    Last Post: 23rd December 2009, 11:43
  2. Custom Widgets to PyQt
    By prashant in forum Qt Programming
    Replies: 0
    Last Post: 24th September 2009, 15:17
  3. Replies: 0
    Last Post: 15th May 2009, 15:38
  4. Help with custom widgets!!
    By superteny in forum Qt Programming
    Replies: 4
    Last Post: 29th April 2009, 12:43
  5. port qt3 app to desinger 4 ui files
    By hvengel in forum Qt Programming
    Replies: 4
    Last Post: 27th February 2007, 06:14

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.