diff options
author | Mikolaj Boc <mikolaj.boc@qt.io> | 2022-09-13 17:10:06 +0200 |
---|---|---|
committer | Mikolaj Boc <mikolaj.boc@qt.io> | 2022-09-20 16:34:57 +0200 |
commit | b4780f1990e3e8408c57f44572ba7fbcf8054007 (patch) | |
tree | d2b69e7b93a1e06a37ede8e95c1f8f95ee0c4c1e /src/widgets/kernel/qapplication_p.h | |
parent | de560476208d43cf4dbfff45fcd8c6f6847e0631 (diff) |
Get rid of copypasted code between isWindowBlocked's overrides
The code in QGuiApplication::isWindowBlocked and
QApplication::isWindowBlocked is very similar, a result of copying and
pasting. Due to the copying it is difficult to modify the code and the
implementation is hard to comprehend, too.
There are ultimately only two parts that are different. First is that
QApplication's override may also specify a certain window as
non-blockable if it is a popup window. Second, default modality is
computed in QApplication if a modal window does not have one assigned.
The differing parts have been extracted following the template method
design pattern.
Pick-to: 6.4
Change-Id: I3b9aa206a3c7211fe022730943bf6f76aa5ae6d2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/widgets/kernel/qapplication_p.h')
-rw-r--r-- | src/widgets/kernel/qapplication_p.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/widgets/kernel/qapplication_p.h b/src/widgets/kernel/qapplication_p.h index 6d80201d62..4be35320d9 100644 --- a/src/widgets/kernel/qapplication_p.h +++ b/src/widgets/kernel/qapplication_p.h @@ -84,7 +84,8 @@ public: #endif //modality - bool isWindowBlocked(QWindow *window, QWindow **blockingWindow = nullptr) const override; + Qt::WindowModality defaultModality() const override; + bool windowNeverBlocked(QWindow *window) const override; static bool isBlockedByModal(QWidget *widget); static bool modalState(); static bool tryModalHelper(QWidget *widget, QWidget **rettop = nullptr); |