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
This commit is contained in:
Liang Qi 2016-10-17 11:02:54 +02:00
commit d90b155c60
14 changed files with 81 additions and 19 deletions

View File

@ -1,12 +1,9 @@
defineTest(addExclusiveBuilds) { defineTest(addExclusiveBuildsProper) {
lessThan(ARGC, 2): \ !$$1:!fix_output_dirs: \
error("addExclusiveBuilds() requires at least two arguments")
!$$join(ARGS, _and_):!fix_output_dirs: \
return(true) return(true)
for(build, ARGS) { for(build, 2) {
isEmpty($${build}.name) { isEmpty($${build}.name) {
$${build}.name = $$title($$build) $${build}.name = $$title($$build)
export($${build}.name) export($${build}.name)
@ -20,7 +17,7 @@ defineTest(addExclusiveBuilds) {
export($${build}.dir_affix) export($${build}.dir_affix)
} }
$${build}.exclusive = $$ARGS $${build}.exclusive = $$2
export($${build}.exclusive) export($${build}.exclusive)
QMAKE_EXCLUSIVE_BUILDS += $$build QMAKE_EXCLUSIVE_BUILDS += $$build
@ -33,6 +30,13 @@ defineTest(addExclusiveBuilds) {
return(true) return(true)
} }
defineTest(addExclusiveBuilds) {
lessThan(ARGC, 2): \
error("addExclusiveBuilds() requires at least two arguments")
addExclusiveBuildsProper($$join(ARGS, _and_), $$ARGS)
}
# Default directories to process # Default directories to process
QMAKE_DIR_REPLACE = OBJECTS_DIR MOC_DIR RCC_DIR PRECOMPILED_DIR QGLTF_DIR DESTDIR QMAKE_DIR_REPLACE = OBJECTS_DIR MOC_DIR RCC_DIR PRECOMPILED_DIR QGLTF_DIR DESTDIR
QMAKE_DIR_REPLACE_SANE += QGLTF_DIR QMAKE_DIR_REPLACE_SANE += QGLTF_DIR

View File

@ -32,9 +32,9 @@ macx-xcode {
} else { } else {
# Switch the order to make sure that the first Makefile target is the right one # 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}.*): \ !contains(QT_CONFIG, simulator_and_device):contains(QMAKE_MAC_SDK, ^$${simulator.sdk}.*): \
addExclusiveBuilds(simulator, device) addExclusiveBuildsProper(simulator_and_device, simulator device)
else: \ else: \
addExclusiveBuilds(device, simulator) addExclusiveBuildsProper(simulator_and_device, device simulator)
} }
equals(TEMPLATE, subdirs) { equals(TEMPLATE, subdirs) {

View File

@ -710,6 +710,10 @@ QMimeXMLProvider::QMimeXMLProvider(QMimeDatabasePrivate *db)
initResources(); initResources();
} }
QMimeXMLProvider::~QMimeXMLProvider()
{
}
bool QMimeXMLProvider::isValid() bool QMimeXMLProvider::isValid()
{ {
return true; return true;

View File

@ -138,6 +138,7 @@ class QMimeXMLProvider : public QMimeProviderBase
{ {
public: public:
QMimeXMLProvider(QMimeDatabasePrivate *db); QMimeXMLProvider(QMimeDatabasePrivate *db);
~QMimeXMLProvider();
virtual bool isValid() Q_DECL_OVERRIDE; virtual bool isValid() Q_DECL_OVERRIDE;
virtual QMimeType mimeTypeForName(const QString &name) Q_DECL_OVERRIDE; virtual QMimeType mimeTypeForName(const QString &name) Q_DECL_OVERRIDE;

View File

@ -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 z \li the milliseconds without leading zeroes (0 to 999)
\row \li zzz \li the milliseconds with leading zeroes (000 to 999) \row \li zzz \li the milliseconds with leading zeroes (000 to 999)
\row \li AP or A \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 \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") \row \li t \li the timezone (for example "CEST")
\endtable \endtable
@ -1655,7 +1657,8 @@ QString QTime::toString(Qt::DateFormat format) const
expression. Two consecutive single quotes ("''") are replaced by a singlequote expression. Two consecutive single quotes ("''") are replaced by a singlequote
in the output. Formats without separators (e.g. "HHmm") are currently not supported. 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 \table
\header \li Format \li Result \header \li Format \li Result

View File

@ -41,6 +41,7 @@
#include <QtCore/qatomic.h> #include <QtCore/qatomic.h>
#include <QtCore/QDebug> #include <QtCore/QDebug>
#include <QOpenGLContext>
#ifdef major #ifdef major
#undef major #undef major
@ -761,6 +762,13 @@ Q_GLOBAL_STATIC(QSurfaceFormat, qt_default_surface_format)
*/ */
void QSurfaceFormat::setDefaultFormat(const QSurfaceFormat &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; *qt_default_surface_format() = format;
} }

View File

@ -1497,6 +1497,7 @@ bool QOpenGLFramebufferObject::bindDefault()
if (ctx) { if (ctx) {
ctx->functions()->glBindFramebuffer(GL_FRAMEBUFFER, ctx->defaultFramebufferObject()); ctx->functions()->glBindFramebuffer(GL_FRAMEBUFFER, ctx->defaultFramebufferObject());
QOpenGLContextPrivate::get(ctx)->qgl_current_fbo_invalid = true; QOpenGLContextPrivate::get(ctx)->qgl_current_fbo_invalid = true;
QOpenGLContextPrivate::get(ctx)->qgl_current_fbo = Q_NULLPTR;
} }
#ifdef QT_DEBUG #ifdef QT_DEBUG
else else

View File

@ -48,6 +48,11 @@
#include "qnetworkconfigmanager_p.h" #include "qnetworkconfigmanager_p.h"
// for QNetworkSession::interface
#ifdef interface
# undef interface
#endif
#ifndef QT_NO_BEARERMANAGEMENT #ifndef QT_NO_BEARERMANAGEMENT
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE

View File

@ -207,8 +207,8 @@ QIOSScreen::QIOSScreen(UIScreen *screen)
else else
m_depth = 24; m_depth = 24;
if (deviceIdentifier.contains(QRegularExpression("^iPhone(7,1|8,2)$"))) { if (deviceIdentifier.contains(QRegularExpression("^iPhone(7,1|8,2|9,2|9,4)$"))) {
// iPhone 6 Plus or iPhone 6S Plus // iPhone Plus models
m_physicalDpi = 401; 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])$"))) { } 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 // All iPads except the iPad Mini series

View File

@ -124,7 +124,7 @@
\relates QTest \relates QTest
The QTRY_VERIFY_WITH_TIMEOUT() macro is similar to QVERIFY(), but checks the \a condition 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 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 is reached, a failure is recorded in the test log and the test won't be
executed further. executed further.
@ -156,7 +156,7 @@
The QTRY_VERIFY2_WITH_TIMEOUT macro is similar to QTRY_VERIFY_WITH_TIMEOUT() 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 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: Example:
\code \code
@ -196,7 +196,7 @@
The QTRY_COMPARE_WITH_TIMEOUT() macro is similar to QCOMPARE(), but performs the comparison 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 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 will be processed. If the timeout is reached, a failure is recorded in the
test log and the test won't be executed further. test log and the test won't be executed further.

View File

@ -366,7 +366,7 @@ void QStyledItemDelegate::initStyleOption(QStyleOptionViewItem *option,
if it is enabled or selected. if it is enabled or selected.
After painting, you should ensure that the painter is returned to 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 For example, it may be useful to call QPainter::save() before
painting and QPainter::restore() afterwards. painting and QPainter::restore() afterwards.

View File

@ -1684,6 +1684,9 @@ void QComboBox::setIconSize(const QSize &size)
By default, this property is \c false. The effect of editing depends By default, this property is \c false. The effect of editing depends
on the insert policy. on the insert policy.
\note When disabling the \a editable state, the validator and
completer are removed.
\sa InsertPolicy \sa InsertPolicy
*/ */
bool QComboBox::isEditable() const bool QComboBox::isEditable() const
@ -1837,6 +1840,8 @@ QLineEdit *QComboBox::lineEdit() const
\fn void QComboBox::setValidator(const QValidator *validator) \fn void QComboBox::setValidator(const QValidator *validator)
Sets the \a validator to use instead of the current 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) 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 By default, for an editable combo box, a QCompleter that
performs case insensitive inline completion is automatically created. 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) void QComboBox::setCompleter(QCompleter *c)
{ {

View File

@ -109,6 +109,7 @@ private slots:
void vaoCreate(); void vaoCreate();
void bufferCreate(); void bufferCreate();
void bufferMapRange(); void bufferMapRange();
void defaultQGLCurrentBuffer();
}; };
struct SharedResourceTracker struct SharedResourceTracker
@ -1520,6 +1521,33 @@ void tst_QOpenGL::bufferMapRange()
ctx->doneCurrent(); 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() void tst_QOpenGL::nullTextureInitializtion()
{ {
QScopedPointer<QSurface> surface(createSurface(QSurface::Window)); QScopedPointer<QSurface> surface(createSurface(QSurface::Window));

View File

@ -154,12 +154,13 @@ QString Environment::msvcVersion()
const QString command = QFile::decodeName(qgetenv("ComSpec")) const QString command = QFile::decodeName(qgetenv("ComSpec"))
+ QLatin1String(" /c ") + QLatin1String(compilerInfo(CC_MSVC2015)->executable) + QLatin1String(" /c ") + QLatin1String(compilerInfo(CC_MSVC2015)->executable)
+ QLatin1String(" /? 2>&1"); + QLatin1String(" /? 2>&1");
SetEnvironmentVariable(L"CL", NULL); // May contain /nologo, which suppresses the version.
QString version = execute(command, &returnValue); QString version = execute(command, &returnValue);
if (returnValue != 0) { if (returnValue != 0) {
cout << "Could not get cl version" << returnValue << qPrintable(version) << '\n';; cout << "Could not get cl version" << returnValue << qPrintable(version) << '\n';;
version.clear(); version.clear();
} else { } 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()); Q_ASSERT(versionRegexp.isValid());
if (versionRegexp.exactMatch(version)) { if (versionRegexp.exactMatch(version)) {
version = versionRegexp.cap(1); version = versionRegexp.cap(1);