summaryrefslogtreecommitdiffstats
path: root/src/gui/util/qgridlayoutengine_p.h
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2024-03-29 15:22:10 +0800
committerMitch Curtis <mitch.curtis@qt.io>2024-04-08 10:17:46 +0800
commit3f720b8acfc3ee63d860a78b58e945923e8bae0a (patch)
treee42c108f97e54d2cecae588aca553d779abaf781 /src/gui/util/qgridlayoutengine_p.h
parentce23c9083f4d06054eb59781c3309b1fcc807a1f (diff)
QGridLayoutEngine: print stringified layout item in warnings
This provides a way for the user to identify any items involved in warnings we may print, as e.g. their objectName will be included. Qt Quick's Layout types can use this to stringify the QQuickItem, which will result in the type and objectName being printed. Change-Id: I3d6b6ea0315df98629992afd29e4bf2aad847e22 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'src/gui/util/qgridlayoutengine_p.h')
-rw-r--r--src/gui/util/qgridlayoutengine_p.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gui/util/qgridlayoutengine_p.h b/src/gui/util/qgridlayoutengine_p.h
index e21d89dd2e..2f60cb99fd 100644
--- a/src/gui/util/qgridlayoutengine_p.h
+++ b/src/gui/util/qgridlayoutengine_p.h
@@ -24,6 +24,7 @@
#include <QtCore/qpair.h>
#include <QtCore/qsize.h>
#include <QtCore/qrect.h>
+#include <QtCore/qdebug.h>
#include <float.h>
#include "qlayoutpolicy_p.h"
@@ -283,6 +284,8 @@ public:
virtual QLayoutPolicy::ControlTypes controlTypes(LayoutSide side) const;
+ inline virtual QString toString() const { return QDebug::toString(this); }
+
QRectF geometryWithin(qreal x, qreal y, qreal width, qreal height, qreal rowDescent, Qt::Alignment align, bool snapToPixelGrid) const;
QGridLayoutBox box(Qt::Orientation orientation, bool snapToPixelGrid, qreal constraint = -1.0) const;