summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwindow_p.h
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2021-09-03 15:06:59 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2021-09-17 14:56:19 +0200
commit28b14b966fe8535d7a81914b70759546b694e31b (patch)
tree707f4b0702242cf4a7e01e5003d9772e8bb1a703 /src/gui/kernel/qwindow_p.h
parent1b0cb842129616d67ddf279e7e900fcdf433e390 (diff)
Deduplicate maybeQuitOnLastWindowClosed handling
The functionality now lives in QGuiApplication, and is triggered by QGuiApplication and QApplication after dispatching the close event to the window. The slight difference between how a Qt GUI and Qt Widget app determines if a window should contribute to the close-on-quit behavior has been abstracted into a QWindowPrivate helper. The additional checks that were in place for skipping out of the whole maybeQuitOnLastWindowClosed machinery have been kept. Task-number: QTBUG-53286 Change-Id: I81bd474755f9adb3a2b082621e5ecaa1c4726808 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/gui/kernel/qwindow_p.h')
-rw-r--r--src/gui/kernel/qwindow_p.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/kernel/qwindow_p.h b/src/gui/kernel/qwindow_p.h
index fef8b4ca72..3eeafeff86 100644
--- a/src/gui/kernel/qwindow_p.h
+++ b/src/gui/kernel/qwindow_p.h
@@ -81,7 +81,6 @@ public:
void init(QScreen *targetScreen = nullptr);
- void maybeQuitOnLastWindowClosed();
#ifndef QT_NO_CURSOR
void setCursor(const QCursor *c = nullptr);
bool applyCursor();
@@ -119,6 +118,9 @@ public:
virtual void processSafeAreaMarginsChanged() {}
+ virtual bool shouldTriggerQuitOnClose() const;
+ virtual bool shouldCancelQuitOnClose() const;
+
bool isPopup() const { return (windowFlags & Qt::WindowType_Mask) == Qt::Popup; }
void setAutomaticPositionAndResizeEnabled(bool a)
{ positionAutomatic = resizeAutomatic = a; }