diff --git a/Libs/Core/ctkFileLogger.cpp b/Libs/Core/ctkFileLogger.cpp index ad0cdbf51f..d46c7c2fc0 100644 --- a/Libs/Core/ctkFileLogger.cpp +++ b/Libs/Core/ctkFileLogger.cpp @@ -136,7 +136,11 @@ void ctkFileLogger::logMessage(const QString& msg) return; } QTextStream s(&f); + #if (QT_VERSION >= QT_VERSION_CHECK(5,14,0)) + s << msg << Qt::endl; + #else s << msg << endl; + #endif f.close(); } diff --git a/Libs/QtTesting/ctkEventTranslatorPlayerWidget.cpp b/Libs/QtTesting/ctkEventTranslatorPlayerWidget.cpp index 541641a8c2..92ae2a86c2 100644 --- a/Libs/QtTesting/ctkEventTranslatorPlayerWidget.cpp +++ b/Libs/QtTesting/ctkEventTranslatorPlayerWidget.cpp @@ -279,10 +279,17 @@ bool ctkEventTranslatorPlayerWidget::compare(const double &actual, { if (actual != expected) { + #if (QT_VERSION >= QT_VERSION_CHECK(5,14,0)) + QTextStream(stderr, QIODevice::WriteOnly) + << "Line " << line << " - Problem with function " << function << "\n" + << "\tActual value : '" << actualName << "' = " << actual << " \n" + << "\tExpected value : '" << expectedName << "' = " << expected << Qt::endl; + #else QTextStream(stderr, QIODevice::WriteOnly) << "Line " << line << " - Problem with function " << function << "\n" << "\tActual value : '" << actualName << "' = " << actual << " \n" << "\tExpected value : '" << expectedName << "' = " << expected << endl; + #endif QApplication::exit(EXIT_FAILURE); return false; } @@ -298,10 +305,17 @@ bool ctkEventTranslatorPlayerWidget::compare(const int &actual, { if (actual != expected) { + #if (QT_VERSION >= QT_VERSION_CHECK(5,14,0)) + QTextStream(stderr, QIODevice::WriteOnly) + << "Line " << line << " - Problem with function " << function << "\n" + << "\tActual value : '" << actualName << "' = " << actual << " \n" + << "\tExpected value : '" << expectedName << "' = " << expected << Qt::endl; + #else QTextStream(stderr, QIODevice::WriteOnly) << "Line " << line << " - Problem with function " << function << "\n" << "\tActual value : '" << actualName << "' = " << actual << " \n" << "\tExpected value : '" << expectedName << "' = " << expected << endl; + #endif QApplication::exit(EXIT_FAILURE); return false; } @@ -318,10 +332,17 @@ bool ctkEventTranslatorPlayerWidget::compare(const QString& actual, { if (actual != expected) { + #if (QT_VERSION >= QT_VERSION_CHECK(5,14,0)) + QTextStream(stderr, QIODevice::WriteOnly) + << "Line " << line << " - Problem with function " << function << "\n" + << "\tActual value : '" << actualName << "' = " << actual << " \n" + << "\tExpected value : '" << expectedName << "' = " << expected << Qt::endl; + #else QTextStream(stderr, QIODevice::WriteOnly) << "Line " << line << " - Problem with function " << function << "\n" << "\tActual value : '" << actualName << "' = " << actual << " \n" << "\tExpected value : '" << expectedName << "' = " << expected << endl; + #endif QApplication::exit(EXIT_FAILURE); return false; } @@ -338,10 +359,17 @@ bool ctkEventTranslatorPlayerWidget::compare(const QStringList& actual, { if (actual != expected) { + #if (QT_VERSION >= QT_VERSION_CHECK(5,14,0)) + QTextStream(stderr, QIODevice::WriteOnly) + << "Line " << line << " - Problem with function " << function << "\n" + << "\tActual value : '" << actualName << "' = " << actual.join(" ") << " \n" + << "\tExpected value : '" << expectedName << "' = " << expected.join(" ") << Qt::endl; + #else QTextStream(stderr, QIODevice::WriteOnly) << "Line " << line << " - Problem with function " << function << "\n" << "\tActual value : '" << actualName << "' = " << actual.join(" ") << " \n" << "\tExpected value : '" << expectedName << "' = " << expected.join(" ") << endl; + #endif QApplication::exit(EXIT_FAILURE); return false; } @@ -358,10 +386,17 @@ bool ctkEventTranslatorPlayerWidget::compare(const QDateTime& actual, { if (actual != expected) { + #if (QT_VERSION >= QT_VERSION_CHECK(5,14,0)) + QTextStream(stderr, QIODevice::WriteOnly) + << "Line " << line << " - Problem with function " << function << "\n" + << "\tActual value : '" << actualName << "' = " << actual.date().toString() << " \n" + << "\tExpected value : '" << expectedName << "' = " << expected.date().toString() << Qt::endl; + #else QTextStream(stderr, QIODevice::WriteOnly) << "Line " << line << " - Problem with function " << function << "\n" << "\tActual value : '" << actualName << "' = " << actual.date().toString() << " \n" << "\tExpected value : '" << expectedName << "' = " << expected.date().toString() << endl; + #endif QApplication::exit(EXIT_FAILURE); return false; } @@ -378,10 +413,17 @@ bool ctkEventTranslatorPlayerWidget::compare(const QColor& actual, { if (actual != expected) { + #if (QT_VERSION >= QT_VERSION_CHECK(5,14,0)) + QTextStream(stderr, QIODevice::WriteOnly) + << "Line " << line << " - Problem with function " << function << "\n" + << "\tActual value : '" << actualName << "' = R:" << actual.red() << " G:"<< actual.green() << " B:" << actual.blue() << "\n" + << "\tExpected value : '" << expectedName << "' = R:" << expected.red() << " G:"<< expected.green() << " B:" << expected.blue()<< Qt::endl; + #else QTextStream(stderr, QIODevice::WriteOnly) << "Line " << line << " - Problem with function " << function << "\n" << "\tActual value : '" << actualName << "' = R:" << actual.red() << " G:"<< actual.green() << " B:" << actual.blue() << "\n" << "\tExpected value : '" << expectedName << "' = R:" << expected.red() << " G:"<< expected.green() << " B:" << expected.blue()<< endl; + #endif QApplication::exit(EXIT_FAILURE); return false; } @@ -406,18 +448,30 @@ bool ctkEventTranslatorPlayerWidget::compare(const QImage& actual, // images are not the same if one images contains a null image if (actual.isNull() || expected.isNull()) { + #if (QT_VERSION >= QT_VERSION_CHECK(5,14,0)) + QTextStream(stderr, QIODevice::WriteOnly) + << "Line " << line << " - 1 image is Null " << function << "\n" << Qt::endl; + #else QTextStream(stderr, QIODevice::WriteOnly) << "Line " << line << " - 1 image is Null " << function << "\n" << endl; + #endif QApplication::exit(EXIT_FAILURE); return false; } // images do not have the same size if (actual.size() != expected.size()) { + #if (QT_VERSION >= QT_VERSION_CHECK(5,14,0)) + QTextStream(stderr, QIODevice::WriteOnly) + << "Line " << line << " - The 2 Images don't have the same size " << function << "\n" + << "\tActual value : '" << actualName << "' = W:" << actual.width() << " H:"<< actual.height() << "\n" + << "\tExpected value : '" << expectedName << "' = W:" << expected.width() << " H:"<< expected.height() << Qt::endl; + #else QTextStream(stderr, QIODevice::WriteOnly) << "Line " << line << " - The 2 Images don't have the same size " << function << "\n" << "\tActual value : '" << actualName << "' = W:" << actual.width() << " H:"<< actual.height() << "\n" << "\tExpected value : '" << expectedName << "' = W:" << expected.width() << " H:"<< expected.height() << endl; + #endif QApplication::exit(EXIT_FAILURE); return false; } @@ -444,9 +498,15 @@ bool ctkEventTranslatorPlayerWidget::compare(const QImage& actual, totaldiff = (totaldiff * 100) / (a.width() * a.height()); if (totaldiff >= 0.01) { + #if (QT_VERSION >= QT_VERSION_CHECK(5,14,0)) + QTextStream(stderr, QIODevice::WriteOnly) + << "Line " << line << " - The 2 Images have " + << totaldiff << "% differencies \n" << Qt::endl; + #else QTextStream(stderr, QIODevice::WriteOnly) << "Line " << line << " - The 2 Images have " << totaldiff << "% differencies \n" << endl; + #endif QApplication::exit(EXIT_FAILURE); return false; } diff --git a/Libs/Visualization/VTK/Core/ctkVTKConnection.cpp b/Libs/Visualization/VTK/Core/ctkVTKConnection.cpp index 5130bce945..935d74142d 100644 --- a/Libs/Visualization/VTK/Core/ctkVTKConnection.cpp +++ b/Libs/Visualization/VTK/Core/ctkVTKConnection.cpp @@ -249,6 +249,19 @@ vtkObject* ctkVTKConnection::vtkobject() const QDebug operator<<(QDebug dbg, const ctkVTKConnection& connection) { const ctkVTKConnectionPrivate* d = connection.d_func(); + #if (QT_VERSION >= QT_VERSION_CHECK(5,14,0)) + dbg.nospace() << "ctkVTKConnection:" << &connection << Qt::endl + << "Id:" << d->Id << Qt::endl + << " VTKObject:" << (d->VTKObject ? d->VTKObject->GetClassName() : "") + << "(" << d->VTKObject << ")" << Qt::endl + << " QtObject:" << d->QtObject << Qt::endl + << " VTKEvent:" << d->VTKEvent << Qt::endl + << " QtSlot:" << d->QtSlot << Qt::endl + << " SlotType:" << d->SlotType << Qt::endl + << " Priority:" << d->Priority << Qt::endl + << " Connected:" << d->Connected << Qt::endl + << " Blocked:" << d->Blocked; + #else dbg.nospace() << "ctkVTKConnection:" << &connection << endl << "Id:" << d->Id << endl << " VTKObject:" << (d->VTKObject ? d->VTKObject->GetClassName() : "") @@ -260,6 +273,7 @@ QDebug operator<<(QDebug dbg, const ctkVTKConnection& connection) << " Priority:" << d->Priority << endl << " Connected:" << d->Connected << endl << " Blocked:" << d->Blocked; + #endif return dbg.space(); } diff --git a/Libs/Visualization/VTK/Core/ctkVTKObjectEventsObserver.cpp b/Libs/Visualization/VTK/Core/ctkVTKObjectEventsObserver.cpp index c0c9f3c75e..3862552446 100644 --- a/Libs/Visualization/VTK/Core/ctkVTKObjectEventsObserver.cpp +++ b/Libs/Visualization/VTK/Core/ctkVTKObjectEventsObserver.cpp @@ -253,10 +253,17 @@ void ctkVTKObjectEventsObserver::printAdditionalInfo() { this->Superclass::dumpObjectInfo(); Q_D(ctkVTKObjectEventsObserver); + #if (QT_VERSION >= QT_VERSION_CHECK(5,14,0)) + qDebug() << "ctkVTKObjectEventsObserver:" << this << Qt::endl + << " AllBlocked:" << d->AllBlocked << Qt::endl + << " Parent:" << (this->parent()?this->parent()->objectName():"NULL") << Qt::endl + << " Connection count:" << d->connections().count(); + #else qDebug() << "ctkVTKObjectEventsObserver:" << this << endl << " AllBlocked:" << d->AllBlocked << endl << " Parent:" << (this->parent()?this->parent()->objectName():"NULL") << endl << " Connection count:" << d->connections().count(); + #endif // Loop through all connection foreach (const ctkVTKConnection* connection, d->connections()) diff --git a/Libs/Widgets/ctkAddRemoveComboBox.cpp b/Libs/Widgets/ctkAddRemoveComboBox.cpp index 35c788fe55..d65fb61bdf 100644 --- a/Libs/Widgets/ctkAddRemoveComboBox.cpp +++ b/Libs/Widgets/ctkAddRemoveComboBox.cpp @@ -150,6 +150,16 @@ ctkAddRemoveComboBox::~ctkAddRemoveComboBox() void ctkAddRemoveComboBox::printAdditionalInfo() { Q_D(ctkAddRemoveComboBox); + #if (QT_VERSION >= QT_VERSION_CHECK(5,14,0)) + qDebug() << "ctkAddRemoveComboBox:" << this << Qt::endl + << " EmptyText:" << d->EmptyText << Qt::endl + << " AddingEmptyItem:" << d->AddingEmptyItem << Qt::endl + << " RemovingEmptyItem:" << d->RemovingEmptyItem << Qt::endl + << " AddEnabled:" << d->AddEnabled << Qt::endl + << " RemoveEnabled:" << d->RemoveEnabled << Qt::endl + << " EditEnabled:" << d->EditEnabled << Qt::endl + << " HasEmptyItem:" << d->HasEmptyItem; + #else qDebug() << "ctkAddRemoveComboBox:" << this << endl << " EmptyText:" << d->EmptyText << endl << " AddingEmptyItem:" << d->AddingEmptyItem << endl @@ -158,6 +168,7 @@ void ctkAddRemoveComboBox::printAdditionalInfo() << " RemoveEnabled:" << d->RemoveEnabled << endl << " EditEnabled:" << d->EditEnabled << endl << " HasEmptyItem:" << d->HasEmptyItem; + #endif } // --------------------------------------------------------------------------