Results 1 to 3 of 3

Thread: Qt Designer's Widget Box buttons

  1. #1
    Join Date
    Dec 2006
    Posts
    10
    Qt products
    Qt4
    Platforms
    Windows

    Default Qt Designer's Widget Box buttons

    Silly question:

    How are the category disclosure buttons seen in Designer's widget box actually drawn? They are the ones with the tiny +- on the left and centered text like "Spacers", "Layouts", etc. I'd like to make a similar button and was curious how the Qt gurus implemented it. I searched the Designer source but never really found the specifics.

    I realize they are using a TreeWidget so the actual show/hide happens as usual.

    Is the +- surrounded by a box simply a standard Qt style option?

    Thanks,

    RobF

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Qt Designer's Widget Box buttons

    See SheetDelegate::paint() in tools/designer/src/lib/shared/sheet_delegate.cpp.
    J-P Nurmi

  3. #3
    Join Date
    Dec 2006
    Posts
    10
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt Designer's Widget Box buttons

    Awesome, that was it. Thanks so much.

    Included within the whole paint function, an important piece (at least for me) was usage of the QStyle::PE_IndicatorBranch and how one graphic was layered after another.

    -RobF

Similar Threads

  1. transparent background of the main widget
    By nagpalma in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2007, 17:52
  2. Controlling which widget on top layer?
    By JonathanForQT4 in forum Qt Programming
    Replies: 6
    Last Post: 22nd March 2007, 14:27
  3. Replies: 4
    Last Post: 10th March 2007, 18:01
  4. widget for text AND buttons
    By nongentesimus in forum Newbie
    Replies: 2
    Last Post: 16th June 2006, 13:43
  5. [Qt 4.1.0] Split a widget on demand
    By Townk in forum Qt Programming
    Replies: 3
    Last Post: 17th February 2006, 14:16

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.