+ Reply to Thread
Results 1 to 2 of 2

Thread: QTreeWidget + StyleSheet problem

  1. #1
    Join Date
    May 2009
    Qt products

    Default QTreeWidget + StyleSheet problem

    Currently I'm working on a multi column TreeWidget, with a custom highlight style set with style sheets.

    Qt Code:
    1. QTreeWidget::item:hover {
    2. border: 2px solid #fff;
    3. }
    4. QTreeWidget::item:selected {
    5. border: 2px solid #fff;
    6. }
    To copy to clipboard, switch view to plain text mode 

    Problem is, that the style is applied to all colums of a row, each cell got a border. But I only want to whole row to be bordered, not each row cell.

    Does anybody have an idea how to achieve this with style sheets? Or do I have to use a custom ItemDelegate for this?

    Edit: Forgot to mention: Each row is a single QTreeWidgetItem, while each column is simply set with SetText(0,...), SetText(1,...)...
    Attached Images Attached Images
    Last edited by BlackHornet; 21st December 2009 at 09:58.

  2. #2
    Join Date
    Sep 2009
    Aachen, Germany
    Thanked 7 Times in 7 Posts
    Qt products

    Default Re: QTreeWidget + StyleSheet problem

    There doesn't seem to be a subcontrol for a whole row. But a delegate that just draws the boxes really isn't much work. Just reimplement the paint Method, let the standard paint method do most of the work and draw that lines as needed

+ Reply to Thread

Similar Threads

  1. QPushButton stylesheet problem
    By blukske in forum Qt Programming
    Replies: 10
    Last Post: 24th August 2009, 21:51
  2. QTreeWidget refeshing view
    By grazyna in forum Qt Programming
    Replies: 3
    Last Post: 10th August 2009, 14:31
  3. Problem with TabBar und StyleSheet
    By QtNoob in forum Qt Programming
    Replies: 0
    Last Post: 23rd July 2009, 00:06
  4. QTreeWidget problem!!
    By mcenatie in forum Qt Programming
    Replies: 2
    Last Post: 10th March 2006, 11:47
  5. Replies: 16
    Last Post: 7th March 2006, 15:57


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts