diff options
Diffstat (limited to 'src/gui/kernel/qwindow.cpp')
-rw-r--r-- | src/gui/kernel/qwindow.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index 19bd947c2c..8ec74fdf31 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -2147,6 +2147,26 @@ void QWindowPrivate::maybeQuitOnLastWindowClosed() } +QWindow *QWindowPrivate::topLevelWindow() const +{ + Q_Q(const QWindow); + + QWindow *window = const_cast<QWindow *>(q); + + while (window) { + QWindow *parent = window->parent(); + if (!parent) + parent = window->transientParent(); + + if (!parent) + break; + + window = parent; + } + + return window; +} + /*! Creates a local representation of a window created by another process or by using native libraries below Qt. |