Results 1 to 1 of 1

Thread: Pivot Table with QTreeView: changing display properties on expanded rows

  1. #1
    Join Date
    Apr 2009
    Posts
    7
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Platforms
    Unix/X11 Windows

    Default Pivot Table with QTreeView: changing display properties on expanded rows

    Hello,

    I am trying to implement a 'pivot table' in PyQt using a QTreeView. I have started from Mark Summerfeld's example 'Representing Tabular Data in Trees' and modified it so that it will calculate subtotals for numeric fields under each branch (and sub-branches).

    The example works OK so far, but I would like to be able to change the view according to wether a given row is expanded or not. In particular, I would like to be able to hide or change the colours for the expanded rows' subtotals, or changing their background colour, etc, so that they do not distract (or at least are easily distinguishable from) the final nodes of the tree ('leaves') and the unexpanded subtotals. (Please check out the attached image and code).

    My question is: where should I try to do this? I thought about creating a custom delegate, but I cannot grasp how the delegate could know wether a given row is is expanded or not in the view.

    Thanks a lot,

    Federico.
    Pivot_Table_example.jpg
    TreeView_Pivot_Table-v0.02.py
    Last edited by fede; 18th April 2011 at 02:30.

Similar Threads

  1. Display QTreeView expanded in QDialog
    By LynneV in forum Qt Programming
    Replies: 3
    Last Post: 21st December 2010, 20:32
  2. Replies: 6
    Last Post: 3rd November 2010, 15:21
  3. Replies: 1
    Last Post: 8th February 2009, 11:37
  4. Changing properties of pushbutton?
    By triperzonak in forum Newbie
    Replies: 2
    Last Post: 24th June 2008, 15:48
  5. QTreeView restore Expanded node after reload model
    By patrik08 in forum Qt Programming
    Replies: 3
    Last Post: 26th May 2008, 17:42

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.