aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2018-01-13 19:32:22 +0100
committerMitch Curtis <mitch.curtis@qt.io>2018-01-24 12:47:13 +0000
commit388f9b151245ae194a0a9175da7cc70ce534e6e6 (patch)
treeb66705ad0004b7bd2d8197d8307fd592dc8dec3a /src
parentb64a1b3078a764797cbc3e1e4a456257c32721d6 (diff)
QQuickItem::stackBefore/After: print more useful warnings
Before this patch, you'd get the following warning: QQuickItem::stackAfter: Cannot stack after 0x7f9e668368c0, which must be a sibling After this patch, you get this warning: QQuickItem::stackAfter: Cannot stack QQuickItem_QML_131(0x7ff548f44d70, name="hoverPathDelegate", parent=0x7ff54a871c90, geometry=0,0 0x0) after QQuickItem_QML_131(0x7ff548f3c8f0, name = "hoverPathDelegate"), which must be a sibling This tells you which type caused the warning, and, if you've set it, its objectName. Change-Id: I7b20f1ac089f42d73f02bcca0382022905d0cb57 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/quick/items/qquickitem.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp
index af60ab879b..8499c37010 100644
--- a/src/quick/items/qquickitem.cpp
+++ b/src/quick/items/qquickitem.cpp
@@ -2805,7 +2805,8 @@ void QQuickItem::stackBefore(const QQuickItem *sibling)
{
Q_D(QQuickItem);
if (!sibling || sibling == this || !d->parentItem || d->parentItem != QQuickItemPrivate::get(sibling)->parentItem) {
- qWarning("QQuickItem::stackBefore: Cannot stack before %p, which must be a sibling", sibling);
+ qWarning().nospace() << "QQuickItem::stackBefore: Cannot stack "
+ << this << " before " << sibling << ", which must be a sibling";
return;
}
@@ -2849,7 +2850,8 @@ void QQuickItem::stackAfter(const QQuickItem *sibling)
{
Q_D(QQuickItem);
if (!sibling || sibling == this || !d->parentItem || d->parentItem != QQuickItemPrivate::get(sibling)->parentItem) {
- qWarning("QQuickItem::stackAfter: Cannot stack after %p, which must be a sibling", sibling);
+ qWarning().nospace() << "QQuickItem::stackAfter: Cannot stack "
+ << this << " after " << sibling << ", which must be a sibling";
return;
}