qt - Is there a simple way to change background color of row in a QTableWidget? -


i know can loop through qtablewidgetitems , change colors but, if have used setcellwidget , have cells not qtablewidgetitems. can't find simple setrowcolor method. seems there should since there methods alternating row color , whatnot. there simple way without sub-classing table's delegate?

rhetorical question: want change row color, should need whole new class that?

you can add style sheet qtablewidget this:

qtablewidget::item {     background-color: rgb(255, 85, 127); } 

you can set code follows:

qstring _customstyle = qstring(       "qtablewidget::item {"       "background-color: rgba(162, 186, 60);"       "}"; tablewidget->setstylesheet(_customstyle); 

use own color rgb (obviously).


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -