diff options
162 files changed, 925 insertions, 313 deletions
diff --git a/doc/global/qt-cpp-defines.qdocconf b/doc/global/qt-cpp-defines.qdocconf index bbf1dda2e6..b2205f54ac 100644 --- a/doc/global/qt-cpp-defines.qdocconf +++ b/doc/global/qt-cpp-defines.qdocconf @@ -27,9 +27,11 @@ Cpp.ignoretokens += \ Q_CORE_EXPORT_INLINE \ Q_DBUS_EXPORT \ Q_DECL_CONSTEXPR \ + Q_DECL_CONST_FUNCTION \ Q_DECL_DEPRECATED \ Q_DECL_NOEXCEPT \ Q_DECL_NOTHROW \ + Q_DECL_PURE_FUNCTION \ Q_DECL_UNUSED \ Q_DECLARATIVE_EXPORT \ Q_EXPLICIT \ diff --git a/mkspecs/common/qnx/qplatformdefs.h b/mkspecs/common/qnx/qplatformdefs.h new file mode 100644 index 0000000000..4baa93b642 --- /dev/null +++ b/mkspecs/common/qnx/qplatformdefs.h @@ -0,0 +1,109 @@ +/**************************************************************************** +** +** Copyright (C) 2014 BlackBerry Limited. All rights reserved. +** Contact: http://www.qt-project.org/legal +** +** This file is part of the qmake spec of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q_QNX_PLATFORMDEFS_H +#define Q_QNX_PLATFORMDEFS_H + +// Get Qt defines/settings + +#include "qglobal.h" + +// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs + +#include <unistd.h> + +#define __STDC_CONSTANT_MACROS + +// We are hot - unistd.h should have turned on the specific APIs we requested + + +#include <pthread.h> +#include <dirent.h> +#include <fcntl.h> +#include <grp.h> +#include <pwd.h> +#include <signal.h> + +#include <sys/types.h> +#include <sys/ioctl.h> +#include <sys/ipc.h> +#include <sys/time.h> +// QNX doesn't have the System V <sys/shm.h> header. This is not a standard +// POSIX header, it's only documented in the Single UNIX Specification. +// The preferred POSIX compliant way to share memory is to use the functions +// in <sys/mman.h> that comply with the POSIX Real Time Interface (1003.1b). +#include <sys/mman.h> +#include <sys/socket.h> +#include <sys/stat.h> +#include <sys/wait.h> +#include <netinet/in.h> +#ifndef QT_NO_IPV6IFNAME +#include <net/if.h> +#endif + +// for htonl +#include <arpa/inet.h> + +#define QT_USE_XOPEN_LFS_EXTENSIONS +#if !defined(__EXT_QNX__READDIR64_R) +#define QT_NO_READDIR64 +#endif +#include "../posix/qplatformdefs.h" +#if defined(__EXT_QNX__READDIR64_R) +#define QT_EXT_QNX_READDIR_R ::_readdir64_r +#elif defined(__EXT_QNX__READDIR_R) +#define QT_EXT_QNX_READDIR_R ::_readdir_r +#endif + +#define QT_SNPRINTF ::snprintf +#define QT_VSNPRINTF ::vsnprintf + +// QNX6 doesn't have getpagesize() +inline int getpagesize() +{ + return ::sysconf(_SC_PAGESIZE); +} + +#include <stdlib.h> + +#define QT_QWS_TEMP_DIR QString::fromLatin1(qgetenv("TMP")) + +#endif // Q_QNX_PLATFORMDEFS_H diff --git a/mkspecs/qnx-armv7le-qcc/qplatformdefs.h b/mkspecs/qnx-armv7le-qcc/qplatformdefs.h index b47aecde0d..e8590f2e3e 100644 --- a/mkspecs/qnx-armv7le-qcc/qplatformdefs.h +++ b/mkspecs/qnx-armv7le-qcc/qplatformdefs.h @@ -1,9 +1,9 @@ /**************************************************************************** ** -** Copyright (C) 2012 Research In Motion Limited. <blackberry-qt@qnx.com> +** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** Contact: http://www.qt-project.org/legal ** -** This file is part of the QtCore module of the Qt Toolkit. +** This file is part of the qmake spec of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -42,68 +42,6 @@ #ifndef QPLATFORMDEFS_H #define QPLATFORMDEFS_H -// Get Qt defines/settings - -#include "qglobal.h" - -// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs - -#include <unistd.h> - -#define __STDC_CONSTANT_MACROS - -// We are hot - unistd.h should have turned on the specific APIs we requested - - -#include <pthread.h> -#include <dirent.h> -#include <fcntl.h> -#include <grp.h> -#include <pwd.h> -#include <signal.h> - -#include <sys/types.h> -#include <sys/ioctl.h> -#include <sys/ipc.h> -#include <sys/time.h> -// QNX doesn't have the System V <sys/shm.h> header. This is not a standard -// POSIX header, it's only documented in the Single UNIX Specification. -// The preferred POSIX compliant way to share memory is to use the functions -// in <sys/mman.h> that comply with the POSIX Real Time Interface (1003.1b). -#include <sys/mman.h> -#include <sys/socket.h> -#include <sys/stat.h> -#include <sys/wait.h> -#include <netinet/in.h> -#ifndef QT_NO_IPV6IFNAME -#include <net/if.h> -#endif - -// for htonl -#include <arpa/inet.h> - -#define QT_USE_XOPEN_LFS_EXTENSIONS -#if !defined(__EXT_QNX__READDIR64_R) -#define QT_NO_READDIR64 -#endif -#include "../common/posix/qplatformdefs.h" -#if defined(__EXT_QNX__READDIR64_R) -#define QT_EXT_QNX_READDIR_R ::_readdir64_r -#elif defined(__EXT_QNX__READDIR_R) -#define QT_EXT_QNX_READDIR_R ::_readdir_r -#endif - -#define QT_SNPRINTF ::snprintf -#define QT_VSNPRINTF ::vsnprintf - -// QNX6 doesn't have getpagesize() -inline int getpagesize() -{ - return ::sysconf(_SC_PAGESIZE); -} - -#include <stdlib.h> - -#define QT_QWS_TEMP_DIR QString::fromLatin1(qgetenv("TMP")) +#include "../common/qnx/qplatformdefs.h" #endif // QPLATFORMDEFS_H diff --git a/mkspecs/qnx-x86-qcc/qplatformdefs.h b/mkspecs/qnx-x86-qcc/qplatformdefs.h index b47aecde0d..e8590f2e3e 100644 --- a/mkspecs/qnx-x86-qcc/qplatformdefs.h +++ b/mkspecs/qnx-x86-qcc/qplatformdefs.h @@ -1,9 +1,9 @@ /**************************************************************************** ** -** Copyright (C) 2012 Research In Motion Limited. <blackberry-qt@qnx.com> +** Copyright (C) 2012 - 2014 BlackBerry Limited. All rights reserved. ** Contact: http://www.qt-project.org/legal ** -** This file is part of the QtCore module of the Qt Toolkit. +** This file is part of the qmake spec of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -42,68 +42,6 @@ #ifndef QPLATFORMDEFS_H #define QPLATFORMDEFS_H -// Get Qt defines/settings - -#include "qglobal.h" - -// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs - -#include <unistd.h> - -#define __STDC_CONSTANT_MACROS - -// We are hot - unistd.h should have turned on the specific APIs we requested - - -#include <pthread.h> -#include <dirent.h> -#include <fcntl.h> -#include <grp.h> -#include <pwd.h> -#include <signal.h> - -#include <sys/types.h> -#include <sys/ioctl.h> -#include <sys/ipc.h> -#include <sys/time.h> -// QNX doesn't have the System V <sys/shm.h> header. This is not a standard -// POSIX header, it's only documented in the Single UNIX Specification. -// The preferred POSIX compliant way to share memory is to use the functions -// in <sys/mman.h> that comply with the POSIX Real Time Interface (1003.1b). -#include <sys/mman.h> -#include <sys/socket.h> -#include <sys/stat.h> -#include <sys/wait.h> -#include <netinet/in.h> -#ifndef QT_NO_IPV6IFNAME -#include <net/if.h> -#endif - -// for htonl -#include <arpa/inet.h> - -#define QT_USE_XOPEN_LFS_EXTENSIONS -#if !defined(__EXT_QNX__READDIR64_R) -#define QT_NO_READDIR64 -#endif -#include "../common/posix/qplatformdefs.h" -#if defined(__EXT_QNX__READDIR64_R) -#define QT_EXT_QNX_READDIR_R ::_readdir64_r -#elif defined(__EXT_QNX__READDIR_R) -#define QT_EXT_QNX_READDIR_R ::_readdir_r -#endif - -#define QT_SNPRINTF ::snprintf -#define QT_VSNPRINTF ::vsnprintf - -// QNX6 doesn't have getpagesize() -inline int getpagesize() -{ - return ::sysconf(_SC_PAGESIZE); -} - -#include <stdlib.h> - -#define QT_QWS_TEMP_DIR QString::fromLatin1(qgetenv("TMP")) +#include "../common/qnx/qplatformdefs.h" #endif // QPLATFORMDEFS_H diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qhash.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qhash.cpp index 8c21083976..aa0473964c 100644 --- a/src/corelib/doc/snippets/code/src_corelib_tools_qhash.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_tools_qhash.cpp @@ -297,3 +297,13 @@ while (i != hash.end() && i.key() == "plenty") { ++i; } //! [26] + +//! [qhashbits] +inline uint qHash(const std::vector<int> &key, uint seed = 0) +{ + if (key.empty()) + return seed; + else + return qHashBits(&key.front(), key.size() * sizeof(int), seed); +} +//! [qhashbits] diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index 6755b82f61..dfa3d83fb8 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -200,6 +200,8 @@ # define Q_UNLIKELY(expr) __builtin_expect(!!(expr), false) # define Q_NORETURN __attribute__((__noreturn__)) # define Q_REQUIRED_RESULT __attribute__ ((__warn_unused_result__)) +# define Q_DECL_PURE_FUNCTION __attribute__((pure)) +# define Q_DECL_CONST_FUNCTION __attribute__((const)) # if !defined(QT_MOC_CPP) # define Q_PACKED __attribute__ ((__packed__)) # ifndef __ARM_EABI__ @@ -975,6 +977,12 @@ #ifndef Q_DECL_NS_RETURNS_AUTORELEASED # define Q_DECL_NS_RETURNS_AUTORELEASED #endif +#ifndef Q_DECL_PURE_FUNCTION +# define Q_DECL_PURE_FUNCTION +#endif +#ifndef Q_DECL_CONST_FUNCTION +# define Q_DECL_CONST_FUNCTION Q_DECL_PURE_FUNCTION +#endif /* Workaround for static const members on MSVC++. diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index b2f9e29b44..7789461a1c 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -45,11 +45,11 @@ #include <stddef.h> -#define QT_VERSION_STR "5.3.0" +#define QT_VERSION_STR "5.4.0" /* QT_VERSION is (major << 16) + (minor << 8) + patch. */ -#define QT_VERSION 0x050300 +#define QT_VERSION 0x050400 /* can be used like #if (QT_VERSION >= QT_VERSION_CHECK(4, 4, 0)) */ @@ -858,22 +858,37 @@ Q_CORE_EXPORT void qFreeAligned(void *ptr); # endif #endif -#if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && !defined(Q_CC_RVCT) -/* make use of typeof-extension */ +#if defined(Q_COMPILER_DECLTYPE) || (defined(Q_CC_GNU) && !defined(Q_CC_RVCT)) +/* make use of decltype or GCC's __typeof__ extension */ template <typename T> class QForeachContainer { public: - inline QForeachContainer(const T& t) : c(t), brk(0), i(c.begin()), e(c.end()) { } + inline QForeachContainer(const T& t) : c(t), i(c.begin()), e(c.end()), control(1) { } const T c; - int brk; typename T::const_iterator i, e; + int control; }; -#define Q_FOREACH(variable, container) \ -for (QForeachContainer<__typeof__((container))> _container_((container)); \ - !_container_.brk && _container_.i != _container_.e; \ - __extension__ ({ ++_container_.brk; ++_container_.i; })) \ - for (variable = *_container_.i;; __extension__ ({--_container_.brk; break;})) +# ifdef Q_COMPILER_DECLTYPE +# define QT_FOREACH_DECLTYPE(x) typename QtPrivate::remove_reference<decltype(x)>::type +# else +# define QT_FOREACH_DECLTYPE(x) __typeof__((x)) +# endif + +// Explanation of the control word: +// - it's initialized to 1 +// - that means both the inner and outer loops start +// - if there were no breaks, at the end of the inner loop, it's set to 0, which +// causes it to exit (the inner loop is run exactly once) +// - at the end of the outer loop, it's inverted, so it becomes 1 again, allowing +// the outer loop to continue executing +// - if there was a break inside the inner loop, it will exit with control still +// set to 1; in that case, the outer loop will invert it to 0 and will exit too +# define Q_FOREACH(variable, container) \ +for (QForeachContainer<QT_FOREACH_DECLTYPE(container)> _container_((container)); \ + _container_.control && _container_.i != _container_.e; \ + ++_container_.i, _container_.control ^= 1) \ + for (variable = *_container_.i; _container_.control; _container_.control = 0) #else diff --git a/src/corelib/io/qdatastream.cpp b/src/corelib/io/qdatastream.cpp index a6fbffee7e..a4c4dbf5ff 100644 --- a/src/corelib/io/qdatastream.cpp +++ b/src/corelib/io/qdatastream.cpp @@ -251,7 +251,7 @@ QT_BEGIN_NAMESPACE return retVal; enum { - DefaultStreamVersion = QDataStream::Qt_5_3 + DefaultStreamVersion = QDataStream::Qt_5_4 }; /*! @@ -542,6 +542,7 @@ void QDataStream::setByteOrder(ByteOrder bo) \value Qt_5_1 Version 14 (Qt 5.1) \value Qt_5_2 Version 15 (Qt 5.2) \value Qt_5_3 Same as Qt_5_2 + \value Qt_5_4 Same as Qt_5_2 \sa setVersion(), version() */ diff --git a/src/corelib/io/qdatastream.h b/src/corelib/io/qdatastream.h index 28f1d51a12..fb8dce0641 100644 --- a/src/corelib/io/qdatastream.h +++ b/src/corelib/io/qdatastream.h @@ -88,8 +88,9 @@ public: Qt_5_0 = 13, Qt_5_1 = 14, Qt_5_2 = 15, - Qt_5_3 = Qt_5_2 -#if QT_VERSION >= 0x050400 + Qt_5_3 = Qt_5_2, + Qt_5_4 = Qt_5_3 +#if QT_VERSION >= 0x050500 #error Add the datastream version for this Qt version #endif }; diff --git a/src/corelib/itemmodels/qabstractitemmodel.cpp b/src/corelib/itemmodels/qabstractitemmodel.cpp index 4241fe08ca..3e303e529c 100644 --- a/src/corelib/itemmodels/qabstractitemmodel.cpp +++ b/src/corelib/itemmodels/qabstractitemmodel.cpp @@ -990,9 +990,9 @@ void QAbstractItemModel::resetInternalData() */ /*! - \fn void *QModelIndex::internalId() const + \fn quintptr QModelIndex::internalId() const - Returns a \c{qint64} used by the model to associate + Returns a \c{quintptr} used by the model to associate the index with the internal data structure. \sa QAbstractItemModel::createIndex() diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h index 83801a20c5..a2f203bf7a 100644 --- a/src/corelib/kernel/qmetatype.h +++ b/src/corelib/kernel/qmetatype.h @@ -889,11 +889,11 @@ struct ContainerAPI<QVector<T> > : CapabilitiesImpl<QVector<T> > template<typename T> struct ContainerAPI<std::vector<T> > : CapabilitiesImpl<std::vector<T> > -{ static int size(const std::vector<T> *t) { return t->size(); } }; +{ static int size(const std::vector<T> *t) { return int(t->size()); } }; template<typename T> struct ContainerAPI<std::list<T> > : CapabilitiesImpl<std::list<T> > -{ static int size(const std::list<T> *t) { return t->size(); } }; +{ static int size(const std::list<T> *t) { return int(t->size()); } }; class QSequentialIterableImpl { diff --git a/src/corelib/tools/qarraydata.cpp b/src/corelib/tools/qarraydata.cpp index 825b3289c7..45587b1214 100644 --- a/src/corelib/tools/qarraydata.cpp +++ b/src/corelib/tools/qarraydata.cpp @@ -68,7 +68,7 @@ static const QArrayData &qt_array_empty = qt_array[0]; static const QArrayData &qt_array_unsharable_empty = qt_array[1]; QArrayData *QArrayData::allocate(size_t objectSize, size_t alignment, - size_t capacity, AllocationOptions options) + size_t capacity, AllocationOptions options) Q_DECL_NOTHROW { // Alignment is a power of two Q_ASSERT(alignment >= Q_ALIGNOF(QArrayData) @@ -111,7 +111,7 @@ QArrayData *QArrayData::allocate(size_t objectSize, size_t alignment, } void QArrayData::deallocate(QArrayData *data, size_t objectSize, - size_t alignment) + size_t alignment) Q_DECL_NOTHROW { // Alignment is a power of two Q_ASSERT(alignment >= Q_ALIGNOF(QArrayData) diff --git a/src/corelib/tools/qarraydata.h b/src/corelib/tools/qarraydata.h index ffb2b8765e..534f310d36 100644 --- a/src/corelib/tools/qarraydata.h +++ b/src/corelib/tools/qarraydata.h @@ -116,9 +116,9 @@ struct Q_CORE_EXPORT QArrayData static QArrayData *allocate(size_t objectSize, size_t alignment, size_t capacity, AllocationOptions options = Default) - Q_REQUIRED_RESULT; + Q_DECL_NOTHROW Q_REQUIRED_RESULT; static void deallocate(QArrayData *data, size_t objectSize, - size_t alignment); + size_t alignment) Q_DECL_NOTHROW; static const QArrayData shared_null[2]; static QArrayData *sharedNull() { return const_cast<QArrayData*>(shared_null); } diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp index fb92d82f07..9c2a242e8e 100644 --- a/src/corelib/tools/qbytearray.cpp +++ b/src/corelib/tools/qbytearray.cpp @@ -67,7 +67,7 @@ int qFindByteArray( const char *needle0, int needleLen); -int qAllocMore(int alloc, int extra) +int qAllocMore(int alloc, int extra) Q_DECL_NOTHROW { Q_ASSERT(alloc >= 0 && extra >= 0); Q_ASSERT_X(alloc < (1 << 30) - extra, "qAllocMore", "Requested size is too large!"); diff --git a/src/corelib/tools/qchar.h b/src/corelib/tools/qchar.h index 266effb66a..88758bdd6d 100644 --- a/src/corelib/tools/qchar.h +++ b/src/corelib/tools/qchar.h @@ -384,7 +384,7 @@ public: QT_DEPRECATED inline char toAscii() const { return toLatin1(); } #endif inline char toLatin1() const; - inline ushort unicode() const { return ucs; } + Q_DECL_CONSTEXPR inline ushort unicode() const { return ucs; } inline ushort &unicode() { return ucs; } #if QT_DEPRECATED_SINCE(5, 0) diff --git a/src/corelib/tools/qhash.cpp b/src/corelib/tools/qhash.cpp index a5d14a3535..65c88d35ab 100644 --- a/src/corelib/tools/qhash.cpp +++ b/src/corelib/tools/qhash.cpp @@ -163,6 +163,11 @@ static inline uint hash(const uchar *p, int len, uint seed) Q_DECL_NOTHROW return h; } +uint qHashBits(const void *p, size_t len, uint seed) Q_DECL_NOTHROW +{ + return hash(static_cast<const uchar*>(p), int(len), seed); +} + static inline uint hash(const QChar *p, int len, uint seed) Q_DECL_NOTHROW { uint h = seed; @@ -669,6 +674,25 @@ void QHashData::checkSanity() Types \c T1 and \c T2 must be supported by qHash(). */ +/*! \fn uint qHashBits(const void *p, size_t len, uint seed = 0) + \relates QHash + \since 5.4 + + Returns the hash value for the memory block of size \a len pointed + to by \a p, using \a seed to seed the calculation. + + Use this function only to implement qHash() for your own custom + types. E.g., here's how you could implement a qHash() overload for + std::vector<int>: + + \snippet code/src_corelib_tools_qhash.cpp qhashbits + + It bears repeating that the implementation of qHashBits() - like + the qHash() overloads offered by Qt - may change at any time. You + \b{must not} rely on the fact that qHashBits() will give the same + results (for the same inputs) across different Qt versions. +*/ + /*! \fn uint qHash(char key, uint seed = 0) \relates QHash \since 5.0 diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h index d4bf8df442..4af2d4878e 100644 --- a/src/corelib/tools/qhash.h +++ b/src/corelib/tools/qhash.h @@ -60,6 +60,8 @@ class QString; class QStringRef; class QLatin1String; +Q_CORE_EXPORT uint qHashBits(const void *p, size_t size, uint seed = 0) Q_DECL_NOTHROW; + inline uint qHash(char key, uint seed = 0) Q_DECL_NOTHROW { return uint(key) ^ seed; } inline uint qHash(uchar key, uint seed = 0) Q_DECL_NOTHROW { return uint(key) ^ seed; } inline uint qHash(signed char key, uint seed = 0) Q_DECL_NOTHROW { return uint(key) ^ seed; } @@ -297,7 +299,7 @@ public: inline QHash(std::initializer_list<std::pair<Key,T> > list) : d(const_cast<QHashData *>(&QHashData::shared_null)) { - reserve(list.size()); + reserve(int(list.size())); for (typename std::initializer_list<std::pair<Key,T> >::const_iterator it = list.begin(); it != list.end(); ++it) insert(it->first, it->second); } @@ -973,7 +975,7 @@ public: #ifdef Q_COMPILER_INITIALIZER_LISTS inline QMultiHash(std::initializer_list<std::pair<Key,T> > list) { - this->reserve(list.size()); + this->reserve(int(list.size())); for (typename std::initializer_list<std::pair<Key,T> >::const_iterator it = list.begin(); it != list.end(); ++it) insert(it->first, it->second); } diff --git a/src/corelib/tools/qset.h b/src/corelib/tools/qset.h index ad2f91b983..291c8fe4f9 100644 --- a/src/corelib/tools/qset.h +++ b/src/corelib/tools/qset.h @@ -60,7 +60,7 @@ public: #ifdef Q_COMPILER_INITIALIZER_LISTS inline QSet(std::initializer_list<T> list) { - reserve(list.size()); + reserve(int(list.size())); for (typename std::initializer_list<T>::const_iterator it = list.begin(); it != list.end(); ++it) insert(*it); } diff --git a/src/corelib/tools/qsharedpointer_impl.h b/src/corelib/tools/qsharedpointer_impl.h index 1423449a69..c077b84492 100644 --- a/src/corelib/tools/qsharedpointer_impl.h +++ b/src/corelib/tools/qsharedpointer_impl.h @@ -318,16 +318,22 @@ public: inline QSharedPointer(T *ptr, Deleter deleter) : value(ptr) // throws { internalConstruct(ptr, deleter); } - inline QSharedPointer(const QSharedPointer<T> &other) : value(other.value), d(other.d) + inline QSharedPointer(const QSharedPointer &other) : value(other.value), d(other.d) { if (d) ref(); } - inline QSharedPointer<T> &operator=(const QSharedPointer<T> &other) + inline QSharedPointer &operator=(const QSharedPointer &other) { QSharedPointer copy(other); swap(copy); return *this; } #ifdef Q_COMPILER_RVALUE_REFS - inline QSharedPointer<T> &operator=(QSharedPointer<T> &&other) + inline QSharedPointer(QSharedPointer &&other) + : value(other.value), d(other.d) + { + other.d = 0; + other.value = 0; + } + inline QSharedPointer &operator=(QSharedPointer &&other) { swap(other); return *this; @@ -339,7 +345,7 @@ public: { if (d) ref(); } template <class X> - inline QSharedPointer<T> &operator=(const QSharedPointer<X> &other) + inline QSharedPointer &operator=(const QSharedPointer<X> &other) { QSHAREDPOINTER_VERIFY_AUTO_CAST(T, X); // if you get an error in this line, the cast is invalid internalCopy(other); @@ -355,7 +361,7 @@ public: { internalSet(other.d, other.value); return *this; } inline void swap(QSharedPointer &other) - { QSharedPointer<T>::internalSwap(other); } + { this->internalSwap(other); } inline void reset() { clear(); } inline void reset(T *t) @@ -396,7 +402,7 @@ public: #if defined(Q_COMPILER_RVALUE_REFS) && defined(Q_COMPILER_VARIADIC_TEMPLATES) template <typename... Args> - static QSharedPointer<T> create(Args && ...arguments) + static QSharedPointer create(Args && ...arguments) { typedef QtSharedPointer::ExternalRefCountWithContiguousData<T> Private; # ifdef QT_SHAREDPOINTER_TRACK_POINTERS @@ -404,7 +410,7 @@ public: # else typename Private::DestroyerFn destroy = &Private::deleter; # endif - QSharedPointer<T> result(Qt::Uninitialized); + QSharedPointer result(Qt::Uninitialized); result.d = Private::create(&result.value, destroy); // now initialize the data @@ -416,7 +422,7 @@ public: return result; } #else - static inline QSharedPointer<T> create() + static inline QSharedPointer create() { typedef QtSharedPointer::ExternalRefCountWithContiguousData<T> Private; # ifdef QT_SHAREDPOINTER_TRACK_POINTERS @@ -424,7 +430,7 @@ public: # else typename Private::DestroyerFn destroy = &Private::deleter; # endif - QSharedPointer<T> result(Qt::Uninitialized); + QSharedPointer result(Qt::Uninitialized); result.d = Private::create(&result.value, destroy); // now initialize the data @@ -573,9 +579,9 @@ public: { return *this = QWeakPointer(ptr); } #endif - inline QWeakPointer(const QWeakPointer<T> &o) : d(o.d), value(o.value) + inline QWeakPointer(const QWeakPointer &o) : d(o.d), value(o.value) { if (d) d->weakref.ref(); } - inline QWeakPointer<T> &operator=(const QWeakPointer<T> &o) + inline QWeakPointer &operator=(const QWeakPointer &o) { internalSet(o.d, o.value); return *this; @@ -583,7 +589,7 @@ public: inline QWeakPointer(const QSharedPointer<T> &o) : d(o.d), value(o.data()) { if (d) d->weakref.ref();} - inline QWeakPointer<T> &operator=(const QSharedPointer<T> &o) + inline QWeakPointer &operator=(const QSharedPointer<T> &o) { internalSet(o.d, o.value); return *this; @@ -594,7 +600,7 @@ public: { *this = o; } template <class X> - inline QWeakPointer<T> &operator=(const QWeakPointer<X> &o) + inline QWeakPointer &operator=(const QWeakPointer<X> &o) { // conversion between X and T could require access to the virtual table // so force the operation to go through QSharedPointer @@ -615,7 +621,7 @@ public: { *this = o; } template <class X> - inline QWeakPointer<T> &operator=(const QSharedPointer<X> &o) + inline QWeakPointer &operator=(const QSharedPointer<X> &o) { QSHAREDPOINTER_VERIFY_AUTO_CAST(T, X); // if you get an error in this line, the cast is invalid internalSet(o.d, o.data()); @@ -630,7 +636,7 @@ public: inline bool operator!=(const QSharedPointer<X> &o) const { return !(*this == o); } - inline void clear() { *this = QWeakPointer<T>(); } + inline void clear() { *this = QWeakPointer(); } inline QSharedPointer<T> toStrongRef() const { return QSharedPointer<T>(*this); } diff --git a/src/corelib/tools/qtools_p.h b/src/corelib/tools/qtools_p.h index b00343dd39..38073a6e30 100644 --- a/src/corelib/tools/qtools_p.h +++ b/src/corelib/tools/qtools_p.h @@ -58,7 +58,7 @@ QT_BEGIN_NAMESPACE // implemented in qbytearray.cpp -int Q_CORE_EXPORT qAllocMore(int alloc, int extra); +int Q_CORE_EXPORT qAllocMore(int alloc, int extra) Q_DECL_NOTHROW; QT_END_NAMESPACE diff --git a/src/gui/image/qimage_conversions.cpp b/src/gui/image/qimage_conversions.cpp index 629a7c9b69..cf61d2d84b 100644 --- a/src/gui/image/qimage_conversions.cpp +++ b/src/gui/image/qimage_conversions.cpp @@ -2176,7 +2176,11 @@ void qInitImageConversions() #ifdef QT_COMPILER_SUPPORTS_MIPS_DSPR2 extern bool convert_ARGB_to_ARGB_PM_inplace_mips_dspr2(QImageData *data, Qt::ImageConversionFlags); inplace_converter_map[QImage::Format_ARGB32][QImage::Format_ARGB32_Premultiplied] = convert_ARGB_to_ARGB_PM_inplace_mips_dspr2; - return; + + extern void convert_RGB888_to_RGB32_mips_dspr2(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags); + qimage_converter_map[QImage::Format::RGB888][QImage::Format_RGB32] = convert_RGB888_to_RGB32_mips_dspr2; + qimage_converter_map[QImage::Format::RGB888][QImage::Format_ARGB32] = convert_RGB888_to_RGB32_mips_dspr2; + qimage_converter_map[QImage::Format::RGB888][QImage::Format_ARGB32_Premultiplied] = convert_RGB888_to_RGB32_mips_dspr2; #endif } diff --git a/src/gui/image/qimage_mips_dspr2.cpp b/src/gui/image/qimage_mips_dspr2.cpp index a1c40a16df..f61a2262d2 100644 --- a/src/gui/image/qimage_mips_dspr2.cpp +++ b/src/gui/image/qimage_mips_dspr2.cpp @@ -66,4 +66,24 @@ bool convert_ARGB_to_ARGB_PM_inplace_mips_dspr2(QImageData *data, Qt::ImageConve return true; } +extern "C" void qt_convert_rgb888_to_rgb32_mips_dspr2_asm(uint *dst, const uchar *src, int len); + +void convert_RGB888_to_RGB32_mips_dspr2(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags) +{ + Q_ASSERT(src->format == QImage::Format_RGB888); + Q_ASSERT(dest->format == QImage::Format_RGB32 || dest->format == QImage::Format_ARGB32 || dest->format == QImage::Format_ARGB32_Premultiplied); + Q_ASSERT(src->width == dest->width); + Q_ASSERT(src->height == dest->height); + + const uchar *src_data = (const uchar*) src->data; + quint32 *dest_data = (quint32*) dest->data; + + for (int i = 0; i < src->height; ++i) { + qt_convert_rgb888_to_rgb32_mips_dspr2_asm(dest_data, src_data, src->width); + src_data += src->bytes_per_line; + dest_data = (quint32*) ((uchar*) dest_data + dest->bytes_per_line); + } +} + QT_END_NAMESPACE + diff --git a/src/gui/image/qimage_mips_dspr2_asm.S b/src/gui/image/qimage_mips_dspr2_asm.S index 1f03b72dd4..df626586dc 100644 --- a/src/gui/image/qimage_mips_dspr2_asm.S +++ b/src/gui/image/qimage_mips_dspr2_asm.S @@ -205,3 +205,95 @@ LEAF_MIPS_DSPR2(premultiply_argb_inplace_mips_asm) END(premultiply_argb_inplace_mips_asm) + +LEAF_MIPS_DSPR2(qt_convert_rgb888_to_rgb32_mips_dspr2_asm) +/* + * Parameters: + * a0 - dst *a8r8g8b8 + * a1 - src *r8g8b8 + * a2 - len + * + * R G B r g b R G B r g b R G B r g b . . . -- input + * ------- ------- ------- ------- ------- + * _ R G B _ r g b _ R G B _ r g b _ R G . . -- output + * + * Register usage: + * a2 - tail (len % 4) == (len & 0x3) + * t0 - batches (len / 4) == (len >> 2) + * t1-t7, s1-s3 - temporary + */ + + srl t0, a2, 2 /* batches = len / 4 */ + andi a2, a2, 0x3 /* tail = len % 4 */ + + beqz t0, 5f /* if !batches: tail */ + lui t7, 0xff00 /* [FF 00 00 00] */ + SAVE_REGS_ON_STACK 8, s1, s2, s3, s0, v0, v1 + +1: pref 4, 0 (a1) /* hint: read-streamed */ + pref 5, 0 (a0) /* hint: prepare-write */ + addiu t0, t0, -1 /* batches-- */ + + lbu t1, 0 (a1) /* [__ __ __ R1] */ + lbu t2, 1 (a1) /* [__ __ __ G1] */ + lbu t3, 2 (a1) /* [__ __ __ B1] */ + + lbu t4, 3 (a1) /* [__ __ __ r2] */ + lbu t5, 4 (a1) /* [__ __ __ g2] */ + lbu t6, 5 (a1) /* [__ __ __ b2] */ + + lbu s1, 6 (a1) /* [__ __ __ R3] */ + lbu s2, 7 (a1) /* [__ __ __ G3] */ + lbu s3, 8 (a1) /* [__ __ __ B3] */ + + lbu s0, 9 (a1) /* [__ __ __ r4] */ + lbu v0, 10 (a1) /* [__ __ __ g4] */ + lbu v1, 11 (a1) /* [__ __ __ b4] */ + + append t1, t2, 8 /* [__ __ R1 G1] */ + append t4, t5, 8 /* [__ __ r2 g2] */ + append s1, s2, 8 /* [__ __ R3 G3] */ + append s0, v0, 8 /* [__ __ r4 g4] */ + append t1, t3, 8 /* [__ R1 G1 B1] */ + append t4, t6, 8 /* [__ r2 g2 b2] */ + append s1, s3, 8 /* [__ R3 G4 B3] */ + append s0, v1, 8 /* [__ r4 g4 b4] */ + or t1, t1, t7 /* [FF R1 G1 B1] */ + or t4, t4, t7 /* [FF r2 g2 b2] */ + or s1, s1, t7 /* [FF R3 G3 B3] */ + or s0, s0, t7 /* [FF r4 g4 b4] */ + + sw t1, 0 (a0) + sw t4, 4 (a0) + sw s1, 8 (a0) + sw s0, 12 (a0) + + addiu a1, a1, 12 /* src += 4*3 */ + bnez t0, 1b /* if batches: loop */ + addiu a0, a0, 16 /* dst += 4 */ + + RESTORE_REGS_FROM_STACK 8, s1, s2, s3, s0, v0, v1 + + /* handle remaining "tail" (a2) items */ +5: beqz a2, 0f + lui t0, 0xff00 /* [FF __ __ __] */ + +1: lbu t1, 0 (a1) /* [__ __ __ RR] */ + lbu t2, 1 (a1) /* [__ __ __ GG] */ + lbu t3, 2 (a1) /* [__ __ __ BB] */ + sll t1, t1, 16 /* [__ RR __ __] */ + sll t2, t2, 8 /* [__ __ GG __] */ + or t0, t0, t1 /* [FF RR __ __] */ + or t2, t2, t3 /* [__ __ GG BB] */ + addi a2, a2, -1 /* len-- */ + or t0, t0, t2 /* [FF RR GG BB] */ + addiu a1, a1, 3 /* src += 3 */ + sw t0, 0 (a0) + addiu a0, a0, 4 /* dst++ */ + bnez a2, 1b /* if tail: loop */ + lui t0, 0xff00 /* [FF __ __ __] */ + +0: jr ra + nop + +END(qt_convert_rgb888_to_rgb32_mips_dspr2_asm) diff --git a/src/gui/image/qjpeghandler.cpp b/src/gui/image/qjpeghandler.cpp index bd358b7228..22d82ba894 100644 --- a/src/gui/image/qjpeghandler.cpp +++ b/src/gui/image/qjpeghandler.cpp @@ -857,6 +857,7 @@ bool QJpegHandlerPrivate::read(QImage *image) Q_GUI_EXPORT void QT_FASTCALL qt_convert_rgb888_to_rgb32_neon(quint32 *dst, const uchar *src, int len); Q_GUI_EXPORT void QT_FASTCALL qt_convert_rgb888_to_rgb32_ssse3(quint32 *dst, const uchar *src, int len); Q_GUI_EXPORT void QT_FASTCALL qt_convert_rgb888_to_rgb32_avx(quint32 *dst, const uchar *src, int len); +extern "C" void qt_convert_rgb888_to_rgb32_mips_dspr2_asm(quint32 *dst, const uchar *src, int len); QJpegHandler::QJpegHandler() : d(new QJpegHandlerPrivate(this)) @@ -875,6 +876,9 @@ QJpegHandler::QJpegHandler() rgb888ToRgb32ConverterPtr = qt_convert_rgb888_to_rgb32_ssse3; } #endif // QT_COMPILER_SUPPORTS_SSSE3 +#if defined(QT_COMPILER_SUPPORTS_MIPS_DSPR2) + rgb888ToRgb32ConverterPtr = qt_convert_rgb888_to_rgb32_mips_dspr2_asm; +#endif // QT_COMPILER_SUPPORTS_DSPR2 } QJpegHandler::~QJpegHandler() diff --git a/src/gui/painting/qpainterpath.cpp b/src/gui/painting/qpainterpath.cpp index aa2b9bea54..7a29bb87b4 100644 --- a/src/gui/painting/qpainterpath.cpp +++ b/src/gui/painting/qpainterpath.cpp @@ -1644,7 +1644,8 @@ QList<QPolygonF> QPainterPath::toFillPolygons(const QTransform &matrix) const if (count == 0) return polys; - QList<QRectF> bounds; + QVector<QRectF> bounds; + bounds.reserve(count); for (int i=0; i<count; ++i) bounds += subpaths.at(i).boundingRect(); diff --git a/src/gui/painting/qpen.cpp b/src/gui/painting/qpen.cpp index c0b3769c2d..b661057f64 100644 --- a/src/gui/painting/qpen.cpp +++ b/src/gui/painting/qpen.cpp @@ -327,17 +327,29 @@ QPen::QPen(const QBrush &brush, qreal width, Qt::PenStyle s, Qt::PenCapStyle c, QPen::QPen(const QPen &p) { d = p.d; - d->ref.ref(); + if (d) + d->ref.ref(); } /*! + \fn QPen::QPen(QPen &&pen) + \since 5.4 + + Constructs a pen that is moved from the given \a pen. + + The moved-from pen can only be assigned to, copied, or + destroyed. Any other operation (prior to assignment) leads to + undefined behavior. +*/ + +/*! Destroys the pen. */ QPen::~QPen() { - if (!d->ref.deref()) + if (d && !d->ref.deref()) delete d; } @@ -373,7 +385,7 @@ void QPen::detach() QPen &QPen::operator=(const QPen &p) { - qAtomicAssign(d, p.d); + QPen(p).swap(*this); return *this; } diff --git a/src/gui/painting/qpen.h b/src/gui/painting/qpen.h index c5144f784f..486f699476 100644 --- a/src/gui/painting/qpen.h +++ b/src/gui/painting/qpen.h @@ -72,6 +72,8 @@ public: QPen &operator=(const QPen &pen); #ifdef Q_COMPILER_RVALUE_REFS + inline QPen(QPen &&other) + : d(other.d) { other.d = 0; } inline QPen &operator=(QPen &&other) { qSwap(d, other.d); return *this; } #endif diff --git a/src/gui/util/qgridlayoutengine.cpp b/src/gui/util/qgridlayoutengine.cpp index 10b4a2ee35..7170477e84 100644 --- a/src/gui/util/qgridlayoutengine.cpp +++ b/src/gui/util/qgridlayoutengine.cpp @@ -983,9 +983,10 @@ void QGridLayoutEngine::invalidate() q_cachedEffectiveFirstRows[Ver] = -1; q_cachedEffectiveLastRows[Hor] = -1; q_cachedEffectiveLastRows[Ver] = -1; - q_totalBoxesValid = false; - q_sizeHintValid[Hor] = false; - q_sizeHintValid[Ver] = false; + + q_totalBoxCachedConstraints[Hor] = NotCached; + q_totalBoxCachedConstraints[Ver] = NotCached; + q_cachedSize = QSizeF(); q_cachedConstraintOrientation = UnknownConstraint; } @@ -1530,7 +1531,11 @@ void QGridLayoutEngine::ensureColumnAndRowData(QGridLayoutRowData *rowData, QGri const QAbstractLayoutStyleInfo *styleInfo) const { const int o = (orientation == Qt::Vertical ? Ver : Hor); - if (q_sizeHintValid[o] && !colPositions && !colSizes) { + const int cc = columnCount(orientation); + + const qreal constraint = (colPositions && colSizes && hasDynamicConstraint()) ? (colPositions[cc - 1] + colSizes[cc - 1]) : qreal(CachedWithNoConstraint); + qreal &cachedConstraint = q_totalBoxCachedConstraints[o]; + if (cachedConstraint == constraint) { if (totalBox != &q_totalBoxes[o]) *totalBox = q_totalBoxes[o]; return; @@ -1541,10 +1546,10 @@ void QGridLayoutEngine::ensureColumnAndRowData(QGridLayoutRowData *rowData, QGri rowData->distributeMultiCells(rowInfo); *totalBox = rowData->totalBox(0, rowCount(orientation)); - if (!colPositions && !colSizes) { + if (totalBox != &q_totalBoxes[o]) q_totalBoxes[o] = *totalBox; - q_sizeHintValid[o] = true; - } + + cachedConstraint = constraint; } /** @@ -1593,10 +1598,9 @@ Qt::Orientation QGridLayoutEngine::constraintOrientation() const void QGridLayoutEngine::ensureGeometries(const QSizeF &size, const QAbstractLayoutStyleInfo *styleInfo) const { - if (!styleInfo->hasChanged() && q_totalBoxesValid && q_cachedSize == size) + if (!styleInfo->hasChanged() && q_cachedSize == size) return; - q_totalBoxesValid = true; q_cachedSize = size; q_xx.resize(columnCount()); @@ -1606,7 +1610,7 @@ void QGridLayoutEngine::ensureGeometries(const QSizeF &size, q_descents.resize(rowCount()); if (constraintOrientation() != Qt::Horizontal) { - //We might have items whose width depends on their height + //We might have items whose height depends on their width (HFW) ensureColumnAndRowData(&q_columnData, &q_totalBoxes[Hor], NULL, NULL, Qt::Horizontal, styleInfo); //Calculate column widths and positions, and put results in q_xx.data() and q_widths.data() so that we can use this information as //constraints to find the row heights @@ -1617,7 +1621,7 @@ void QGridLayoutEngine::ensureGeometries(const QSizeF &size, q_rowData.calculateGeometries(0, rowCount(), size.height(), q_yy.data(), q_heights.data(), q_descents.data(), q_totalBoxes[Ver], q_infos[Ver]); } else { - //We have items whose height depends on their width + //We have items whose width depends on their height (WFH) ensureColumnAndRowData(&q_rowData, &q_totalBoxes[Ver], NULL, NULL, Qt::Vertical, styleInfo); //Calculate row heights and positions, and put results in q_yy.data() and q_heights.data() so that we can use this information as //constraints to find the column widths diff --git a/src/gui/util/qgridlayoutengine_p.h b/src/gui/util/qgridlayoutengine_p.h index 9650e7fffe..bbc94bd51f 100644 --- a/src/gui/util/qgridlayoutengine_p.h +++ b/src/gui/util/qgridlayoutengine_p.h @@ -450,15 +450,21 @@ private: mutable int q_cachedEffectiveLastRows[NOrientations]; mutable quint8 q_cachedConstraintOrientation : 3; + // this is useful to cache + mutable QGridLayoutBox q_totalBoxes[NOrientations]; + enum { + NotCached = -2, // Cache is empty. Happens when the engine is invalidated. + CachedWithNoConstraint = -1 // cache has a totalBox without any HFW/WFH constraints. + // >= 0 // cache has a totalBox with this specific constraint. + }; + mutable qreal q_totalBoxCachedConstraints[NOrientations]; // holds the constraint used for the cached totalBox + // Layout item input mutable QGridLayoutRowData q_columnData; mutable QGridLayoutRowData q_rowData; - mutable QGridLayoutBox q_totalBoxes[NOrientations]; // Output mutable QSizeF q_cachedSize; - mutable bool q_totalBoxesValid; - mutable bool q_sizeHintValid[NOrientations]; mutable QVector<qreal> q_xx; mutable QVector<qreal> q_yy; mutable QVector<qreal> q_widths; diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp index 87511076d3..cf786e37c6 100644 --- a/src/network/access/qhttpnetworkconnection.cpp +++ b/src/network/access/qhttpnetworkconnection.cpp @@ -1199,7 +1199,7 @@ QHttpNetworkConnection::QHttpNetworkConnection(const QString &hostName, quint16 : QObject(*(new QHttpNetworkConnectionPrivate(hostName, port, encrypt, connectionType)), parent) { Q_D(QHttpNetworkConnection); - d->networkSession = networkSession; + d->networkSession = qMove(networkSession); d->init(); } @@ -1211,7 +1211,7 @@ QHttpNetworkConnection::QHttpNetworkConnection(quint16 connectionCount, const QS connectionType)), parent) { Q_D(QHttpNetworkConnection); - d->networkSession = networkSession; + d->networkSession = qMove(networkSession); d->init(); } #else @@ -1335,7 +1335,7 @@ QSharedPointer<QSslContext> QHttpNetworkConnection::sslContext() void QHttpNetworkConnection::setSslContext(QSharedPointer<QSslContext> context) { Q_D(QHttpNetworkConnection); - d->sslContext = context; + d->sslContext = qMove(context); } void QHttpNetworkConnection::ignoreSslErrors(int channel) diff --git a/src/network/access/qhttpthreaddelegate.cpp b/src/network/access/qhttpthreaddelegate.cpp index e03dcb8ead..7b5ad1e2f1 100644 --- a/src/network/access/qhttpthreaddelegate.cpp +++ b/src/network/access/qhttpthreaddelegate.cpp @@ -188,7 +188,7 @@ public: QHttpNetworkConnection::ConnectionType connectionType, QSharedPointer<QNetworkSession> networkSession) : QHttpNetworkConnection(hostName, port, encrypt, connectionType, /*parent=*/0, - networkSession) + qMove(networkSession)) #endif { setExpires(true); diff --git a/src/network/ssl/qsslconfiguration.cpp b/src/network/ssl/qsslconfiguration.cpp index 14881931af..64b75f98ec 100644 --- a/src/network/ssl/qsslconfiguration.cpp +++ b/src/network/ssl/qsslconfiguration.cpp @@ -208,6 +208,7 @@ bool QSslConfiguration::operator==(const QSslConfiguration &other) const d->localCertificateChain == other.d->localCertificateChain && d->privateKey == other.d->privateKey && d->sessionCipher == other.d->sessionCipher && + d->sessionProtocol == other.d->sessionProtocol && d->ciphers == other.d->ciphers && d->caCertificates == other.d->caCertificates && d->protocol == other.d->protocol && @@ -512,6 +513,18 @@ QSslCipher QSslConfiguration::sessionCipher() const } /*! + Returns the socket's SSL/TLS protocol or UnknownProtocol if the + connection isn't encrypted. The socket's protocol for the session + is set during the handshake phase. + + \sa protocol(), setProtocol() +*/ +QSsl::SslProtocol QSslConfiguration::sessionProtocol() const +{ + return d->sessionProtocol; +} + +/*! Returns the \l {QSslKey} {SSL key} assigned to this connection or a null key if none has been assigned yet. diff --git a/src/network/ssl/qsslconfiguration.h b/src/network/ssl/qsslconfiguration.h index 587187ca06..4c5799bf28 100644 --- a/src/network/ssl/qsslconfiguration.h +++ b/src/network/ssl/qsslconfiguration.h @@ -109,6 +109,7 @@ public: QSslCertificate peerCertificate() const; QList<QSslCertificate> peerCertificateChain() const; QSslCipher sessionCipher() const; + QSsl::SslProtocol sessionProtocol() const; // Private keys, for server sockets QSslKey privateKey() const; diff --git a/src/network/ssl/qsslconfiguration_p.h b/src/network/ssl/qsslconfiguration_p.h index d183c3335c..29bd4053ad 100644 --- a/src/network/ssl/qsslconfiguration_p.h +++ b/src/network/ssl/qsslconfiguration_p.h @@ -81,7 +81,8 @@ class QSslConfigurationPrivate: public QSharedData { public: QSslConfigurationPrivate() - : protocol(QSsl::SecureProtocols), + : sessionProtocol(QSsl::UnknownProtocol), + protocol(QSsl::SecureProtocols), peerVerifyMode(QSslSocket::AutoVerifyPeer), peerVerifyDepth(0), allowRootCertOnDemandLoading(true), @@ -98,6 +99,7 @@ public: QSslKey privateKey; QSslCipher sessionCipher; + QSsl::SslProtocol sessionProtocol; QList<QSslCipher> ciphers; QList<QSslCertificate> caCertificates; diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp index c5ae517fb0..04c0fb0487 100644 --- a/src/network/ssl/qsslsocket.cpp +++ b/src/network/ssl/qsslsocket.cpp @@ -878,6 +878,7 @@ QSslConfiguration QSslSocket::sslConfiguration() const QSslConfigurationPrivate *copy = new QSslConfigurationPrivate(d->configuration); copy->ref.store(0); // the QSslConfiguration constructor refs up copy->sessionCipher = d->sessionCipher(); + copy->sessionProtocol = d->sessionProtocol(); return QSslConfiguration(copy); } @@ -1073,6 +1074,20 @@ QSslCipher QSslSocket::sessionCipher() const } /*! + Returns the socket's SSL/TLS protocol or UnknownProtocol if the + connection isn't encrypted. The socket's protocol for the session + is set during the handshake phase. + + \sa protocol(), setProtocol() +*/ +QSsl::SslProtocol QSslSocket::sessionProtocol() const +{ + Q_D(const QSslSocket); + return d->sessionProtocol(); +} + + +/*! Sets the socket's private \l {QSslKey} {key} to \a key. The private key and the local \l {QSslCertificate} {certificate} are used by clients and servers that must prove their identity to @@ -1665,6 +1680,32 @@ QString QSslSocket::sslLibraryVersionString() } /*! + \since 5.4 + Returns the version number of the SSL library in use at compile + time. If no SSL support is available then this will return an + undefined value. + + \sa sslLibraryVersionNumber() +*/ +long QSslSocket::sslLibraryBuildVersionNumber() +{ + return QSslSocketPrivate::sslLibraryBuildVersionNumber(); +} + +/*! + \since 5.4 + Returns the version string of the SSL library in use at compile + time. If no SSL support is available then this will return an + empty value. + + \sa sslLibraryVersionString() +*/ +QString QSslSocket::sslLibraryBuildVersionString() +{ + return QSslSocketPrivate::sslLibraryBuildVersionString(); +} + +/*! Starts a delayed SSL handshake for a client connection. This function can be called when the socket is in the \l ConnectedState but still in the \l UnencryptedMode. If it is not yet connected, @@ -2095,6 +2136,7 @@ void QSslConfigurationPrivate::deepCopyDefaultConfiguration(QSslConfigurationPri ptr->localCertificateChain = global->localCertificateChain; ptr->privateKey = global->privateKey; ptr->sessionCipher = global->sessionCipher; + ptr->sessionProtocol = global->sessionProtocol; ptr->ciphers = global->ciphers; ptr->caCertificates = global->caCertificates; ptr->protocol = global->protocol; diff --git a/src/network/ssl/qsslsocket.h b/src/network/ssl/qsslsocket.h index d89933efda..9cc5e02de3 100644 --- a/src/network/ssl/qsslsocket.h +++ b/src/network/ssl/qsslsocket.h @@ -140,6 +140,7 @@ public: QSslCertificate peerCertificate() const; QList<QSslCertificate> peerCertificateChain() const; QSslCipher sessionCipher() const; + QSsl::SslProtocol sessionProtocol() const; // Private keys, for server sockets. void setPrivateKey(const QSslKey &key); @@ -182,6 +183,8 @@ public: static bool supportsSsl(); static long sslLibraryVersionNumber(); static QString sslLibraryVersionString(); + static long sslLibraryBuildVersionNumber(); + static QString sslLibraryBuildVersionString(); void ignoreSslErrors(const QList<QSslError> &errors); diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp index 3421154114..4360a13b51 100644 --- a/src/network/ssl/qsslsocket_openssl.cpp +++ b/src/network/ssl/qsslsocket_openssl.cpp @@ -584,6 +584,16 @@ QString QSslSocketPrivate::sslLibraryVersionString() return QString::fromLatin1(versionString); } +long QSslSocketPrivate::sslLibraryBuildVersionNumber() +{ + return OPENSSL_VERSION_NUMBER; +} + +QString QSslSocketPrivate::sslLibraryBuildVersionString() +{ + return QLatin1String(OPENSSL_VERSION_TEXT); +} + /*! \internal @@ -1428,6 +1438,28 @@ QSslCipher QSslSocketBackendPrivate::sessionCipher() const return sessionCipher ? QSslCipher_from_SSL_CIPHER(sessionCipher) : QSslCipher(); } +QSsl::SslProtocol QSslSocketBackendPrivate::sessionProtocol() const +{ + if (!ssl) + return QSsl::UnknownProtocol; + int ver = q_SSL_version(ssl); + + switch (ver) { + case 0x2: + return QSsl::SslV2; + case 0x300: + return QSsl::SslV3; + case 0x301: + return QSsl::TlsV1_0; + case 0x302: + return QSsl::TlsV1_1; + case 0x303: + return QSsl::TlsV1_2; + } + + return QSsl::UnknownProtocol; +} + void QSslSocketBackendPrivate::continueHandshake() { Q_Q(QSslSocket); diff --git a/src/network/ssl/qsslsocket_openssl_p.h b/src/network/ssl/qsslsocket_openssl_p.h index c8b23e6cad..0a9d02287d 100644 --- a/src/network/ssl/qsslsocket_openssl_p.h +++ b/src/network/ssl/qsslsocket_openssl_p.h @@ -131,6 +131,7 @@ public: void disconnectFromHost(); void disconnected(); QSslCipher sessionCipher() const; + QSsl::SslProtocol sessionProtocol() const; void continueHandshake(); bool checkSslErrors(); #ifdef Q_OS_WIN diff --git a/src/network/ssl/qsslsocket_openssl_symbols.cpp b/src/network/ssl/qsslsocket_openssl_symbols.cpp index 79bce22b0d..3c7402cd26 100644 --- a/src/network/ssl/qsslsocket_openssl_symbols.cpp +++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp @@ -238,6 +238,7 @@ DEFINEFUNC(const SSL_CIPHER *, SSL_get_current_cipher, SSL *a, a, return 0, retu #else DEFINEFUNC(SSL_CIPHER *, SSL_get_current_cipher, SSL *a, a, return 0, return) #endif +DEFINEFUNC(int, SSL_version, const SSL *a, a, return 0, return) DEFINEFUNC2(int, SSL_get_error, SSL *a, a, int b, b, return -1, return) DEFINEFUNC(STACK_OF(X509) *, SSL_get_peer_cert_chain, SSL *a, a, return 0, return) DEFINEFUNC(X509 *, SSL_get_peer_certificate, SSL *a, a, return 0, return) @@ -739,6 +740,7 @@ bool q_resolveOpenSslSymbols() RESOLVEFUNC(SSL_free) RESOLVEFUNC(SSL_get_ciphers) RESOLVEFUNC(SSL_get_current_cipher) + RESOLVEFUNC(SSL_version) RESOLVEFUNC(SSL_get_error) RESOLVEFUNC(SSL_get_peer_cert_chain) RESOLVEFUNC(SSL_get_peer_certificate) diff --git a/src/network/ssl/qsslsocket_openssl_symbols_p.h b/src/network/ssl/qsslsocket_openssl_symbols_p.h index 500fe9493b..c363694bf6 100644 --- a/src/network/ssl/qsslsocket_openssl_symbols_p.h +++ b/src/network/ssl/qsslsocket_openssl_symbols_p.h @@ -329,6 +329,7 @@ const SSL_CIPHER *q_SSL_get_current_cipher(SSL *a); #else SSL_CIPHER *q_SSL_get_current_cipher(SSL *a); #endif +int q_SSL_version(const SSL *a); int q_SSL_get_error(SSL *a, int b); STACK_OF(X509) *q_SSL_get_peer_cert_chain(SSL *a); X509 *q_SSL_get_peer_certificate(SSL *a); diff --git a/src/network/ssl/qsslsocket_p.h b/src/network/ssl/qsslsocket_p.h index 6281753225..0033a46d98 100644 --- a/src/network/ssl/qsslsocket_p.h +++ b/src/network/ssl/qsslsocket_p.h @@ -129,6 +129,8 @@ public: static bool supportsSsl(); static long sslLibraryVersionNumber(); static QString sslLibraryVersionString(); + static long sslLibraryBuildVersionNumber(); + static QString sslLibraryBuildVersionString(); static void ensureInitialized(); static void deinitialize(); static QList<QSslCipher> defaultCiphers(); @@ -190,6 +192,7 @@ public: virtual void disconnectFromHost() = 0; virtual void disconnected() = 0; virtual QSslCipher sessionCipher() const = 0; + virtual QSsl::SslProtocol sessionProtocol() const = 0; virtual void continueHandshake() = 0; Q_AUTOTEST_EXPORT static bool rootCertOnDemandLoadingSupported(); diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp index 6462cb8d3e..a74a7efb41 100644 --- a/src/plugins/platforms/windows/qwindowscontext.cpp +++ b/src/plugins/platforms/windows/qwindowscontext.cpp @@ -412,9 +412,17 @@ QString QWindowsContext::registerWindowClass(const QWindow *w, bool isGL) && (type == Qt::Popup || w->property("_q_windowsDropShadow").toBool())) { style |= CS_DROPSHADOW; } - if (type == Qt::Tool || type == Qt::ToolTip || type == Qt::Popup) { + switch (type) { + case Qt::Tool: + case Qt::ToolTip: + case Qt::Popup: style |= CS_SAVEBITS; // Save/restore background icon = false; + break; + case Qt::Dialog: + if (!(flags & Qt::WindowSystemMenuHint)) + icon = false; // QTBUG-2027, dialogs without system menu. + break; } // Create a unique name for the flag combination QString cname = QStringLiteral("Qt5QWindow"); diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 3cf9481c17..274366d4fe 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -110,6 +110,8 @@ static QByteArray debugWinExStyle(DWORD exStyle) rc += " WS_EX_CONTEXTHELP"; if (exStyle & WS_EX_LAYERED) rc += " WS_EX_LAYERED"; + if (exStyle & WS_EX_DLGMODALFRAME) + rc += " WS_EX_DLGMODALFRAME"; return rc; } @@ -513,6 +515,10 @@ void WindowCreationData::fromWindow(const QWindow *w, const Qt::WindowFlags flag } if (flags & Qt::WindowSystemMenuHint) style |= WS_SYSMENU; + else if (dialog) { + style |= WS_SYSMENU | WS_BORDER; // QTBUG-2027, dialogs without system menu. + exStyle |= WS_EX_DLGMODALFRAME; + } if (flags & Qt::WindowMinimizeButtonHint) style |= WS_MINIMIZEBOX; if (shouldShowMaximizeButton(w, flags)) diff --git a/src/plugins/platforms/xcb/qxcbclipboard.cpp b/src/plugins/platforms/xcb/qxcbclipboard.cpp index e7f8510706..3b30274f25 100644 --- a/src/plugins/platforms/xcb/qxcbclipboard.cpp +++ b/src/plugins/platforms/xcb/qxcbclipboard.cpp @@ -135,9 +135,10 @@ protected: (void)formats(); // trigger update of format list - QList<xcb_atom_t> atoms; + QVector<xcb_atom_t> atoms; xcb_atom_t *targets = (xcb_atom_t *) format_atoms.data(); int size = format_atoms.size() / sizeof(xcb_atom_t); + atoms.reserve(size); for (int i = 0; i < size; ++i) atoms.append(targets[i]); @@ -524,7 +525,7 @@ xcb_atom_t QXcbClipboard::sendTargetsSelection(QMimeData *d, xcb_window_t window QVector<xcb_atom_t> types; QStringList formats = QInternalMimeData::formatsHelper(d); for (int i = 0; i < formats.size(); ++i) { - QList<xcb_atom_t> atoms = QXcbMime::mimeAtomsForFormat(connection(), formats.at(i)); + QVector<xcb_atom_t> atoms = QXcbMime::mimeAtomsForFormat(connection(), formats.at(i)); for (int j = 0; j < atoms.size(); ++j) { if (!types.contains(atoms.at(j))) types.append(atoms.at(j)); diff --git a/src/plugins/platforms/xcb/qxcbdrag.cpp b/src/plugins/platforms/xcb/qxcbdrag.cpp index 61dfe8ac17..6042ec0f87 100644 --- a/src/plugins/platforms/xcb/qxcbdrag.cpp +++ b/src/plugins/platforms/xcb/qxcbdrag.cpp @@ -183,7 +183,7 @@ void QXcbDrag::startDrag() QStringList fmts = QXcbMime::formatsHelper(drag()->mimeData()); for (int i = 0; i < fmts.size(); ++i) { - QList<xcb_atom_t> atoms = QXcbMime::mimeAtomsForFormat(connection(), fmts.at(i)); + QVector<xcb_atom_t> atoms = QXcbMime::mimeAtomsForFormat(connection(), fmts.at(i)); for (int j = 0; j < atoms.size(); ++j) { if (!drag_types.contains(atoms.at(j))) drag_types.append(atoms.at(j)); @@ -1211,7 +1211,7 @@ QVariant QXcbDropData::xdndObtainData(const QByteArray &format, QVariant::Type r return result; } - QList<xcb_atom_t> atoms = drag->xdnd_types; + QVector<xcb_atom_t> atoms = drag->xdnd_types; QByteArray encoding; xcb_atom_t a = mimeAtomForFormat(c, QLatin1String(format), requestedType, atoms, &encoding); if (a == XCB_NONE) diff --git a/src/plugins/platforms/xcb/qxcbdrag.h b/src/plugins/platforms/xcb/qxcbdrag.h index 5648f70d9e..537898db48 100644 --- a/src/plugins/platforms/xcb/qxcbdrag.h +++ b/src/plugins/platforms/xcb/qxcbdrag.h @@ -46,7 +46,6 @@ #include <private/qsimpledrag_p.h> #include <qxcbobject.h> #include <xcb/xcb.h> -#include <qlist.h> #include <qpoint.h> #include <qrect.h> #include <qsharedpointer.h> @@ -127,7 +126,7 @@ private: // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; - QList<xcb_atom_t> xdnd_types; + QVector<xcb_atom_t> xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; @@ -160,7 +159,7 @@ private: QDrag *drag; QTime time; }; - QList<Transaction> transactions; + QVector<Transaction> transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); diff --git a/src/plugins/platforms/xcb/qxcbmime.cpp b/src/plugins/platforms/xcb/qxcbmime.cpp index b205a63267..c0f6745e7f 100644 --- a/src/plugins/platforms/xcb/qxcbmime.cpp +++ b/src/plugins/platforms/xcb/qxcbmime.cpp @@ -136,9 +136,10 @@ bool QXcbMime::mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeDa return ret; } -QList<xcb_atom_t> QXcbMime::mimeAtomsForFormat(QXcbConnection *connection, const QString &format) +QVector<xcb_atom_t> QXcbMime::mimeAtomsForFormat(QXcbConnection *connection, const QString &format) { - QList<xcb_atom_t> atoms; + QVector<xcb_atom_t> atoms; + atoms.reserve(7); atoms.append(connection->internAtom(format.toLatin1())); // special cases for strings @@ -240,7 +241,7 @@ QVariant QXcbMime::mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, } xcb_atom_t QXcbMime::mimeAtomForFormat(QXcbConnection *connection, const QString &format, QVariant::Type requestedType, - const QList<xcb_atom_t> &atoms, QByteArray *requestedEncoding) + const QVector<xcb_atom_t> &atoms, QByteArray *requestedEncoding) { requestedEncoding->clear(); diff --git a/src/plugins/platforms/xcb/qxcbmime.h b/src/plugins/platforms/xcb/qxcbmime.h index 4a69a35ced..563716a75b 100644 --- a/src/plugins/platforms/xcb/qxcbmime.h +++ b/src/plugins/platforms/xcb/qxcbmime.h @@ -59,14 +59,14 @@ public: QXcbMime(); ~QXcbMime(); - static QList<xcb_atom_t> mimeAtomsForFormat(QXcbConnection *connection, const QString &format); + static QVector<xcb_atom_t> mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QVariant::Type requestedType, const QByteArray &encoding); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QVariant::Type requestedType, - const QList<xcb_atom_t> &atoms, QByteArray *requestedEncoding); + const QVector<xcb_atom_t> &atoms, QByteArray *requestedEncoding); }; #endif // !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD)) diff --git a/src/testlib/qplaintestlogger.cpp b/src/testlib/qplaintestlogger.cpp index 39580f22d4..774f2cc4fb 100644 --- a/src/testlib/qplaintestlogger.cpp +++ b/src/testlib/qplaintestlogger.cpp @@ -51,21 +51,29 @@ #include <stdlib.h> #include <string.h> -#ifdef Q_OS_WIN -#include <windows.h> -#endif - #ifdef Q_OS_WINCE #include <QtCore/QString> #endif +#ifdef min // windows.h without NOMINMAX is included by the benchmark headers. +# undef min +#endif +#ifdef max +# undef max +#endif + #include <QtCore/QByteArray> #include <QtCore/qmath.h> +#include <QtCore/QLibraryInfo> #ifdef Q_OS_ANDROID # include <android/log.h> #endif +#ifdef Q_OS_WIN +# include <qt_windows.h> +#endif + QT_BEGIN_NAMESPACE namespace QTest { @@ -334,7 +342,7 @@ void QPlainTestLogger::startLogging() qsnprintf(buf, sizeof(buf), "********* Start testing of %s *********\n" "Config: Using QtTest library " QTEST_VERSION_STR - ", Qt %s\n", QTestResult::currentTestObjectName(), qVersion()); + ", %s\n", QTestResult::currentTestObjectName(), QLibraryInfo::build()); } outputMessage(buf); } diff --git a/src/testlib/qxmltestlogger.cpp b/src/testlib/qxmltestlogger.cpp index 3fff753c5c..5ea28bd46d 100644 --- a/src/testlib/qxmltestlogger.cpp +++ b/src/testlib/qxmltestlogger.cpp @@ -42,6 +42,7 @@ #include <stdio.h> #include <string.h> #include <QtCore/qglobal.h> +#include <QtCore/qlibraryinfo.h> #include <QtTest/private/qxmltestlogger_p.h> #include <QtTest/private/qtestresult_p.h> @@ -115,11 +116,15 @@ void QXmlTestLogger::startLogging() outputString(buf.constData()); } + QTestCharBuffer quotedBuild; + xmlQuote("edBuild, QLibraryInfo::build()); + QTest::qt_asprintf(&buf, "<Environment>\n" " <QtVersion>%s</QtVersion>\n" + " <QtBuild>%s</QtBuild>\n" " <QTestVersion>" QTEST_VERSION_STR "</QTestVersion>\n" - "</Environment>\n", qVersion()); + "</Environment>\n", qVersion(), quotedBuild.constData()); outputString(buf.constData()); m_totalTime.start(); } diff --git a/src/testlib/qxunittestlogger.cpp b/src/testlib/qxunittestlogger.cpp index a47f77ae49..fe5b13eeeb 100644 --- a/src/testlib/qxunittestlogger.cpp +++ b/src/testlib/qxunittestlogger.cpp @@ -46,6 +46,15 @@ #include <QtTest/private/qtestresult_p.h> #include <QtTest/private/qbenchmark_p.h> +#ifdef min // windows.h without NOMINMAX is included by the benchmark headers. +# undef min +#endif +#ifdef max +# undef max +#endif + +#include <QtCore/qlibraryinfo.h> + #include <string.h> QT_BEGIN_NAMESPACE @@ -108,6 +117,11 @@ void QXunitTestLogger::stopLogging() property->addAttribute(QTest::AI_PropertyValue, qVersion()); properties->addLogElement(property); + property = new QTestElement(QTest::LET_Property); + property->addAttribute(QTest::AI_Name, "QtBuild"); + property->addAttribute(QTest::AI_PropertyValue, QLibraryInfo::build()); + properties->addLogElement(property); + currentLogElement->addLogElement(properties); currentLogElement->addLogElement(iterator); diff --git a/src/widgets/dialogs/qwizard.cpp b/src/widgets/dialogs/qwizard.cpp index b294e98c30..15f922a5b8 100644 --- a/src/widgets/dialogs/qwizard.cpp +++ b/src/widgets/dialogs/qwizard.cpp @@ -1475,7 +1475,7 @@ void QWizardPrivate::updateButtonTexts() void QWizardPrivate::updateButtonLayout() { if (buttonsHaveCustomLayout) { - QVarLengthArray<QWizard::WizardButton> array(buttonsCustomLayout.count()); + QVarLengthArray<QWizard::WizardButton, QWizard::NButtons> array(buttonsCustomLayout.count()); for (int i = 0; i < buttonsCustomLayout.count(); ++i) array[i] = buttonsCustomLayout.at(i); setButtonLayout(array.constData(), array.count()); diff --git a/src/widgets/kernel/qapplication_qpa.cpp b/src/widgets/kernel/qapplication_qpa.cpp index 7977ae3528..5ce2ac2c4b 100644 --- a/src/widgets/kernel/qapplication_qpa.cpp +++ b/src/widgets/kernel/qapplication_qpa.cpp @@ -143,6 +143,11 @@ void QApplicationPrivate::notifyActiveWindowChange(QWindow *previous) return; QWidget *tlw = qt_tlw_for_window(wnd); QApplication::setActiveWindow(tlw); + // QTBUG-37126, Active X controls may set the focus on native child widgets. + if (wnd && tlw && wnd != tlw->windowHandle()) { + if (QWidgetWindow *widgetWindow = qobject_cast<QWidgetWindow *>(wnd)) + widgetWindow->widget()->setFocus(Qt::ActiveWindowFocusReason); + } } static void ungrabKeyboardForPopup(QWidget *popup) diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 102e659fbf..ab045dd604 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -1064,7 +1064,11 @@ void QWidgetPrivate::adjustFlags(Qt::WindowFlags &flags, QWidget *w) // interpret WindowSystemMenuHint as a close button and we can't change that behavior // we can't just add this in. #ifndef Q_WS_MAC - if (flags & (Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint | Qt::WindowContextHelpButtonHint)) { + if ((flags & (Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint | Qt::WindowContextHelpButtonHint)) +# ifdef Q_OS_WIN + && type != Qt::Dialog // QTBUG-2027, allow for menu-less dialogs. +# endif + ) { flags |= Qt::WindowSystemMenuHint; #else if (flags & (Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint diff --git a/src/widgets/util/qsystemtrayicon.cpp b/src/widgets/util/qsystemtrayicon.cpp index f1a69e6b36..fa318f3233 100644 --- a/src/widgets/util/qsystemtrayicon.cpp +++ b/src/widgets/util/qsystemtrayicon.cpp @@ -672,6 +672,74 @@ void QBalloonTip::timerEvent(QTimerEvent *e) QWidget::timerEvent(e); } +////////////////////////////////////////////////////////////////////// +void QSystemTrayIconPrivate::install_sys_qpa() +{ + qpa_sys->init(); + QObject::connect(qpa_sys, SIGNAL(activated(QPlatformSystemTrayIcon::ActivationReason)), + q_func(), SLOT(_q_emitActivated(QPlatformSystemTrayIcon::ActivationReason))); + QObject::connect(qpa_sys, &QPlatformSystemTrayIcon::messageClicked, + q_func(), &QSystemTrayIcon::messageClicked); + updateMenu_sys(); + updateIcon_sys(); + updateToolTip_sys(); +} + +void QSystemTrayIconPrivate::remove_sys_qpa() +{ + qpa_sys->cleanup(); +} + +QRect QSystemTrayIconPrivate::geometry_sys_qpa() const +{ + return qpa_sys->geometry(); +} + +void QSystemTrayIconPrivate::updateIcon_sys_qpa() +{ + qpa_sys->updateIcon(icon); +} + +void QSystemTrayIconPrivate::updateMenu_sys_qpa() +{ + if (menu) { + if (!menu->platformMenu()) { + QPlatformMenu *platformMenu = qpa_sys->createMenu(); + if (platformMenu) + menu->setPlatformMenu(platformMenu); + } + qpa_sys->updateMenu(menu->platformMenu()); + } +} + +void QSystemTrayIconPrivate::updateToolTip_sys_qpa() +{ + qpa_sys->updateToolTip(toolTip); +} + +void QSystemTrayIconPrivate::showMessage_sys_qpa(const QString &message, + const QString &title, + QSystemTrayIcon::MessageIcon icon, + int msecs) +{ + QIcon notificationIcon; + switch (icon) { + case QSystemTrayIcon::Information: + notificationIcon = QApplication::style()->standardIcon(QStyle::SP_MessageBoxInformation); + break; + case QSystemTrayIcon::Warning: + notificationIcon = QApplication::style()->standardIcon(QStyle::SP_MessageBoxWarning); + break; + case QSystemTrayIcon::Critical: + notificationIcon = QApplication::style()->standardIcon(QStyle::SP_MessageBoxCritical); + break; + default: + break; + } + qpa_sys->showMessage(message, title, notificationIcon, + static_cast<QPlatformSystemTrayIcon::MessageIcon>(icon), msecs); +} + QT_END_NAMESPACE #endif // QT_NO_SYSTEMTRAYICON diff --git a/src/widgets/util/qsystemtrayicon_p.h b/src/widgets/util/qsystemtrayicon_p.h index 211ef308f1..317664a365 100644 --- a/src/widgets/util/qsystemtrayicon_p.h +++ b/src/widgets/util/qsystemtrayicon_p.h @@ -98,6 +98,15 @@ public: QSystemTrayIconSys *sys; QPlatformSystemTrayIcon *qpa_sys; bool visible; + +private: + void install_sys_qpa(); + void remove_sys_qpa(); + void updateIcon_sys_qpa(); + void updateToolTip_sys_qpa(); + void updateMenu_sys_qpa(); + QRect geometry_sys_qpa() const; + void showMessage_sys_qpa(const QString &msg, const QString &title, QSystemTrayIcon::MessageIcon icon, int secs); }; class QBalloonTip : public QWidget diff --git a/src/widgets/util/qsystemtrayicon_qpa.cpp b/src/widgets/util/qsystemtrayicon_qpa.cpp index f98aeaf678..045641c509 100644 --- a/src/widgets/util/qsystemtrayicon_qpa.cpp +++ b/src/widgets/util/qsystemtrayicon_qpa.cpp @@ -65,28 +65,20 @@ QSystemTrayIconPrivate::~QSystemTrayIconPrivate() void QSystemTrayIconPrivate::install_sys() { - if (qpa_sys) { - qpa_sys->init(); - QObject::connect(qpa_sys, SIGNAL(activated(QPlatformSystemTrayIcon::ActivationReason)), - q_func(), SLOT(_q_emitActivated(QPlatformSystemTrayIcon::ActivationReason))); - QObject::connect(qpa_sys, SIGNAL(messageClicked()), - q_func(), SIGNAL(messageClicked())); - updateMenu_sys(); - updateIcon_sys(); - updateToolTip_sys(); - } + if (qpa_sys) + install_sys_qpa(); } void QSystemTrayIconPrivate::remove_sys() { if (qpa_sys) - qpa_sys->cleanup(); + remove_sys_qpa(); } QRect QSystemTrayIconPrivate::geometry_sys() const { if (qpa_sys) - return qpa_sys->geometry(); + return geometry_sys_qpa(); else return QRect(); } @@ -94,25 +86,19 @@ QRect QSystemTrayIconPrivate::geometry_sys() const void QSystemTrayIconPrivate::updateIcon_sys() { if (qpa_sys) - qpa_sys->updateIcon(icon); + updateIcon_sys_qpa(); } void QSystemTrayIconPrivate::updateMenu_sys() { - if (qpa_sys && menu) { - if (!menu->platformMenu()) { - QPlatformMenu *platformMenu = qpa_sys->createMenu(); - if (platformMenu) - menu->setPlatformMenu(platformMenu); - } - qpa_sys->updateMenu(menu->platformMenu()); - } + if (qpa_sys) + updateMenu_sys_qpa(); } void QSystemTrayIconPrivate::updateToolTip_sys() { if (qpa_sys) - qpa_sys->updateToolTip(toolTip); + updateToolTip_sys_qpa(); } bool QSystemTrayIconPrivate::isSystemTrayAvailable_sys() @@ -138,25 +124,8 @@ void QSystemTrayIconPrivate::showMessage_sys(const QString &message, QSystemTrayIcon::MessageIcon icon, int msecs) { - if (!qpa_sys) - return; - - QIcon notificationIcon; - switch (icon) { - case QSystemTrayIcon::Information: - notificationIcon = QApplication::style()->standardIcon(QStyle::SP_MessageBoxInformation); - break; - case QSystemTrayIcon::Warning: - notificationIcon = QApplication::style()->standardIcon(QStyle::SP_MessageBoxWarning); - break; - case QSystemTrayIcon::Critical: - notificationIcon = QApplication::style()->standardIcon(QStyle::SP_MessageBoxCritical); - break; - default: - break; - } - qpa_sys->showMessage(message, title, notificationIcon, - static_cast<QPlatformSystemTrayIcon::MessageIcon>(icon), msecs); + if (qpa_sys) + showMessage_sys_qpa(message, title, icon, msecs); } QT_END_NAMESPACE diff --git a/src/widgets/util/qsystemtrayicon_x11.cpp b/src/widgets/util/qsystemtrayicon_x11.cpp index 347e5701c0..27d0418dff 100644 --- a/src/widgets/util/qsystemtrayicon_x11.cpp +++ b/src/widgets/util/qsystemtrayicon_x11.cpp @@ -55,6 +55,9 @@ #include <qscreen.h> #include <qbackingstore.h> #include <qpa/qplatformnativeinterface.h> +#include <qpa/qplatformsystemtrayicon.h> +#include <qpa/qplatformtheme.h> +#include <private/qguiapplication_p.h> #include <qdebug.h> #ifndef QT_NO_SYSTEMTRAYICON @@ -209,16 +212,22 @@ void QSystemTrayIconSys::paintEvent(QPaintEvent *) QSystemTrayIconPrivate::QSystemTrayIconPrivate() : sys(0), + qpa_sys(QGuiApplicationPrivate::platformTheme()->createPlatformSystemTrayIcon()), visible(false) { } QSystemTrayIconPrivate::~QSystemTrayIconPrivate() { + delete qpa_sys; } void QSystemTrayIconPrivate::install_sys() { + if (qpa_sys) { + install_sys_qpa(); + return; + } Q_Q(QSystemTrayIcon); if (!sys && locateSystemTray()) { sys = new QSystemTrayIconSys(q); @@ -229,6 +238,8 @@ void QSystemTrayIconPrivate::install_sys() QRect QSystemTrayIconPrivate::geometry_sys() const { + if (qpa_sys) + return geometry_sys_qpa(); if (!sys) return QRect(); return sys->globalGeometry(); @@ -236,6 +247,10 @@ QRect QSystemTrayIconPrivate::geometry_sys() const void QSystemTrayIconPrivate::remove_sys() { + if (qpa_sys) { + remove_sys_qpa(); + return; + } if (!sys) return; QBalloonTip::hideBalloon(); @@ -246,17 +261,26 @@ void QSystemTrayIconPrivate::remove_sys() void QSystemTrayIconPrivate::updateIcon_sys() { + if (qpa_sys) { + updateIcon_sys_qpa(); + return; + } if (sys) sys->updateIcon(); } void QSystemTrayIconPrivate::updateMenu_sys() { - + if (qpa_sys) + updateMenu_sys_qpa(); } void QSystemTrayIconPrivate::updateToolTip_sys() { + if (qpa_sys) { + updateToolTip_sys_qpa(); + return; + } if (!sys) return; #ifndef QT_NO_TOOLTIP @@ -266,6 +290,11 @@ void QSystemTrayIconPrivate::updateToolTip_sys() bool QSystemTrayIconPrivate::isSystemTrayAvailable_sys() { + QScopedPointer<QPlatformSystemTrayIcon> sys(QGuiApplicationPrivate::platformTheme()->createPlatformSystemTrayIcon()); + if (sys) + return sys->isSystemTrayAvailable(); + + // no QPlatformSystemTrayIcon so fall back to default xcb platform behavior const QString platform = QGuiApplication::platformName(); if (platform.compare(QStringLiteral("xcb"), Qt::CaseInsensitive) == 0) return locateSystemTray(); @@ -274,12 +303,21 @@ bool QSystemTrayIconPrivate::isSystemTrayAvailable_sys() bool QSystemTrayIconPrivate::supportsMessages_sys() { + QScopedPointer<QPlatformSystemTrayIcon> sys(QGuiApplicationPrivate::platformTheme()->createPlatformSystemTrayIcon()); + if (sys) + return sys->supportsMessages(); + + // no QPlatformSystemTrayIcon so fall back to default xcb platform behavior return true; } void QSystemTrayIconPrivate::showMessage_sys(const QString &message, const QString &title, QSystemTrayIcon::MessageIcon icon, int msecs) { + if (qpa_sys) { + showMessage_sys_qpa(message, title, icon, msecs); + return; + } if (!sys) return; const QPoint g = sys->globalGeometry().topLeft(); diff --git a/src/widgets/widgets/qmdiarea.cpp b/src/widgets/widgets/qmdiarea.cpp index 600d9b536f..d0488d5955 100644 --- a/src/widgets/widgets/qmdiarea.cpp +++ b/src/widgets/widgets/qmdiarea.cpp @@ -169,7 +169,7 @@ #include <QResizeEvent> #include <QScrollBar> #include <QtAlgorithms> -#include <QMutableListIterator> +#include <QMutableVectorIterator> #include <QPainter> #include <QFontMetrics> #include <QStyleOption> @@ -413,7 +413,7 @@ void IconTiler::rearrange(QList<QWidget *> &widgets, const QRect &domain) const \internal Calculates the accumulated overlap (intersection area) between 'source' and 'rects'. */ -int MinOverlapPlacer::accumulatedOverlap(const QRect &source, const QList<QRect> &rects) +int MinOverlapPlacer::accumulatedOverlap(const QRect &source, const QVector<QRect> &rects) { int accOverlap = 0; foreach (const QRect &rect, rects) { @@ -429,7 +429,7 @@ int MinOverlapPlacer::accumulatedOverlap(const QRect &source, const QList<QRect> Finds among 'source' the rectangle with the minimum accumulated overlap with the rectangles in 'rects'. */ -QRect MinOverlapPlacer::findMinOverlapRect(const QList<QRect> &source, const QList<QRect> &rects) +QRect MinOverlapPlacer::findMinOverlapRect(const QVector<QRect> &source, const QVector<QRect> &rects) { int minAccOverlap = -1; QRect minAccOverlapRect; @@ -447,28 +447,37 @@ QRect MinOverlapPlacer::findMinOverlapRect(const QList<QRect> &source, const QLi \internal Gets candidates for the final placement. */ -void MinOverlapPlacer::getCandidatePlacements(const QSize &size, const QList<QRect> &rects, - const QRect &domain,QList<QRect> &candidates) +QVector<QRect> MinOverlapPlacer::getCandidatePlacements(const QSize &size, const QVector<QRect> &rects, + const QRect &domain) { - QSet<int> xset; - QSet<int> yset; - xset << domain.left() << domain.right() - size.width() + 1; - yset << domain.top(); + QVector<QRect> result; + + QVector<int> xlist; + xlist.reserve(2 + rects.size()); + xlist << domain.left() << domain.right() - size.width() + 1; + + QVector<int> ylist; + ylist.reserve(2 + rects.size()); + ylist << domain.top(); if (domain.bottom() - size.height() + 1 >= 0) - yset << domain.bottom() - size.height() + 1; + ylist << domain.bottom() - size.height() + 1; + foreach (const QRect &rect, rects) { - xset << rect.right() + 1; - yset << rect.bottom() + 1; + xlist << rect.right() + 1; + ylist << rect.bottom() + 1; } - QList<int> xlist = xset.values(); std::sort(xlist.begin(), xlist.end()); - QList<int> ylist = yset.values(); + xlist.erase(std::unique(xlist.begin(), xlist.end()), xlist.end()); + std::sort(ylist.begin(), ylist.end()); + ylist.erase(std::unique(ylist.begin(), ylist.end()), ylist.end()); + result.reserve(ylist.size() * xlist.size()); foreach (int y, ylist) foreach (int x, xlist) - candidates << QRect(QPoint(x, y), size); + result << QRect(QPoint(x, y), size); + return result; } /*! @@ -476,10 +485,12 @@ void MinOverlapPlacer::getCandidatePlacements(const QSize &size, const QList<QRe Finds all rectangles in 'source' not completely inside 'domain'. The result is stored in 'result' and also removed from 'source'. */ -void MinOverlapPlacer::findNonInsiders(const QRect &domain, QList<QRect> &source, - QList<QRect> &result) +QVector<QRect> MinOverlapPlacer::findNonInsiders(const QRect &domain, QVector<QRect> &source) { - QMutableListIterator<QRect> it(source); + QVector<QRect> result; + result.reserve(source.size()); + + QMutableVectorIterator<QRect> it(source); while (it.hasNext()) { const QRect srcRect = it.next(); if (!domain.contains(srcRect)) { @@ -487,6 +498,8 @@ void MinOverlapPlacer::findNonInsiders(const QRect &domain, QList<QRect> &source it.remove(); } } + + return result; } /*! @@ -494,9 +507,11 @@ void MinOverlapPlacer::findNonInsiders(const QRect &domain, QList<QRect> &source Finds all rectangles in 'source' that overlaps 'domain' by the maximum overlap area between 'domain' and any rectangle in 'source'. The result is stored in 'result'. */ -void MinOverlapPlacer::findMaxOverlappers(const QRect &domain, const QList<QRect> &source, - QList<QRect> &result) +QVector<QRect> MinOverlapPlacer::findMaxOverlappers(const QRect &domain, const QVector<QRect> &source) { + QVector<QRect> result; + result.reserve(source.size()); + int maxOverlap = -1; foreach (const QRect &srcRect, source) { QRect intersection = domain.intersected(srcRect); @@ -509,6 +524,8 @@ void MinOverlapPlacer::findMaxOverlappers(const QRect &domain, const QList<QRect result << srcRect; } } + + return result; } /*! @@ -517,17 +534,15 @@ void MinOverlapPlacer::findMaxOverlappers(const QRect &domain, const QList<QRect placement that overlaps the rectangles in 'rects' as little as possible while at the same time being as much as possible inside 'domain'. */ -QPoint MinOverlapPlacer::findBestPlacement(const QRect &domain, const QList<QRect> &rects, - QList<QRect> &source) +QPoint MinOverlapPlacer::findBestPlacement(const QRect &domain, const QVector<QRect> &rects, + QVector<QRect> &source) { - QList<QRect> nonInsiders; - findNonInsiders(domain, source, nonInsiders); + const QVector<QRect> nonInsiders = findNonInsiders(domain, source); if (!source.empty()) return findMinOverlapRect(source, rects).topLeft(); - QList<QRect> maxOverlappers; - findMaxOverlappers(domain, nonInsiders, maxOverlappers); + QVector<QRect> maxOverlappers = findMaxOverlappers(domain, nonInsiders); return findMinOverlapRect(maxOverlappers, rects).topLeft(); } @@ -538,7 +553,7 @@ QPoint MinOverlapPlacer::findBestPlacement(const QRect &domain, const QList<QRec overlaps 'rects' as little as possible and 'domain' as much as possible. Returns the position of the resulting rectangle. */ -QPoint MinOverlapPlacer::place(const QSize &size, const QList<QRect> &rects, +QPoint MinOverlapPlacer::place(const QSize &size, const QVector<QRect> &rects, const QRect &domain) const { if (size.isEmpty() || !domain.isValid()) @@ -548,8 +563,7 @@ QPoint MinOverlapPlacer::place(const QSize &size, const QList<QRect> &rects, return QPoint(); } - QList<QRect> candidates; - getCandidatePlacements(size, rects, domain, candidates); + QVector<QRect> candidates = getCandidatePlacements(size, rects, domain); return findBestPlacement(domain, rects, candidates); } @@ -882,7 +896,8 @@ void QMdiAreaPrivate::place(Placer *placer, QMdiSubWindow *child) return; } - QList<QRect> rects; + QVector<QRect> rects; + rects.reserve(childWindows.size()); QRect parentRect = q->rect(); foreach (QMdiSubWindow *window, childWindows) { if (!sanityCheck(window, "QMdiArea::place") || window == child || !window->isVisibleTo(q) diff --git a/src/widgets/widgets/qmdiarea_p.h b/src/widgets/widgets/qmdiarea_p.h index 90db55438a..360ed2508c 100644 --- a/src/widgets/widgets/qmdiarea_p.h +++ b/src/widgets/widgets/qmdiarea_p.h @@ -59,6 +59,7 @@ #ifndef QT_NO_MDIAREA #include <QList> +#include <QVector> #include <QRect> #include <QPoint> #include <QtWidgets/qapplication.h> @@ -116,24 +117,19 @@ public: // Places the rectangle defined by 'size' relative to 'rects' and 'domain'. // Returns the position of the resulting rectangle. virtual QPoint place( - const QSize &size, const QList<QRect> &rects, const QRect &domain) const = 0; + const QSize &size, const QVector<QRect> &rects, const QRect &domain) const = 0; virtual ~Placer() {} }; class MinOverlapPlacer : public Placer { - QPoint place(const QSize &size, const QList<QRect> &rects, const QRect &domain) const; - static int accumulatedOverlap(const QRect &source, const QList<QRect> &rects); - static QRect findMinOverlapRect(const QList<QRect> &source, const QList<QRect> &rects); - static void getCandidatePlacements( - const QSize &size, const QList<QRect> &rects, const QRect &domain, - QList<QRect> &candidates); - static QPoint findBestPlacement( - const QRect &domain, const QList<QRect> &rects, QList<QRect> &source); - static void findNonInsiders( - const QRect &domain, QList<QRect> &source, QList<QRect> &result); - static void findMaxOverlappers( - const QRect &domain, const QList<QRect> &source, QList<QRect> &result); + QPoint place(const QSize &size, const QVector<QRect> &rects, const QRect &domain) const; + static int accumulatedOverlap(const QRect &source, const QVector<QRect> &rects); + static QRect findMinOverlapRect(const QVector<QRect> &source, const QVector<QRect> &rects); + static QVector<QRect> getCandidatePlacements(const QSize &size, const QVector<QRect> &rects, const QRect &domain); + static QPoint findBestPlacement(const QRect &domain, const QVector<QRect> &rects, QVector<QRect> &source); + static QVector<QRect> findNonInsiders(const QRect &domain, QVector<QRect> &source); + static QVector<QRect> findMaxOverlappers(const QRect &domain, const QVector<QRect> &source); }; } // namespace QMdi diff --git a/tests/auto/gui/painting/qpen/tst_qpen.cpp b/tests/auto/gui/painting/qpen/tst_qpen.cpp index 07c996d026..a373c51710 100644 --- a/tests/auto/gui/painting/qpen/tst_qpen.cpp +++ b/tests/auto/gui/painting/qpen/tst_qpen.cpp @@ -57,6 +57,8 @@ public: private slots: void getSetCheck(); void swap(); + void move(); + void move_assign(); void operator_eq_eq(); void operator_eq_eq_data(); @@ -101,6 +103,57 @@ void tst_QPen::swap() QCOMPARE(p2.color(), QColor(Qt::black)); } +void tst_QPen::move() +{ + QPen p1(Qt::black); + + // check that moving does the right thing: + QPen p2 = qMove(p1); // could be move or copy construction, so don't check p1's state + QCOMPARE(p2.color(), QColor(Qt::black)); + + // this, executed ehre, would crash: + // QVERIFY(p1.style() != Qt::NoPen); + + // check that moved-from QPen p1 can still be safely copied: + const QPen p3 = p1; + + // check that moved-from QPen p1 can still be safely assigned to: + const QPen p4(Qt::yellow); + p1 = p4; + QCOMPARE(p1.color(), QColor(Qt::yellow)); + + // check that moved-from QPens p2, p3 can still be safely destroyed: + QPen p5 = qMove(p2); + + // intentionally no more statements beyond this point +} + +void tst_QPen::move_assign() +{ + QPen p1(Qt::black), p2(Qt::white); + + // check that moving does the right thing: + p2 = qMove(p1); // could be move or copy assignment, so don't check p1's state + QCOMPARE(p2.color(), QColor(Qt::black)); + + // check that move-assigned-from QPen p1 can still be used, albeit + // with undocumented state (it's p2's original state): + QVERIFY(p1.style() != Qt::NoPen); + + // check that moved-from QPen p1 can still be safely copied: + const QPen p3 = p1; + + // check that moved-from QPen p1 can still be safely assigned to: + const QPen p4(Qt::yellow); + p1 = p4; + QCOMPARE(p1.color(), QColor(Qt::yellow)); + + // check that moved-from QPens p2, p3 can still be safely destroyed: + QPen p5; + p5 = qMove(p2); + + // intentionally no more statements beyond this point +} tst_QPen::tst_QPen() diff --git a/tests/auto/testlib/selftests/expected_assert.lightxml b/tests/auto/testlib/selftests/expected_assert.lightxml index d2d4ae5153..b40ff41da3 100644 --- a/tests/auto/testlib/selftests/expected_assert.lightxml +++ b/tests/auto/testlib/selftests/expected_assert.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_assert.xml b/tests/auto/testlib/selftests/expected_assert.xml index 9e5ea760ae..9770b3cd57 100644 --- a/tests/auto/testlib/selftests/expected_assert.xml +++ b/tests/auto/testlib/selftests/expected_assert.xml @@ -2,6 +2,7 @@ <TestCase name="tst_Assert"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_assert.xunitxml b/tests/auto/testlib/selftests/expected_assert.xunitxml index 0aebe72745..96daa33dcf 100644 --- a/tests/auto/testlib/selftests/expected_assert.xunitxml +++ b/tests/auto/testlib/selftests/expected_assert.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="pass" name="testNumber1"/> diff --git a/tests/auto/testlib/selftests/expected_badxml.lightxml b/tests/auto/testlib/selftests/expected_badxml.lightxml index e4c79e3bb0..94f479a79a 100644 --- a/tests/auto/testlib/selftests/expected_badxml.lightxml +++ b/tests/auto/testlib/selftests/expected_badxml.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_badxml.xml b/tests/auto/testlib/selftests/expected_badxml.xml index 0811db0f3a..c1266bfeed 100644 --- a/tests/auto/testlib/selftests/expected_badxml.xml +++ b/tests/auto/testlib/selftests/expected_badxml.xml @@ -2,6 +2,7 @@ <TestCase name="tst_BadXml"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_badxml.xunitxml b/tests/auto/testlib/selftests/expected_badxml.xunitxml index a696da58c9..49048fdad6 100644 --- a/tests/auto/testlib/selftests/expected_badxml.xunitxml +++ b/tests/auto/testlib/selftests/expected_badxml.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="fail" name="badDataTag"> diff --git a/tests/auto/testlib/selftests/expected_benchlibcounting.lightxml b/tests/auto/testlib/selftests/expected_benchlibcounting.lightxml index 08872be733..6fe511462c 100644 --- a/tests/auto/testlib/selftests/expected_benchlibcounting.lightxml +++ b/tests/auto/testlib/selftests/expected_benchlibcounting.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_benchlibcounting.xml b/tests/auto/testlib/selftests/expected_benchlibcounting.xml index ee6fd98ef2..d945511eec 100644 --- a/tests/auto/testlib/selftests/expected_benchlibcounting.xml +++ b/tests/auto/testlib/selftests/expected_benchlibcounting.xml @@ -2,6 +2,7 @@ <TestCase name="tst_BenchlibCounting"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_benchlibcounting.xunitxml b/tests/auto/testlib/selftests/expected_benchlibcounting.xunitxml index 83e429aa3a..05d1da9874 100644 --- a/tests/auto/testlib/selftests/expected_benchlibcounting.xunitxml +++ b/tests/auto/testlib/selftests/expected_benchlibcounting.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="pass" name="passingBenchmark"> diff --git a/tests/auto/testlib/selftests/expected_benchlibeventcounter.lightxml b/tests/auto/testlib/selftests/expected_benchlibeventcounter.lightxml index cba91a374f..0bc00569e9 100644 --- a/tests/auto/testlib/selftests/expected_benchlibeventcounter.lightxml +++ b/tests/auto/testlib/selftests/expected_benchlibeventcounter.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_benchlibeventcounter.xml b/tests/auto/testlib/selftests/expected_benchlibeventcounter.xml index 7d28975ead..f543e2775c 100644 --- a/tests/auto/testlib/selftests/expected_benchlibeventcounter.xml +++ b/tests/auto/testlib/selftests/expected_benchlibeventcounter.xml @@ -2,6 +2,7 @@ <TestCase name="tst_BenchlibEventCounter"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_benchlibeventcounter.xunitxml b/tests/auto/testlib/selftests/expected_benchlibeventcounter.xunitxml index 60dca28d4f..ce0a81110d 100644 --- a/tests/auto/testlib/selftests/expected_benchlibeventcounter.xunitxml +++ b/tests/auto/testlib/selftests/expected_benchlibeventcounter.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="pass" name="events"> diff --git a/tests/auto/testlib/selftests/expected_benchlibtickcounter.lightxml b/tests/auto/testlib/selftests/expected_benchlibtickcounter.lightxml index 97422240d9..11296ad9c2 100644 --- a/tests/auto/testlib/selftests/expected_benchlibtickcounter.lightxml +++ b/tests/auto/testlib/selftests/expected_benchlibtickcounter.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_benchlibtickcounter.xml b/tests/auto/testlib/selftests/expected_benchlibtickcounter.xml index 24c2e51084..3dd56b4af7 100644 --- a/tests/auto/testlib/selftests/expected_benchlibtickcounter.xml +++ b/tests/auto/testlib/selftests/expected_benchlibtickcounter.xml @@ -2,6 +2,7 @@ <TestCase name="tst_BenchlibTickCounter"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_benchlibtickcounter.xunitxml b/tests/auto/testlib/selftests/expected_benchlibtickcounter.xunitxml index 28c8f11143..779d3bdcbc 100644 --- a/tests/auto/testlib/selftests/expected_benchlibtickcounter.xunitxml +++ b/tests/auto/testlib/selftests/expected_benchlibtickcounter.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="pass" name="threeBillionTicks"> diff --git a/tests/auto/testlib/selftests/expected_benchlibwalltime.lightxml b/tests/auto/testlib/selftests/expected_benchlibwalltime.lightxml index b2e819b26d..c75a6c944d 100644 --- a/tests/auto/testlib/selftests/expected_benchlibwalltime.lightxml +++ b/tests/auto/testlib/selftests/expected_benchlibwalltime.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_benchlibwalltime.xml b/tests/auto/testlib/selftests/expected_benchlibwalltime.xml index 6ae355783a..a2f0edecc6 100644 --- a/tests/auto/testlib/selftests/expected_benchlibwalltime.xml +++ b/tests/auto/testlib/selftests/expected_benchlibwalltime.xml @@ -2,6 +2,7 @@ <TestCase name="tst_BenchlibWalltime"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_benchlibwalltime.xunitxml b/tests/auto/testlib/selftests/expected_benchlibwalltime.xunitxml index e4ffca4d09..6a0510c4c9 100644 --- a/tests/auto/testlib/selftests/expected_benchlibwalltime.xunitxml +++ b/tests/auto/testlib/selftests/expected_benchlibwalltime.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="pass" name="waitForOneThousand"> diff --git a/tests/auto/testlib/selftests/expected_cmptest.lightxml b/tests/auto/testlib/selftests/expected_cmptest.lightxml index 3a776ea7cb..4a376b5c8b 100644 --- a/tests/auto/testlib/selftests/expected_cmptest.lightxml +++ b/tests/auto/testlib/selftests/expected_cmptest.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_cmptest.xml b/tests/auto/testlib/selftests/expected_cmptest.xml index 970544e4b6..aefb1b5f4c 100644 --- a/tests/auto/testlib/selftests/expected_cmptest.xml +++ b/tests/auto/testlib/selftests/expected_cmptest.xml @@ -2,6 +2,7 @@ <TestCase name="tst_Cmptest"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_cmptest.xunitxml b/tests/auto/testlib/selftests/expected_cmptest.xunitxml index 7874c6c52e..7502d3cc54 100644 --- a/tests/auto/testlib/selftests/expected_cmptest.xunitxml +++ b/tests/auto/testlib/selftests/expected_cmptest.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="pass" name="compare_boolfuncs"/> diff --git a/tests/auto/testlib/selftests/expected_commandlinedata.lightxml b/tests/auto/testlib/selftests/expected_commandlinedata.lightxml index c11017f022..894ae7ae23 100644 --- a/tests/auto/testlib/selftests/expected_commandlinedata.lightxml +++ b/tests/auto/testlib/selftests/expected_commandlinedata.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_commandlinedata.xml b/tests/auto/testlib/selftests/expected_commandlinedata.xml index 20dc0c6a7c..b2aa98f6a7 100644 --- a/tests/auto/testlib/selftests/expected_commandlinedata.xml +++ b/tests/auto/testlib/selftests/expected_commandlinedata.xml @@ -2,6 +2,7 @@ <TestCase name="tst_DataTable"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_commandlinedata.xunitxml b/tests/auto/testlib/selftests/expected_commandlinedata.xunitxml index 45b833cf19..5072a7e6f4 100644 --- a/tests/auto/testlib/selftests/expected_commandlinedata.xunitxml +++ b/tests/auto/testlib/selftests/expected_commandlinedata.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="pass" name="fiveTablePasses"> diff --git a/tests/auto/testlib/selftests/expected_counting.lightxml b/tests/auto/testlib/selftests/expected_counting.lightxml index e5fe1ee3cf..836c35fb85 100644 --- a/tests/auto/testlib/selftests/expected_counting.lightxml +++ b/tests/auto/testlib/selftests/expected_counting.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_counting.xml b/tests/auto/testlib/selftests/expected_counting.xml index e015dddcc6..892fd762c6 100644 --- a/tests/auto/testlib/selftests/expected_counting.xml +++ b/tests/auto/testlib/selftests/expected_counting.xml @@ -2,6 +2,7 @@ <TestCase name="tst_Counting"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_counting.xunitxml b/tests/auto/testlib/selftests/expected_counting.xunitxml index 72bf047ba8..cb3a7815af 100644 --- a/tests/auto/testlib/selftests/expected_counting.xunitxml +++ b/tests/auto/testlib/selftests/expected_counting.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="pass" name="testPassPass"/> diff --git a/tests/auto/testlib/selftests/expected_datatable.lightxml b/tests/auto/testlib/selftests/expected_datatable.lightxml index 6cc2d1c46f..c14a6a1940 100644 --- a/tests/auto/testlib/selftests/expected_datatable.lightxml +++ b/tests/auto/testlib/selftests/expected_datatable.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_datatable.xml b/tests/auto/testlib/selftests/expected_datatable.xml index 79963db0a4..297cb0d5de 100644 --- a/tests/auto/testlib/selftests/expected_datatable.xml +++ b/tests/auto/testlib/selftests/expected_datatable.xml @@ -2,6 +2,7 @@ <TestCase name="tst_DataTable"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_datatable.xunitxml b/tests/auto/testlib/selftests/expected_datatable.xunitxml index 6bac80e0a2..89fc7ee819 100644 --- a/tests/auto/testlib/selftests/expected_datatable.xunitxml +++ b/tests/auto/testlib/selftests/expected_datatable.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="pass" name="singleTestFunction1"/> diff --git a/tests/auto/testlib/selftests/expected_datetime.lightxml b/tests/auto/testlib/selftests/expected_datetime.lightxml index 02c60d04f9..48ad0933f7 100644 --- a/tests/auto/testlib/selftests/expected_datetime.lightxml +++ b/tests/auto/testlib/selftests/expected_datetime.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_datetime.xml b/tests/auto/testlib/selftests/expected_datetime.xml index 03aec4430e..30afde60ec 100644 --- a/tests/auto/testlib/selftests/expected_datetime.xml +++ b/tests/auto/testlib/selftests/expected_datetime.xml @@ -2,6 +2,7 @@ <TestCase name="tst_DateTime"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_datetime.xunitxml b/tests/auto/testlib/selftests/expected_datetime.xunitxml index 00bd43f904..901462b6bf 100644 --- a/tests/auto/testlib/selftests/expected_datetime.xunitxml +++ b/tests/auto/testlib/selftests/expected_datetime.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="fail" name="dateTime"> diff --git a/tests/auto/testlib/selftests/expected_exceptionthrow.lightxml b/tests/auto/testlib/selftests/expected_exceptionthrow.lightxml index 6c9675a2aa..2b802aabaf 100644 --- a/tests/auto/testlib/selftests/expected_exceptionthrow.lightxml +++ b/tests/auto/testlib/selftests/expected_exceptionthrow.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> @@ -7,7 +8,7 @@ <Duration msecs="0"/> </TestFunction> <TestFunction name="throwException"> -<Incident type="fail" file="/home/frederik/dev/qt/qt-src-dev/qtbase/src/testlib/qtestcase.cpp" line="2229"> +<Incident type="fail" file="qtestcase.cpp" line="2235"> <Description><![CDATA[Caught unhandled exception]]></Description> </Incident> <Duration msecs="0"/> diff --git a/tests/auto/testlib/selftests/expected_exceptionthrow.xml b/tests/auto/testlib/selftests/expected_exceptionthrow.xml index 87d9d2d431..a265d5ba5f 100644 --- a/tests/auto/testlib/selftests/expected_exceptionthrow.xml +++ b/tests/auto/testlib/selftests/expected_exceptionthrow.xml @@ -2,6 +2,7 @@ <TestCase name="tst_Exception"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> @@ -9,7 +10,7 @@ <Duration msecs="0"/> </TestFunction> <TestFunction name="throwException"> -<Incident type="fail" file="/home/frederik/dev/qt/qt-src-dev/qtbase/src/testlib/qtestcase.cpp" line="2229"> +<Incident type="fail" file="qtestcase.cpp" line="2235"> <Description><![CDATA[Caught unhandled exception]]></Description> </Incident> <Duration msecs="0"/> diff --git a/tests/auto/testlib/selftests/expected_exceptionthrow.xunitxml b/tests/auto/testlib/selftests/expected_exceptionthrow.xunitxml index ab0d379255..7d10bf6f04 100644 --- a/tests/auto/testlib/selftests/expected_exceptionthrow.xunitxml +++ b/tests/auto/testlib/selftests/expected_exceptionthrow.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="fail" name="throwException"> diff --git a/tests/auto/testlib/selftests/expected_expectfail.lightxml b/tests/auto/testlib/selftests/expected_expectfail.lightxml index e5fcca5875..cd5ab78fbe 100644 --- a/tests/auto/testlib/selftests/expected_expectfail.lightxml +++ b/tests/auto/testlib/selftests/expected_expectfail.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_expectfail.xml b/tests/auto/testlib/selftests/expected_expectfail.xml index 14fee2129e..a98b97810c 100644 --- a/tests/auto/testlib/selftests/expected_expectfail.xml +++ b/tests/auto/testlib/selftests/expected_expectfail.xml @@ -2,6 +2,7 @@ <TestCase name="tst_ExpectFail"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_expectfail.xunitxml b/tests/auto/testlib/selftests/expected_expectfail.xunitxml index 45c260c77f..47483d71bf 100644 --- a/tests/auto/testlib/selftests/expected_expectfail.xunitxml +++ b/tests/auto/testlib/selftests/expected_expectfail.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="xfail" name="xfailAndContinue"> diff --git a/tests/auto/testlib/selftests/expected_failcleanup.lightxml b/tests/auto/testlib/selftests/expected_failcleanup.lightxml index cfc18ef5da..b2db64c4e2 100644 --- a/tests/auto/testlib/selftests/expected_failcleanup.lightxml +++ b/tests/auto/testlib/selftests/expected_failcleanup.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_failcleanup.xml b/tests/auto/testlib/selftests/expected_failcleanup.xml index 3aa7aa265d..476e56c4f4 100644 --- a/tests/auto/testlib/selftests/expected_failcleanup.xml +++ b/tests/auto/testlib/selftests/expected_failcleanup.xml @@ -2,6 +2,7 @@ <TestCase name="tst_FailCleanup"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_failcleanup.xunitxml b/tests/auto/testlib/selftests/expected_failcleanup.xunitxml index 6e35566be8..813e284ee0 100644 --- a/tests/auto/testlib/selftests/expected_failcleanup.xunitxml +++ b/tests/auto/testlib/selftests/expected_failcleanup.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="pass" name="aTestFunction"/> diff --git a/tests/auto/testlib/selftests/expected_failinit.lightxml b/tests/auto/testlib/selftests/expected_failinit.lightxml index c0d193998d..5a940fc36b 100644 --- a/tests/auto/testlib/selftests/expected_failinit.lightxml +++ b/tests/auto/testlib/selftests/expected_failinit.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_failinit.xml b/tests/auto/testlib/selftests/expected_failinit.xml index 70ad613f3f..51e1a7fce4 100644 --- a/tests/auto/testlib/selftests/expected_failinit.xml +++ b/tests/auto/testlib/selftests/expected_failinit.xml @@ -2,6 +2,7 @@ <TestCase name="tst_FailInit"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_failinit.xunitxml b/tests/auto/testlib/selftests/expected_failinit.xunitxml index 3c2e31be29..3715725ea5 100644 --- a/tests/auto/testlib/selftests/expected_failinit.xunitxml +++ b/tests/auto/testlib/selftests/expected_failinit.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="fail" name="initTestCase"> <failure message="'false' returned FALSE. ()" result="fail"/> diff --git a/tests/auto/testlib/selftests/expected_failinitdata.lightxml b/tests/auto/testlib/selftests/expected_failinitdata.lightxml index 285471470f..f9da42c060 100644 --- a/tests/auto/testlib/selftests/expected_failinitdata.lightxml +++ b/tests/auto/testlib/selftests/expected_failinitdata.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_failinitdata.xml b/tests/auto/testlib/selftests/expected_failinitdata.xml index e86e102202..e843863bfc 100644 --- a/tests/auto/testlib/selftests/expected_failinitdata.xml +++ b/tests/auto/testlib/selftests/expected_failinitdata.xml @@ -2,6 +2,7 @@ <TestCase name="tst_FailInitData"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_failinitdata.xunitxml b/tests/auto/testlib/selftests/expected_failinitdata.xunitxml index f32ccd5e81..d245bc0dff 100644 --- a/tests/auto/testlib/selftests/expected_failinitdata.xunitxml +++ b/tests/auto/testlib/selftests/expected_failinitdata.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="fail" name="initTestCase"> <failure message="'false' returned FALSE. ()" result="fail"/> diff --git a/tests/auto/testlib/selftests/expected_fetchbogus.lightxml b/tests/auto/testlib/selftests/expected_fetchbogus.lightxml index c5587cf031..c62a93eb49 100644 --- a/tests/auto/testlib/selftests/expected_fetchbogus.lightxml +++ b/tests/auto/testlib/selftests/expected_fetchbogus.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_fetchbogus.xml b/tests/auto/testlib/selftests/expected_fetchbogus.xml index 40295bdebc..c20de137a2 100644 --- a/tests/auto/testlib/selftests/expected_fetchbogus.xml +++ b/tests/auto/testlib/selftests/expected_fetchbogus.xml @@ -2,6 +2,7 @@ <TestCase name="tst_FetchBogus"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_fetchbogus.xunitxml b/tests/auto/testlib/selftests/expected_fetchbogus.xunitxml index fe31b4b600..77ccbd896a 100644 --- a/tests/auto/testlib/selftests/expected_fetchbogus.xunitxml +++ b/tests/auto/testlib/selftests/expected_fetchbogus.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="fail" name="fetchBogus"> diff --git a/tests/auto/testlib/selftests/expected_findtestdata.lightxml b/tests/auto/testlib/selftests/expected_findtestdata.lightxml index 4c1c7298ed..e3c3cea7bc 100644 --- a/tests/auto/testlib/selftests/expected_findtestdata.lightxml +++ b/tests/auto/testlib/selftests/expected_findtestdata.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_findtestdata.xml b/tests/auto/testlib/selftests/expected_findtestdata.xml index b1f33abaf6..6abaa15103 100644 --- a/tests/auto/testlib/selftests/expected_findtestdata.xml +++ b/tests/auto/testlib/selftests/expected_findtestdata.xml @@ -2,6 +2,7 @@ <TestCase name="FindTestData"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_findtestdata.xunitxml b/tests/auto/testlib/selftests/expected_findtestdata.xunitxml index 60283a1064..c1138da6cb 100644 --- a/tests/auto/testlib/selftests/expected_findtestdata.xunitxml +++ b/tests/auto/testlib/selftests/expected_findtestdata.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="pass" name="paths"> diff --git a/tests/auto/testlib/selftests/expected_globaldata.lightxml b/tests/auto/testlib/selftests/expected_globaldata.lightxml index fd128d2c61..7d4c43905c 100644 --- a/tests/auto/testlib/selftests/expected_globaldata.lightxml +++ b/tests/auto/testlib/selftests/expected_globaldata.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_globaldata.xml b/tests/auto/testlib/selftests/expected_globaldata.xml index 0867619fde..5e5d4d8922 100644 --- a/tests/auto/testlib/selftests/expected_globaldata.xml +++ b/tests/auto/testlib/selftests/expected_globaldata.xml @@ -2,6 +2,7 @@ <TestCase name="tst_globaldata"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_globaldata.xunitxml b/tests/auto/testlib/selftests/expected_globaldata.xunitxml index e8cd03a59c..bdd7e3f00a 100644 --- a/tests/auto/testlib/selftests/expected_globaldata.xunitxml +++ b/tests/auto/testlib/selftests/expected_globaldata.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"> <!-- message="initTestCase initTestCase (null)" type="qdebug" --> diff --git a/tests/auto/testlib/selftests/expected_longstring.lightxml b/tests/auto/testlib/selftests/expected_longstring.lightxml index 45c6d3f78d..f8796bed4a 100644 --- a/tests/auto/testlib/selftests/expected_longstring.lightxml +++ b/tests/auto/testlib/selftests/expected_longstring.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_longstring.xml b/tests/auto/testlib/selftests/expected_longstring.xml index efc29d6def..6623b7cd88 100644 --- a/tests/auto/testlib/selftests/expected_longstring.xml +++ b/tests/auto/testlib/selftests/expected_longstring.xml @@ -2,6 +2,7 @@ <TestCase name="tst_LongString"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_longstring.xunitxml b/tests/auto/testlib/selftests/expected_longstring.xunitxml index 6486817dbb..269c06fe08 100644 --- a/tests/auto/testlib/selftests/expected_longstring.xunitxml +++ b/tests/auto/testlib/selftests/expected_longstring.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="fail" name="failWithLongString"> diff --git a/tests/auto/testlib/selftests/expected_maxwarnings.lightxml b/tests/auto/testlib/selftests/expected_maxwarnings.lightxml index ce6d828eb2..49db189352 100644 --- a/tests/auto/testlib/selftests/expected_maxwarnings.lightxml +++ b/tests/auto/testlib/selftests/expected_maxwarnings.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_maxwarnings.xml b/tests/auto/testlib/selftests/expected_maxwarnings.xml index 758af9d6d5..614b054fad 100644 --- a/tests/auto/testlib/selftests/expected_maxwarnings.xml +++ b/tests/auto/testlib/selftests/expected_maxwarnings.xml @@ -2,6 +2,7 @@ <TestCase name="MaxWarnings"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_maxwarnings.xunitxml b/tests/auto/testlib/selftests/expected_maxwarnings.xunitxml index b1b0215cef..329fae5f1d 100644 --- a/tests/auto/testlib/selftests/expected_maxwarnings.xunitxml +++ b/tests/auto/testlib/selftests/expected_maxwarnings.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="pass" name="warn"> diff --git a/tests/auto/testlib/selftests/expected_singleskip.lightxml b/tests/auto/testlib/selftests/expected_singleskip.lightxml index 685396a243..ce09c0a9ad 100644 --- a/tests/auto/testlib/selftests/expected_singleskip.lightxml +++ b/tests/auto/testlib/selftests/expected_singleskip.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_singleskip.xml b/tests/auto/testlib/selftests/expected_singleskip.xml index c10626ca41..0c5cdade3d 100644 --- a/tests/auto/testlib/selftests/expected_singleskip.xml +++ b/tests/auto/testlib/selftests/expected_singleskip.xml @@ -2,6 +2,7 @@ <TestCase name="tst_SingleSkip"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_singleskip.xunitxml b/tests/auto/testlib/selftests/expected_singleskip.xunitxml index 70968fa1c4..2b2da2f504 100644 --- a/tests/auto/testlib/selftests/expected_singleskip.xunitxml +++ b/tests/auto/testlib/selftests/expected_singleskip.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase name="myTest"> diff --git a/tests/auto/testlib/selftests/expected_skip.lightxml b/tests/auto/testlib/selftests/expected_skip.lightxml index 408bc44871..ee83d263b5 100644 --- a/tests/auto/testlib/selftests/expected_skip.lightxml +++ b/tests/auto/testlib/selftests/expected_skip.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_skip.xml b/tests/auto/testlib/selftests/expected_skip.xml index b220722b6c..2c830bc9fb 100644 --- a/tests/auto/testlib/selftests/expected_skip.xml +++ b/tests/auto/testlib/selftests/expected_skip.xml @@ -2,6 +2,7 @@ <TestCase name="tst_Skip"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_skip.xunitxml b/tests/auto/testlib/selftests/expected_skip.xunitxml index 956d51f531..63e582f96a 100644 --- a/tests/auto/testlib/selftests/expected_skip.xunitxml +++ b/tests/auto/testlib/selftests/expected_skip.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase name="test"> diff --git a/tests/auto/testlib/selftests/expected_skipcleanup.lightxml b/tests/auto/testlib/selftests/expected_skipcleanup.lightxml index 49c9d148f5..dbbc30c0db 100644 --- a/tests/auto/testlib/selftests/expected_skipcleanup.lightxml +++ b/tests/auto/testlib/selftests/expected_skipcleanup.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_skipcleanup.xml b/tests/auto/testlib/selftests/expected_skipcleanup.xml index 0bf1fe53a3..7b787ebb3d 100644 --- a/tests/auto/testlib/selftests/expected_skipcleanup.xml +++ b/tests/auto/testlib/selftests/expected_skipcleanup.xml @@ -2,6 +2,7 @@ <TestCase name="tst_SkipCleanup"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_skipcleanup.xunitxml b/tests/auto/testlib/selftests/expected_skipcleanup.xunitxml index b8f67e2d07..9934584ec5 100644 --- a/tests/auto/testlib/selftests/expected_skipcleanup.xunitxml +++ b/tests/auto/testlib/selftests/expected_skipcleanup.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="pass" name="aTestFunction"/> diff --git a/tests/auto/testlib/selftests/expected_skipinit.lightxml b/tests/auto/testlib/selftests/expected_skipinit.lightxml index e06c745205..3682068825 100644 --- a/tests/auto/testlib/selftests/expected_skipinit.lightxml +++ b/tests/auto/testlib/selftests/expected_skipinit.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_skipinit.xml b/tests/auto/testlib/selftests/expected_skipinit.xml index 6a62b93614..9d6a38b82f 100644 --- a/tests/auto/testlib/selftests/expected_skipinit.xml +++ b/tests/auto/testlib/selftests/expected_skipinit.xml @@ -2,6 +2,7 @@ <TestCase name="tst_SkipInit"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_skipinit.xunitxml b/tests/auto/testlib/selftests/expected_skipinit.xunitxml index f62df71d96..bab08c375c 100644 --- a/tests/auto/testlib/selftests/expected_skipinit.xunitxml +++ b/tests/auto/testlib/selftests/expected_skipinit.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase name="initTestCase"> <!-- message="Skip inside initTestCase. This should skip all tests in the class." type="skip" --> diff --git a/tests/auto/testlib/selftests/expected_skipinitdata.lightxml b/tests/auto/testlib/selftests/expected_skipinitdata.lightxml index 41abd5dccd..26afcb4ab1 100644 --- a/tests/auto/testlib/selftests/expected_skipinitdata.lightxml +++ b/tests/auto/testlib/selftests/expected_skipinitdata.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_skipinitdata.xml b/tests/auto/testlib/selftests/expected_skipinitdata.xml index 8efe12195e..9ab84f21a1 100644 --- a/tests/auto/testlib/selftests/expected_skipinitdata.xml +++ b/tests/auto/testlib/selftests/expected_skipinitdata.xml @@ -2,6 +2,7 @@ <TestCase name="tst_SkipInitData"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_skipinitdata.xunitxml b/tests/auto/testlib/selftests/expected_skipinitdata.xunitxml index 699d50f7a7..e61d50b06b 100644 --- a/tests/auto/testlib/selftests/expected_skipinitdata.xunitxml +++ b/tests/auto/testlib/selftests/expected_skipinitdata.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase name="initTestCase"> <!-- message="Skip inside initTestCase_data. This should skip all tests in the class." type="skip" --> diff --git a/tests/auto/testlib/selftests/expected_strcmp.lightxml b/tests/auto/testlib/selftests/expected_strcmp.lightxml index f0d266d400..298e910be8 100644 --- a/tests/auto/testlib/selftests/expected_strcmp.lightxml +++ b/tests/auto/testlib/selftests/expected_strcmp.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_strcmp.xml b/tests/auto/testlib/selftests/expected_strcmp.xml index 20ffee0611..29208f9a87 100644 --- a/tests/auto/testlib/selftests/expected_strcmp.xml +++ b/tests/auto/testlib/selftests/expected_strcmp.xml @@ -2,6 +2,7 @@ <TestCase name="tst_StrCmp"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_strcmp.xunitxml b/tests/auto/testlib/selftests/expected_strcmp.xunitxml index dde9ff5299..14bef9ec47 100644 --- a/tests/auto/testlib/selftests/expected_strcmp.xunitxml +++ b/tests/auto/testlib/selftests/expected_strcmp.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="pass" name="compareCharStars"/> diff --git a/tests/auto/testlib/selftests/expected_subtest.lightxml b/tests/auto/testlib/selftests/expected_subtest.lightxml index 467fabb7ac..2e484aafef 100644 --- a/tests/auto/testlib/selftests/expected_subtest.lightxml +++ b/tests/auto/testlib/selftests/expected_subtest.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_subtest.xml b/tests/auto/testlib/selftests/expected_subtest.xml index 1107bcb070..f011489ec8 100644 --- a/tests/auto/testlib/selftests/expected_subtest.xml +++ b/tests/auto/testlib/selftests/expected_subtest.xml @@ -2,6 +2,7 @@ <TestCase name="tst_Subtest"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_subtest.xunitxml b/tests/auto/testlib/selftests/expected_subtest.xunitxml index 753711f837..b49c006940 100644 --- a/tests/auto/testlib/selftests/expected_subtest.xunitxml +++ b/tests/auto/testlib/selftests/expected_subtest.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"> <!-- message="initTestCase initTestCase (null)" type="qdebug" --> diff --git a/tests/auto/testlib/selftests/expected_verbose1.lightxml b/tests/auto/testlib/selftests/expected_verbose1.lightxml index 45dca139fa..6d7ce13ea0 100644 --- a/tests/auto/testlib/selftests/expected_verbose1.lightxml +++ b/tests/auto/testlib/selftests/expected_verbose1.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_verbose1.xml b/tests/auto/testlib/selftests/expected_verbose1.xml index 7a182183c1..b5ae1286cb 100644 --- a/tests/auto/testlib/selftests/expected_verbose1.xml +++ b/tests/auto/testlib/selftests/expected_verbose1.xml @@ -2,6 +2,7 @@ <TestCase name="tst_Counting"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_verbose1.xunitxml b/tests/auto/testlib/selftests/expected_verbose1.xunitxml index 72bf047ba8..cb3a7815af 100644 --- a/tests/auto/testlib/selftests/expected_verbose1.xunitxml +++ b/tests/auto/testlib/selftests/expected_verbose1.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="pass" name="testPassPass"/> diff --git a/tests/auto/testlib/selftests/expected_verbose2.lightxml b/tests/auto/testlib/selftests/expected_verbose2.lightxml index 0ead76884c..85f9ec45af 100644 --- a/tests/auto/testlib/selftests/expected_verbose2.lightxml +++ b/tests/auto/testlib/selftests/expected_verbose2.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_verbose2.xml b/tests/auto/testlib/selftests/expected_verbose2.xml index 6d592f4a52..94fef3eed7 100644 --- a/tests/auto/testlib/selftests/expected_verbose2.xml +++ b/tests/auto/testlib/selftests/expected_verbose2.xml @@ -2,6 +2,7 @@ <TestCase name="tst_Counting"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_verbose2.xunitxml b/tests/auto/testlib/selftests/expected_verbose2.xunitxml index 6dabbd34fc..6764a5564f 100644 --- a/tests/auto/testlib/selftests/expected_verbose2.xunitxml +++ b/tests/auto/testlib/selftests/expected_verbose2.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="pass" name="testPassPass"> diff --git a/tests/auto/testlib/selftests/expected_verifyexceptionthrown.lightxml b/tests/auto/testlib/selftests/expected_verifyexceptionthrown.lightxml index fb8f61503e..d38363fb6e 100644 --- a/tests/auto/testlib/selftests/expected_verifyexceptionthrown.lightxml +++ b/tests/auto/testlib/selftests/expected_verifyexceptionthrown.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_verifyexceptionthrown.xml b/tests/auto/testlib/selftests/expected_verifyexceptionthrown.xml index a89528cfb8..8c57fe5c0f 100644 --- a/tests/auto/testlib/selftests/expected_verifyexceptionthrown.xml +++ b/tests/auto/testlib/selftests/expected_verifyexceptionthrown.xml @@ -2,6 +2,7 @@ <TestCase name="tst_VerifyExceptionThrown"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_verifyexceptionthrown.xunitxml b/tests/auto/testlib/selftests/expected_verifyexceptionthrown.xunitxml index f49746a9af..003a31a1cc 100644 --- a/tests/auto/testlib/selftests/expected_verifyexceptionthrown.xunitxml +++ b/tests/auto/testlib/selftests/expected_verifyexceptionthrown.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="pass" name="testCorrectStdTypes"/> diff --git a/tests/auto/testlib/selftests/expected_warnings.lightxml b/tests/auto/testlib/selftests/expected_warnings.lightxml index bbc96b7010..31b3d842aa 100644 --- a/tests/auto/testlib/selftests/expected_warnings.lightxml +++ b/tests/auto/testlib/selftests/expected_warnings.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_warnings.xml b/tests/auto/testlib/selftests/expected_warnings.xml index acb80e4f2a..a3821f84df 100644 --- a/tests/auto/testlib/selftests/expected_warnings.xml +++ b/tests/auto/testlib/selftests/expected_warnings.xml @@ -2,6 +2,7 @@ <TestCase name="tst_Warnings"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_warnings.xunitxml b/tests/auto/testlib/selftests/expected_warnings.xunitxml index 7be47174c6..7ea66522c6 100644 --- a/tests/auto/testlib/selftests/expected_warnings.xunitxml +++ b/tests/auto/testlib/selftests/expected_warnings.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="pass" name="testWarnings"> diff --git a/tests/auto/testlib/selftests/expected_xunit.lightxml b/tests/auto/testlib/selftests/expected_xunit.lightxml index 6660cf4e7a..95ab8f03f0 100644 --- a/tests/auto/testlib/selftests/expected_xunit.lightxml +++ b/tests/auto/testlib/selftests/expected_xunit.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_xunit.xml b/tests/auto/testlib/selftests/expected_xunit.xml index af9fe1f502..f56ca947be 100644 --- a/tests/auto/testlib/selftests/expected_xunit.xml +++ b/tests/auto/testlib/selftests/expected_xunit.xml @@ -2,6 +2,7 @@ <TestCase name="tst_Xunit"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_xunit.xunitxml b/tests/auto/testlib/selftests/expected_xunit.xunitxml index 7d133da7a5..395b6efdd9 100644 --- a/tests/auto/testlib/selftests/expected_xunit.xunitxml +++ b/tests/auto/testlib/selftests/expected_xunit.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="pass" name="testFunc1"> diff --git a/tests/auto/testlib/selftests/generate_expected_output.py b/tests/auto/testlib/selftests/generate_expected_output.py index 1c09faf4db..8c1de0d8b4 100755 --- a/tests/auto/testlib/selftests/generate_expected_output.py +++ b/tests/auto/testlib/selftests/generate_expected_output.py @@ -56,8 +56,11 @@ isWindows = sys.platform == 'win32' replacements = [ (qtver, r'@INSERT_QT_VERSION_HERE@'), + (r'Config: Using QtTest library.*', r'Config: Using QtTest library'), # Build string in text logs (rootPath.encode('unicode-escape').decode('utf-8'), r''), (r'( *)<Duration msecs="[\d\.]+"/>', r'\1<Duration msecs="0"/>'), + (r'( *)<QtBuild>[^<]+</QtBuild>', r'\1<QtBuild/>'), # Build element in xml, lightxml + (r'<property value="[^"]+" name="QtBuild"/>', r'<property value="" name="QtBuild"/>') # Build in xunitxml ] extraArgs = { diff --git a/tests/auto/testlib/selftests/tst_selftests.cpp b/tests/auto/testlib/selftests/tst_selftests.cpp index 8167a96eaa..e73bdc5223 100644 --- a/tests/auto/testlib/selftests/tst_selftests.cpp +++ b/tests/auto/testlib/selftests/tst_selftests.cpp @@ -169,12 +169,17 @@ QString tst_Selftests::logName(const QString &logger) const return (logger.startsWith("stdout") ? "" : QString(tempDir.path() + "/test_output." + logger)); } +static QString expectedFileNameFromTest(const QString &subdir, const QString &logger) +{ + return QStringLiteral("expected_") + subdir + QLatin1Char('.') + logFormat(logger); +} + // Load the expected test output for the nominated test (subdir) and logger // as an array of lines. If there is no expected output file, return an // empty array. -static QList<QByteArray> expectedResult(const QString &subdir, const QString &logger) +static QList<QByteArray> expectedResult(const QString &fileName) { - QFile file(":/expected_" + subdir + "." + logFormat(logger)); + QFile file(QStringLiteral(":/") + fileName); if (!file.open(QIODevice::ReadOnly)) return QList<QByteArray>(); return splitLines(file.readAll()); @@ -619,7 +624,8 @@ void tst_Selftests::doRunSubTest(QString const& subdir, QStringList const& logge for (int n = 0; n < loggers.count(); ++n) { QString logger = loggers[n]; QList<QByteArray> res = splitLines(actualOutputs[n]); - QList<QByteArray> exp = expectedResult(subdir, logger); + const QString expectedFileName = expectedFileNameFromTest(subdir, logger); + QList<QByteArray> exp = expectedResult(expectedFileName); #if defined (Q_CC_MSVC) || defined(Q_CC_MINGW) // MSVC, MinGW format double numbers differently if (n == 0 && subdir == QStringLiteral("float")) { @@ -638,7 +644,7 @@ void tst_Selftests::doRunSubTest(QString const& subdir, QStringList const& logge QList<QByteArray> tmp; int i = 1; do { - tmp = expectedResult(subdir + QString("_%1").arg(i++), logger); + tmp = expectedResult(expectedFileNameFromTest(subdir + QLatin1Char('_') + QString::number(i++), logger)); if (tmp.count()) expArr += tmp; } while (tmp.count()); @@ -667,8 +673,8 @@ void tst_Selftests::doRunSubTest(QString const& subdir, QStringList const& logge qDebug() << ">>>>>>"; QVERIFY2(res.count() == exp.count(), - qPrintable(QString::fromLatin1("Mismatch in line count: %1 != %2 (%3).") - .arg(res.count()).arg(exp.count()).arg(loggers.at(n)))); + qPrintable(QString::fromLatin1("Mismatch in line count: %1 != %2 (%3, %4).") + .arg(res.count()).arg(exp.count()).arg(loggers.at(n), expectedFileName))); } } @@ -711,6 +717,12 @@ void tst_Selftests::doRunSubTest(QString const& subdir, QStringList const& logge if (line.endsWith(" : failure location")) continue; + if (line.startsWith("Config: Using QtTest library") // Text build string + || line.startsWith(" <QtBuild") // XML, Light XML build string + || (line.startsWith(" <property value=") && line.endsWith("name=\"QtBuild\"/>"))) { // XUNIT-XML build string + continue; + } + const QString output(QString::fromLatin1(line)); const QString expected(QString::fromLatin1(exp.at(i)).replace("@INSERT_QT_VERSION_HERE@", QT_VERSION_STR)); @@ -740,8 +752,8 @@ void tst_Selftests::doRunSubTest(QString const& subdir, QStringList const& logge .arg(i).arg(loggers.at(n), output))); } else { QVERIFY2(output == expected, - qPrintable(QString::fromLatin1("Mismatch at line %1 (%2): '%3' != '%4'") - .arg(i).arg(loggers.at(n), output, expected))); + qPrintable(QString::fromLatin1("Mismatch at line %1 (%2, %3): '%4' != '%5'") + .arg(i + 1).arg(loggers.at(n), expectedFileName, output, expected))); } benchmark = line.startsWith("RESULT : "); |