diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2017-12-15 13:27:45 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2017-12-15 13:58:22 +0000 |
commit | 2cacc1c07a1e361bb20411d3f19fdecb3009be12 (patch) | |
tree | f3e077eb6a3948d2127cf29cd95b98cac998c0fb /src/quick/items/qquickitemsmodule.cpp | |
parent | 243b819ff73f6aaa9dc068d43b8b918a98f53663 (diff) |
Add new logging category qt.quick.window.transient
to monitor the increasing number of places from which the transient
parent relationship can be detected; and a debug operator for
QQuickWindow so that these log messages are more useful.
[ChangeLog][QtQuick][QQuickWindow] added logging category
qt.quick.window.transient to check detection of transient windows
declared inside other Items and Windows
Change-Id: Ic899af648765fcdc59b8da7dd1f1bed20db300f2
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Diffstat (limited to 'src/quick/items/qquickitemsmodule.cpp')
-rw-r--r-- | src/quick/items/qquickitemsmodule.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/quick/items/qquickitemsmodule.cpp b/src/quick/items/qquickitemsmodule.cpp index 489b1cbd03..b411e676c2 100644 --- a/src/quick/items/qquickitemsmodule.cpp +++ b/src/quick/items/qquickitemsmodule.cpp @@ -111,6 +111,10 @@ #include <private/qqmlmetatype_p.h> #include <QtQuick/private/qquickaccessibleattached_p.h> +QT_BEGIN_NAMESPACE +Q_DECLARE_LOGGING_CATEGORY(lcTransient) +QT_END_NAMESPACE + static QQmlPrivate::AutoParentResult qquickitem_autoParent(QObject *obj, QObject *parent) { // When setting a parent (especially during dynamic object creation) in QML, @@ -125,6 +129,7 @@ static QQmlPrivate::AutoParentResult qquickitem_autoParent(QObject *obj, QObject QQuickWindow *win = qmlobject_cast<QQuickWindow *>(obj); if (win) { // A Window inside an Item should be transient for that item's window + qCDebug(lcTransient) << win << "is transient for" << parentItem->window(); win->setTransientParent(parentItem->window()); return QQmlPrivate::Parented; } @@ -134,6 +139,7 @@ static QQmlPrivate::AutoParentResult qquickitem_autoParent(QObject *obj, QObject QQuickWindow *win = qmlobject_cast<QQuickWindow *>(obj); if (win) { // A Window inside a Window should be transient for it + qCDebug(lcTransient) << win << "is transient for" << parentWindow; win->setTransientParent(parentWindow); return QQmlPrivate::Parented; } else { |