diff options
author | Friedemann Kleint <Friedemann.Kleint@digia.com> | 2013-04-10 13:55:50 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-04-19 20:10:46 +0200 |
commit | da01deb0ac01b37656e021b9d5d696c5de7b0afb (patch) | |
tree | 6a689d5cddc689bc83c6a74c8dc5ef0f48359b64 /src/plugins/platforms/windows | |
parent | 926086b9e37d45d09d5ce7d632a07583b40a8f70 (diff) |
Implement alertion state for windows.
Add QWindow::alert() and QPlatformWindow::setAlertState().
Add logic to clear alertion state when the window becomes
active. The platform plugins then only need to implement a setter
and a cheap getter and need not handle activation.
Prototypically implement X11 and Windows.
Task-number: QTBUG-30416
Change-Id: Ia70c4722d812462a21f4034b7d52735c9f2bc49c
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Diffstat (limited to 'src/plugins/platforms/windows')
-rw-r--r-- | src/plugins/platforms/windows/qwindowswindow.cpp | 13 | ||||
-rw-r--r-- | src/plugins/platforms/windows/qwindowswindow.h | 5 |
2 files changed, 17 insertions, 1 deletions
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 9b2b67619d..2a5e08cf41 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -1802,6 +1802,19 @@ QWindowsWindow *QWindowsWindow::childAt(const QPoint &clientPoint, unsigned cwex } #ifndef Q_OS_WINCE +void QWindowsWindow::setAlertState(bool enabled) +{ + if (isAlertState() == enabled) + return; + if (enabled) { + alertWindow(0); + setFlag(AlertState); + } else { + stopAlertWindow(); + clearFlag(AlertState); + } +} + void QWindowsWindow::alertWindow(int durationMs) { DWORD timeOutMs = GetCaretBlinkTime(); diff --git a/src/plugins/platforms/windows/qwindowswindow.h b/src/plugins/platforms/windows/qwindowswindow.h index 1148440f05..2117ca50b8 100644 --- a/src/plugins/platforms/windows/qwindowswindow.h +++ b/src/plugins/platforms/windows/qwindowswindow.h @@ -132,7 +132,8 @@ public: SynchronousGeometryChangeEvent = 0x400, WithinSetStyle = 0x800, WithinDestroy = 0x1000, - TouchRegistered = 0x2000 + TouchRegistered = 0x2000, + AlertState = 0x4000 }; struct WindowData @@ -255,6 +256,8 @@ public: void setWindowIcon(const QIcon &icon); #ifndef Q_OS_WINCE + void setAlertState(bool enabled); + bool isAlertState() const { return testFlag(AlertState); } void alertWindow(int durationMs = 0); void stopAlertWindow(); #endif |