Results 1 to 5 of 5

Thread: Q3ListViewItem background color

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Ukraine,Lviv
    Posts
    454
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows
    Thanks
    9
    Thanked 27 Times in 27 Posts

    Default Re: Q3ListViewItem background color

    And if i understand you cant change item colors?
    I think you must subclass QListViewItem and play with reimplementing paintBrushes() or paintCell()
    a life without programming is like an empty bottle

  2. #2
    Join Date
    Feb 2006
    Posts
    60
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    21

    Default Re: Q3ListViewItem background color

    Thanks for the reply,

    I reimplemented paintcell as shown below and it works fine

    void QCexItem:aintCell( QPainter * p, const QColorGroup &cg,
    int column, int width, int align)
    {
    const QBrush brush(Qt::lightgray);
    p->fillRect(0,0, width, height(), brush);
    Q3ListViewItem:aintCell( p, cg, column, width, align );
    return;
    }

    but if i want to change the color of the text in the Q3ListVuewItem, i cannot do it ,

    If you have any suggestions please do reply,

    bye,
    sree

Similar Threads

  1. button background color when it is clicked
    By navi1084 in forum Qt Programming
    Replies: 5
    Last Post: 24th June 2024, 12:09
  2. Change QPushButton Background Color, Qt4.3
    By Rayven in forum Qt Programming
    Replies: 5
    Last Post: 4th July 2009, 07:14
  3. how to change QTextEdit background color ?
    By mismael85 in forum Qt Programming
    Replies: 9
    Last Post: 26th June 2008, 22:05
  4. Menu bar background color focus
    By user_mail07 in forum Qt Tools
    Replies: 0
    Last Post: 18th May 2007, 01:25
  5. QLabel background color
    By munna in forum Newbie
    Replies: 3
    Last Post: 1st May 2006, 15:36

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
  •  
Qt is a trademark of The Qt Company.