Why with the following code I just get an empty table widget?
QString imgPath = \"C:\\\\path\\\\to\\\\image.jpg\";
QImage *img = new QImage(imgPath);
QTable
You are doing all almost right, but try to control your img, for example, like this:
QString imgPath = "C:\\path\\to\\image.jpg";
QImage *img = new QImage();
bool loaded = img->load(imgPath);
if (loaded)
{
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);
w.setCentralWidget(thumbnailsWidget);
} else {
qDebug()<<"Image "<
Hope, it helps you! Good luck!