Results 1 to 2 of 2

Thread: QTreeWidget question

  1. #1
    Join Date
    Mar 2008
    Posts
    1
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Red face QTreeWidget question

    Hello, I have a question that relates to QT4 and the QTreeWidget (using PyQT).

    I want to have (or somehow mimic the appearance of) horizontal lines between the rows of QTreeWidgetItems. I know the QTableView has the grid option, and I am looking for something similar to that. The only difference is I only want to display horizontal lines in between each item to separate the rows. I didn't see any members or inherited members that could do this. I was hoping there was a way to simulate this using a style sheet or something, but I could not come up with a way.

    Is there a reasonably simple way to do this?

    Thanks!

  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: QTreeWidget question

    You could reimplement QTreeView::drawRow(). Call the base class implementation to draw the actual content and draw the additional line by yourself.
    J-P Nurmi

Similar Threads

  1. how to add icons to QTreeWidget?
    By wei243 in forum Qt Programming
    Replies: 4
    Last Post: 21st September 2007, 08:34
  2. QTreeWidget Question
    By BatteryCell in forum Qt Programming
    Replies: 2
    Last Post: 22nd June 2007, 22:44
  3. resizing a QTreeWidget
    By drhex in forum Qt Programming
    Replies: 6
    Last Post: 27th October 2006, 22:32
  4. QTreeWidget questions
    By fellobo in forum Qt Programming
    Replies: 4
    Last Post: 2nd May 2006, 18:39
  5. QTreeWidget question
    By Mad Max in forum Qt Programming
    Replies: 13
    Last Post: 1st March 2006, 12:58

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
  •  
Qt is a trademark of The Qt Company.