Results 1 to 3 of 3

Thread: Problem in QT treewidget background colour

  1. #1
    Join Date
    Feb 2011
    Posts
    29
    Qt products
    Qt3 Qt4 Qt/Embedded Qt Jambi
    Platforms
    Unix/X11 Windows

    Default Problem in QT treewidget background colour

    Dear all,

    I am facing problem in changing background color of tree widget.

    I have add some items in tree widget.
    but when try to change back ground colour than it only changes colour of some part of widget.
    item part remain white only.
    it not changes to actual back ground of tree widget.
    please help me in this matter.
    i m not able to complete this task.

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problem in QT treewidget background colour

    What did you try ?
    Without knowing wat code you wrote, its not possible to guess where you are going wrong.

  3. #3
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Problem in QT treewidget background colour

    Question was asked by the same poster in QtForum.org, and was answered 5 days ago without acknowledgment or thanks. So either he never bothered to check to see if his question was answered, or didn't like the answer given. Answer as posted there was to try one of the following:

    Qt Code:
    1. QTreeWidgetItem::setBackground();
    2.  
    3. // and / or
    4.  
    5. QPalette p = treeWidget->palette();
    6. p.setBrush( QPalette::Base, QBrush( Qt::blue );
    7. treeWidget->setPalette( p );
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Replies: 2
    Last Post: 18th May 2010, 22:44
  2. QTextDocument background colour
    By Ruud v A in forum Qt Programming
    Replies: 6
    Last Post: 18th May 2010, 14:30
  3. Replies: 13
    Last Post: 29th April 2009, 15:51
  4. Dynamically changing QLabel background colour
    By T4ng10r in forum Qt Programming
    Replies: 19
    Last Post: 19th April 2007, 12:47
  5. background colour
    By kw in forum Qt Programming
    Replies: 6
    Last Post: 11th April 2006, 00:44

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.