Results 1 to 3 of 3

Thread: Widget Promotion

  1. #1
    Join Date
    Dec 2016
    Posts
    37
    Qt products
    Qt5
    Platforms
    Windows

    Default Widget Promotion

    I've got a form in Qt designer that I am trying to promote to a custom widget.
    At the moment there is nothing else in the form, so just the QWidget.
    When I right click on this widget in the designer, the "Promote to.." option is missing.
    I go ahead and select the "Promoted widgets..." option, but then in the resulting
    dialog, the "Add" button is grayed out even after I select the custom widget in the top window.

    Are you not allowed to promote the top widget to something else?

    n

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Widget Promotion

    I think you can only promote child widgets, not the template's container.

    Cheers,
    _

  3. #3
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,243
    Thanks
    303
    Thanked 866 Times in 853 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Widget Promotion

    If you create a custom QWidget-based class for your form, and you want to add that form class to another UI file in Qt Designer, then you add a QWidget and promote -that- QWidget to your form class. It doesn't make much sense to promote the top level widget (the form) to something that doesn't yet exist until you actually use the form as the UI class for a new QWidget-based class.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. Replies: 0
    Last Post: 6th July 2015, 15:51
  2. Widget Promotion
    By A9am in forum Newbie
    Replies: 4
    Last Post: 6th February 2013, 12:39
  3. QWidget promotion with child widgets
    By Phlucious in forum Qt Programming
    Replies: 3
    Last Post: 22nd February 2012, 08:41
  4. Replies: 0
    Last Post: 3rd August 2011, 13:07
  5. promotion problems with designer
    By szisziszilvi in forum Qt Programming
    Replies: 3
    Last Post: 26th April 2011, 09:27

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.