+ Reply to Thread
Results 1 to 2 of 2

Thread: QTreeWidget + StyleSheet problem

  1. #1
    Join Date
    May 2009
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    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 10:58.

  2. #2
    Join Date
    Sep 2009
    Location
    Aachen, Germany
    Posts
    54
    Thanks
    1
    Thanked 7 Times in 7 Posts
    Qt products
    Qt4
    Platforms
    Windows

    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, 22:51
  2. QTreeWidget refeshing view
    By grazyna in forum Qt Programming
    Replies: 3
    Last Post: 10th August 2009, 15:31
  3. Problem with TabBar und StyleSheet
    By QtNoob in forum Qt Programming
    Replies: 0
    Last Post: 23rd July 2009, 01:06
  4. QTreeWidget problem!!
    By mcenatie in forum Qt Programming
    Replies: 2
    Last Post: 10th March 2006, 12:47
  5. Replies: 16
    Last Post: 7th March 2006, 16:57

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