Qt - Cannot put an image in a table
问题 Why with the following code I just get an empty table widget? QString imgPath = "C:\\path\\to\\image.jpg"; QImage *img = new QImage(imgPath); QTableWidget *thumbnailsWidget = new QTableWidget; QTableWidgetItem *thumbnail = new QTableWidgetItem; thumbnail->setData(Qt::DecorationRole, QPixmap::fromImage(*img)); thumbnailsWidget->setColumnCount(5); thumbnailsWidget->setRowCount(3); thumbnailsWidget->setItem(0, 0, thumbnail); setCentralWidget(thumbnailsWidget); How can I put an image into a