diff options
author | Lars Knoll <lars.knoll@nokia.com> | 2012-04-16 12:04:34 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@nokia.com> | 2012-04-16 12:04:34 +0200 |
commit | 9bd032355163d92cda5e7e59ecd21214b131f187 (patch) | |
tree | 002fa12558505683143c7eb08949a3d225bf0712 /src/plugins/platforms/windows/qwindowswindow.cpp | |
parent | d037d25c3d5236623371cf051aaf6a9e59792ba7 (diff) | |
parent | 41673c45dde2eb95ee21dd918235218399f2be2c (diff) |
Merge remote-tracking branch 'origin/master' into api_changes
Conflicts:
configure
src/corelib/io/qurl.cpp
src/gui/kernel/qwindow.cpp
src/tools/moc/generator.cpp
src/widgets/kernel/qwidget_qpa.cpp
src/widgets/styles/qstyle.h
src/widgets/widgets/qtabbar.cpp
tests/auto/corelib/codecs/utf8/tst_utf8.cpp
Change-Id: Ia457228d6f684ec8184e13e8fcc9d25857b1751e
Diffstat (limited to 'src/plugins/platforms/windows/qwindowswindow.cpp')
-rw-r--r-- | src/plugins/platforms/windows/qwindowswindow.cpp | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 6ff854805c..38a44e2b5a 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -704,8 +704,11 @@ void QWindowsWindow::setVisible(bool visible) if (m_data.hwnd) { if (visible) { show_sys(); + QWindowSystemInterface::handleSynchronousExposeEvent(window(), + QRect(QPoint(), geometry().size())); } else { hide_sys(); + QWindowSystemInterface::handleSynchronousExposeEvent(window(), QRegion()); } } } @@ -1191,6 +1194,22 @@ void QWindowsWindow::lower() SetWindowPos(m_data.hwnd, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE); } +void QWindowsWindow::windowEvent(QEvent *event) +{ + switch (event->type()) { + case QEvent::WindowBlocked: // Blocked by another modal window. + setEnabled(false); + setFlag(BlockedByModal); + break; + case QEvent::WindowUnblocked: + setEnabled(true); + clearFlag(BlockedByModal); + break; + default: + break; + } +} + void QWindowsWindow::propagateSizeHints() { if (QWindowsContext::verboseWindows) @@ -1351,6 +1370,50 @@ QWindowsWindow *QWindowsWindow::childAt(const QPoint &clientPoint, unsigned cwex return 0; } +void QWindowsWindow::alertWindow(int durationMs) +{ + DWORD timeOutMs = GetCaretBlinkTime(); + if (!timeOutMs || timeOutMs == INFINITE) + timeOutMs = 250; + + FLASHWINFO info; + info.cbSize = sizeof(info); + info.hwnd = m_data.hwnd; + info.dwFlags = FLASHW_TRAY; + info.dwTimeout = timeOutMs; + info.uCount = durationMs == 0 ? 10 : durationMs / timeOutMs; + FlashWindowEx(&info); +} + +void QWindowsWindow::stopAlertWindow() +{ + FLASHWINFO info; + info.cbSize = sizeof(info); + info.hwnd = m_data.hwnd; + info.dwFlags = FLASHW_STOP; + info.dwTimeout = 0; + info.uCount = 0; + FlashWindowEx(&info); +} + +bool QWindowsWindow::isEnabled() const +{ + return (style() & WS_DISABLED) == 0; +} + +void QWindowsWindow::setEnabled(bool enabled) +{ + const unsigned oldStyle = style(); + unsigned newStyle = oldStyle; + if (enabled) { + newStyle &= ~WS_DISABLED; + } else { + newStyle |= WS_DISABLED; + } + if (newStyle != oldStyle) + setStyle(newStyle); +} + QByteArray QWindowsWindow::debugWindowFlags(Qt::WindowFlags wf) { const int iwf = int(wf); |