diff options
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r-- | src/widgets/kernel/qapplication.cpp | 7 | ||||
-rw-r--r-- | src/widgets/kernel/qapplication_qpa.cpp | 2 | ||||
-rw-r--r-- | src/widgets/kernel/qopenglwidget.cpp | 2 | ||||
-rw-r--r-- | src/widgets/kernel/qtooltip.cpp | 23 | ||||
-rw-r--r-- | src/widgets/kernel/qwidget_qpa.cpp | 6 | ||||
-rw-r--r-- | src/widgets/kernel/qwidgetwindow.cpp | 14 | ||||
-rw-r--r-- | src/widgets/kernel/qwidgetwindow_qpa_p.h | 1 |
7 files changed, 44 insertions, 11 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index c053fdfb22..92d3359909 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -2697,7 +2697,8 @@ void QApplication::setStartDragDistance(int l) Qt uses this value internally, e.g. in QFileDialog. - The default value is 4 pixels. + The default value (if the platform doesn't provide a different default) + is 10 pixels. \sa startDragTime(), QPoint::manhattanLength(), {Drag and Drop} */ @@ -3102,12 +3103,12 @@ bool QApplication::notify(QObject *receiver, QEvent *e) QPoint relpos = wheel->pos(); bool eventAccepted = wheel->isAccepted(); - if (e->spontaneous()) + if (e->spontaneous() && wheel->phase() == Qt::ScrollUpdate) QApplicationPrivate::giveFocusAccordingToFocusPolicy(w, e, relpos); while (w) { QWheelEvent we(relpos, wheel->globalPos(), wheel->pixelDelta(), wheel->angleDelta(), wheel->delta(), wheel->orientation(), wheel->buttons(), - wheel->modifiers()); + wheel->modifiers(), wheel->phase()); we.spont = wheel->spontaneous(); res = d->notify_helper(w, w == receiver ? wheel : &we); eventAccepted = ((w == receiver) ? wheel : &we)->isAccepted(); diff --git a/src/widgets/kernel/qapplication_qpa.cpp b/src/widgets/kernel/qapplication_qpa.cpp index 5ce2ac2c4b..1c40ca01be 100644 --- a/src/widgets/kernel/qapplication_qpa.cpp +++ b/src/widgets/kernel/qapplication_qpa.cpp @@ -288,7 +288,7 @@ void QApplicationPrivate::initializeWidgetPaletteHash() setPossiblePalette(platformTheme->palette(QPlatformTheme::RadioButtonPalette), "QRadioButton"); setPossiblePalette(platformTheme->palette(QPlatformTheme::HeaderPalette), "QHeaderView"); setPossiblePalette(platformTheme->palette(QPlatformTheme::ItemViewPalette), "QAbstractItemView"); - setPossiblePalette(platformTheme->palette(QPlatformTheme::MessageBoxLabelPelette), "QMessageBoxLabel"); + setPossiblePalette(platformTheme->palette(QPlatformTheme::MessageBoxLabelPalette), "QMessageBoxLabel"); setPossiblePalette(platformTheme->palette(QPlatformTheme::TabBarPalette), "QTabBar"); setPossiblePalette(platformTheme->palette(QPlatformTheme::LabelPalette), "QLabel"); setPossiblePalette(platformTheme->palette(QPlatformTheme::GroupBoxPalette), "QGroupBox"); diff --git a/src/widgets/kernel/qopenglwidget.cpp b/src/widgets/kernel/qopenglwidget.cpp index e05c03d952..66aacadb28 100644 --- a/src/widgets/kernel/qopenglwidget.cpp +++ b/src/widgets/kernel/qopenglwidget.cpp @@ -163,7 +163,7 @@ void QOpenGLWidget::resizeEvent(QResizeEvent *) d->context.makeCurrent(d->surface()); delete d->fbo; // recreate when resized - d->fbo = new QOpenGLFramebufferObject(size()); + d->fbo = new QOpenGLFramebufferObject(size() * devicePixelRatio()); d->fbo->bind(); QOpenGLFunctions *funcs = d->context.functions(); funcs->glBindTexture(GL_TEXTURE_2D, d->fbo->texture()); diff --git a/src/widgets/kernel/qtooltip.cpp b/src/widgets/kernel/qtooltip.cpp index c898f56015..5aea55e196 100644 --- a/src/widgets/kernel/qtooltip.cpp +++ b/src/widgets/kernel/qtooltip.cpp @@ -322,13 +322,32 @@ bool QTipLabel::eventFilter(QObject *o, QEvent *e) case QEvent::Leave: hideTip(); break; + + +#if defined (Q_OS_QNX) // On QNX the window activate and focus events are delayed and will appear + // after the window is shown. + case QEvent::WindowActivate: + case QEvent::FocusIn: + return false; + case QEvent::WindowDeactivate: + if (o != this) + return false; + hideTipImmediately(); + break; + case QEvent::FocusOut: + if (reinterpret_cast<QWindow*>(o) != windowHandle()) + return false; + hideTipImmediately(); + break; +#else case QEvent::WindowActivate: case QEvent::WindowDeactivate: + case QEvent::FocusIn: + case QEvent::FocusOut: +#endif case QEvent::MouseButtonPress: case QEvent::MouseButtonRelease: case QEvent::MouseButtonDblClick: - case QEvent::FocusIn: - case QEvent::FocusOut: case QEvent::Wheel: hideTipImmediately(); break; diff --git a/src/widgets/kernel/qwidget_qpa.cpp b/src/widgets/kernel/qwidget_qpa.cpp index 88a08060c1..85ae55b8ac 100644 --- a/src/widgets/kernel/qwidget_qpa.cpp +++ b/src/widgets/kernel/qwidget_qpa.cpp @@ -959,6 +959,8 @@ void QWidgetPrivate::deleteTLSysExtra() #ifndef QT_NO_OPENGL if (textureChildSeen && extra->topextra->shareContext) extra->topextra->shareContext->doneCurrent(); + delete extra->topextra->shareContext; + extra->topextra->shareContext = 0; #endif //the toplevel might have a context with a "qglcontext associated with it. We need to @@ -972,10 +974,6 @@ void QWidgetPrivate::deleteTLSysExtra() delete extra->topextra->window; extra->topextra->window = 0; -#ifndef QT_NO_OPENGL - delete extra->topextra->shareContext; - extra->topextra->shareContext = 0; -#endif } } diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp index e50736d6b8..ef138267bb 100644 --- a/src/widgets/kernel/qwidgetwindow.cpp +++ b/src/widgets/kernel/qwidgetwindow.cpp @@ -100,6 +100,7 @@ QWidgetWindow::QWidgetWindow(QWidget *widget) setSurfaceType(QSurface::RasterGLSurface); } connect(m_widget, &QObject::objectNameChanged, this, &QWidgetWindow::updateObjectName); + connect(this, SIGNAL(screenChanged(QScreen*)), this, SLOT(repaintWindow())); } QWidgetWindow::~QWidgetWindow() @@ -560,6 +561,19 @@ void QWidgetWindow::updateGeometry() m_widget->data->fstrut_dirty = false; } +// Invalidates the backing store buffer and repaints immediately. +// ### Qt 5.4: replace with QUpdateWindowRequestEvent. +void QWidgetWindow::repaintWindow() +{ + if (!m_widget->isVisible() || !m_widget->updatesEnabled()) + return; + + QTLWExtra *tlwExtra = m_widget->window()->d_func()->maybeTopData(); + if (tlwExtra && !tlwExtra->inTopLevelResize && tlwExtra->backingStore) + tlwExtra->backingStoreTracker->markDirty(m_widget->rect(), m_widget, + QWidgetBackingStore::UpdateNow, QWidgetBackingStore::BufferInvalid); +} + Qt::WindowState effectiveState(Qt::WindowStates state); // Store normal geometry used for saving application settings. diff --git a/src/widgets/kernel/qwidgetwindow_qpa_p.h b/src/widgets/kernel/qwidgetwindow_qpa_p.h index 8d6f14a669..06ba8ea646 100644 --- a/src/widgets/kernel/qwidgetwindow_qpa_p.h +++ b/src/widgets/kernel/qwidgetwindow_qpa_p.h @@ -101,6 +101,7 @@ protected: private slots: void updateObjectName(); + void repaintWindow(); private: void updateGeometry(); |