diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-04-06 09:32:13 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-04-06 09:32:13 +0200 |
commit | 1a464f35d19fbf6a5cbe93b2a2d52f2f44465913 (patch) | |
tree | 7306fbbb50429d66cf4d3d08e60e7310431b9f85 /src | |
parent | 061fbceb777c41b23bc2b8180b2af85d9b35b246 (diff) | |
parent | b6f7230cda02d9b11b309816ca1e41dbd2716fe0 (diff) |
Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: Ic811cd444e523b904211797112bba6aaec85dddd
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/global/qglobal.cpp | 4 | ||||
-rw-r--r-- | src/network/access/qhttp2protocolhandler.cpp | 7 | ||||
-rw-r--r-- | src/plugins/platforms/windows/qwindowscursor.h | 1 | ||||
-rw-r--r-- | src/plugins/platforms/windows/qwindowswindow.cpp | 2 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp | 8 | ||||
-rw-r--r-- | src/plugins/styles/mac/qmacstyle_mac.mm | 3 | ||||
-rw-r--r-- | src/widgets/kernel/qlayoutitem.cpp | 2 | ||||
-rw-r--r-- | src/widgets/widgets/qabstractspinbox.cpp | 9 | ||||
-rw-r--r-- | src/widgets/widgets/qtabbar.cpp | 6 |
9 files changed, 28 insertions, 14 deletions
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 2d8b860c5b..b75b218201 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -4439,7 +4439,7 @@ bool QInternal::activateCallbacks(Callback cb, void **parameters) Calls the message handler with the critical message \a message. If no message handler has been installed, the message is printed to stderr. Under Windows, the message is sent to the debugger. - On QNX the message is sent to slogger2 + On QNX the message is sent to slogger2. It exits if the environment variable QT_FATAL_CRITICALS is not empty. @@ -4472,7 +4472,7 @@ bool QInternal::activateCallbacks(Callback cb, void **parameters) Calls the message handler with the fatal message \a message. If no message handler has been installed, the message is printed to stderr. Under Windows, the message is sent to the debugger. - On QNX the message is sent to slogger2 + On QNX the message is sent to slogger2. If you are using the \b{default message handler} this function will abort to create a core dump. On Windows, for debug builds, diff --git a/src/network/access/qhttp2protocolhandler.cpp b/src/network/access/qhttp2protocolhandler.cpp index 0cdcee6b59..5420e713b5 100644 --- a/src/network/access/qhttp2protocolhandler.cpp +++ b/src/network/access/qhttp2protocolhandler.cpp @@ -917,10 +917,11 @@ void QHttp2ProtocolHandler::handleContinuedHEADERS() if (activeStreams.contains(streamID)) { Stream &stream = activeStreams[streamID]; if (stream.state != Stream::halfClosedLocal - && stream.state != Stream::remoteReserved) { + && stream.state != Stream::remoteReserved + && stream.state != Stream::open) { // We can receive HEADERS on streams initiated by our requests - // (these streams are in halfClosedLocal state) or remote-reserved - // streams from a server's PUSH_PROMISE. + // (these streams are in halfClosedLocal or open state) or + // remote-reserved streams from a server's PUSH_PROMISE. finishStreamWithError(stream, QNetworkReply::ProtocolFailure, QLatin1String("HEADERS on invalid stream")); sendRST_STREAM(streamID, CANCEL); diff --git a/src/plugins/platforms/windows/qwindowscursor.h b/src/plugins/platforms/windows/qwindowscursor.h index 4772f3fce5..53f185358b 100644 --- a/src/plugins/platforms/windows/qwindowscursor.h +++ b/src/plugins/platforms/windows/qwindowscursor.h @@ -107,6 +107,7 @@ public: void changeCursor(QCursor * widgetCursor, QWindow * widget) override; void setOverrideCursor(const QCursor &cursor) override; void clearOverrideCursor() override; + bool hasOverrideCursor() const { return m_overriddenCursor != nullptr; } QPoint pos() const override; void setPos(const QPoint &pos) override; diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 9872b6b4e0..f1762146ec 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -2410,6 +2410,8 @@ static inline bool applyNewCursor(const QWindow *w) void QWindowsWindow::applyCursor() { + if (static_cast<const QWindowsCursor *>(screen()->cursor())->hasOverrideCursor()) + return; #ifndef QT_NO_CURSOR if (m_cursor->isNull()) { // Recurse up to parent with non-null cursor. Set default for toplevel. if (const QWindow *p = window()->parent()) { diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp index 86ca7afa12..d37eb572a6 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp @@ -302,7 +302,7 @@ void QGLXContext::init(QXcbScreen *screen, QPlatformOpenGLContext *share) contextAttributes << GLX_CONTEXT_PROFILE_MASK_ARB << GLX_CONTEXT_ES2_PROFILE_BIT_EXT; } - if (supportsRobustness && supportsVideoMemoryPurge) { + if (supportsRobustness && supportsVideoMemoryPurge && m_format.testOption(QSurfaceFormat::ResetNotification)) { QVector<int> contextAttributesWithNvidiaReset = contextAttributes; contextAttributesWithNvidiaReset << GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB << GLX_LOSE_CONTEXT_ON_RESET_ARB; @@ -539,6 +539,7 @@ bool QGLXContext::makeCurrent(QPlatformSurface *surface) m_lost = false; if (m_getGraphicsResetStatus && m_getGraphicsResetStatus() != GL_NO_ERROR) { m_lost = true; + success = false; // Drop the surface. Will recreate on the next makeCurrent. window->invalidateSurface(); } @@ -547,6 +548,11 @@ bool QGLXContext::makeCurrent(QPlatformSurface *surface) QGLXPbuffer *pbuffer = static_cast<QGLXPbuffer *>(surface); glxDrawable = pbuffer->pbuffer(); success = glXMakeContextCurrent(m_display, glxDrawable, glxDrawable, m_context); + m_lost = false; + if (m_getGraphicsResetStatus && m_getGraphicsResetStatus() != GL_NO_ERROR) { + m_lost = true; + success = false; + } } if (success && surfaceClass == QSurface::Window) { diff --git a/src/plugins/styles/mac/qmacstyle_mac.mm b/src/plugins/styles/mac/qmacstyle_mac.mm index 0f5f9395c8..8d03ed9783 100644 --- a/src/plugins/styles/mac/qmacstyle_mac.mm +++ b/src/plugins/styles/mac/qmacstyle_mac.mm @@ -3944,7 +3944,8 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter if (!hasMenu && ct != QMacStylePrivate::Button_SquareButton) { if (isPressed || (isActive && isEnabled - && ((btn.features & QStyleOptionButton::DefaultButton && !d->autoDefaultButton) + && ((btn.state & State_On) + || ((btn.features & QStyleOptionButton::DefaultButton) && !d->autoDefaultButton) || d->autoDefaultButton == btn.styleObject))) btn.palette.setColor(QPalette::ButtonText, Qt::white); } diff --git a/src/widgets/kernel/qlayoutitem.cpp b/src/widgets/kernel/qlayoutitem.cpp index 5c4fc20687..52640daf55 100644 --- a/src/widgets/kernel/qlayoutitem.cpp +++ b/src/widgets/kernel/qlayoutitem.cpp @@ -839,7 +839,7 @@ int QWidgetItemV2::heightForWidth(int width) const const QSize &size = q_cachedHfws[offset % HfwCacheMaxSize]; if (size.width() == width) { if (q_hfwCacheSize == HfwCacheMaxSize) - q_firstCachedHfw = offset; + q_firstCachedHfw = offset % HfwCacheMaxSize; return size.height(); } } diff --git a/src/widgets/widgets/qabstractspinbox.cpp b/src/widgets/widgets/qabstractspinbox.cpp index c5ccfac109..d2cbd9d456 100644 --- a/src/widgets/widgets/qabstractspinbox.cpp +++ b/src/widgets/widgets/qabstractspinbox.cpp @@ -611,12 +611,11 @@ void QAbstractSpinBox::stepDown() } /*! Virtual function that is called whenever the user triggers a step. - The \a steps parameter indicates how many steps were taken, e.g. - Pressing Qt::Key_Down will trigger a call to stepBy(-1), - whereas pressing Qt::Key_Prior will trigger a call to - stepBy(10). + The \a steps parameter indicates how many steps were taken. + For example, pressing \c Qt::Key_Down will trigger a call to \c stepBy(-1), + whereas pressing \c Qt::Key_PageUp will trigger a call to \c stepBy(10). - If you subclass QAbstractSpinBox you must reimplement this + If you subclass \c QAbstractSpinBox you must reimplement this function. Note that this function is called even if the resulting value will be outside the bounds of minimum and maximum. It's this function's job to handle these situations. diff --git a/src/widgets/widgets/qtabbar.cpp b/src/widgets/widgets/qtabbar.cpp index 9df1a4823a..3e26b04327 100644 --- a/src/widgets/widgets/qtabbar.cpp +++ b/src/widgets/widgets/qtabbar.cpp @@ -2166,8 +2166,12 @@ void QTabBar::mouseReleaseEvent(QMouseEvent *event) QStyleOptionTabBarBase optTabBase; optTabBase.initFrom(this); optTabBase.documentMode = d->documentMode; - if (style()->styleHint(QStyle::SH_TabBar_SelectMouseType, &optTabBase, this) == QEvent::MouseButtonRelease) + const bool selectOnRelease = + (style()->styleHint(QStyle::SH_TabBar_SelectMouseType, &optTabBase, this) == QEvent::MouseButtonRelease); + if (selectOnRelease) setCurrentIndex(i); + if (!selectOnRelease || !d->validIndex(i) || d->currentIndex == i) + repaint(tabRect(i)); } /*!\reimp |