Results 1 to 2 of 2

Thread: Promoting a custom widget derived from QWidget Qt4

  1. #1
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Promoting a custom widget in designer Qt4

    Hi,

    I think I am missing somthing about the widget promotion principal, and hope you can help me find what it is.
    Promoting does nothing more then to put the right include line and the right constructor in the auto generated code.
    What I don't understand is, why the trolls didn't make this mechanism to be available for the rest widgets that are not in designer, such as QStatusBar QScrollArea etc.
    I actually didn't know there was such a restriction, and thought I could just use the promotion mechanism to nicely design my GUI with designer with a scroll area.
    And it works!
    I just used a QFrame in designer and promoted it to a "custom widget" named QScrollArea, that has the QScrollArea (h) file.
    I guess the trolls just missed the QScrollArea in their class list that designer checks agaist, since when I tried to do the same with QStatusBar, designer gave me a message, that this class already axist, and I can't promot to it.
    I wonder why the trolls use this policy...
    For simple GUIs its no problem to add widgets in code, but if you can add only some widgets in designer, but not all, this can be quite a job to fit in code widgets in to complex designer designed froms that contain several (somtimes nested) layouts...

    Any thoughts on this?

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Promoting a custom widget derived from QWidget Qt4

    I wonder what does the fact no one answer this means...
    Any way, I just made a QStatusBar plugin, so I can use it in designer.
    Feel free to use it, hope it will be usefull.
    Attached Files Attached Files

Similar Threads

  1. Custom Widget - First Steps
    By sekatsim in forum Qt Programming
    Replies: 8
    Last Post: 26th June 2008, 18:19
  2. Custom widget
    By zorro68 in forum Qt Programming
    Replies: 7
    Last Post: 28th January 2008, 15:06
  3. get custom widget to inherit qwidget
    By CopyrightPhilly in forum Qt Tools
    Replies: 3
    Last Post: 4th October 2007, 09:58
  4. custom plug-in widget in another custom plug-in widget.
    By MrGarbage in forum Qt Programming
    Replies: 6
    Last Post: 27th August 2007, 16:38
  5. Replies: 4
    Last Post: 24th March 2006, 23:50

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.