From e65e258b2be66d206162c3aa19339fa6c11e846c Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Tue, 2 Apr 2024 17:50:37 -0400 Subject: [PATCH] COMP: Ensure DICOMWidget compatibility with Qt 5.12.8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit resolves compilation issues encountered when building the DICOMWidget against Qt 5.12.8. The changes include: 1. Removed the setting of the unsupported and unused `placeholderText` property from `ctkDICOMVisualBrowserWidget.ui`. This property's removal does not affect widget rendering. The removal addresses a compilation error introduced in commit 88ff72b9 ("ENH: Add Visual DICOM Browser (#1165)", 2024-01-19): ``` /path/to/CTK/Libs/DICOM/Core/ctkDICOMStorageListener.cpp:71:18: error: ‘acceptAssociations’ is not a member of ‘DcmSCP’ 71 | return DcmSCP::acceptAssociations(); | ^~~~~~~~~~~~~~~~~~ ``` 2. Introduced conditional utilization of `Qt::MatchRegularExpression`, available in Qt 5.15, to resolve a compilation error introduced in commit 888cdd92 ("ENH: Add ctkDICOMJobListWidget for logging jobs activity in the UI", 2024-01-18): ``` /path/to/CTK/Libs/DICOM/Widgets/ctkDICOMJobListWidget.cpp:405:69: error: ‘MatchRegularExpression’ is not a member of ‘Qt’ 405 | QList list = this->findItems(tr("completed"), Qt::MatchRegularExpression, Columns::Status); | ^~~~~~~~~~~~~~~~~~~~~~ ``` --- .../Widgets/Resources/UI/ctkDICOMVisualBrowserWidget.ui | 3 --- Libs/DICOM/Widgets/ctkDICOMJobListWidget.cpp | 5 +++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Libs/DICOM/Widgets/Resources/UI/ctkDICOMVisualBrowserWidget.ui b/Libs/DICOM/Widgets/Resources/UI/ctkDICOMVisualBrowserWidget.ui index 5422b05067..645d4c9109 100644 --- a/Libs/DICOM/Widgets/Resources/UI/ctkDICOMVisualBrowserWidget.ui +++ b/Libs/DICOM/Widgets/Resources/UI/ctkDICOMVisualBrowserWidget.ui @@ -403,9 +403,6 @@ QComboBox::AdjustToContents - - - true diff --git a/Libs/DICOM/Widgets/ctkDICOMJobListWidget.cpp b/Libs/DICOM/Widgets/ctkDICOMJobListWidget.cpp index dd9a24ae07..e6fa63105b 100644 --- a/Libs/DICOM/Widgets/ctkDICOMJobListWidget.cpp +++ b/Libs/DICOM/Widgets/ctkDICOMJobListWidget.cpp @@ -402,7 +402,12 @@ void QCenteredItemModel::setProgressBar(int row, const ctkDICOMJobDetail &td, ct //---------------------------------------------------------------------------- void QCenteredItemModel::clearCompletedJobs() { +#if (QT_VERSION >= QT_VERSION_CHECK(5,15,0)) QList list = this->findItems(tr("completed"), Qt::MatchRegularExpression, Columns::Status); +#else + QList list = this->findItems(tr("completed"), Qt::MatchRegExp, Columns::Status); +#endif + foreach (QStandardItem* item, list) { this->removeRow(item->row());