Skip to content

Commit

Permalink
COMP: Ensure DICOMWidget compatibility with Qt 5.12.8
Browse files Browse the repository at this point in the history
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
   88ff72b ("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 888cdd9 ("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<QStandardItem*> list = this->findItems(tr("completed"), Qt::MatchRegularExpression, Columns::Status);
        |                                                                     ^~~~~~~~~~~~~~~~~~~~~~
    ```
  • Loading branch information
jcfr committed Apr 3, 2024
1 parent 867f387 commit 9e6f70c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -403,9 +403,6 @@
<property name="sizeAdjustPolicy">
<enum>QComboBox::AdjustToContents</enum>
</property>
<property name="placeholderText">
<string/>
</property>
<property name="frame">
<bool>true</bool>
</property>
Expand Down
5 changes: 5 additions & 0 deletions Libs/DICOM/Widgets/ctkDICOMJobListWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<QStandardItem*> list = this->findItems(tr("completed"), Qt::MatchRegularExpression, Columns::Status);
#else
QList<QStandardItem*> list = this->findItems(tr("completed"), Qt::MatchRegExp, Columns::Status);
#endif

foreach (QStandardItem* item, list)
{
this->removeRow(item->row());
Expand Down

0 comments on commit 9e6f70c

Please sign in to comment.