Results 1 to 2 of 2

Thread: How to color a particular column which has pixmap in a QTableView

  1. #1
    Join Date
    Feb 2014
    Posts
    60
    Thanks
    4
    Thanked 5 Times in 5 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default How to color a particular column which has pixmap in a QTableView

    I have a custom table view class which has the structure such that the first and third columns are lineedit and second and third columns are buttons . I just want to color the text of the buttons even though when it is not selected . In delegate , Paint() method colors the 2nd and 4th columns as a pixmap not as a buttons so i want to color the text of a pixmap . Can any one help on it ?

  2. #2
    Join Date
    Feb 2012
    Location
    Warsaw, Poland
    Posts
    37
    Thanks
    3
    Thanked 6 Times in 6 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: How to color a particular column which has pixmap in a QTableView

    I am not sure if I understood you but maybe try this:
    http://doc.qt.io/qt-5/qabstractitemmodel.html#data
    with Qt::ForegroundRole

Similar Threads

  1. Replies: 4
    Last Post: 27th February 2014, 09:42
  2. change pixmap color, clip background
    By Bocky in forum Qt Programming
    Replies: 1
    Last Post: 9th November 2013, 17:31
  3. Scroll QTableView beyond last column/row
    By ftnirp in forum Qt Programming
    Replies: 2
    Last Post: 3rd September 2013, 13:27
  4. QwtHistogramm one column color
    By denis821 in forum Qwt
    Replies: 2
    Last Post: 4th March 2013, 06:42
  5. QTableView Drag without pixmap
    By TheGrimace in forum Newbie
    Replies: 1
    Last Post: 18th June 2010, 18:19

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.