diff options
Diffstat (limited to 'src/widgets/kernel/qapplication.cpp')
-rw-r--r-- | src/widgets/kernel/qapplication.cpp | 49 |
1 files changed, 12 insertions, 37 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index 5908d3036b..008b2a0d77 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -408,7 +408,6 @@ QWidget *QApplicationPrivate::focus_widget = 0; // has keyboard input foc QWidget *QApplicationPrivate::hidden_focus_widget = 0; // will get keyboard input focus after show() QWidget *QApplicationPrivate::active_window = 0; // toplevel with keyboard focus #ifndef QT_NO_WHEELEVENT -int QApplicationPrivate::wheel_scroll_lines; // number of lines to scroll QPointer<QWidget> QApplicationPrivate::wheel_widget; #endif bool qt_in_tab_key_event = false; @@ -642,19 +641,12 @@ void QApplicationPrivate::initialize() if (qEnvironmentVariableIntValue("QT_USE_NATIVE_WINDOWS") > 0) QCoreApplication::setAttribute(Qt::AA_NativeWindows); -#ifndef QT_NO_WHEELEVENT - QApplicationPrivate::wheel_scroll_lines = 3; -#endif - if (qt_is_gui_used) initializeMultitouch(); if (QApplication::desktopSettingsAware()) if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme()) { QApplicationPrivate::enabledAnimations = theme->themeHint(QPlatformTheme::UiEffects).toInt(); -#ifndef QT_NO_WHEELEVENT - QApplicationPrivate::wheel_scroll_lines = theme->themeHint(QPlatformTheme::WheelScrollLines).toInt(); -#endif } is_app_running = true; // no longer starting up @@ -2455,26 +2447,11 @@ bool QApplicationPrivate::isWindowBlocked(QWindow *window, QWindow **blockingWin for (int i = 0; i < modalWindowList.count(); ++i) { QWindow *modalWindow = modalWindowList.at(i); - { - // check if the modal window is our window or a (transient) parent of our window - QWindow *w = window; - while (w) { - if (w == modalWindow) { - *blockingWindow = 0; - return false; - } - QWindow *p = w->parent(); - if (!p) - p = w->transientParent(); - w = p; - } - - // Embedded in-process windows are not visible in normal parent-child chain, - // so check the native parent chain, too. - const QPlatformWindow *platWin = window->handle(); - const QPlatformWindow *modalPlatWin = modalWindow->handle(); - if (platWin && modalPlatWin && platWin->isEmbedded(modalPlatWin)) - return false; + // A window is not blocked by another modal window if the two are + // the same, or if the window is a child of the modal window. + if (window == modalWindow || modalWindow->isAncestorOf(window, QWindow::IncludeTransients)) { + *blockingWindow = 0; + return false; } Qt::WindowModality windowModality = modalWindow->modality(); @@ -3558,9 +3535,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e) touchEvent->setTarget(widget); for (int i = 0; i < touchEvent->_touchPoints.size(); ++i) { QTouchEvent::TouchPoint &pt = touchEvent->_touchPoints[i]; - QRectF rect = pt.rect(); - rect.translate(offset); - pt.d->rect = rect; + pt.d->pos = pt.pos() + offset; pt.d->startPos = pt.startPos() + offset; pt.d->lastPos = pt.lastPos() + offset; } @@ -4066,16 +4041,18 @@ int QApplication::keyboardInputInterval() or \l{QAbstractItemView::ScrollPerPixel}{scroll one pixel}. By default, this property has a value of 3. + + \sa QStyleHints::wheelScrollLines() */ #ifndef QT_NO_WHEELEVENT int QApplication::wheelScrollLines() { - return QApplicationPrivate::wheel_scroll_lines; + return styleHints()->wheelScrollLines(); } void QApplication::setWheelScrollLines(int lines) { - QApplicationPrivate::wheel_scroll_lines = lines; + styleHints()->setWheelScrollLines(lines); } #endif @@ -4257,12 +4234,10 @@ bool QApplicationPrivate::updateTouchPointsForWidget(QWidget *widget, QTouchEven QTouchEvent::TouchPoint &touchPoint = touchEvent->_touchPoints[i]; // preserve the sub-pixel resolution - QRectF rect = touchPoint.screenRect(); - const QPointF screenPos = rect.center(); + const QPointF screenPos = touchPoint.screenRect().center(); const QPointF delta = screenPos - screenPos.toPoint(); - rect.moveCenter(widget->mapFromGlobal(screenPos.toPoint()) + delta); - touchPoint.d->rect = rect; + touchPoint.d->pos = widget->mapFromGlobal(screenPos.toPoint()) + delta; touchPoint.d->startPos = widget->mapFromGlobal(touchPoint.startScreenPos().toPoint()) + delta; touchPoint.d->lastPos = widget->mapFromGlobal(touchPoint.lastScreenPos().toPoint()) + delta; |