summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-04-06 09:32:13 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-04-06 09:32:13 +0200
commit1a464f35d19fbf6a5cbe93b2a2d52f2f44465913 (patch)
tree7306fbbb50429d66cf4d3d08e60e7310431b9f85
parent061fbceb777c41b23bc2b8180b2af85d9b35b246 (diff)
parentb6f7230cda02d9b11b309816ca1e41dbd2716fe0 (diff)
Merge remote-tracking branch 'origin/5.11' into dev
-rwxr-xr-xconfigure2
-rw-r--r--src/corelib/global/qglobal.cpp4
-rw-r--r--src/network/access/qhttp2protocolhandler.cpp7
-rw-r--r--src/plugins/platforms/windows/qwindowscursor.h1
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp2
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp8
-rw-r--r--src/plugins/styles/mac/qmacstyle_mac.mm3
-rw-r--r--src/widgets/kernel/qlayoutitem.cpp2
-rw-r--r--src/widgets/widgets/qabstractspinbox.cpp9
-rw-r--r--src/widgets/widgets/qtabbar.cpp6
-rw-r--r--tests/auto/corelib/io/qloggingcategory/tst_qloggingcategory.cpp1
-rw-r--r--tests/auto/corelib/io/qloggingregistry/tst_qloggingregistry.cpp1
-rw-r--r--tests/auto/corelib/tools/qlocale/tst_qlocale.cpp38
-rw-r--r--tests/auto/gui/kernel/qcursor/tst_qcursor.cpp3
14 files changed, 62 insertions, 25 deletions
diff --git a/configure b/configure
index 9757254097..2830a1b189 100755
--- a/configure
+++ b/configure
@@ -305,7 +305,7 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
BUILD_ON_MAC=no
-if [ -d /System/Library/Frameworks/Carbon.framework ]; then
+if [ -d /System/Library/Frameworks/Cocoa.framework ]; then
BUILD_ON_MAC=yes
fi
if [ "$OSTYPE" = "msys" ]; then
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
diff --git a/tests/auto/corelib/io/qloggingcategory/tst_qloggingcategory.cpp b/tests/auto/corelib/io/qloggingcategory/tst_qloggingcategory.cpp
index 571288675e..11a9b3f189 100644
--- a/tests/auto/corelib/io/qloggingcategory/tst_qloggingcategory.cpp
+++ b/tests/auto/corelib/io/qloggingcategory/tst_qloggingcategory.cpp
@@ -203,6 +203,7 @@ private:
private slots:
void initTestCase()
{
+ qputenv("XDG_CONFIG_DIRS", "/does/not/exist");
qputenv("QT_MESSAGE_PATTERN", QByteArray("%{category}: %{type},%{message}"));
oldMessageHandler = qInstallMessageHandler(myCustomMessageHandler);
// Create configuration
diff --git a/tests/auto/corelib/io/qloggingregistry/tst_qloggingregistry.cpp b/tests/auto/corelib/io/qloggingregistry/tst_qloggingregistry.cpp
index a74ea3a89e..5b61a6007d 100644
--- a/tests/auto/corelib/io/qloggingregistry/tst_qloggingregistry.cpp
+++ b/tests/auto/corelib/io/qloggingregistry/tst_qloggingregistry.cpp
@@ -50,6 +50,7 @@ private slots:
{
// ensure a clean environment
QStandardPaths::setTestModeEnabled(true);
+ qputenv("XDG_CONFIG_DIRS", "/does/not/exist");
qunsetenv("QT_LOGGING_CONF");
qunsetenv("QT_LOGGING_RULES");
}
diff --git a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp
index d5e2935d28..c6c16a5982 100644
--- a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp
+++ b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp
@@ -79,9 +79,7 @@ private slots:
void ctor();
void emptyCtor();
- void legacyNames();
void consistentC();
- void unixLocaleName();
void matchingLocales();
void stringToDouble_data();
void stringToDouble();
@@ -108,8 +106,6 @@ private slots:
void toDateTime();
void negativeNumbers();
void numberOptions();
- void testNames_data();
- void testNames();
void dayName_data();
void dayName();
void standaloneDayName_data();
@@ -143,6 +139,15 @@ private slots:
void systemLocale();
+ // *** ORDER-DEPENDENCY *** (This Is Bad.)
+ // Test order is determined by order of declaration here: *all* tests that
+ // QLocale::setDefault() *must* appear *after* all other tests !
+ void defaulted_ctor(); // This one must be the first of these.
+ void legacyNames();
+ void unixLocaleName();
+ void testNames_data();
+ void testNames();
+ // DO NOT add tests here unless they QLocale::setDefault(); see above.
private:
QString m_decimal, m_thousand, m_sdate, m_ldate, m_time;
QString m_sysapp;
@@ -232,6 +237,23 @@ void tst_QLocale::ctor()
TEST_CTOR(Chinese, LatinScript, UnitedStates, QLocale::Chinese, QLocale::SimplifiedHanScript, QLocale::China);
#undef TEST_CTOR
+}
+
+void tst_QLocale::defaulted_ctor()
+{
+ QLocale default_locale = QLocale::system();
+ QLocale::Language default_lang = default_locale.language();
+ QLocale::Country default_country = default_locale.country();
+
+ qDebug("Default: %s/%s", QLocale::languageToString(default_lang).toLatin1().constData(),
+ QLocale::countryToString(default_country).toLatin1().constData());
+
+ {
+ QLocale l(QLocale::C, QLocale::AnyCountry);
+ QCOMPARE(l.language(), QLocale::C);
+ QCOMPARE(l.country(), QLocale::AnyCountry);
+ }
+
#define TEST_CTOR(req_lang, req_country, exp_lang, exp_country) \
{ \
QLocale l(QLocale::req_lang, QLocale::req_country); \
@@ -239,11 +261,6 @@ void tst_QLocale::ctor()
QCOMPARE((int)l.country(), (int)exp_country); \
}
- {
- QLocale l(QLocale::C, QLocale::AnyCountry);
- QCOMPARE(l.language(), QLocale::C);
- QCOMPARE(l.country(), QLocale::AnyCountry);
- }
TEST_CTOR(AnyLanguage, AnyCountry, default_lang, default_country)
TEST_CTOR(C, AnyCountry, QLocale::C, QLocale::AnyCountry)
TEST_CTOR(Aymara, AnyCountry, default_lang, default_country)
@@ -1961,10 +1978,11 @@ void tst_QLocale::testNames_data()
QTest::addColumn<int>("language");
QTest::addColumn<int>("country");
+ QLocale::setDefault(QLocale(QLocale::C)); // Ensures predictable fall-backs
+
for (int i = 0; i < locale_data_count; ++i) {
const QLocaleData &item = locale_data[i];
-
const QString testName = QLatin1String("data_") + QString::number(i) + QLatin1String(" (")
+ QLocale::languageToString((QLocale::Language)item.m_language_id)
+ QLatin1Char('/') + QLocale::countryToString((QLocale::Country)item.m_country_id)
diff --git a/tests/auto/gui/kernel/qcursor/tst_qcursor.cpp b/tests/auto/gui/kernel/qcursor/tst_qcursor.cpp
index d505f5a655..eb33cce95b 100644
--- a/tests/auto/gui/kernel/qcursor/tst_qcursor.cpp
+++ b/tests/auto/gui/kernel/qcursor/tst_qcursor.cpp
@@ -93,6 +93,9 @@ void tst_QCursor::equality()
VERIFY_DIFFERENT(bitmapCursor, pixmapCursor);
// Empty pixmap
+ for (int i = 0; i < 18; ++i)
+ QTest::ignoreMessage(QtWarningMsg, "QCursor: Cannot create bitmap cursor; invalid bitmap(s)");
+
QPixmap emptyPixmap;
QCursor emptyPixmapCursor(emptyPixmap);
QCOMPARE(emptyPixmapCursor.shape(), Qt::ArrowCursor);