Skip to content

Commit

Permalink
COMP: Fix Qt4/C++98 ctkDICOMTableView build error due to missing QJso…
Browse files Browse the repository at this point in the history
…nObject

This commit exclude the parsing of "formatForField" and instead reported
the warning indicating that the specified format string failed to be
decoded from json.
  • Loading branch information
jcfr committed Nov 4, 2021
1 parent 5aa16aa commit f2f0284
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Libs/DICOM/Widgets/ctkDICOMTableView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
#include "ui_ctkDICOMTableView.h"

// Qt includes
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
#include <QJsonObject>
#endif
#include <QMouseEvent>
#include <QSortFilterProxyModel>
#include <QSqlError>
Expand Down Expand Up @@ -209,6 +211,7 @@ void ctkDICOMTableViewPrivate::applyColumnProperties()
QHeaderView::ResizeMode columnResizeMode = QHeaderView::Interactive;
if (!fieldFormat.isEmpty())
{
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
QJsonDocument fieldFormatDoc = QJsonDocument::fromJson(fieldFormat.toUtf8());
QJsonObject fieldFormatObj;
if (!fieldFormatDoc.isNull())
Expand Down Expand Up @@ -262,6 +265,7 @@ void ctkDICOMTableViewPrivate::applyColumnProperties()

}
else
#endif
{
// format string is specified but failed to be decoded from json
qWarning() << "Invalid ColumnDisplayProperties Format string for column " << columnName << ": " << fieldFormat;
Expand Down

0 comments on commit f2f0284

Please sign in to comment.