diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp index 191fcf8cfd..aaa639272c 100644 --- a/src/corelib/tools/qdatetime.cpp +++ b/src/corelib/tools/qdatetime.cpp @@ -4965,7 +4965,8 @@ QDebug operator<<(QDebug dbg, const QTime &time) QDebug operator<<(QDebug dbg, const QDateTime &date) { QDebugStateSaver saver(dbg); - dbg.nospace() << "QDateTime(" << date.toString(QStringLiteral("yyyy-MM-dd HH:mm:ss.zzz t")) + dbg.nospace() << "QDateTime("; + dbg.noquote() << date.toString(QStringLiteral("yyyy-MM-dd HH:mm:ss.zzz t")) << ' ' << date.timeSpec(); switch (date.d->m_spec) { case Qt::UTC: diff --git a/tests/auto/corelib/io/qnodebug/tst_qnodebug.cpp b/tests/auto/corelib/io/qnodebug/tst_qnodebug.cpp index ae08a4631d..5ece9190a5 100644 --- a/tests/auto/corelib/io/qnodebug/tst_qnodebug.cpp +++ b/tests/auto/corelib/io/qnodebug/tst_qnodebug.cpp @@ -70,7 +70,7 @@ void tst_QNoDebug::streaming() const { QDateTime dt(QDate(1,2,3),QTime(4,5,6)); const QString debugString = dt.toString(QStringLiteral("yyyy-MM-dd HH:mm:ss.zzz t")); - QTest::ignoreMessage(QtWarningMsg, qPrintable(QString::fromLatin1("QDateTime(\"%1\" Qt::TimeSpec(LocalTime))").arg(debugString))); + QTest::ignoreMessage(QtWarningMsg, qPrintable(QString::fromLatin1("QDateTime(%1 Qt::TimeSpec(LocalTime))").arg(debugString))); qWarning() << dt; }