summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2021-01-20 11:58:08 +0100
committerMitch Curtis <mitch.curtis@qt.io>2021-02-15 13:54:28 +0100
commitb770d54c6b71fb7a1084a5a2b7994ec8472716a0 (patch)
tree6cdeb433e660695170205139589573ab00869dc8
parent24769d86c9e6dbf9608eff9bddb8f9fc1f751ef2 (diff)
Add QWindow and QQuickWindow overloads for qmlInfo()
Otherwise you can't print out window objects with it. Change-Id: I2a177bd71215cfcb3f5fc47c9171eaba9a12ac0f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
-rw-r--r--src/quick/items/qquickwindow.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/quick/items/qquickwindow.h b/src/quick/items/qquickwindow.h
index 8700b5a141..af22912930 100644
--- a/src/quick/items/qquickwindow.h
+++ b/src/quick/items/qquickwindow.h
@@ -48,6 +48,7 @@
#include <QtGui/qevent.h>
#include <QtQml/qqml.h>
#include <QtQml/qqmldebug.h>
+#include <QtQml/qqmlinfo.h>
QT_BEGIN_NAMESPACE
@@ -253,6 +254,14 @@ private Q_SLOTS:
void runJobsAfterSwap();
void handleApplicationStateChanged(Qt::ApplicationState state);
private:
+#ifndef QT_NO_DEBUG_STREAM
+ inline friend QQmlInfo operator<<(QQmlInfo info, const QQuickWindow *window)
+ {
+ info.QDebug::operator<<(window);
+ return info;
+ }
+#endif
+
friend class QQuickItem;
friend class QQuickWidget;
friend class QQuickRenderControl;
@@ -263,6 +272,12 @@ private:
#ifndef QT_NO_DEBUG_STREAM
QDebug Q_QUICK_EXPORT operator<<(QDebug debug, const QQuickWindow *item);
+
+inline QQmlInfo operator<<(QQmlInfo info, const QWindow *window)
+{
+ info.QDebug::operator<<(window);
+ return info;
+}
#endif
QT_END_NAMESPACE