Results 1 to 4 of 4

Thread: frame around the tree widget items

  1. #1
    Join Date
    Oct 2010
    Posts
    21
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default frame around the tree widget items

    Hello all,

    Is it possible to draw frames around each tree widget items? I could not find any way to handle this

    Thanks in advance for your help...
    Last edited by fulbay; 29th December 2010 at 14:25.

  2. #2
    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: frame around the tree widget items

    Frames as in ? rect on the boudary ?
    Sure... use delegates. Have a look at QItemDelegateand QStyledItemDelegate

  3. #3
    Join Date
    Oct 2010
    Posts
    21
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: frame around the tree widget items

    Borders between each tree widget item in a tree widget (QTreeWidget).

    Which widget should I delegate? It is not very clear to me. I have used delegated items just to put another type of widget on a column in the tree. How should I use this kind of implementation to make frames around the tree widget items?

    Thanks a lot...

  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: frame around the tree widget items

    You just need to override the paint function of delegate.
    Call the base class paint function, and after that draw the rect as a boundary,

  5. The following user says thank you to aamer4yu for this useful post:

    fulbay (29th December 2010)

Similar Threads

  1. Replies: 6
    Last Post: 10th March 2015, 12:34
  2. tree view displaying widgets as items
    By paksas in forum Qt Programming
    Replies: 9
    Last Post: 28th January 2013, 13:58
  3. tree widget like designer's widget tree
    By nroberts in forum Newbie
    Replies: 1
    Last Post: 20th November 2010, 00:06
  4. Context Menu for specific items in a Tree Widget
    By manekineko in forum Qt Programming
    Replies: 0
    Last Post: 16th November 2009, 01:46
  5. Get rid of the frame around items in the QTreeView
    By THRESHE in forum Qt Programming
    Replies: 3
    Last Post: 10th December 2008, 18:00

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.