Results 1 to 2 of 2

Thread: height property not adjusted when QTreeView item selected

  1. #1
    Join Date
    Dec 2009
    Posts
    62
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Windows

    Default height property not adjusted when QTreeView item selected

    Hi

    I have a QTreeView which uses this style sheet:

    QTreeWidget::item:selected{
    background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #6ea1f1, stop: 1 #567dbc);
    height: 60px;
    }

    My intention was that the row in the QTreeView would not only highlight but also get bigger when it is the selected one. The highlighting above works fine but the height is not changed when the item becomes active.

    Using setSizeHint from the code instad increases the size of the row was expected.

    Am I missing the point on what stylesheets can be/shold be used for here?

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: height property not adjusted when QTreeView item selected

    Personally I don't like style sheets for Qt applications so much. They are nice if you want quickly style the common elements in a program. But not more. All other things (even if they can be accessed with style sheets) should be done in C++. But that's only my personal opinion. I also try to avoid style sheets where ever possible.

    Also note, and you have it, that style sheets don't support everything on every widget. To find out what is where supported you have to go carefully through the docs.

  3. The following user says thank you to Lykurg for this useful post:

    hubbobubbo (22nd April 2010)

Similar Threads

  1. popupmenu for QTreeWidget's item when a particular item selected.
    By vinod sharma in forum Best Practices in Qt Programming
    Replies: 1
    Last Post: 22nd January 2010, 10:45
  2. Changing selected QTreeView item font
    By dima1000 in forum Newbie
    Replies: 5
    Last Post: 8th October 2009, 09:28
  3. Replies: 1
    Last Post: 18th February 2009, 08:34
  4. QTreeView: selection behavior upon selected item removal
    By Pieter from Belgium in forum Qt Programming
    Replies: 6
    Last Post: 11th July 2007, 16:00
  5. Replies: 1
    Last Post: 21st September 2006, 10:37

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.