diff options
author | Liang Qi <liang.qi@qt.io> | 2016-10-17 11:02:54 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2016-10-17 11:02:54 +0200 |
commit | d90b155c6034bc16a9eb2d5794f101cde4ea9e2c (patch) | |
tree | e648b8db6b9e8e8d7f0c765ac2953b066524eb49 | |
parent | b00565bc2803bb783e8f2b0d02becfa73323e283 (diff) | |
parent | d71bb504a635b51a85f3ccd919e0d77f869e50a8 (diff) |
Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
mkspecs/macx-ios-clang/features/resolve_config.prf
src/testlib/qtestcase.qdoc
Change-Id: Icefa63056ffb37106f35299a8f19165535571799
-rw-r--r-- | mkspecs/features/exclusive_builds.prf | 18 | ||||
-rw-r--r-- | mkspecs/macx-ios-clang/features/resolve_config.prf | 4 | ||||
-rw-r--r-- | src/corelib/mimetypes/qmimeprovider.cpp | 4 | ||||
-rw-r--r-- | src/corelib/mimetypes/qmimeprovider_p.h | 1 | ||||
-rw-r--r-- | src/corelib/tools/qdatetime.cpp | 9 | ||||
-rw-r--r-- | src/gui/kernel/qsurfaceformat.cpp | 8 | ||||
-rw-r--r-- | src/gui/opengl/qopenglframebufferobject.cpp | 1 | ||||
-rw-r--r-- | src/network/bearer/qnetworksession.cpp | 5 | ||||
-rw-r--r-- | src/plugins/platforms/ios/qiosscreen.mm | 4 | ||||
-rw-r--r-- | src/testlib/qtestcase.qdoc | 6 | ||||
-rw-r--r-- | src/widgets/itemviews/qstyleditemdelegate.cpp | 2 | ||||
-rw-r--r-- | src/widgets/widgets/qcombobox.cpp | 7 | ||||
-rw-r--r-- | tests/auto/gui/qopengl/tst_qopengl.cpp | 28 | ||||
-rw-r--r-- | tools/configure/environment.cpp | 3 |
14 files changed, 81 insertions, 19 deletions
diff --git a/mkspecs/features/exclusive_builds.prf b/mkspecs/features/exclusive_builds.prf index 5d06198ae4..f40cc99172 100644 --- a/mkspecs/features/exclusive_builds.prf +++ b/mkspecs/features/exclusive_builds.prf @@ -1,12 +1,9 @@ -defineTest(addExclusiveBuilds) { - lessThan(ARGC, 2): \ - error("addExclusiveBuilds() requires at least two arguments") - - !$$join(ARGS, _and_):!fix_output_dirs: \ +defineTest(addExclusiveBuildsProper) { + !$$1:!fix_output_dirs: \ return(true) - for(build, ARGS) { + for(build, 2) { isEmpty($${build}.name) { $${build}.name = $$title($$build) export($${build}.name) @@ -20,7 +17,7 @@ defineTest(addExclusiveBuilds) { export($${build}.dir_affix) } - $${build}.exclusive = $$ARGS + $${build}.exclusive = $$2 export($${build}.exclusive) QMAKE_EXCLUSIVE_BUILDS += $$build @@ -33,6 +30,13 @@ defineTest(addExclusiveBuilds) { return(true) } +defineTest(addExclusiveBuilds) { + lessThan(ARGC, 2): \ + error("addExclusiveBuilds() requires at least two arguments") + + addExclusiveBuildsProper($$join(ARGS, _and_), $$ARGS) +} + # Default directories to process QMAKE_DIR_REPLACE = OBJECTS_DIR MOC_DIR RCC_DIR PRECOMPILED_DIR QGLTF_DIR DESTDIR QMAKE_DIR_REPLACE_SANE += QGLTF_DIR diff --git a/mkspecs/macx-ios-clang/features/resolve_config.prf b/mkspecs/macx-ios-clang/features/resolve_config.prf index a964ee3278..22d962af38 100644 --- a/mkspecs/macx-ios-clang/features/resolve_config.prf +++ b/mkspecs/macx-ios-clang/features/resolve_config.prf @@ -32,9 +32,9 @@ macx-xcode { } else { # Switch the order to make sure that the first Makefile target is the right one !contains(QT_CONFIG, simulator_and_device):contains(QMAKE_MAC_SDK, ^$${simulator.sdk}.*): \ - addExclusiveBuilds(simulator, device) + addExclusiveBuildsProper(simulator_and_device, simulator device) else: \ - addExclusiveBuilds(device, simulator) + addExclusiveBuildsProper(simulator_and_device, device simulator) } equals(TEMPLATE, subdirs) { diff --git a/src/corelib/mimetypes/qmimeprovider.cpp b/src/corelib/mimetypes/qmimeprovider.cpp index dc6eb05d9a..aae5cc411b 100644 --- a/src/corelib/mimetypes/qmimeprovider.cpp +++ b/src/corelib/mimetypes/qmimeprovider.cpp @@ -710,6 +710,10 @@ QMimeXMLProvider::QMimeXMLProvider(QMimeDatabasePrivate *db) initResources(); } +QMimeXMLProvider::~QMimeXMLProvider() +{ +} + bool QMimeXMLProvider::isValid() { return true; diff --git a/src/corelib/mimetypes/qmimeprovider_p.h b/src/corelib/mimetypes/qmimeprovider_p.h index b6028191f7..e6fc47bf80 100644 --- a/src/corelib/mimetypes/qmimeprovider_p.h +++ b/src/corelib/mimetypes/qmimeprovider_p.h @@ -138,6 +138,7 @@ class QMimeXMLProvider : public QMimeProviderBase { public: QMimeXMLProvider(QMimeDatabasePrivate *db); + ~QMimeXMLProvider(); virtual bool isValid() Q_DECL_OVERRIDE; virtual QMimeType mimeTypeForName(const QString &name) Q_DECL_OVERRIDE; diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp index bfc7e1ca0e..e2fbe6ae60 100644 --- a/src/corelib/tools/qdatetime.cpp +++ b/src/corelib/tools/qdatetime.cpp @@ -1644,9 +1644,11 @@ QString QTime::toString(Qt::DateFormat format) const \row \li z \li the milliseconds without leading zeroes (0 to 999) \row \li zzz \li the milliseconds with leading zeroes (000 to 999) \row \li AP or A - \li use AM/PM display. \e A/AP will be replaced by either "AM" or "PM". + \li use AM/PM display. \e A/AP will be replaced by either + QLocale::amText() or QLocale::pmText(). \row \li ap or a - \li use am/pm display. \e a/ap will be replaced by either "am" or "pm". + \li use am/pm display. \e a/ap will be replaced by a lower-case version of + QLocale::amText() or QLocale::pmText(). \row \li t \li the timezone (for example "CEST") \endtable @@ -1655,7 +1657,8 @@ QString QTime::toString(Qt::DateFormat format) const expression. Two consecutive single quotes ("''") are replaced by a singlequote in the output. Formats without separators (e.g. "HHmm") are currently not supported. - Example format strings (assuming that the QTime is 14:13:09.042) + Example format strings (assuming that the QTime is 14:13:09.042 and the system + locale is \c{en_US}) \table \header \li Format \li Result diff --git a/src/gui/kernel/qsurfaceformat.cpp b/src/gui/kernel/qsurfaceformat.cpp index d7dc0faceb..dd742b6007 100644 --- a/src/gui/kernel/qsurfaceformat.cpp +++ b/src/gui/kernel/qsurfaceformat.cpp @@ -41,6 +41,7 @@ #include <QtCore/qatomic.h> #include <QtCore/QDebug> +#include <QOpenGLContext> #ifdef major #undef major @@ -761,6 +762,13 @@ Q_GLOBAL_STATIC(QSurfaceFormat, qt_default_surface_format) */ void QSurfaceFormat::setDefaultFormat(const QSurfaceFormat &format) { +#ifndef QT_NO_OPENGL + QOpenGLContext *globalContext = QOpenGLContext::globalShareContext(); + if (globalContext && globalContext->isValid()) { + qWarning("Warning: Setting a new default format with a different version or profile after " + "the global shared context is created may cause issues with context sharing."); + } +#endif *qt_default_surface_format() = format; } diff --git a/src/gui/opengl/qopenglframebufferobject.cpp b/src/gui/opengl/qopenglframebufferobject.cpp index 14581c89f6..d9d4288ec8 100644 --- a/src/gui/opengl/qopenglframebufferobject.cpp +++ b/src/gui/opengl/qopenglframebufferobject.cpp @@ -1497,6 +1497,7 @@ bool QOpenGLFramebufferObject::bindDefault() if (ctx) { ctx->functions()->glBindFramebuffer(GL_FRAMEBUFFER, ctx->defaultFramebufferObject()); QOpenGLContextPrivate::get(ctx)->qgl_current_fbo_invalid = true; + QOpenGLContextPrivate::get(ctx)->qgl_current_fbo = Q_NULLPTR; } #ifdef QT_DEBUG else diff --git a/src/network/bearer/qnetworksession.cpp b/src/network/bearer/qnetworksession.cpp index 6d864a7d3e..2ad46918b2 100644 --- a/src/network/bearer/qnetworksession.cpp +++ b/src/network/bearer/qnetworksession.cpp @@ -48,6 +48,11 @@ #include "qnetworkconfigmanager_p.h" +// for QNetworkSession::interface +#ifdef interface +# undef interface +#endif + #ifndef QT_NO_BEARERMANAGEMENT QT_BEGIN_NAMESPACE diff --git a/src/plugins/platforms/ios/qiosscreen.mm b/src/plugins/platforms/ios/qiosscreen.mm index d53f0df846..dc14698146 100644 --- a/src/plugins/platforms/ios/qiosscreen.mm +++ b/src/plugins/platforms/ios/qiosscreen.mm @@ -207,8 +207,8 @@ QIOSScreen::QIOSScreen(UIScreen *screen) else m_depth = 24; - if (deviceIdentifier.contains(QRegularExpression("^iPhone(7,1|8,2)$"))) { - // iPhone 6 Plus or iPhone 6S Plus + if (deviceIdentifier.contains(QRegularExpression("^iPhone(7,1|8,2|9,2|9,4)$"))) { + // iPhone Plus models m_physicalDpi = 401; } else if (deviceIdentifier.contains(QRegularExpression("^iPad(1,1|2,[1-4]|3,[1-6]|4,[1-3]|5,[3-4]|6,[7-8])$"))) { // All iPads except the iPad Mini series diff --git a/src/testlib/qtestcase.qdoc b/src/testlib/qtestcase.qdoc index 85f71fc27f..f34c84708f 100644 --- a/src/testlib/qtestcase.qdoc +++ b/src/testlib/qtestcase.qdoc @@ -124,7 +124,7 @@ \relates QTest The QTRY_VERIFY_WITH_TIMEOUT() macro is similar to QVERIFY(), but checks the \a condition - repeatedly, until either the condition becomes true or the \a timeout is + repeatedly, until either the condition becomes true or the \a timeout (in milliseconds) is reached. Between each evaluation, events will be processed. If the timeout is reached, a failure is recorded in the test log and the test won't be executed further. @@ -156,7 +156,7 @@ The QTRY_VERIFY2_WITH_TIMEOUT macro is similar to QTRY_VERIFY_WITH_TIMEOUT() except that it outputs a verbose \a message when \a condition is still false - after the specified \a timeout. The \a message is a plain C string. + after the specified \a timeout (in milliseconds). The \a message is a plain C string. Example: \code @@ -196,7 +196,7 @@ The QTRY_COMPARE_WITH_TIMEOUT() macro is similar to QCOMPARE(), but performs the comparison of the \a actual and \a expected values repeatedly, until either the two values - are equal or the \a timeout is reached. Between each comparison, events + are equal or the \a timeout (in milliseconds) is reached. Between each comparison, events will be processed. If the timeout is reached, a failure is recorded in the test log and the test won't be executed further. diff --git a/src/widgets/itemviews/qstyleditemdelegate.cpp b/src/widgets/itemviews/qstyleditemdelegate.cpp index bab8436dce..e4115c9e60 100644 --- a/src/widgets/itemviews/qstyleditemdelegate.cpp +++ b/src/widgets/itemviews/qstyleditemdelegate.cpp @@ -366,7 +366,7 @@ void QStyledItemDelegate::initStyleOption(QStyleOptionViewItem *option, if it is enabled or selected. After painting, you should ensure that the painter is returned to - its the state it was supplied in when this function was called. + the state it was supplied in when this function was called. For example, it may be useful to call QPainter::save() before painting and QPainter::restore() afterwards. diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp index 728d243ce3..4287114ec3 100644 --- a/src/widgets/widgets/qcombobox.cpp +++ b/src/widgets/widgets/qcombobox.cpp @@ -1684,6 +1684,9 @@ void QComboBox::setIconSize(const QSize &size) By default, this property is \c false. The effect of editing depends on the insert policy. + \note When disabling the \a editable state, the validator and + completer are removed. + \sa InsertPolicy */ bool QComboBox::isEditable() const @@ -1837,6 +1840,8 @@ QLineEdit *QComboBox::lineEdit() const \fn void QComboBox::setValidator(const QValidator *validator) Sets the \a validator to use instead of the current validator. + + \note The validator is removed when the editable property becomes \c false. */ void QComboBox::setValidator(const QValidator *v) @@ -1870,6 +1875,8 @@ const QValidator *QComboBox::validator() const By default, for an editable combo box, a QCompleter that performs case insensitive inline completion is automatically created. + + \note The completer is removed when the \a editable property becomes \c false. */ void QComboBox::setCompleter(QCompleter *c) { diff --git a/tests/auto/gui/qopengl/tst_qopengl.cpp b/tests/auto/gui/qopengl/tst_qopengl.cpp index 15244744bf..f988cdb957 100644 --- a/tests/auto/gui/qopengl/tst_qopengl.cpp +++ b/tests/auto/gui/qopengl/tst_qopengl.cpp @@ -109,6 +109,7 @@ private slots: void vaoCreate(); void bufferCreate(); void bufferMapRange(); + void defaultQGLCurrentBuffer(); }; struct SharedResourceTracker @@ -1520,6 +1521,33 @@ void tst_QOpenGL::bufferMapRange() ctx->doneCurrent(); } +void tst_QOpenGL::defaultQGLCurrentBuffer() +{ + QScopedPointer<QSurface> surface(createSurface(QSurface::Window)); + QScopedPointer<QOpenGLContext> ctx(new QOpenGLContext); + ctx->create(); + ctx->makeCurrent(surface.data()); + + // Bind default FBO on the current context, and record what's the current QGL FBO. It should + // be Q_NULLPTR because the default platform OpenGL FBO is not backed by a + // QOpenGLFramebufferObject. + QOpenGLFramebufferObject::bindDefault(); + QOpenGLFramebufferObject *defaultQFBO = QOpenGLContextPrivate::get(ctx.data())->qgl_current_fbo; + + // Create new FBO, bind it, and see that the QGL FBO points to the newly created FBO. + QScopedPointer<QOpenGLFramebufferObject> obj(new QOpenGLFramebufferObject(128, 128)); + obj->bind(); + QOpenGLFramebufferObject *customQFBO = QOpenGLContextPrivate::get(ctx.data())->qgl_current_fbo; + QVERIFY(defaultQFBO != customQFBO); + + // Bind the default FBO, and check that the QGL FBO points to the original FBO object. + QOpenGLFramebufferObject::bindDefault(); + QOpenGLFramebufferObject *finalQFBO = QOpenGLContextPrivate::get(ctx.data())->qgl_current_fbo; + QCOMPARE(defaultQFBO, finalQFBO); + + ctx->doneCurrent(); +} + void tst_QOpenGL::nullTextureInitializtion() { QScopedPointer<QSurface> surface(createSurface(QSurface::Window)); diff --git a/tools/configure/environment.cpp b/tools/configure/environment.cpp index 1a05c9ce62..bf82f14159 100644 --- a/tools/configure/environment.cpp +++ b/tools/configure/environment.cpp @@ -154,12 +154,13 @@ QString Environment::msvcVersion() const QString command = QFile::decodeName(qgetenv("ComSpec")) + QLatin1String(" /c ") + QLatin1String(compilerInfo(CC_MSVC2015)->executable) + QLatin1String(" /? 2>&1"); + SetEnvironmentVariable(L"CL", NULL); // May contain /nologo, which suppresses the version. QString version = execute(command, &returnValue); if (returnValue != 0) { cout << "Could not get cl version" << returnValue << qPrintable(version) << '\n';; version.clear(); } else { - QRegExp versionRegexp(QStringLiteral("^.*Compiler Version ([0-9.]+) for.*$")); + QRegExp versionRegexp(QStringLiteral("^.*\\b(\\d{2,2}\\.\\d{2,2}\\.\\d{5,5})\\b.*$")); Q_ASSERT(versionRegexp.isValid()); if (versionRegexp.exactMatch(version)) { version = versionRegexp.cap(1); |