diff options
Diffstat (limited to 'src/gui')
47 files changed, 178 insertions, 180 deletions
diff --git a/src/gui/accessible/qaccessible_win.cpp b/src/gui/accessible/qaccessible_win.cpp index f287874..6195451 100644 --- a/src/gui/accessible/qaccessible_win.cpp +++ b/src/gui/accessible/qaccessible_win.cpp @@ -270,9 +270,9 @@ void QAccessible::updateAccessibility(QObject *o, int who, Event reason) if (!w) { if (reason != QAccessible::ContextHelpStart && reason != QAccessible::ContextHelpEnd) - w = qApp->focusWidget(); + w = QApplication::focusWidget(); if (!w) { - w = qApp->activeWindow(); + w = QApplication::activeWindow(); if (!w) return; diff --git a/src/gui/accessible/qaccessibleobject.cpp b/src/gui/accessible/qaccessibleobject.cpp index 7df097b..0c710f0 100644 --- a/src/gui/accessible/qaccessibleobject.cpp +++ b/src/gui/accessible/qaccessibleobject.cpp @@ -212,7 +212,7 @@ QAccessibleApplication::QAccessibleApplication() static QWidgetList topLevelWidgets() { QWidgetList list; - const QWidgetList tlw(qApp->topLevelWidgets()); + const QWidgetList tlw(QApplication::topLevelWidgets()); for (int i = 0; i < tlw.count(); ++i) { QWidget *w = tlw.at(i); if (!(w->windowType() == Qt::Popup) && !(w->windowType() == Qt::Desktop)) @@ -308,7 +308,7 @@ int QAccessibleApplication::navigate(RelationFlag relation, int entry, } break; case FocusChild: - targetObject = qApp->activeWindow(); + targetObject = QApplication::activeWindow(); break; default: break; @@ -322,11 +322,11 @@ QString QAccessibleApplication::text(Text t, int) const { switch (t) { case Name: - if (qApp->activeWindow()) - return qApp->activeWindow()->windowTitle(); + if (QApplication::activeWindow()) + return QApplication::activeWindow()->windowTitle(); break; case Description: - return qApp->applicationFilePath(); + return QApplication::applicationFilePath(); default: break; } @@ -342,7 +342,7 @@ QAccessible::Role QAccessibleApplication::role(int) const /*! \reimp */ QAccessible::State QAccessibleApplication::state(int) const { - return qApp->activeWindow() ? Focused : Normal; + return QApplication::activeWindow() ? Focused : Normal; } /*! \reimp */ @@ -356,7 +356,7 @@ bool QAccessibleApplication::doAction(int action, int child, const QVariantList { if (action == 0 || action == 1) { QWidget *w = 0; - w = qApp->activeWindow(); + w = QApplication::activeWindow(); if (!w) w = topLevelWidgets().at(0); if (!w) diff --git a/src/gui/dialogs/qcolordialog.cpp b/src/gui/dialogs/qcolordialog.cpp index dc7e3cc..8299381 100644 --- a/src/gui/dialogs/qcolordialog.cpp +++ b/src/gui/dialogs/qcolordialog.cpp @@ -1375,7 +1375,7 @@ void QColorDialogPrivate::init(const QColor &initial) #else // small displays (e.g. PDAs) cannot fit the full color dialog, // so just use the color picker. - smallDisplay = (qApp->desktop()->width() < 480 || qApp->desktop()->height() < 350); + smallDisplay = (QApplication::desktop()->width() < 480 || QApplication::desktop()->height() < 350); const int lumSpace = topLay->spacing() / 2; #endif diff --git a/src/gui/dialogs/qerrormessage.cpp b/src/gui/dialogs/qerrormessage.cpp index ca39d31..d24d348 100644 --- a/src/gui/dialogs/qerrormessage.cpp +++ b/src/gui/dialogs/qerrormessage.cpp @@ -300,7 +300,7 @@ QErrorMessage * QErrorMessage::qtHandler() if (!qtMessageHandler) { qtMessageHandler = new QErrorMessage(0); qAddPostRoutine(deleteStaticcQErrorMessage); // clean up - qtMessageHandler->setWindowTitle(qApp->applicationName()); + qtMessageHandler->setWindowTitle(QApplication::applicationName()); qInstallMsgHandler(jump); } return qtMessageHandler; diff --git a/src/gui/dialogs/qfiledialog_win.cpp b/src/gui/dialogs/qfiledialog_win.cpp index 75a1820..4e818be 100644 --- a/src/gui/dialogs/qfiledialog_win.cpp +++ b/src/gui/dialogs/qfiledialog_win.cpp @@ -206,7 +206,7 @@ static OPENFILENAMEA *qt_win_make_OFNA(QWidget *parent, if (parent) parent = parent->window(); else - parent = qApp->activeWindow(); + parent = QApplication::activeWindow(); aTitle = title.toLocal8Bit(); aInitDir = QDir::toNativeSeparators(initialDirectory).toLocal8Bit(); @@ -279,7 +279,7 @@ static OPENFILENAME* qt_win_make_OFN(QWidget *parent, if (parent) parent = parent->window(); else - parent = qApp->activeWindow(); + parent = QApplication::activeWindow(); tInitDir = QDir::toNativeSeparators(initialDirectory); tFilters = filters; @@ -692,7 +692,7 @@ QString qt_win_get_existing_directory(const QFileDialogArgs &args) if (parent) parent = parent->window(); else - parent = qApp->activeWindow(); + parent = QApplication::activeWindow(); if (parent) parent->createWinId(); diff --git a/src/gui/dialogs/qfilesystemmodel.cpp b/src/gui/dialogs/qfilesystemmodel.cpp index 2c47116..603789e 100644 --- a/src/gui/dialogs/qfilesystemmodel.cpp +++ b/src/gui/dialogs/qfilesystemmodel.cpp @@ -1407,7 +1407,7 @@ void QFileSystemModel::setIconProvider(QFileIconProvider *provider) { Q_D(QFileSystemModel); d->fileInfoGatherer.setIconProvider(provider); - qApp->processEvents(); + QApplication::processEvents(); d->root.updateIcon(provider, QString()); } diff --git a/src/gui/dialogs/qmessagebox.cpp b/src/gui/dialogs/qmessagebox.cpp index c526c7d..1fefb67 100644 --- a/src/gui/dialogs/qmessagebox.cpp +++ b/src/gui/dialogs/qmessagebox.cpp @@ -332,7 +332,7 @@ void QMessageBoxPrivate::updateSize() label->setSizePolicy(policy); } - QFontMetrics fm(qApp->font("QWorkspaceTitleBar")); + QFontMetrics fm(QApplication::font("QWorkspaceTitleBar")); int windowTitleWidth = qMin(fm.width(q->windowTitle()) + 50, hardLimit); if (windowTitleWidth > width) width = windowTitleWidth; @@ -361,7 +361,7 @@ void QMessageBoxPrivate::hideSpecial() QPushButton *pb = list.at(i); QString text = pb->text(); text.remove(QChar::fromLatin1('&')); - if (text == qApp->translate("QMessageBox", "OK" )) + if (text == QApplication::translate("QMessageBox", "OK" )) pb->setFixedSize(0,0); } } @@ -1208,8 +1208,8 @@ bool QMessageBox::event(QEvent *e) case QEvent::HelpRequest: { QString bName = (e->type() == QEvent::OkRequest) - ? qApp->translate("QMessageBox", "OK") - : qApp->translate("QMessageBox", "Help"); + ? QApplication::translate("QMessageBox", "OK") + : QApplication::translate("QMessageBox", "Help"); QList<QPushButton*> list = qFindChildren<QPushButton*>(this); for (int i=0; i<list.size(); ++i) { QPushButton *pb = list.at(i); @@ -1322,7 +1322,7 @@ void QMessageBox::keyPressEvent(QKeyEvent *e) } textToCopy += buttonTexts + separator; - qApp->clipboard()->setText(textToCopy); + QApplication::clipboard()->setText(textToCopy); return; } #endif //QT_NO_SHORTCUT QT_NO_CLIPBOARD Q_OS_WIN diff --git a/src/gui/dialogs/qpagesetupdialog_win.cpp b/src/gui/dialogs/qpagesetupdialog_win.cpp index 4bb571c..2c74ed2 100644 --- a/src/gui/dialogs/qpagesetupdialog_win.cpp +++ b/src/gui/dialogs/qpagesetupdialog_win.cpp @@ -98,7 +98,7 @@ int QPageSetupDialog::exec() psd.hDevNames = tempDevNames; QWidget *parent = parentWidget(); - parent = parent ? parent->window() : qApp->activeWindow(); + parent = parent ? parent->window() : QApplication::activeWindow(); Q_ASSERT(!parent ||parent->testAttribute(Qt::WA_WState_Created)); psd.hwndOwner = parent ? parent->winId() : 0; diff --git a/src/gui/dialogs/qprintdialog_win.cpp b/src/gui/dialogs/qprintdialog_win.cpp index 936d1ed..2561227 100644 --- a/src/gui/dialogs/qprintdialog_win.cpp +++ b/src/gui/dialogs/qprintdialog_win.cpp @@ -225,7 +225,7 @@ int QPrintDialogPrivate::openWindowsPrintDialogModally() if (parent) parent = parent->window(); else - parent = qApp->activeWindow(); + parent = QApplication::activeWindow(); QWidget modal_widget; modal_widget.setAttribute(Qt::WA_NoChildEventsForParent, true); diff --git a/src/gui/dialogs/qprogressdialog.cpp b/src/gui/dialogs/qprogressdialog.cpp index 66a1285..b68a0a72 100644 --- a/src/gui/dialogs/qprogressdialog.cpp +++ b/src/gui/dialogs/qprogressdialog.cpp @@ -643,7 +643,7 @@ void QProgressDialog::setValue(int progress) if (d->shown_once) { if (isModal()) - qApp->processEvents(); + QApplication::processEvents(); } else { if (progress == 0) { d->starttime.start(); diff --git a/src/gui/dialogs/qwizard.cpp b/src/gui/dialogs/qwizard.cpp index b2ed983..7fc8a63 100644 --- a/src/gui/dialogs/qwizard.cpp +++ b/src/gui/dialogs/qwizard.cpp @@ -377,7 +377,7 @@ void QWizardHeader::setup(const QWizardLayoutInfo &info, const QString &title, /* There is no widthForHeight() function, so we simulate it with a loop. */ - int candidateSubTitleWidth = qMin(512, 2 * qApp->desktop()->width() / 3); + int candidateSubTitleWidth = qMin(512, 2 * QApplication::desktop()->width() / 3); int delta = candidateSubTitleWidth >> 1; while (delta > 0) { if (subTitleLabel->heightForWidth(candidateSubTitleWidth - delta) diff --git a/src/gui/dialogs/qwizard_win.cpp b/src/gui/dialogs/qwizard_win.cpp index 8aad4af..e0aaa19 100644 --- a/src/gui/dialogs/qwizard_win.cpp +++ b/src/gui/dialogs/qwizard_win.cpp @@ -279,7 +279,7 @@ QVistaHelper::VistaState QVistaHelper::vistaState() QColor QVistaHelper::basicWindowFrameColor() { DWORD rgb; - HANDLE hTheme = pOpenThemeData(qApp->desktop()->winId(), L"WINDOW"); + HANDLE hTheme = pOpenThemeData(QApplication::desktop()->winId(), L"WINDOW"); pGetThemeColor( hTheme, WIZ_WP_CAPTION, WIZ_CS_ACTIVE, wizard->isActiveWindow() ? WIZ_TMT_FILLCOLORHINT : WIZ_TMT_BORDERCOLORHINT, @@ -611,7 +611,7 @@ bool QVistaHelper::drawTitleText(QPainter *painter, const QString &text, const Q { bool value = false; if (vistaState() == VistaAero) { - HANDLE hTheme = pOpenThemeData(qApp->desktop()->winId(), L"WINDOW"); + HANDLE hTheme = pOpenThemeData(QApplication::desktop()->winId(), L"WINDOW"); if (!hTheme) return false; // Set up a memory DC and bitmap that we'll draw into HDC dcMem; diff --git a/src/gui/graphicsview/qgraphicsgridlayout.cpp b/src/gui/graphicsview/qgraphicsgridlayout.cpp index 1e21b54..36281f8 100644 --- a/src/gui/graphicsview/qgraphicsgridlayout.cpp +++ b/src/gui/graphicsview/qgraphicsgridlayout.cpp @@ -100,7 +100,7 @@ QLayoutStyleInfo QGraphicsGridLayoutPrivate::styleInfo() const if (!wid) wid = new QWidget; QGraphicsItem *item = parentItem(); - QStyle *style = (item && item->isWidget()) ? static_cast<QGraphicsWidget*>(item)->style() : qApp->style(); + QStyle *style = (item && item->isWidget()) ? static_cast<QGraphicsWidget*>(item)->style() : QApplication::style(); return QLayoutStyleInfo(style, wid); } diff --git a/src/gui/graphicsview/qgraphicslinearlayout.cpp b/src/gui/graphicsview/qgraphicslinearlayout.cpp index 6a2d456..2f32950 100644 --- a/src/gui/graphicsview/qgraphicslinearlayout.cpp +++ b/src/gui/graphicsview/qgraphicslinearlayout.cpp @@ -178,7 +178,7 @@ QLayoutStyleInfo QGraphicsLinearLayoutPrivate::styleInfo() const if (!wid) wid = new QWidget; QGraphicsItem *item = parentItem(); - QStyle *style = (item && item->isWidget()) ? static_cast<QGraphicsWidget*>(item)->style() : qApp->style(); + QStyle *style = (item && item->isWidget()) ? static_cast<QGraphicsWidget*>(item)->style() : QApplication::style(); return QLayoutStyleInfo(style, wid); } diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index e6c3503..1c48675 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -2161,7 +2161,7 @@ void QGraphicsScenePrivate::setFont_helper(const QFont &font) */ void QGraphicsScenePrivate::resolveFont() { - QFont naturalFont = qApp->font(); + QFont naturalFont = QApplication::font(); naturalFont.resolve(0); QFont resolvedFont = font.resolve(naturalFont); updateFont(resolvedFont); @@ -2217,7 +2217,7 @@ void QGraphicsScenePrivate::setPalette_helper(const QPalette &palette) */ void QGraphicsScenePrivate::resolvePalette() { - QPalette naturalPalette = qApp->palette(); + QPalette naturalPalette = QApplication::palette(); naturalPalette.resolve(0); QPalette resolvedPalette = palette.resolve(naturalPalette); updatePalette(resolvedPalette); @@ -3975,10 +3975,10 @@ bool QGraphicsScene::eventFilter(QObject *watched, QEvent *event) switch (event->type()) { case QEvent::ApplicationPaletteChange: - qApp->postEvent(this, new QEvent(QEvent::ApplicationPaletteChange)); + QApplication::postEvent(this, new QEvent(QEvent::ApplicationPaletteChange)); break; case QEvent::ApplicationFontChange: - qApp->postEvent(this, new QEvent(QEvent::ApplicationFontChange)); + QApplication::postEvent(this, new QEvent(QEvent::ApplicationFontChange)); break; default: break; @@ -4918,7 +4918,7 @@ void QGraphicsScenePrivate::drawItemHelper(QGraphicsItem *item, QPainter *painte bool allowPartialCacheExposure = !viewRect.contains(deviceRect); #else // Only if deviceRect is 20% taller or wider than the desktop. - QRect desktopRect = qApp->desktop()->availableGeometry(widget); + QRect desktopRect = QApplication::desktop()->availableGeometry(widget); bool allowPartialCacheExposure = (desktopRect.width() * 1.2 < deviceRect.width() || desktopRect.height() * 1.2 < deviceRect.height()); #endif @@ -5606,7 +5606,7 @@ QStyle *QGraphicsScene::style() const { Q_D(const QGraphicsScene); // ### This function, and the use of styles in general, is non-reentrant. - return d->style ? d->style : qApp->style(); + return d->style ? d->style : QApplication::style(); } /*! @@ -5683,7 +5683,7 @@ QFont QGraphicsScene::font() const void QGraphicsScene::setFont(const QFont &font) { Q_D(QGraphicsScene); - QFont naturalFont = qApp->font(); + QFont naturalFont = QApplication::font(); naturalFont.resolve(0); QFont resolvedFont = font.resolve(naturalFont); d->setFont_helper(resolvedFont); @@ -5720,7 +5720,7 @@ QPalette QGraphicsScene::palette() const void QGraphicsScene::setPalette(const QPalette &palette) { Q_D(QGraphicsScene); - QPalette naturalPalette = qApp->palette(); + QPalette naturalPalette = QApplication::palette(); naturalPalette.resolve(0); QPalette resolvedPalette = palette.resolve(naturalPalette); d->setPalette_helper(resolvedPalette); diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp index f24aeff..7e262b1 100644 --- a/src/gui/image/qicon.cpp +++ b/src/gui/image/qicon.cpp @@ -304,7 +304,7 @@ QPixmap QPixmapIconEngine::pixmap(const QSize &size, QIcon::Mode mode, QIcon::St QString key = QLatin1String("$qt_icon_") + QString::number(pm.cacheKey()) + QString::number(pe->mode) - + QString::number(qApp->palette().cacheKey()) + + QString::number(QApplication::palette().cacheKey()) + QLatin1Char('_') + QString::number(actualSize.width()) + QLatin1Char('_') diff --git a/src/gui/inputmethod/qinputcontext.cpp b/src/gui/inputmethod/qinputcontext.cpp index f78b86a..8db326b 100644 --- a/src/gui/inputmethod/qinputcontext.cpp +++ b/src/gui/inputmethod/qinputcontext.cpp @@ -262,7 +262,7 @@ void QInputContext::sendEvent(const QInputMethodEvent &event) return; QInputMethodEvent e(event); - qApp->sendEvent(focus, &e); + QApplication::sendEvent(focus, &e); } @@ -408,7 +408,7 @@ QList<QAction *> QInputContext::actions() QTextFormat QInputContext::standardFormat(StandardFormat s) const { QWidget *focus = focusWidget(); - const QPalette &pal = focus ? focus->palette() : qApp->palette(); + const QPalette &pal = focus ? focus->palette() : QApplication::palette(); QTextCharFormat fmt; QColor bg; diff --git a/src/gui/inputmethod/qwininputcontext_win.cpp b/src/gui/inputmethod/qwininputcontext_win.cpp index dd966d5..b94c604 100644 --- a/src/gui/inputmethod/qwininputcontext_win.cpp +++ b/src/gui/inputmethod/qwininputcontext_win.cpp @@ -539,7 +539,7 @@ bool QWinInputContext::endComposition() } if (!fw) - fw = qApp->focusWidget(); + fw = QApplication::focusWidget(); if (fw) { QInputMethodEvent e; @@ -637,7 +637,7 @@ bool QWinInputContext::composition(LPARAM lParam) // bogus event return true; - QWidget *fw = qApp->focusWidget(); + QWidget *fw = QApplication::focusWidget(); if (fw) { Q_ASSERT(fw->testAttribute(Qt::WA_WState_Created)); HIMC imc = getContext(fw->effectiveWinId()); diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp index 7890e1f..9effc70 100644 --- a/src/gui/itemviews/qabstractitemview.cpp +++ b/src/gui/itemviews/qabstractitemview.cpp @@ -3784,7 +3784,7 @@ void QAbstractItemViewPrivate::clearOrRemove() void QAbstractItemViewPrivate::checkPersistentEditorFocus() { Q_Q(QAbstractItemView); - if (QWidget *widget = qApp->focusWidget()) { + if (QWidget *widget = QApplication::focusWidget()) { if (persistent.contains(widget)) { //a persistent editor has gained the focus QModelIndex index = indexForEditor(widget); diff --git a/src/gui/itemviews/qcolumnview.cpp b/src/gui/itemviews/qcolumnview.cpp index 1f88f7c..16ae8e9 100644 --- a/src/gui/itemviews/qcolumnview.cpp +++ b/src/gui/itemviews/qcolumnview.cpp @@ -1116,7 +1116,7 @@ void QColumnViewDelegate::paint(QPainter *painter, // Draw > if (index.model()->hasChildren(index)) { const QWidget *view = opt.widget; - QStyle *style = view ? view->style() : qApp->style(); + QStyle *style = view ? view->style() : QApplication::style(); style->drawPrimitive(QStyle::PE_IndicatorColumnViewArrow, &opt, painter, view); } } diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index 4923d23..cbb1f45 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -491,8 +491,6 @@ QWidgetList * qt_modal_stack=0; // stack of modal widgets */ void QApplicationPrivate::process_cmdline() { - Q_Q(QApplication); - Q_UNUSED(q);// only static members being used. // process platform-indep command line if (!qt_is_gui_used || !argc) return; @@ -537,7 +535,7 @@ void QApplicationPrivate::process_cmdline() #endif } else if (qstrcmp(arg, "-reverse") == 0) { force_reverse = true; - q->setLayoutDirection(Qt::RightToLeft); + QApplication::setLayoutDirection(Qt::RightToLeft); } else if (qstrcmp(arg, "-widgetcount") == 0) { widgetCount = true; } else if (arg == "-graphicssystem" && i < argc-1) { @@ -2577,14 +2575,14 @@ void QApplicationPrivate::dispatchEnterLeave(QWidget* enter, QWidget* leave) { QEvent leaveEvent(QEvent::Leave); for (int i = 0; i < leaveList.size(); ++i) { w = leaveList.at(i); - if (!qApp->activeModalWidget() || QApplicationPrivate::tryModalHelper(w, 0)) { + if (!QApplication::activeModalWidget() || QApplicationPrivate::tryModalHelper(w, 0)) { #if defined(Q_WS_WIN) || defined(Q_WS_X11) if (leaveAfterRelease == w) leaveAfterRelease = 0; #endif QApplication::sendEvent(w, &leaveEvent); if (w->testAttribute(Qt::WA_Hover) && - (!qApp->activePopupWidget() || qApp->activePopupWidget() == w->window())) { + (!QApplication::activePopupWidget() || QApplication::activePopupWidget() == w->window())) { Q_ASSERT(instance()); QHoverEvent he(QEvent::HoverLeave, QPoint(-1, -1), w->mapFromGlobal(QApplicationPrivate::instance()->hoverGlobalPos)); qApp->d_func()->notify_helper(w, &he); @@ -2595,10 +2593,10 @@ void QApplicationPrivate::dispatchEnterLeave(QWidget* enter, QWidget* leave) { QEvent enterEvent(QEvent::Enter); for (int i = 0; i < enterList.size(); ++i) { w = enterList.at(i); - if (!qApp->activeModalWidget() || QApplicationPrivate::tryModalHelper(w, 0)) { + if (!QApplication::activeModalWidget() || QApplicationPrivate::tryModalHelper(w, 0)) { QApplication::sendEvent(w, &enterEvent); if (w->testAttribute(Qt::WA_Hover) && - (!qApp->activePopupWidget() || qApp->activePopupWidget() == w->window())) { + (!QApplication::activePopupWidget() || QApplication::activePopupWidget() == w->window())) { QHoverEvent he(QEvent::HoverEnter, w->mapFromGlobal(posEnter), QPoint(-1, -1)); qApp->d_func()->notify_helper(w, &he); } @@ -2672,7 +2670,7 @@ bool QApplicationPrivate::isBlockedByModal(QWidget *widget) widget = widget->window(); if (!modalState()) return false; - if (qApp->activePopupWidget() == widget) + if (QApplication::activePopupWidget() == widget) return false; for (int i = 0; i < qt_modal_stack->size(); ++i) { @@ -2761,7 +2759,7 @@ bool QApplicationPrivate::isBlockedByModal(QWidget *widget) void QApplicationPrivate::enterModal(QWidget *widget) { QSet<QWidget*> blocked; - QList<QWidget*> windows = qApp->topLevelWidgets(); + QList<QWidget*> windows = QApplication::topLevelWidgets(); for (int i = 0; i < windows.count(); ++i) { QWidget *window = windows.at(i); if (window->windowType() != Qt::Tool && isBlockedByModal(window)) @@ -2770,7 +2768,7 @@ void QApplicationPrivate::enterModal(QWidget *widget) enterModal_sys(widget); - windows = qApp->topLevelWidgets(); + windows = QApplication::topLevelWidgets(); QEvent e(QEvent::WindowBlocked); for (int i = 0; i < windows.count(); ++i) { QWidget *window = windows.at(i); @@ -2784,7 +2782,7 @@ void QApplicationPrivate::enterModal(QWidget *widget) void QApplicationPrivate::leaveModal(QWidget *widget) { QSet<QWidget*> blocked; - QList<QWidget*> windows = qApp->topLevelWidgets(); + QList<QWidget*> windows = QApplication::topLevelWidgets(); for (int i = 0; i < windows.count(); ++i) { QWidget *window = windows.at(i); if (window->windowType() != Qt::Tool && isBlockedByModal(window)) @@ -2793,7 +2791,7 @@ void QApplicationPrivate::leaveModal(QWidget *widget) leaveModal_sys(widget); - windows = qApp->topLevelWidgets(); + windows = QApplication::topLevelWidgets(); QEvent e(QEvent::WindowUnblocked); for (int i = 0; i < windows.count(); ++i) { QWidget *window = windows.at(i); @@ -2816,7 +2814,7 @@ bool QApplicationPrivate::tryModalHelper(QWidget *widget, QWidget **rettop) *rettop = top; // the active popup widget always gets the input event - if (qApp->activePopupWidget()) + if (QApplication::activePopupWidget()) return true; #if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA) @@ -2882,7 +2880,7 @@ bool QApplicationPrivate::sendMouseEvent(QWidget *receiver, QMouseEvent *event, QPointer<QWidget> receiverGuard = receiver; QPointer<QWidget> nativeGuard = nativeWidget; QPointer<QWidget> alienGuard = alienWidget; - QPointer<QWidget> activePopupWidget = qApp->activePopupWidget(); + QPointer<QWidget> activePopupWidget = QApplication::activePopupWidget(); const bool graphicsWidget = nativeWidget->testAttribute(Qt::WA_DontShowOnScreen); @@ -3779,7 +3777,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e) QPoint diff = relpos - w->mapFromGlobal(d->hoverGlobalPos); while (w) { if (w->testAttribute(Qt::WA_Hover) && - (!qApp->activePopupWidget() || qApp->activePopupWidget() == w->window())) { + (!QApplication::activePopupWidget() || QApplication::activePopupWidget() == w->window())) { QHoverEvent he(QEvent::HoverMove, relpos, relpos - diff); d->notify_helper(w, &he); } @@ -4038,7 +4036,7 @@ bool QApplicationPrivate::notify_helper(QObject *receiver, QEvent * e) #if !defined(Q_WS_WINCE) || (defined(GWES_ICONCURS) && !defined(QT_NO_CURSOR)) // toggle HasMouse widget state on enter and leave if ((e->type() == QEvent::Enter || e->type() == QEvent::DragEnter) && - (!qApp->activePopupWidget() || qApp->activePopupWidget() == widget->window())) + (!QApplication::activePopupWidget() || QApplication::activePopupWidget() == widget->window())) widget->setAttribute(Qt::WA_UnderMouse, true); else if (e->type() == QEvent::Leave || e->type() == QEvent::DragLeave) widget->setAttribute(Qt::WA_UnderMouse, false); @@ -4568,9 +4566,9 @@ void QSessionManager::requestPhase2() \oldcode app.setWinStyleHighlightColor(color); \newcode - QPalette palette(qApp->palette()); + QPalette palette(QApplication::palette()); palette.setColor(QPalette::Highlight, color); - qApp->setPalette(palette); + QApplication::setPalette(palette); \endcode */ @@ -4589,7 +4587,7 @@ void QSessionManager::requestPhase2() /*! \fn const QColor &QApplication::winStyleHighlightColor() - Use qApp->palette().color(QPalette::Active, QPalette::Highlight) instead. + Use QApplication::palette().color(QPalette::Active, QPalette::Highlight) instead. */ /*! diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp index 8d77c4c..f449141 100644 --- a/src/gui/kernel/qapplication_win.cpp +++ b/src/gui/kernel/qapplication_win.cpp @@ -1526,13 +1526,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)); @@ -1558,7 +1558,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); @@ -1581,7 +1581,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(); @@ -1590,7 +1590,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); @@ -1642,7 +1642,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) @@ -1652,9 +1652,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 @@ -1673,8 +1673,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); } @@ -1752,7 +1752,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(); @@ -1875,8 +1875,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()) { @@ -1991,7 +1991,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) { @@ -2004,7 +2004,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(); @@ -2047,7 +2047,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) { @@ -2276,12 +2276,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(); } @@ -2298,7 +2298,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) @@ -2331,7 +2331,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; } @@ -2431,7 +2431,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) @@ -2450,16 +2450,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; @@ -3047,7 +3047,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(); @@ -3140,7 +3140,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); @@ -3198,7 +3198,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); @@ -3215,7 +3215,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, @@ -3325,7 +3325,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 @@ -3341,8 +3341,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 diff --git a/src/gui/kernel/qcursor.cpp b/src/gui/kernel/qcursor.cpp index 598f4ba..4ffa8fd 100644 --- a/src/gui/kernel/qcursor.cpp +++ b/src/gui/kernel/qcursor.cpp @@ -403,7 +403,7 @@ void QCursorData::initialize() QCursor::QCursor() { if (!QCursorData::initialized) { - if (qApp->startingUp()) { + if (QApplication::startingUp()) { d = 0; return; } diff --git a/src/gui/kernel/qdnd.cpp b/src/gui/kernel/qdnd.cpp index a5092a0..e83a2ae 100644 --- a/src/gui/kernel/qdnd.cpp +++ b/src/gui/kernel/qdnd.cpp @@ -368,7 +368,7 @@ QDragManager::~QDragManager() QDragManager *QDragManager::self() { - if (!instance && qApp && !qApp->closingDown()) + if (!instance && !QApplication::closingDown()) instance = new QDragManager; return instance; } diff --git a/src/gui/kernel/qdnd_win.cpp b/src/gui/kernel/qdnd_win.cpp index 8bf5c84..b8c65e8 100644 --- a/src/gui/kernel/qdnd_win.cpp +++ b/src/gui/kernel/qdnd_win.cpp @@ -549,7 +549,7 @@ QOleDropSource::QueryContinueDrag(BOOL fEscapePressed, DWORD grfKeyState) return ResultFromScode(DRAGDROP_S_DROP); } #endif - qApp->processEvents(); + QApplication::processEvents(); return NOERROR; } } diff --git a/src/gui/kernel/qshortcutmap.cpp b/src/gui/kernel/qshortcutmap.cpp index 3c2fcdd..735fe0f 100644 --- a/src/gui/kernel/qshortcutmap.cpp +++ b/src/gui/kernel/qshortcutmap.cpp @@ -628,13 +628,13 @@ QKeySequence::SequenceMatch QShortcutMap::matches(const QKeySequence &seq1, bool QShortcutMap::correctContext(const QShortcutEntry &item) const { Q_ASSERT_X(item.owner, "QShortcutMap", "Shortcut has no owner. Illegal map state!"); - QWidget *active_window = qApp->activeWindow(); + QWidget *active_window = QApplication::activeWindow(); // popups do not become the active window, // so we fake it here to get the correct context // for the shortcut system. - if (qApp->activePopupWidget()) - active_window = qApp->activePopupWidget(); + if (QApplication::activePopupWidget()) + active_window = QApplication::activePopupWidget(); if (!active_window) return false; diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 230b8f6..7b0bf1e 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -1052,7 +1052,7 @@ void QWidgetPrivate::adjustFlags(Qt::WindowFlags &flags, QWidget *w) void QWidgetPrivate::init(QWidget *parentWidget, Qt::WindowFlags f) { Q_Q(QWidget); - if (qApp->type() == QApplication::Tty) + if (QApplication::type() == QApplication::Tty) qFatal("QWidget: Cannot create a QWidget when no GUI is being used"); Q_ASSERT(uncreatedWidgets); @@ -1345,7 +1345,7 @@ QWidget::~QWidget() #ifdef QT3_SUPPORT if (QApplicationPrivate::main_widget == this) { // reset main widget QApplicationPrivate::main_widget = 0; - qApp->quit(); + QApplication::quit(); } #endif @@ -2034,8 +2034,8 @@ void QWidgetPrivate::deactivateWidgetCleanup() { Q_Q(QWidget); // If this was the active application window, reset it - if (qApp->activeWindow() == q) - qApp->setActiveWindow(0); + if (QApplication::activeWindow() == q) + QApplication::setActiveWindow(0); // If the is the active mouse press widget, reset it if (q == qt_button_down) qt_button_down = 0; @@ -2236,7 +2236,7 @@ QStyle *QWidget::style() const if (d->extra && d->extra->style) return d->extra->style; - return qApp->style(); + return QApplication::style(); } /*! @@ -5372,7 +5372,7 @@ QIcon QWidget::windowIcon() const return *d->extra->topextra->icon; w = w->parentWidget(); } - return qApp->windowIcon(); + return QApplication::windowIcon(); } void QWidgetPrivate::setWindowIcon_helper() @@ -5894,7 +5894,7 @@ QWidget *QWidget::previousInFocusChain() const bool QWidget::isActiveWindow() const { QWidget *tlw = window(); - if(tlw == qApp->activeWindow() || (isVisible() && (tlw->windowType() == Qt::Popup))) + if(tlw == QApplication::activeWindow() || (isVisible() && (tlw->windowType() == Qt::Popup))) return true; #ifndef QT_NO_GRAPHICSVIEW @@ -5915,7 +5915,7 @@ bool QWidget::isActiveWindow() const !tlw->isModal() && (!tlw->parentWidget() || tlw->parentWidget()->isActiveWindow())) return true; - QWidget *w = qApp->activeWindow(); + QWidget *w = QApplication::activeWindow(); while(w && tlw->windowType() == Qt::Tool && !w->isModal() && w->parentWidget()) { w = w->parentWidget()->window(); @@ -7085,7 +7085,7 @@ bool QWidgetPrivate::close_helper(CloseMode mode) #ifdef QT3_SUPPORT if (isMain) - qApp->quit(); + QApplication::quit(); #endif // Attempt to close the application only if this widget has the // WA_QuitOnClose flag set set and has a non-visible parent @@ -7784,7 +7784,7 @@ bool QWidget::event(QEvent *event) QList<QObject*> childList = d->children; for (int i = 0; i < childList.size(); ++i) { QObject *o = childList.at(i); - if (o != qApp->activeModalWidget()) { + if (o != QApplication::activeModalWidget()) { if (qobject_cast<QWidget *>(o) && static_cast<QWidget *>(o)->isWindow()) { // do not forward the event to child windows, // QApplication does this for us @@ -8007,9 +8007,9 @@ void QWidget::mousePressEvent(QMouseEvent *event) if ((windowType() == Qt::Popup)) { event->accept(); QWidget* w; - while ((w = qApp->activePopupWidget()) && w != this){ + while ((w = QApplication::activePopupWidget()) && w != this){ w->close(); - if (qApp->activePopupWidget() == w) // widget does not want to dissappear + if (QApplication::activePopupWidget() == w) // widget does not want to dissappear w->hide(); // hide at least } if (!rect().contains(event->pos())){ diff --git a/src/gui/kernel/qwidget_win.cpp b/src/gui/kernel/qwidget_win.cpp index ea79329..6ad2548 100644 --- a/src/gui/kernel/qwidget_win.cpp +++ b/src/gui/kernel/qwidget_win.cpp @@ -1036,7 +1036,7 @@ void QWidget::setWindowState(Qt::WindowStates newstate) if (isVisible()) style |= WS_VISIBLE; SetWindowLongA(internalWinId(), GWL_STYLE, style); - QRect r = qApp->desktop()->screenGeometry(this); + QRect r = QApplication::desktop()->screenGeometry(this); UINT swpf = SWP_FRAMECHANGED; if (newstate & Qt::WindowActive) swpf |= SWP_NOACTIVATE; @@ -1977,8 +1977,8 @@ public: // in QOnScreenRasterPaintEngine() : QRasterPaintEngine(new QImage(qt_primary_surface_bits, - qApp->desktop()->width(), - qApp->desktop()->height(), + QApplication::desktop()->width(), + QApplication::desktop()->height(), qt_primary_surface_stride, qt_primary_surface_format)) { diff --git a/src/gui/painting/qbackingstore.cpp b/src/gui/painting/qbackingstore.cpp index 0a3a8dd..25dab4c 100644 --- a/src/gui/painting/qbackingstore.cpp +++ b/src/gui/painting/qbackingstore.cpp @@ -758,7 +758,7 @@ void QWidgetBackingStore::paintWindowDecoration() engine->setSystemClip(decorationRegion.translated(tlwOffset)); QPainter painter(windowSurface->paintDevice()); - painter.setFont(qApp->font()); + painter.setFont(QApplication::font()); painter.translate(tlwOffset); const int numDirty = managerPrivate->dirtyRegions.size(); @@ -1347,7 +1347,7 @@ void QWidgetBackingStore::flush(QWidget *widget, QWindowSurface *surface) static inline bool discardInvalidateBufferRequest(QWidget *widget, QTLWExtra *tlwExtra) { Q_ASSERT(widget); - if (qApp && qApp->closingDown()) + if (QApplication::closingDown()) return true; if (!tlwExtra || tlwExtra->inTopLevelResize || !tlwExtra->backingStore) diff --git a/src/gui/styles/qcleanlooksstyle.cpp b/src/gui/styles/qcleanlooksstyle.cpp index 805cd05..aff0af3 100644 --- a/src/gui/styles/qcleanlooksstyle.cpp +++ b/src/gui/styles/qcleanlooksstyle.cpp @@ -4419,7 +4419,7 @@ QIcon QCleanlooksStyle::standardIconImplementation(StandardPixmap standardIcon, { #ifdef Q_WS_X11 Q_D(const QCleanlooksStyle); - if (!qApp->desktopSettingsAware()) + if (!QApplication::desktopSettingsAware()) return QWindowsStyle::standardIconImplementation(standardIcon, option, widget); QIcon icon; QPixmap pixmap; @@ -4588,7 +4588,7 @@ QPixmap QCleanlooksStyle::standardPixmap(StandardPixmap standardPixmap, const QS #ifdef Q_WS_X11 Q_D(const QCleanlooksStyle); QPixmap pixmap; - if (!qApp->desktopSettingsAware()) + if (!QApplication::desktopSettingsAware()) return QWindowsStyle::standardPixmap(standardPixmap, opt, widget); d->lookupIconTheme(); #ifndef QT_NO_IMAGEFORMAT_XPM diff --git a/src/gui/styles/qcommonstyle.cpp b/src/gui/styles/qcommonstyle.cpp index 1285598..74eacf6 100644 --- a/src/gui/styles/qcommonstyle.cpp +++ b/src/gui/styles/qcommonstyle.cpp @@ -3130,7 +3130,7 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt, if (dw->isFloating()) icon = dw->windowIcon(); if (!icon.isNull() - && icon.cacheKey() != qApp->windowIcon().cacheKey()) { + && icon.cacheKey() != QApplication::windowIcon().cacheKey()) { QSize sz = icon.actualSize(QSize(r.height(), r.height())); if (verticalTitleBar) sz.transpose(); @@ -5309,7 +5309,7 @@ QPixmap QCommonStyle::standardPixmap(StandardPixmap sp, const QStyleOption *opti #ifdef Q_WS_X11 Q_D(const QCommonStyle); QPixmap pixmap; - if (qApp->desktopSettingsAware()) { + if (QApplication::desktopSettingsAware()) { d->lookupIconTheme(); switch (sp) { case SP_DirHomeIcon: @@ -5730,7 +5730,7 @@ QIcon QCommonStyle::standardIconImplementation(StandardPixmap standardIcon, cons QIcon icon; #ifdef Q_WS_X11 Q_D(const QCommonStyle); - if (qApp->desktopSettingsAware()) { + if (QApplication::desktopSettingsAware()) { d->lookupIconTheme(); QPixmap pixmap; switch (standardIcon) { diff --git a/src/gui/styles/qstylesheetstyle.cpp b/src/gui/styles/qstylesheetstyle.cpp index fe0e53c..1bbe70e 100644 --- a/src/gui/styles/qstylesheetstyle.cpp +++ b/src/gui/styles/qstylesheetstyle.cpp @@ -867,7 +867,7 @@ static QStyle::StandardPixmap subControlIcon(int pe) QRenderRule::QRenderRule(const QVector<Declaration> &declarations, const QWidget *widget) : features(0), hasFont(false), pal(0), b(0), bg(0), bd(0), ou(0), geo(0), p(0), img(0), clipset(0) { - QPalette palette = qApp->palette(); // ###: ideally widget's palette + QPalette palette = QApplication::palette(); // ###: ideally widget's palette ValueExtractor v(declarations, palette); features = v.extractStyleFeatures(); @@ -2584,7 +2584,7 @@ static void updateWidgets(const QList<const QWidget *>& widgets) continue; widget->style()->polish(widget); QEvent event(QEvent::StyleChange); - qApp->sendEvent(widget, &event); + QApplication::sendEvent(widget, &event); widget->update(); widget->updateGeometry(); } @@ -2630,9 +2630,9 @@ QStyle *QStyleSheetStyle::baseStyle() const { if (base) return base; - if (QStyleSheetStyle *me = qobject_cast<QStyleSheetStyle *>(qApp->style())) + if (QStyleSheetStyle *me = qobject_cast<QStyleSheetStyle *>(QApplication::style())) return me->base; - return qApp->style(); + return QApplication::style(); } void QStyleSheetStyle::widgetDestroyed(QObject *o) diff --git a/src/gui/styles/qwindowsvistastyle.cpp b/src/gui/styles/qwindowsvistastyle.cpp index 013ca1e..9ea9a03 100644 --- a/src/gui/styles/qwindowsvistastyle.cpp +++ b/src/gui/styles/qwindowsvistastyle.cpp @@ -1436,7 +1436,7 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption if (isFloating) { titleRect.adjust(0, -fw, 0, 0); - if (widget != 0 && widget->windowIcon().cacheKey() != qApp->windowIcon().cacheKey()) + if (widget != 0 && widget->windowIcon().cacheKey() != QApplication::windowIcon().cacheKey()) titleRect.adjust(titleRect.height() + mw, 0, 0, 0); } else { titleRect.adjust(mw, 0, 0, 0); @@ -2435,7 +2435,7 @@ void QWindowsVistaStyle::unpolish(QWidget *widget) else if (QTreeView *tree = qobject_cast<QTreeView *> (widget)) { tree->viewport()->setAttribute(Qt::WA_Hover, false); } else if (qobject_cast<QCommandLinkButton*>(widget)) { - QFont font = qApp->font("QCommandLinkButton"); + QFont font = QApplication::font("QCommandLinkButton"); QFont widgetFont = widget->font(); widgetFont.setFamily(font.family()); //Only family set by polish widget->setFont(widgetFont); diff --git a/src/gui/styles/qwindowsxpstyle.cpp b/src/gui/styles/qwindowsxpstyle.cpp index 3dac9f5..b5dfdbd 100644 --- a/src/gui/styles/qwindowsxpstyle.cpp +++ b/src/gui/styles/qwindowsxpstyle.cpp @@ -261,7 +261,7 @@ void QWindowsXPStylePrivate::cleanup(bool force) use_xp = false; cleanupHandleMap(); if (limboWidget) { - if (qApp->closingDown()) + if (QApplication::closingDown()) delete limboWidget; else limboWidget->deleteLater(); @@ -2275,7 +2275,7 @@ void QWindowsXPStyle::drawControl(ControlElement element, const QStyleOption *op if (isFloating) { titleRect.adjust(0, -fw, 0, 0); - if (widget != 0 && widget->windowIcon().cacheKey() != qApp->windowIcon().cacheKey()) + if (widget != 0 && widget->windowIcon().cacheKey() != QApplication::windowIcon().cacheKey()) titleRect.adjust(titleRect.height() + mw, 0, 0, 0); } else { titleRect.adjust(mw, 0, 0, 0); @@ -2322,7 +2322,7 @@ void QWindowsXPStyle::drawControl(ControlElement element, const QStyleOption *op // Figure out maximal button space on title bar QIcon ico = widget->windowIcon(); - bool hasIcon = (ico.cacheKey() != qApp->windowIcon().cacheKey()); + bool hasIcon = (ico.cacheKey() != QApplication::windowIcon().cacheKey()); if (hasIcon) { QPixmap pxIco = ico.pixmap(titleHeight); if (!verticalTitleBar && QApplication::layoutDirection() == Qt::RightToLeft) diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp index 9c3c4a4..e9f067a 100644 --- a/src/gui/text/qfontdatabase.cpp +++ b/src/gui/text/qfontdatabase.cpp @@ -87,34 +87,34 @@ static int getFontWeight(const QString &weightString) // Test in decreasing order of commonness if (s == QLatin1String("medium") || s == QLatin1String("normal") - || s.compare(qApp->translate("QFontDatabase", "Normal"), Qt::CaseInsensitive) == 0) + || s.compare(QApplication::translate("QFontDatabase", "Normal"), Qt::CaseInsensitive) == 0) return QFont::Normal; if (s == QLatin1String("bold") - || s.compare(qApp->translate("QFontDatabase", "Bold"), Qt::CaseInsensitive) == 0) + || s.compare(QApplication::translate("QFontDatabase", "Bold"), Qt::CaseInsensitive) == 0) return QFont::Bold; if (s == QLatin1String("demibold") || s == QLatin1String("demi bold") - || s.compare(qApp->translate("QFontDatabase", "Demi Bold"), Qt::CaseInsensitive) == 0) + || s.compare(QApplication::translate("QFontDatabase", "Demi Bold"), Qt::CaseInsensitive) == 0) return QFont::DemiBold; if (s == QLatin1String("black") - || s.compare(qApp->translate("QFontDatabase", "Black"), Qt::CaseInsensitive) == 0) + || s.compare(QApplication::translate("QFontDatabase", "Black"), Qt::CaseInsensitive) == 0) return QFont::Black; if (s == QLatin1String("light")) return QFont::Light; if (s.contains(QLatin1String("bold")) - || s.contains(qApp->translate("QFontDatabase", "Bold"), Qt::CaseInsensitive)) { + || s.contains(QApplication::translate("QFontDatabase", "Bold"), Qt::CaseInsensitive)) { if (s.contains(QLatin1String("demi")) - || s.compare(qApp->translate("QFontDatabase", "Demi"), Qt::CaseInsensitive) == 0) + || s.compare(QApplication::translate("QFontDatabase", "Demi"), Qt::CaseInsensitive) == 0) return (int) QFont::DemiBold; return (int) QFont::Bold; } if (s.contains(QLatin1String("light")) - || s.compare(qApp->translate("QFontDatabase", "Light"), Qt::CaseInsensitive) == 0) + || s.compare(QApplication::translate("QFontDatabase", "Light"), Qt::CaseInsensitive) == 0) return (int) QFont::Light; if (s.contains(QLatin1String("black")) - || s.compare(qApp->translate("QFontDatabase", "Black"), Qt::CaseInsensitive) == 0) + || s.compare(QApplication::translate("QFontDatabase", "Black"), Qt::CaseInsensitive) == 0) return (int) QFont::Black; return (int) QFont::Normal; @@ -251,10 +251,10 @@ QtFontStyle::Key::Key(const QString &styleString) weight = getFontWeight(styleString); if (styleString.contains(QLatin1String("Italic")) - || styleString.contains(qApp->translate("QFontDatabase", "Italic"))) + || styleString.contains(QApplication::translate("QFontDatabase", "Italic"))) style = QFont::StyleItalic; else if (styleString.contains(QLatin1String("Oblique")) - || styleString.contains(qApp->translate("QFontDatabase", "Oblique"))) + || styleString.contains(QApplication::translate("QFontDatabase", "Oblique"))) style = QFont::StyleOblique; } @@ -1249,21 +1249,21 @@ static QString styleStringHelper(int weight, QFont::Style style) { QString result; if (weight >= QFont::Black) - result = qApp->translate("QFontDatabase", "Black"); + result = QApplication::translate("QFontDatabase", "Black"); else if (weight >= QFont::Bold) - result = qApp->translate("QFontDatabase", "Bold"); + result = QApplication::translate("QFontDatabase", "Bold"); else if (weight >= QFont::DemiBold) - result = qApp->translate("QFontDatabase", "Demi Bold"); + result = QApplication::translate("QFontDatabase", "Demi Bold"); else if (weight < QFont::Normal) - result = qApp->translate("QFontDatabase", "Light"); + result = QApplication::translate("QFontDatabase", "Light"); if (style == QFont::StyleItalic) - result += QLatin1Char(' ') + qApp->translate("QFontDatabase", "Italic"); + result += QLatin1Char(' ') + QApplication::translate("QFontDatabase", "Italic"); else if (style == QFont::StyleOblique) - result += QLatin1Char(' ') + qApp->translate("QFontDatabase", "Oblique"); + result += QLatin1Char(' ') + QApplication::translate("QFontDatabase", "Oblique"); if (result.isEmpty()) - result = qApp->translate("QFontDatabase", "Normal"); + result = QApplication::translate("QFontDatabase", "Normal"); return result.simplified(); } @@ -2067,7 +2067,7 @@ QString QFontDatabase::writingSystemName(WritingSystem writingSystem) Q_ASSERT_X(false, "QFontDatabase::writingSystemName", "invalid 'writingSystem' parameter"); break; } - return qApp ? qApp->translate("QFontDatabase", name) : QString::fromLatin1(name); + return QApplication::translate("QFontDatabase", name); } diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp index 780891b..8573fc9 100644 --- a/src/gui/text/qtextcontrol.cpp +++ b/src/gui/text/qtextcontrol.cpp @@ -1712,7 +1712,7 @@ void QTextControlPrivate::mouseDoubleClickEvent(QEvent *e, Qt::MouseButton butto selectedWordOnDoubleClick = cursor; trippleClickPoint = pos; - trippleClickTimer.start(qApp->doubleClickInterval(), q); + trippleClickTimer.start(QApplication::doubleClickInterval(), q); if (doEmit) { selectionChanged(); #ifndef QT_NO_CLIPBOARD diff --git a/src/gui/util/qsystemtrayicon_win.cpp b/src/gui/util/qsystemtrayicon_win.cpp index c46c929..f79f135 100644 --- a/src/gui/util/qsystemtrayicon_win.cpp +++ b/src/gui/util/qsystemtrayicon_win.cpp @@ -518,7 +518,7 @@ void QSystemTrayIconPrivate::install_sys() QRect QSystemTrayIconSys::findTrayGeometry() { //Use lower right corner as fallback - QPoint brCorner = qApp->desktop()->screenGeometry().bottomRight(); + QPoint brCorner = QApplication::desktop()->screenGeometry().bottomRight(); QRect ret(brCorner.x() - 10, brCorner.y() - 10, 10, 10); #if defined(Q_OS_WINCE) HWND trayHandle = FindWindowW(L"Shell_TrayWnd", NULL); diff --git a/src/gui/widgets/qabstractbutton.cpp b/src/gui/widgets/qabstractbutton.cpp index f28288e..6337b5c 100644 --- a/src/gui/widgets/qabstractbutton.cpp +++ b/src/gui/widgets/qabstractbutton.cpp @@ -379,7 +379,7 @@ void QAbstractButtonPrivate::moveFocus(int key) #else bool exclusive = autoExclusive; #endif - QWidget *f = qApp->focusWidget(); + QWidget *f = QApplication::focusWidget(); QAbstractButton *fb = qobject_cast<QAbstractButton *>(f); if (!fb || !buttonList.contains(fb)) return; diff --git a/src/gui/widgets/qeffects.cpp b/src/gui/widgets/qeffects.cpp index 140953d..19cdf89 100644 --- a/src/gui/widgets/qeffects.cpp +++ b/src/gui/widgets/qeffects.cpp @@ -588,8 +588,8 @@ void qScrollEffect(QWidget* w, QEffects::DirFlags orient, int time) if (!w) return; - qApp->sendPostedEvents(w, QEvent::Move); - qApp->sendPostedEvents(w, QEvent::Resize); + QApplication::sendPostedEvents(w, QEvent::Move); + QApplication::sendPostedEvents(w, QEvent::Resize); Qt::WindowFlags flags = Qt::ToolTip; // those can be popups - they would steal the focus, but are disabled @@ -610,8 +610,8 @@ void qFadeEffect(QWidget* w, int time) if (!w) return; - qApp->sendPostedEvents(w, QEvent::Move); - qApp->sendPostedEvents(w, QEvent::Resize); + QApplication::sendPostedEvents(w, QEvent::Move); + QApplication::sendPostedEvents(w, QEvent::Resize); Qt::WindowFlags flags = Qt::ToolTip; diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp index 711f1f4..7baea94 100644 --- a/src/gui/widgets/qmenu.cpp +++ b/src/gui/widgets/qmenu.cpp @@ -1048,7 +1048,7 @@ void QMenuPrivate::activateAction(QAction *action, QAction::ActionEvent action_e if (q->testAttribute(Qt::WA_DontShowOnScreen)) { hideUpToMenuBar(); } else { - for(QWidget *widget = qApp->activePopupWidget(); widget; ) { + for(QWidget *widget = QApplication::activePopupWidget(); widget; ) { if (QMenu *qmenu = qobject_cast<QMenu*>(widget)) { if(qmenu == q) hideUpToMenuBar(); @@ -1843,7 +1843,7 @@ void QMenu::popup(const QPoint &p, QAction *atAction) if (adjustToDesktop) { //handle popup falling "off screen" - if (qApp->layoutDirection() == Qt::RightToLeft) { + if (QApplication::layoutDirection() == Qt::RightToLeft) { if(snapToMouse) //position flowing left from the mouse pos.setX(mouse.x()-size.width()); @@ -1881,9 +1881,9 @@ void QMenu::popup(const QPoint &p, QAction *atAction) } setGeometry(QRect(pos, size)); #ifndef QT_NO_EFFECTS - int hGuess = qApp->layoutDirection() == Qt::RightToLeft ? QEffects::LeftScroll : QEffects::RightScroll; + int hGuess = QApplication::layoutDirection() == Qt::RightToLeft ? QEffects::LeftScroll : QEffects::RightScroll; int vGuess = QEffects::DownScroll; - if (qApp->layoutDirection() == Qt::RightToLeft) { + if (QApplication::layoutDirection() == Qt::RightToLeft) { if ((snapToMouse && (pos.x() + size.width()/2 > mouse.x())) || (qobject_cast<QMenu*>(d->causedPopup.widget) && pos.x() + size.width()/2 > d->causedPopup.widget->x())) hGuess = QEffects::RightScroll; @@ -2575,7 +2575,7 @@ void QMenu::keyPressEvent(QKeyEvent *e) { d->hideMenu(this); #ifndef QT_NO_MENUBAR - if (QMenuBar *mb = qobject_cast<QMenuBar*>(qApp->focusWidget())) { + if (QMenuBar *mb = qobject_cast<QMenuBar*>(QApplication::focusWidget())) { mb->d_func()->setKeyboardMode(false); } #endif @@ -2719,7 +2719,7 @@ void QMenu::keyPressEvent(QKeyEvent *e) #ifdef Q_OS_WIN32 if (key_consumed && (e->key() == Qt::Key_Control || e->key() == Qt::Key_Shift || e->key() == Qt::Key_Meta)) - qApp->beep(); + QApplication::beep(); #endif // Q_OS_WIN32 } if (key_consumed) diff --git a/src/gui/widgets/qmenubar.cpp b/src/gui/widgets/qmenubar.cpp index fc7e901..51e38e6 100644 --- a/src/gui/widgets/qmenubar.cpp +++ b/src/gui/widgets/qmenubar.cpp @@ -284,7 +284,7 @@ void QMenuBarPrivate::setKeyboardMode(bool b) } keyboardState = b; if(b) { - QWidget *fw = qApp->focusWidget(); + QWidget *fw = QApplication::focusWidget(); if (fw != q) keyboardFocusWidget = fw; if(!currentAction && !actionList.isEmpty()) @@ -294,7 +294,7 @@ void QMenuBarPrivate::setKeyboardMode(bool b) if(!popupState) setCurrentAction(0); if(keyboardFocusWidget) { - if (qApp->focusWidget() == q) + if (QApplication::focusWidget() == q) keyboardFocusWidget->setFocus(Qt::MenuBarFocusReason); keyboardFocusWidget = 0; } diff --git a/src/gui/widgets/qpushbutton.cpp b/src/gui/widgets/qpushbutton.cpp index 5001001..b526f02 100644 --- a/src/gui/widgets/qpushbutton.cpp +++ b/src/gui/widgets/qpushbutton.cpp @@ -589,7 +589,7 @@ void QPushButtonPrivate::_q_popupPressed() int x = globalPos.x(); int y = globalPos.y(); if (horizontal) { - if (globalPos.y() + rect.height() + menuSize.height() <= qApp->desktop()->height()) { + if (globalPos.y() + rect.height() + menuSize.height() <= QApplication::desktop()->height()) { y += rect.height(); } else { y -= menuSize.height(); @@ -597,7 +597,7 @@ void QPushButtonPrivate::_q_popupPressed() if (q->layoutDirection() == Qt::RightToLeft) x += rect.width() - menuSize.width(); } else { - if (globalPos.x() + rect.width() + menu->sizeHint().width() <= qApp->desktop()->width()) + if (globalPos.x() + rect.width() + menu->sizeHint().width() <= QApplication::desktop()->width()) x += rect.width(); else x -= menuSize.width(); diff --git a/src/gui/widgets/qtabwidget.cpp b/src/gui/widgets/qtabwidget.cpp index 43b2f54..c97154c 100644 --- a/src/gui/widgets/qtabwidget.cpp +++ b/src/gui/widgets/qtabwidget.cpp @@ -1057,7 +1057,7 @@ void QTabWidget::keyPressEvent(QKeyEvent *e) break; } } - if (!qApp->focusWidget()) + if (!QApplication::focusWidget()) d->tabs->setFocus(); } else { e->ignore(); diff --git a/src/gui/widgets/qtextbrowser.cpp b/src/gui/widgets/qtextbrowser.cpp index a1f4d34..d849184 100644 --- a/src/gui/widgets/qtextbrowser.cpp +++ b/src/gui/widgets/qtextbrowser.cpp @@ -263,7 +263,7 @@ void QTextBrowserPrivate::setSource(const QUrl &url) Q_Q(QTextBrowser); #ifndef QT_NO_CURSOR if (q->isVisible()) - qApp->setOverrideCursor(Qt::WaitCursor); + QApplication::setOverrideCursor(Qt::WaitCursor); #endif textOrSourceChanged = true; @@ -295,9 +295,9 @@ void QTextBrowserPrivate::setSource(const QUrl &url) if (q->isVisible()) { QString firstTag = txt.left(txt.indexOf(QLatin1Char('>')) + 1); - if (firstTag.left(3) == QLatin1String("<qt") && firstTag.contains(QLatin1String("type")) && firstTag.contains(QLatin1String("detail"))) { + if (firstTag.startsWith(QLatin1String("<qt")) && firstTag.contains(QLatin1String("type")) && firstTag.contains(QLatin1String("detail"))) { #ifndef QT_NO_CURSOR - qApp->restoreOverrideCursor(); + QApplication::restoreOverrideCursor(); #endif #ifndef QT_NO_WHATSTHIS QWhatsThis::showText(QCursor::pos(), txt, q); @@ -342,7 +342,7 @@ void QTextBrowserPrivate::setSource(const QUrl &url) #ifndef QT_NO_CURSOR if (q->isVisible()) - qApp->restoreOverrideCursor(); + QApplication::restoreOverrideCursor(); #endif emit q->sourceChanged(url); } diff --git a/src/gui/widgets/qtoolbar.cpp b/src/gui/widgets/qtoolbar.cpp index 20f2c23..7787a66 100644 --- a/src/gui/widgets/qtoolbar.cpp +++ b/src/gui/widgets/qtoolbar.cpp @@ -1181,7 +1181,7 @@ bool QToolBar::event(QEvent *event) if (!d->layout->expanded) break; - QWidget *w = qApp->activePopupWidget(); + QWidget *w = QApplication::activePopupWidget(); if (waitForPopup(this, w)) { d->waitForPopupTimer->start(); break; @@ -1201,7 +1201,7 @@ void QToolBarPrivate::_q_waitForPopup() { Q_Q(QToolBar); - QWidget *w = qApp->activePopupWidget(); + QWidget *w = QApplication::activePopupWidget(); if (!waitForPopup(q, w)) { waitForPopupTimer->stop(); if (!q->underMouse()) diff --git a/src/gui/widgets/qtoolbutton.cpp b/src/gui/widgets/qtoolbutton.cpp index 7d41d1e..0eb6364 100644 --- a/src/gui/widgets/qtoolbutton.cpp +++ b/src/gui/widgets/qtoolbutton.cpp @@ -895,7 +895,7 @@ void QToolButtonPrivate::popupTimerDone() horizontal = false; #endif QPoint p; - QRect screen = qApp->desktop()->availableGeometry(q); + QRect screen = QApplication::desktop()->availableGeometry(q); QSize sh = ((QToolButton*)(QMenu*)actualMenu)->receivers(SIGNAL(aboutToShow()))? QSize() : actualMenu->sizeHint(); QRect rect = q->rect(); if (horizontal) { diff --git a/src/gui/widgets/qwidgetresizehandler.cpp b/src/gui/widgets/qwidgetresizehandler.cpp index 9171244..0e5b28a 100644 --- a/src/gui/widgets/qwidgetresizehandler.cpp +++ b/src/gui/widgets/qwidgetresizehandler.cpp @@ -258,7 +258,7 @@ void QWidgetResizeHandler::mouseMoveEvent(QMouseEvent *e) #ifdef Q_WS_X11 // Workaround for window managers which refuse to move a tool window partially offscreen. - QRect desktop = qApp->desktop()->availableGeometry(widget); + QRect desktop = QApplication::desktop()->availableGeometry(widget); pp.rx() = qMax(pp.x(), desktop.left()); pp.ry() = qMax(pp.y(), desktop.top()); p.rx() = qMin(p.x(), desktop.right()); |