diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2015-06-26 16:20:21 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2015-06-27 13:54:35 +0200 |
commit | 4dd8a63fc13cee365c58ef67fa4a4503aeceebe8 (patch) | |
tree | c34de00e0bceeb70ed006e06a7fefc21537c72a1 /src/corelib | |
parent | 5757b8c516ad0d613739b222687583bca914a981 (diff) | |
parent | fae33bfbe35f8d082b420ee09662ff60634cb355 (diff) |
Merge remote-tracking branch 'origin/5.5.0' into 5.5
Conflicts:
src/plugins/platforms/cocoa/qcocoafiledialoghelper.h
Manually fixed src/testlib/qtestcase.cpp to return the right type.
Change-Id: Id1634dbe3d73fefe9431b9f5378846cb187624e4
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/doc/snippets/code/src_corelib_io_qtextstream.cpp | 2 | ||||
-rw-r--r-- | src/corelib/global/qcompilerdetection.h | 6 | ||||
-rw-r--r-- | src/corelib/global/qglobal.cpp | 10 | ||||
-rw-r--r-- | src/corelib/global/qsysinfo.h | 9 | ||||
-rw-r--r-- | src/corelib/global/qsystemdetection.h | 21 | ||||
-rw-r--r-- | src/corelib/io/qprocess.cpp | 2 | ||||
-rw-r--r-- | src/corelib/io/qstorageinfo.cpp | 6 | ||||
-rw-r--r-- | src/corelib/io/qstorageinfo_p.h | 2 | ||||
-rw-r--r-- | src/corelib/io/qtextstream.cpp | 6 | ||||
-rw-r--r-- | src/corelib/io/qtextstream.h | 2 | ||||
-rw-r--r-- | src/corelib/kernel/qcoreapplication.cpp | 11 | ||||
-rw-r--r-- | src/corelib/kernel/qmetatype.cpp | 20 | ||||
-rw-r--r-- | src/corelib/statemachine/qabstracttransition.h | 2 |
13 files changed, 83 insertions, 16 deletions
diff --git a/src/corelib/doc/snippets/code/src_corelib_io_qtextstream.cpp b/src/corelib/doc/snippets/code/src_corelib_io_qtextstream.cpp index c76a0f1f3b..ab91a00f5f 100644 --- a/src/corelib/doc/snippets/code/src_corelib_io_qtextstream.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_io_qtextstream.cpp @@ -51,7 +51,7 @@ if (data.open(QFile::WriteOnly | QFile::Truncate)) { //! [1] QTextStream stream(stdin); QString line; -while (stream.readLine(&line)) { +while (stream.readLineInto(&line)) { ... } //! [1] diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index 50dfe84403..7ff1b67918 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -155,7 +155,9 @@ /* Clang also masquerades as GCC */ # if defined(__apple_build_version__) # /* http://en.wikipedia.org/wiki/Xcode#Toolchain_Versions */ -# if __apple_build_version__ >= 6000051 +# if __apple_build_version__ >= 6020049 +# define Q_CC_CLANG 306 +# elif __apple_build_version__ >= 6000051 # define Q_CC_CLANG 305 # elif __apple_build_version__ >= 5030038 # define Q_CC_CLANG 304 @@ -616,7 +618,7 @@ # if __has_feature(cxx_strong_enums) # define Q_COMPILER_CLASS_ENUM # endif -# if __has_feature(cxx_constexpr) +# if __has_feature(cxx_constexpr) && Q_CC_CLANG > 302 /* CLANG 3.2 has bad/partial support */ # define Q_COMPILER_CONSTEXPR # endif # if __has_feature(cxx_decltype) /* && __has_feature(cxx_decltype_incomplete_return_types) */ diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 126bf62fb6..5fd221e1c0 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -1128,6 +1128,7 @@ bool qSharedBuild() Q_DECL_NOTHROW \value MV_10_8 OS X 10.8 \value MV_10_9 OS X 10.9 \value MV_10_10 OS X 10.10 + \value MV_10_11 OS X 10.11 \value MV_Unknown An unknown and currently unsupported platform \value MV_CHEETAH Apple codename for MV_10_0 @@ -1141,6 +1142,7 @@ bool qSharedBuild() Q_DECL_NOTHROW \value MV_MOUNTAINLION Apple codename for MV_10_8 \value MV_MAVERICKS Apple codename for MV_10_9 \value MV_YOSEMITE Apple codename for MV_10_10 + \value MV_ELCAPITAN Apple codename for MV_10_11 \value MV_IOS iOS (any) \value MV_IOS_4_3 iOS 4.3 @@ -1151,6 +1153,11 @@ bool qSharedBuild() Q_DECL_NOTHROW \value MV_IOS_7_0 iOS 7.0 \value MV_IOS_7_1 iOS 7.1 \value MV_IOS_8_0 iOS 8.0 + \value MV_IOS_8_1 iOS 8.1 + \value MV_IOS_8_2 iOS 8.2 + \value MV_IOS_8_3 iOS 8.3 + \value MV_IOS_8_4 iOS 8.4 + \value MV_IOS_9_0 iOS 9.0 \value MV_None Not a Darwin operating system @@ -2735,6 +2742,9 @@ QString QSysInfo::prettyProductName() case MV_YOSEMITE: basename = "OS X Yosemite ("; break; + case MV_ELCAPITAN: + basename = "OS X El Capitan ("; + break; } if (basename) return QLatin1String(basename) + productVersion() + QLatin1Char(')'); diff --git a/src/corelib/global/qsysinfo.h b/src/corelib/global/qsysinfo.h index a571e43568..625b366cc6 100644 --- a/src/corelib/global/qsysinfo.h +++ b/src/corelib/global/qsysinfo.h @@ -137,6 +137,7 @@ public: MV_10_8 = 0x000A, MV_10_9 = 0x000B, MV_10_10 = 0x000C, + MV_10_11 = 0x000D, /* codenames */ MV_CHEETAH = MV_10_0, @@ -150,6 +151,7 @@ public: MV_MOUNTAINLION = MV_10_8, MV_MAVERICKS = MV_10_9, MV_YOSEMITE = MV_10_10, + MV_ELCAPITAN = MV_10_11, /* iOS */ MV_IOS = 1 << 8, @@ -160,7 +162,12 @@ public: MV_IOS_6_1 = Q_MV_IOS(6, 1), MV_IOS_7_0 = Q_MV_IOS(7, 0), MV_IOS_7_1 = Q_MV_IOS(7, 1), - MV_IOS_8_0 = Q_MV_IOS(8, 0) + MV_IOS_8_0 = Q_MV_IOS(8, 0), + MV_IOS_8_1 = Q_MV_IOS(8, 1), + MV_IOS_8_2 = Q_MV_IOS(8, 2), + MV_IOS_8_3 = Q_MV_IOS(8, 3), + MV_IOS_8_4 = Q_MV_IOS(8, 4), + MV_IOS_9_0 = Q_MV_IOS(9, 0) }; #if defined(Q_OS_MAC) static const MacVersion MacintoshVersion; diff --git a/src/corelib/global/qsystemdetection.h b/src/corelib/global/qsystemdetection.h index 64f9d91ec7..562427e4b9 100644 --- a/src/corelib/global/qsystemdetection.h +++ b/src/corelib/global/qsystemdetection.h @@ -233,6 +233,9 @@ # if !defined(__MAC_10_10) # define __MAC_10_10 101000 # endif +# if !defined(__MAC_10_11) +# define __MAC_10_11 101100 +# endif # if !defined(MAC_OS_X_VERSION_10_7) # define MAC_OS_X_VERSION_10_7 1070 # endif @@ -245,6 +248,9 @@ # if !defined(MAC_OS_X_VERSION_10_10) # define MAC_OS_X_VERSION_10_10 101000 # endif +# if !defined(MAC_OS_X_VERSION_10_11) +# define MAC_OS_X_VERSION_10_11 101100 +# endif # # if !defined(__IPHONE_4_3) # define __IPHONE_4_3 40300 @@ -270,6 +276,21 @@ # if !defined(__IPHONE_8_0) # define __IPHONE_8_0 80000 # endif +# if !defined(__IPHONE_8_1) +# define __IPHONE_8_1 80100 +# endif +# if !defined(__IPHONE_8_2) +# define __IPHONE_8_2 80200 +# endif +# if !defined(__IPHONE_8_3) +# define __IPHONE_8_3 80300 +# endif +# if !defined(__IPHONE_8_4) +# define __IPHONE_8_4 80400 +# endif +# if !defined(__IPHONE_9_0) +# define __IPHONE_9_0 90000 +# endif #endif #ifdef __LSB_VERSION__ diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp index ead04791e5..1842541644 100644 --- a/src/corelib/io/qprocess.cpp +++ b/src/corelib/io/qprocess.cpp @@ -2053,7 +2053,7 @@ QByteArray QProcess::readAllStandardError() printed at the console, and the existing process will continue running unaffected. - \sa pid(), started(), waitForStarted(), setNativeArguments() + \sa processId(), started(), waitForStarted(), setNativeArguments() */ void QProcess::start(const QString &program, const QStringList &arguments, OpenMode mode) { diff --git a/src/corelib/io/qstorageinfo.cpp b/src/corelib/io/qstorageinfo.cpp index d63b6a2a21..337a9c7cef 100644 --- a/src/corelib/io/qstorageinfo.cpp +++ b/src/corelib/io/qstorageinfo.cpp @@ -186,6 +186,8 @@ QString QStorageInfo::rootPath() const This size can be less than or equal to the free size returned by bytesFree() function. + Returns -1 if QStorageInfo object is not valid. + \sa bytesTotal(), bytesFree() */ qint64 QStorageInfo::bytesAvailable() const @@ -198,6 +200,8 @@ qint64 QStorageInfo::bytesAvailable() const quotas on the filesystem, this value can be larger than the value returned by bytesAvailable(). + Returns -1 if QStorageInfo object is not valid. + \sa bytesTotal(), bytesAvailable() */ qint64 QStorageInfo::bytesFree() const @@ -208,6 +212,8 @@ qint64 QStorageInfo::bytesFree() const /*! Returns the total volume size in bytes. + Returns -1 if QStorageInfo object is not valid. + \sa bytesFree(), bytesAvailable() */ qint64 QStorageInfo::bytesTotal() const diff --git a/src/corelib/io/qstorageinfo_p.h b/src/corelib/io/qstorageinfo_p.h index 9e152df1ad..564321bedd 100644 --- a/src/corelib/io/qstorageinfo_p.h +++ b/src/corelib/io/qstorageinfo_p.h @@ -53,7 +53,7 @@ class QStorageInfoPrivate : public QSharedData { public: inline QStorageInfoPrivate() : QSharedData(), - bytesTotal(0), bytesFree(0), bytesAvailable(0), + bytesTotal(-1), bytesFree(-1), bytesAvailable(-1), readOnly(false), ready(false), valid(false) {} diff --git a/src/corelib/io/qtextstream.cpp b/src/corelib/io/qtextstream.cpp index 47b96d708f..8ad1c2852c 100644 --- a/src/corelib/io/qtextstream.cpp +++ b/src/corelib/io/qtextstream.cpp @@ -1591,7 +1591,7 @@ QString QTextStream::readLine(qint64 maxlen) { QString line; - readLine(&line, maxlen); + readLineInto(&line, maxlen); return line; } @@ -1612,7 +1612,7 @@ QString QTextStream::readLine(qint64 maxlen) If \a line has sufficient capacity for the data that is about to be read, this function may not need to allocate new memory. Because of - this, it can be faster than the other readLine() overload. + this, it can be faster than readLine(). Returns \c false if the stream has read to the end of the file or an error has occurred; otherwise returns \c true. The contents in @@ -1620,7 +1620,7 @@ QString QTextStream::readLine(qint64 maxlen) \sa readAll(), QIODevice::readLine() */ -bool QTextStream::readLine(QString *line, qint64 maxlen) +bool QTextStream::readLineInto(QString *line, qint64 maxlen) { Q_D(QTextStream); // keep in sync with CHECK_VALID_STREAM diff --git a/src/corelib/io/qtextstream.h b/src/corelib/io/qtextstream.h index 125502e68d..e5f429ae4d 100644 --- a/src/corelib/io/qtextstream.h +++ b/src/corelib/io/qtextstream.h @@ -124,7 +124,7 @@ public: void skipWhiteSpace(); QString readLine(qint64 maxlen = 0); - bool readLine(QString *line, qint64 maxlen = 0); + bool readLineInto(QString *line, qint64 maxlen = 0); QString readAll(); QString read(qint64 maxlen); diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index 34dad73c80..8489afe5a7 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -1005,6 +1005,17 @@ bool QCoreApplication::notifyInternal(QObject *receiver, QEvent *event) do not change the focus widget. \endlist + \b{Future direction:} This function will not be called for objects that live + outside the main thread in Qt 6. Applications that need that functionality + should find other solutions for their event inspection needs in the meantime. + The change may be extended to the main thread, causing this function to be + deprecated. + + \warning If you override this function, you must ensure all threads that + process events stop doing so before your application object begins + destruction. This includes threads started by other libraries that you may be + using, but does not apply to Qt's own threads. + \sa QObject::event(), installNativeEventFilter() */ diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp index 3b70ef92ed..58912e3fb7 100644 --- a/src/corelib/kernel/qmetatype.cpp +++ b/src/corelib/kernel/qmetatype.cpp @@ -303,7 +303,7 @@ struct DefinedTypesFilter { \omitvalue WeakPointerToQObject \omitvalue TrackingPointerToQObject \omitvalue WasDeclaredAsMetaType - \value IsGadget This type is a Q_GADGET and it's corresponding QMetaObject can be accessed with QMetaType::metaObject Since 5.5. + \omitvalue IsGadget This type is a Q_GADGET and it's corresponding QMetaObject can be accessed with QMetaType::metaObject Since 5.5. */ /*! @@ -1046,6 +1046,16 @@ int QMetaType::registerNormalizedType(const NS(QByteArray) &normalizedTypeName, if (idx >= User) { previousSize = ct->at(idx - User).size; previousFlags = ct->at(idx - User).flags; + + // Set new/additional flags in case of old library/app. + // Ensures that older code works in conjunction with new Qt releases + // requiring the new flags. + if (flags != previousFlags) { + QCustomTypeInfo &inf = ct->data()[idx - User]; + inf.flags |= flags; + if (metaObject) + inf.metaObject = metaObject; + } } } @@ -1061,11 +1071,11 @@ int QMetaType::registerNormalizedType(const NS(QByteArray) &normalizedTypeName, normalizedTypeName.constData(), idx, previousSize, size); } + // Do not compare types higher than 0x100: // Ignore WasDeclaredAsMetaType inconsitency, to many users were hitting the problem - previousFlags |= WasDeclaredAsMetaType; - flags |= WasDeclaredAsMetaType; - - if (previousFlags != flags) { + // Ignore IsGadget as it was added in Qt 5.5 + // Ignore all the future flags as well + if ((previousFlags ^ flags) & 0xff) { const int maskForTypeInfo = NeedsConstruction | NeedsDestruction | MovableType; const char *msg = "QMetaType::registerType: Binary compatibility break. " "\nType flags for type '%s' [%i] don't match. Previously " diff --git a/src/corelib/statemachine/qabstracttransition.h b/src/corelib/statemachine/qabstracttransition.h index bf32b3e825..475a4dedfc 100644 --- a/src/corelib/statemachine/qabstracttransition.h +++ b/src/corelib/statemachine/qabstracttransition.h @@ -59,7 +59,7 @@ class Q_CORE_EXPORT QAbstractTransition : public QObject Q_PROPERTY(QState* sourceState READ sourceState) Q_PROPERTY(QAbstractState* targetState READ targetState WRITE setTargetState NOTIFY targetStateChanged) Q_PROPERTY(QList<QAbstractState*> targetStates READ targetStates WRITE setTargetStates NOTIFY targetStatesChanged) - Q_PROPERTY(TransitionType transitionType READ transitionType WRITE setTransitionType) + Q_PROPERTY(TransitionType transitionType READ transitionType WRITE setTransitionType REVISION 1) public: enum TransitionType { ExternalTransition, |