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.
Qt Code:
  1. QTableWidgetItem * iconItem = new QTableWidgetItem(QIcon(":/images/ok.png"), "");
  2. table->setItem(row, 0, iconItem);
To copy to clipboard, switch view to plain text mode 

So, what would be the correct (and simplest) way to show Icons in a Table?