ghorwin
16th March 2007, 20:36
Hi there,
while using a TableView and costum item delegates would be one way to display Icons in a table, I suspect there is a simpler way, possibly even with QTableWidget.
However, when I simply create a new QTableWidgetItem with an Icon and insert it into the table, it won't be shown.
The code below doesn't will insert a table widget item, but won't show the icon.
QTableWidgetItem * iconItem = new QTableWidgetItem(QIcon(":/images/ok.png"), "");
table->setItem(row, 0, iconItem);
So, what would be the correct (and simplest) way to show Icons in a Table?
while using a TableView and costum item delegates would be one way to display Icons in a table, I suspect there is a simpler way, possibly even with QTableWidget.
However, when I simply create a new QTableWidgetItem with an Icon and insert it into the table, it won't be shown.
The code below doesn't will insert a table widget item, but won't show the icon.
QTableWidgetItem * iconItem = new QTableWidgetItem(QIcon(":/images/ok.png"), "");
table->setItem(row, 0, iconItem);
So, what would be the correct (and simplest) way to show Icons in a Table?