Every item has a widget, just set the background for that.
//'index' is 'QModelIndex' for item
//'table' is 'QTableView *' instance
//'PIXMAP_PATH' is your background image path
QWidget *widget
= table
->indexWidget
( index
);
widget->setPalette(p);
table->setIndexWidget( index, widget );
//'index' is 'QModelIndex' for item
//'table' is 'QTableView *' instance
//'PIXMAP_PATH' is your background image path
QWidget *widget = table->indexWidget( index );
QPalette p( widget->palette());
p.setBrush(QPalette::Base, QBrush(QPixmap(PIXMAP_PATH)) );
widget->setPalette(p);
table->setIndexWidget( index, widget );
To copy to clipboard, switch view to plain text mode
Bookmarks