diff options
author | Olivier Goffart <ogoffart@woboq.com> | 2015-02-16 15:25:46 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-02-17 06:17:59 +0000 |
commit | 50e2bc2aa0f46562936a3137c15a2c9b4f67afde (patch) | |
tree | d482fffd5ee3fd3d006f0939a2e0e547f18cf691 /tests | |
parent | 51b7bd1e4faa5111489c4376a02969ad8197fadf (diff) |
Fix QDebug cumulating operator<< with many Q_ENUM
The problem is that the operator<< was taking a non-const reference to the QDebug
object. This causes a problem as all other operator<< return a temporary.
Since every other roperator<< takes the QDebug by value, we should also take it by value
in this case.
Move the operator<< in qdebug.h because i don't want to #include qdebug.h from qobject.h
And move the qt_QMetaEnum_debugOperator to be in the corresponding .cpp
Task-number: QTBUG-44462
Change-Id: Ia01629224c58930c2997e767efc43de90d6309e2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp b/tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp index 42dee6f1f8..90242f78a2 100644 --- a/tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp +++ b/tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp @@ -1417,6 +1417,9 @@ void tst_QMetaObject::enumDebugStream() QTest::ignoreMessage(QtDebugMsg, "hello MyNamespace::MyClass::MyEnum(MyEnum2) world "); MyNamespace::MyClass::MyEnum e = MyNamespace::MyClass::MyEnum2; qDebug() << "hello" << e << "world"; + + QTest::ignoreMessage(QtDebugMsg, "Qt::WindowType(WindowTitleHint) Qt::WindowType(Window) Qt::WindowType(Desktop) Qt::WindowType(WindowSystemMenuHint)"); + qDebug() << Qt::WindowTitleHint << Qt::Window <<Qt::Desktop << Qt::WindowSystemMenuHint; } QTEST_MAIN(tst_QMetaObject) |