diff options
-rw-r--r-- | src/quick/items/qquickitem.cpp | 2 | ||||
-rw-r--r-- | tests/auto/quick/qquickitem2/tst_qquickitem.cpp | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp index b742dc16e9..de98e8e030 100644 --- a/src/quick/items/qquickitem.cpp +++ b/src/quick/items/qquickitem.cpp @@ -2602,7 +2602,7 @@ void QQuickItem::setParentItem(QQuickItem *parentItem) QQuickItem *itemAncestor = parentItem; while (itemAncestor != 0) { if (itemAncestor == this) { - qWarning("QQuickItem::setParentItem: Parent is already part of this items subtree."); + qWarning() << "QQuickItem::setParentItem: Parent" << parentItem << "is already part of the subtree of" << this; return; } itemAncestor = itemAncestor->parentItem(); diff --git a/tests/auto/quick/qquickitem2/tst_qquickitem.cpp b/tests/auto/quick/qquickitem2/tst_qquickitem.cpp index f3351fcc4e..aa0b5b7693 100644 --- a/tests/auto/quick/qquickitem2/tst_qquickitem.cpp +++ b/tests/auto/quick/qquickitem2/tst_qquickitem.cpp @@ -2721,7 +2721,10 @@ void tst_QQuickItem::parentLoop() { QQuickView *window = new QQuickView(0); - QTest::ignoreMessage(QtWarningMsg, "QQuickItem::setParentItem: Parent is already part of this items subtree."); +#ifndef QT_NO_REGULAREXPRESSION + QRegularExpression msgRegexp = QRegularExpression("QQuickItem::setParentItem: Parent QQuickItem\\(.*\\) is already part of the subtree of QQuickItem\\(.*\\)"); + QTest::ignoreMessage(QtWarningMsg, msgRegexp); +#endif window->setSource(testFileUrl("parentLoop.qml")); QQuickItem *root = qobject_cast<QQuickItem*>(window->rootObject()); |