From bf3bdc6dc50340a0e481cd620b207986c95d115e Mon Sep 17 00:00:00 2001 From: Pedro Beirao Date: Tue, 24 Sep 2024 21:47:53 +0100 Subject: [PATCH] Empty items are no longer selectable in demodialog --- src/demodialog.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/demodialog.cpp b/src/demodialog.cpp index 5130f02..9632a2a 100644 --- a/src/demodialog.cpp +++ b/src/demodialog.cpp @@ -67,11 +67,17 @@ demodialog::demodialog(QString footer_iwad, QStringList footer_files, QWidget *p { QTableWidgetItem *newItemTemp = new QTableWidgetItem(""); newItemTemp->setFlags(newItemTemp->flags() & ~Qt::ItemIsEditable); - files_listWidget->setItem(height, j, newItemTemp); + files_listWidget->setItem(height + j, j, newItemTemp); for (int i = 0; i < height + j; i++) { - if (i + j * height >= files.size()) continue; + if (i + j * height >= files.size()) + { + QTableWidgetItem *newItem = new QTableWidgetItem(""); + newItem->setFlags(newItem->flags() & ~Qt::ItemIsEditable & ~Qt::ItemIsSelectable); + files_listWidget->setItem(i, j, newItem); + continue; + } QTableWidgetItem *newItem = new QTableWidgetItem(files[i + j * height].fileName()); newItem->setToolTip(files[i + j * height].absoluteFilePath());