Results 1 to 4 of 4

Thread: QTreeWidget Expand/Collapse Button Size

  1. #1
    Join Date
    Sep 2009
    Posts
    64

    Default QTreeWidget Expand/Collapse Button Size

    Is there a way to increase the "Expand/Collapse (+/-)" button size in the QTreeWidget. I am assuming it is a style sheet issue but i have looked through the style sheet help and couldnt find anything.

    I am trying to use the treewidget on a touch screen and it is proving to be difficult to expand/collapse the tree's items because the expand/collapse buttons are too small.

  2. #2
    Join Date
    Sep 2009
    Posts
    64

    Default Re: QTreeWidget Expand/Collapse Button Size

    Im reposing the question...

    is there a way to increase the size of the expand/collapse buttons in a QTreeWidget?

    Using a touch screen with the QTreeWidget is almost impossible with the default size of the buttons

  3. #3
    Join Date
    Oct 2009
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTreeWidget Expand/Collapse Button Size

    Maybe the QApplication::globalStrut property could be useful.

    But if it isn't mandatory to expand/collpase using the +/- buttons, maybe you can rewrite the click event of the QTreeWidget to do this.

    Hope it helps!

  4. #4
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTreeWidget Expand/Collapse Button Size

    You will need to use a delegate.
    Then in delegate one - you will need to return size hint for the item
    and second - override the drawDecoration function, and draw a bigger +/- yourself.

Similar Threads

  1. QTabbar style ::scroller to expand the tab scoll button space.
    By AmolShinde_8 in forum Qt Programming
    Replies: 0
    Last Post: 22nd February 2010, 14:40
  2. preserve collapse/expand of a QTreeView
    By yazwas in forum Qt Programming
    Replies: 1
    Last Post: 7th November 2009, 09:49
  3. QTreeWidget double click - expand problem
    By stefan in forum Newbie
    Replies: 2
    Last Post: 29th June 2008, 13:24
  4. QTableWidget columns to expand to window size
    By bruccutler in forum Newbie
    Replies: 1
    Last Post: 13th April 2007, 16:02
  5. howto expand frame to maximum size
    By masoroso in forum Newbie
    Replies: 4
    Last Post: 21st April 2006, 09:40

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.