summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qapplication_win.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel/qapplication_win.cpp')
-rw-r--r--src/gui/kernel/qapplication_win.cpp84
1 files changed, 42 insertions, 42 deletions
diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp
index 4ecf299..25288f4 100644
--- a/src/gui/kernel/qapplication_win.cpp
+++ b/src/gui/kernel/qapplication_win.cpp
@@ -1558,13 +1558,13 @@ LRESULT CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam
int index = QApplication::staticMetaObject.indexOfSignal("aboutToQuit()");
qApp->qt_metacall(QMetaObject::InvokeMetaMethod, index,0);
// since the process will be killed immediately quit() has no real effect
- qApp->quit();
+ QApplication::quit();
}
RETURN(0);
}
case WM_DISPLAYCHANGE:
- if (qApp->type() == QApplication::Tty)
+ if (QApplication::type() == QApplication::Tty)
break;
if (qt_desktopWidget) {
qt_desktopWidget->move(GetSystemMetrics(76), GetSystemMetrics(77));
@@ -1590,7 +1590,7 @@ LRESULT CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam
}
#endif
// ignore spurious XP message when user logs in again after locking
- if (qApp->type() == QApplication::Tty)
+ if (QApplication::type() == QApplication::Tty)
break;
if (QApplication::desktopSettingsAware() && wParam != SPI_SETWORKAREA) {
widget = (QETWidget*)QWidget::find(hwnd);
@@ -1613,7 +1613,7 @@ LRESULT CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam
if (wParam == SPI_SETFONTSMOOTHINGTYPE) {
qt_win_read_cleartype_settings();
- foreach (QWidget *w, qApp->topLevelWidgets()) {
+ foreach (QWidget *w, QApplication::topLevelWidgets()) {
if (!w->isVisible())
continue;
((QETWidget *) w)->forceUpdate();
@@ -1622,7 +1622,7 @@ LRESULT CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam
break;
case WM_SYSCOLORCHANGE:
- if (qApp->type() == QApplication::Tty)
+ if (QApplication::type() == QApplication::Tty)
break;
if (QApplication::desktopSettingsAware()) {
widget = (QETWidget*)QWidget::find(hwnd);
@@ -1674,7 +1674,7 @@ LRESULT CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam
RETURN(res);
if (qt_is_translatable_mouse_event(message)) {
- if (qApp->activePopupWidget() != 0) { // in popup mode
+ if (QApplication::activePopupWidget() != 0) { // in popup mode
POINT curPos = msg.pt;
QWidget* w = QApplication::widgetAt(curPos.x, curPos.y);
if (w)
@@ -1684,9 +1684,9 @@ LRESULT CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam
if (!qt_tabletChokeMouse) {
result = widget->translateMouseEvent(msg); // mouse event
#if defined(Q_WS_WINCE) && !defined(QT_NO_CONTEXTMENU)
- if (message == WM_LBUTTONDOWN && widget != qApp->activePopupWidget()) {
+ if (message == WM_LBUTTONDOWN && widget != QApplication::activePopupWidget()) {
QWidget* alienWidget = widget;
- if ((alienWidget != qApp->activePopupWidget()) && (alienWidget->contextMenuPolicy() != Qt::PreventContextMenu)) {
+ if ((alienWidget != QApplication::activePopupWidget()) && (alienWidget->contextMenuPolicy() != Qt::PreventContextMenu)) {
QPoint pos(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
QPoint globalPos(msg.pt.x, msg.pt.y);
// In case we are using Alien, then the widget to
@@ -1705,8 +1705,8 @@ LRESULT CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam
shrg.dwFlags = SHRG_RETURNCMD | SHRG_NOANIMATION;
resolveAygLibs();
if (ptrRecognizeGesture && (ptrRecognizeGesture(&shrg) == GN_CONTEXTMENU)) {
- if (qApp->activePopupWidget())
- qApp->activePopupWidget()->close();
+ if (QApplication::activePopupWidget())
+ QApplication::activePopupWidget()->close();
QContextMenuEvent e(QContextMenuEvent::Mouse, pos, globalPos);
result = qt_sendSpontaneousEvent(alienWidget, &e);
}
@@ -1787,7 +1787,7 @@ LRESULT CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam
widget = (QETWidget*)QApplication::activePopupWidget()->focusWidget()
? (QETWidget*)QApplication::activePopupWidget()->focusWidget()
: (QETWidget*)QApplication::activePopupWidget();
- else if (qApp->focusWidget())
+ else if (QApplication::focusWidget())
widget = (QETWidget*)QApplication::focusWidget();
else if (!widget || widget->internalWinId() == GetFocus()) // We faked the message to go to exactly that widget.
widget = (QETWidget*)widget->window();
@@ -1910,8 +1910,8 @@ LRESULT CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam
QWidget *g = QWidget::keyboardGrabber();
if (g)
widget = (QETWidget*)g;
- else if (qApp->focusWidget())
- widget = (QETWidget*)qApp->focusWidget();
+ else if (QApplication::focusWidget())
+ widget = (QETWidget*)QApplication::focusWidget();
else
widget = (QETWidget*)widget->window();
if (widget->isEnabled()) {
@@ -2026,7 +2026,7 @@ LRESULT CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam
}
case WM_SETTINGCHANGE:
- if ( qApp->type() == QApplication::Tty )
+ if ( QApplication::type() == QApplication::Tty )
break;
if (!msg.wParam) {
@@ -2039,7 +2039,7 @@ LRESULT CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam
}
}
else if (msg.wParam == SPI_SETICONTITLELOGFONT) {
- if (qApp->desktopSettingsAware()) {
+ if (QApplication::desktopSettingsAware()) {
widget = (QETWidget*)QWidget::find(hwnd);
if (widget && !widget->parentWidget()) {
qt_set_windows_font_resources();
@@ -2082,7 +2082,7 @@ LRESULT CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam
break;
case WM_ACTIVATE:
- if ( qApp->type() == QApplication::Tty )
+ if ( QApplication::type() == QApplication::Tty )
break;
if (ptrWTOverlap && ptrWTEnable) {
@@ -2311,12 +2311,12 @@ LRESULT CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam
QWidget *fw = QWidget::keyboardGrabber();
if (!fw) {
- if (qApp->activePopupWidget())
- fw = (qApp->activePopupWidget()->focusWidget()
- ? qApp->activePopupWidget()->focusWidget()
- : qApp->activePopupWidget());
- else if (qApp->focusWidget())
- fw = qApp->focusWidget();
+ if (QApplication::activePopupWidget())
+ fw = (QApplication::activePopupWidget()->focusWidget()
+ ? QApplication::activePopupWidget()->focusWidget()
+ : QApplication::activePopupWidget());
+ else if (QApplication::focusWidget())
+ fw = QApplication::focusWidget();
else if (widget)
fw = widget->window();
}
@@ -2333,7 +2333,7 @@ LRESULT CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam
case WM_IME_STARTCOMPOSITION:
case WM_IME_ENDCOMPOSITION:
case WM_IME_COMPOSITION: {
- QWidget *fw = qApp->focusWidget();
+ QWidget *fw = QApplication::focusWidget();
QWinInputContext *im = fw ? qobject_cast<QWinInputContext *>(fw->inputContext()) : 0;
if (fw && im) {
if(message == WM_IME_STARTCOMPOSITION)
@@ -2366,7 +2366,7 @@ LRESULT CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam
case WM_GETOBJECT:
{
// Ignoring all requests while starting up
- if (qApp->startingUp() || qApp->closingDown() || (DWORD)lParam != OBJID_CLIENT) {
+ if (QApplication::startingUp() || QApplication::closingDown() || (DWORD)lParam != OBJID_CLIENT) {
result = false;
break;
}
@@ -2466,7 +2466,7 @@ LRESULT CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam
case WM_KILLFOCUS:
if (!QWidget::find((HWND)wParam)) { // we don't get focus, so unset it now
if (!widget->hasFocus()) // work around Windows bug after minimizing/restoring
- widget = (QETWidget*)qApp->focusWidget();
+ widget = (QETWidget*)QApplication::focusWidget();
HWND focus = ::GetFocus();
//if there is a current widget and the new widget belongs to the same toplevel window
//or if the current widget was embedded into non-qt window (i.e. we won't get WM_ACTIVATEAPP)
@@ -2485,16 +2485,16 @@ LRESULT CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam
}
break;
case WM_THEMECHANGED:
- if ((widget->windowType() == Qt::Desktop) || !qApp || qApp->closingDown()
- || qApp->type() == QApplication::Tty)
+ if ((widget->windowType() == Qt::Desktop) || !qApp || QApplication::closingDown()
+ || QApplication::type() == QApplication::Tty)
break;
if (widget->testAttribute(Qt::WA_WState_Polished))
- qApp->style()->unpolish(widget);
+ QApplication::style()->unpolish(widget);
if (widget->testAttribute(Qt::WA_WState_Polished))
- qApp->style()->polish(widget);
- widget->repolishStyle(*qApp->style());
+ QApplication::style()->polish(widget);
+ widget->repolishStyle(*QApplication::style());
if (widget->isVisible())
widget->update();
break;
@@ -2783,9 +2783,9 @@ void QApplicationPrivate::openPopup(QWidget *popup)
if (popup->focusWidget()) {
popup->focusWidget()->setFocus(Qt::PopupFocusReason);
} else if (QApplicationPrivate::popupWidgets->count() == 1) { // this was the first popup
- if (QWidget *fw = q_func()->focusWidget()) {
+ if (QWidget *fw = QApplication::focusWidget()) {
QFocusEvent e(QEvent::FocusOut, Qt::PopupFocusReason);
- q_func()->sendEvent(fw, &e);
+ QApplication::sendEvent(fw, &e);
}
}
}
@@ -2812,13 +2812,13 @@ void QApplicationPrivate::closePopup(QWidget *popup)
if (!qt_nograb()) // grabbing not disabled
releaseAutoCapture();
QWidget *fw = QApplicationPrivate::active_window ? QApplicationPrivate::active_window->focusWidget()
- : q_func()->focusWidget();
+ : QApplication::focusWidget();
if (fw) {
- if (fw != q_func()->focusWidget()) {
+ if (fw != QApplication::focusWidget()) {
fw->setFocus(Qt::PopupFocusReason);
} else {
QFocusEvent e(QEvent::FocusIn, Qt::PopupFocusReason);
- q_func()->sendEvent(fw, &e);
+ QApplication::sendEvent(fw, &e);
}
}
} else {
@@ -3082,7 +3082,7 @@ bool QETWidget::translateMouseEvent(const MSG &msg)
HWND id = effectiveWinId();
QWidget *mouseGrabber = QWidget::mouseGrabber();
- QWidget *activePopupWidget = qApp->activePopupWidget();
+ QWidget *activePopupWidget = QApplication::activePopupWidget();
if (mouseGrabber) {
if (!activePopupWidget || (activePopupWidget == this && !rect().contains(widgetPos)))
id = mouseGrabber->effectiveWinId();
@@ -3175,7 +3175,7 @@ bool QETWidget::translateMouseEvent(const MSG &msg)
return false;
replayPopupMouseEvent = false;
- QWidget* activePopupWidget = qApp->activePopupWidget();
+ QWidget* activePopupWidget = QApplication::activePopupWidget();
QWidget *target = activePopupWidget;
const QPoint globalPos(gpos.x, gpos.y);
@@ -3233,7 +3233,7 @@ bool QETWidget::translateMouseEvent(const MSG &msg)
}
if (type == QEvent::MouseButtonPress
- && qApp->activePopupWidget() != activePopupWidget
+ && QApplication::activePopupWidget() != activePopupWidget
&& replayPopupMouseEvent) {
// the popup dissappeared. Replay the event
QWidget* w = QApplication::widgetAt(gpos.x, gpos.y);
@@ -3250,7 +3250,7 @@ bool QETWidget::translateMouseEvent(const MSG &msg)
winPostMessage(hwndTarget, msg.message, msg.wParam, lParam);
}
} else if (type == QEvent::MouseButtonRelease && button == Qt::RightButton
- && qApp->activePopupWidget() == activePopupWidget) {
+ && QApplication::activePopupWidget() == activePopupWidget) {
// popup still alive and received right-button-release
#if !defined(QT_NO_CONTEXTMENU)
QContextMenuEvent e2(QContextMenuEvent::Mouse, pos, globalPos,
@@ -3360,7 +3360,7 @@ bool QETWidget::translateWheelEvent(const MSG &msg)
// send the event to the widget or its ancestors
{
- QWidget* popup = qApp->activePopupWidget();
+ QWidget* popup = QApplication::activePopupWidget();
if (popup && w->window() != popup)
popup->close();
#ifndef QT_NO_WHEELEVENT
@@ -3376,8 +3376,8 @@ bool QETWidget::translateWheelEvent(const MSG &msg)
}
// send the event to the widget that has the focus or its ancestors, if different
- if (w != qApp->focusWidget() && (w = qApp->focusWidget())) {
- QWidget* popup = qApp->activePopupWidget();
+ if (w != QApplication::focusWidget() && (w = QApplication::focusWidget())) {
+ QWidget* popup = QApplication::activePopupWidget();
if (popup && w->window() != popup)
popup->close();
#ifndef QT_NO_WHEELEVENT