summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorBradley T. Hughes <bradley.hughes@nokia.com>2012-04-12 12:52:24 +0200
committerQt by Nokia <qt-info@nokia.com>2012-04-17 10:15:44 +0200
commit2afeb072273bf6977b7e1897a1350cfeefa7d1b5 (patch)
treeda7b3d002c0fc17bcfd894b6b631dc78ecb1ead8 /src/gui
parent1bbd9d8ee563c0741f5f0767b24413a863b63d95 (diff)
Add QPlatformWindow::setWindowModified(bool)
Mac OS X provided a platform API for marking a window/document as modified. This previously worked in Qt 4, so we need to have an interface to keep this working in Qt 5. If the platform window does not provide an implementation, fallback to setting the window title. Note that this does not add any QWindow API, it's only in QPlatformWindow. Change-Id: I84c5a5df8536859157f2b1fa9e4cc647a09fd06d Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qplatformwindow_qpa.cpp11
-rw-r--r--src/gui/kernel/qplatformwindow_qpa.h2
2 files changed, 13 insertions, 0 deletions
diff --git a/src/gui/kernel/qplatformwindow_qpa.cpp b/src/gui/kernel/qplatformwindow_qpa.cpp
index b36a2771f3..e07ed78615 100644
--- a/src/gui/kernel/qplatformwindow_qpa.cpp
+++ b/src/gui/kernel/qplatformwindow_qpa.cpp
@@ -311,6 +311,17 @@ bool QPlatformWindow::setMouseGrabEnabled(bool grab)
}
/*!
+ Reimplement to be able to let Qt indicate that the window has been
+ modified. Return true if the native window supports setting the modified
+ flag, false otherwise.
+*/
+bool QPlatformWindow::setWindowModified(bool modified)
+{
+ Q_UNUSED(modified);
+ return false;
+}
+
+/*!
Reimplement this method to be able to do any platform specific event
handling. All events for window() are passed to this function before being
sent to QWindow::event().
diff --git a/src/gui/kernel/qplatformwindow_qpa.h b/src/gui/kernel/qplatformwindow_qpa.h
index 31b14ca97d..aa4d7f5054 100644
--- a/src/gui/kernel/qplatformwindow_qpa.h
+++ b/src/gui/kernel/qplatformwindow_qpa.h
@@ -113,6 +113,8 @@ public:
virtual bool setKeyboardGrabEnabled(bool grab);
virtual bool setMouseGrabEnabled(bool grab);
+ virtual bool setWindowModified(bool modified);
+
virtual void windowEvent(QEvent *event);
protected: