summaryrefslogtreecommitdiffstats
path: root/src/corelib
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Add support for Apple tvOSMike Krus2016-05-1717-31/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pass -xplatform macx-tvos-clang to configure to build. Builds device and simulator by default. Added ‘uikit’ platform with the common setup. Also added QT_PLATFORM_UIKIT define (undocumented). qmake config defines tvos (but not ios). tvOS is 64bits only (QT_ARCH is arm64) and requires bitcode to be embedded in the binary. A new ‘bitcode’ configuration was added. For ReleaseDevice builds (which get archived and push to the store), bitcode is actually embedded (-fembed-bitcode passed to clang). For all other configurations, only using bitcode markers to keep file size down (-fembed-bitcode-marker). Build disables Widgets in qtbase, and qtscript (unsupported, would require fixes to JavaScriptCore source code). Qpa same as on iOS but disables device orientation, status bar, clipboard, menus, dialogs which are not supported on tvOS. Change-Id: I645804fd933be0befddeeb43095a74d2c178b2ba Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* | | Remove qt_cancelIo helper functionJoerg Bornemann2016-05-172-20/+2
| | | | | | | | | | | | | | | | | | | | | | | | We can now directly use CancelIoEx. The fallback to CancelIo was needed for supporting Windows XP. Change-Id: I24a53a774caf695e6006f24a914abaa5ab204035 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-05-1278-368/+732
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: config_help.txt configure src/corelib/io/qprocess_wince.cpp src/plugins/platforms/windows/qwindowstheme.cpp src/plugins/platforms/xcb/qxcbbackingstore.cpp tests/auto/corelib/tools/qtimezone/BLACKLIST tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp Change-Id: I26644d1cb3b78412c8ff285e2a55bea1bd641c01
| * | QDateTimeParser: adapt unquote() to make good use of QStringRef.Anton Kudryavtsev2016-05-111-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | Avoid unnecessary allocations. Change-Id: I9bed622c0dd7d9fe993b52d9169d1773957da4f2 Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * | QDateTimeParser: de-duplicate calls and cache resultsAnton Kudryavtsev2016-05-111-7/+9
| | | | | | | | | | | | | | | | | | Change-Id: I0d6065fbdd19acff14072ff626585e8a12a3e073 Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * | Make it an #error if we failed to detect the ARM architecture versionThiago Macieira2016-05-101-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | ... or if it is less than ARMv5. The last ARMv4 Qt supported was Windows CE 7, which was dropped for Qt 5.7 alongside MSVC 2008. Change-Id: Ifc817705441a4aab9469ffff141dcfe491464efa Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
| * | QFactoryLoader: use new QJsonObject::value(QLatin1String)Marc Mutz2016-05-101-27/+11
| | | | | | | | | | | | | | | | | | | | | | | | Allows to get rid of some QStringLiterals, reducing QtCore text size by ~800b. Change-Id: I8f7e57927163eaaf628e42020f83f053faea6bf8 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
| * | QJsonObject: add some overloads taking QLatin1StringMarc Mutz2016-05-104-2/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QXmlStreamReader also has QLatin1String overloads, which greatly benefits parsers, since the vast majority of keys in both JSON and XML are US-ASCII. This patch adds such an overload to the JSON parser. The value() function is all typical parsers need, so even though many more QJsonObject functions taking QString could benefit from the same treatment, value() is the single most important one for read-only JSON access. Add some more overloads, too, for functions that don't need more internal scaffolding than value(). Requires adding a dummy op[](QL1S) (forwarding to the QString overload) so as not to make QJsonObject json; json[QLatin1String("key")]; // mutable ambiguous between const op[](QL1S) and mutable op[](QString). [ChangeLog][QtCore][QJsonObject] Added value(), op[] const, find(), constFind(), contains() overloads taking QLatin1String. Change-Id: I00883028956ad949ba5ba2b18dd8a6a25ad5085b Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
| * | Fix build on WinRTMaurice Kalinowski2016-05-101-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | a63ca3fa106f4b0f9776bf2004661ef6dec2c0c6 caused a build breakage for WinRT as GetModuleHandleEx does not exist on that platform. Change-Id: I143d9cad5f32d98a4d86292dfa73f94a4acdf305 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
| * | QUrl: enable (N)RVO for gccAnton Kudryavtsev2016-05-091-37/+37
| | | | | | | | | | | | | | | Change-Id: Ie0fba08ce55a3c60a5b1565986c4280f065c7b2f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | QDateTimeParser: proper construction of QStringAnton Kudryavtsev2016-05-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... with known size and known char by corresponding ctor. Don't use fill() for this case. Change-Id: I475a0655132ecbb40b1eac919309597b2560e71b Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * | Be more specific what is in Core and what is notJędrzej Nowacki2016-05-091-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | !isComplex is quite good heuristic, but we know for sure which types should be included. Change-Id: I609d021b8a668e6c1945ed2b11d69f5a82b5e2bf Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * | QJsonValue: don't create a temporary QString on every toString() invocationMarc Mutz2016-05-092-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The vast majority of users call toString() without the optional defaultValue. So do it like the toArray() and toObject() methods and split toString() into two overloads, so the common case no longer needs to pass a temporaray QString. Saves ~1.4 and ~1KiB in QtCore and QtGui text size, resp., on optimized GCC 6.0 Linux AMD64 builds, even though we added a new function to QtCore, too. Change-Id: Ibe02397ca49ce11fdb58f5c5fc69e909bf94c1c6 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
| * | Add a QMutex::isRecursive() const noexceptThiago Macieira2016-05-092-9/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is source- and binary-compatible, including the marking of the existing function as noexcept. [ChangeLog][QtCore][QMutex] Made the isRecursive() method be a const function so that it can be called in const QMutex objects too. Change-Id: Ifea6e497f11a461db432ffff1448bead97c08f92 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * | Work around ICC's bug in making std::atomic a literal typeThiago Macieira2016-05-081-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ICC 15.x and 16.0 (beta, at least) are missing the "constexpr" and "noexcept" keywords in the definition of the std::atomic constructors. The lack of constexpr makes std::atomic a non-literal type, which in turn makes QBasicAtomicInteger's constructor (which is constexpr) fail to compile. Reported as Intel issue 6000117277. Change-Id: I4a88bcca48bf0ce51557d809ef32a4545edcafee Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * | Mark QThread::currentThreadId() as a pure functionThiago Macieira2016-05-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It always returns the same information for each thread it is called in. But since it's different per thread, we don't think it's const. pthread_self() on Linux is marked const, though we think it really ought to be pure. On other OSes, the annotation isn't present, but the we can assume function is so. Change-Id: Ifea6e497f11a461db432ffff1448c2b37d94d5f3 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * | Implement QLibrary::PreventUnloadHint for WindowsThiago Macieira2016-05-082-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's interesting that the HMODULE/HINSTANCE pointer points to something in the actual module that got loaded, so we can use its value as "address of something in the module" for GetModuleHandleEx. The "PIN" flag tells the Windows DLL loader to never unload. Change-Id: Ifea6e497f11a461db432ffff1449a2169eb6293e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
| * | Remove includes to qdatetime_p.h that aren't necessaryThiago Macieira2016-05-081-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | Since I'm changing QDateTime's privates, it's easier to know what may be depending on it or not. Change-Id: Id5480807d25e49e78b79ffff144a53018d057e19 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * | Mark QTimeZone constructor nothrow.Thiago Macieira2016-05-082-2/+2
| | | | | | | | | | | | | | | Change-Id: Id5480807d25e49e78b79ffff144a9eead3fc9597 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-05-0615-88/+108
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/qtestlib/tutorial5/containers.cpp examples/widgets/tools/tools.pro src/corelib/io/qprocess.cpp src/corelib/io/qprocess_unix.cpp src/corelib/io/qprocess_win.cpp src/network/kernel/qdnslookup_unix.cpp src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/testlib/qtestcase.cpp tools/configure/configureapp.cpp Change-Id: I838ae7f082535a67a4a53aa13a21ba5580758be8
| | * QFileSystemMetaData: do not treat block devices as sequentialAlex Trotsenko2016-05-041-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch allows handling of special block devices in random-access mode that restores a Qt4 behavior. Can not be tested because requires root privileges in the system. Task-number: QTBUG-51666 Change-Id: Iaa56355f1be343c0d05b292e3c7d2e1c88724529 Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com> Reviewed-by: Andrius Štikonas <andrius@stikonas.eu> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
| | * normalize structure of plugandpaint exampleOswald Buddenhagen2016-05-032-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | as in other examples which come with plugins, use an additional hierarchy level which contains the app and plugin subdirs. Change-Id: I2487755967aa3474c337c8c8af10be49627b63d0 Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
| | * Fix QFile::copy() on WinRT.John Preston2016-05-021-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implementation of QFileSystemEngine::copyFile() uses CopyFile2() as if it is CopyFile() function, but CopyFile2() returns HRESULT, not BOOL. So the success should be checked by "SUCCEEDED()" instead of "!= 0". Current implementation does exactly the opposite because S_OK == 0. Change-Id: I0677d54447d22366fb2031e0b928a3d10e24c0ed Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
| | * QWindowsPipeWriter: Fix developer build with MinGW.Friedemann Kleint2016-05-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix signedness in comparion: io\qwindowspipewriter.cpp: In member function 'void QWindowsPipeWriter::notified(DWORD, DWORD)': io\qwindowspipewriter.cpp:134:65: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] Q_ASSERT(errorCode != ERROR_SUCCESS || numberOfBytesWritten == buffer.size()); Amends change a4d26cf522b966056e47e47a004b7e4d668e3a2d. Task-number: QTBUG-52401 Change-Id: If0c0e2107342408675fa00b93f28c9de339080f6 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
| | * Fix UB (data race) in Q_GLOBAL_STATICMarc Mutz2016-05-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The store to guard in the inner function's critical section was not synchronized-with the load at the start of the function: T1 T2 guard.load() mutex.lock() guard.load() d = new Type guard.store() guard.load() // use d mutex.unlock() The use of d in T2 does not synchronize with the write to d in T1 -> data race -> UB. Fix by storing with release memory ordering, so that the guard.load() in T2 synchronizes with the guard.store() in T1. Change-Id: I5c1cd1fa097c6397cb0b48b0d8e8012f95978558 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | * QWindowsPipeWriter: ensure validity of the write bufferAlex Trotsenko2016-04-307-55/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QWindowsPipeWriter uses asynchronous API to perform writing. Once a cycle has been started, the write buffer must remain valid until the write operation is completed. To avoid data corruption and possibly undefined behavior, this patch makes QWindowsPipeWriter::write() take a QByteArray, which it keeps alive for the duration of the write cycle. Autotest-by: Thomas Hartmann Task-number: QTBUG-52401 Change-Id: Ia35faee735c4e684267daa1f6bd689512b670cd2 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
| | * Don't store the pthread_t thread ID twice in QThreadThiago Macieira2016-04-303-22/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was being stored once in QThreadPrivate and once in QThreadData, with the latter being hidden as a Qt::HANDLE. Besides saving a little bit of memory, this also solves a small data race condition that arises from trying to connect a signal to an object moved to that thread and then emit that signal shortly after the thread starts. Before this patch, QThreadData::threadId was initialized only by QThreadPrivate::start(), which meant that we were racing that initialization with this check in QMetaObject::activate: const bool receiverInSameThread = currentThreadId == receiver->d_func()->threadData->threadId; Task-number: QTBUG-52337 Change-Id: Ifea6e497f11a461db432ffff1449ae01f1099aae Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
| * | QUrlQuery: use erase and std::remove_if with QListAnton Kudryavtsev2016-05-041-8/+8
| | | | | | | | | | | | | | | | | | | | | ... instead of using erase() in a loop, with quadratic complexity. Change-Id: I277ff2527e0a22b3d754b1d14296b9882f164c23 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * | QScoped(Array)Pointer: canonicalize swappingMarc Mutz2016-05-041-11/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This includes: - have nothrow member-swap - have ADL non-member swap - not specialize qSwap or std::swap Also prevent QScopedPointer <-> QScopedArrayPointer swaps by overloading swap (both member and non-member) on QScopedArrayPointer. It's not 100% safe, but it's what we're doing elsewhere (QMulti(Map,Hash), say). That's technically a SiC change if users expected (qualified) std::swap to invoke QScopedPointer::swap(), but those users were doing it wrong to begin with, and they now get a compile-error instead of silent pessimization, because generic std::swap() doesn't work on QScopedPointer, due to lack of copy (and thus move) semantics. Change-Id: I3ab5c1668722a2c8ccafc16f57310ce8d4bffbd6 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * | Tune fast-exit for signal activation for QML.Erik Verbruggen2016-05-032-11/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using QML, it quite often happens that only the QML engine is connected to a signal, and no C++ handlers. By splitting up the fast-exit case and handling QML separately, we can prevent a call to QThread::currentThreadId, and locking+unlocking the mutex. On x86 this saves ~130 instructions according to valgrind. Change-Id: I947fe42afe351922339ac982a6d498bc2f7b5192 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * | Add ImInputItemClipRectangleJan Arve Saether2016-05-022-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This rectangle represents the "effective" visual rectangle of the input item, excluding any areas obscured due to clipping. Note: The effective visual rectangle will not be influenced by overlapping items. Change-Id: I234176161dcfb9c236124e33ae510a0b01fe6dc3 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
| * | Merge "Merge remote-tracking branch 'origin/5.6' into 5.7" into refs/staging/5.7Liang Qi2016-05-0210-18/+48
| |\ \
| | * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-04-2910-18/+48
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/features/qml_module.prf mkspecs/features/qt_common.prf src/gui/text/qzip.cpp src/plugins/platforms/cocoa/qnsview.mm src/plugins/platforms/windows/array.h src/testlib/qtestcase.cpp src/widgets/dialogs/qfilesystemmodel.h Change-Id: Ie41c5868415b81f7693c80e045497035504bb210
| | | * Make it clear that QObject::tr() falls back to QString::fromUtf8()Sérgio Martins2016-04-281-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The reference to trUtf8() made it even more confusing, so remove it. It's redundant and deprecated anyway. Change-Id: I9921297160db3660bb5099692bbfdaf6e85637aa Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
| | | * Unhide QObject::parent() from QFileSystemModel and QIdentityProxyModelAlexander Volkov2016-04-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was hidden by overridden parent(const QModelIndex &) methods. See also 63b5082ea8e3e750af986f815474f7207006cb46 (Unhide QObject::parent() from QAbstract{Table,List}model). Change-Id: I8b6d4d4175e4d43ff269eaeb0b2b1a9fb8f44bab Task-number: QTBUG-45393 Reviewed-by: Milian Wolff <milian.wolff@kdab.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| | | * Use C++11 alignas() for Q_DECL_ALIGN, if possibleThiago Macieira2016-04-281-0/+5
| | | | | | | | | | | | | | | | | | | | Change-Id: Ifea6e497f11a461db432ffff144863d4ed69a212 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| | | * Fix QArrayData::allocate() to guard against integer overflowsThiago Macieira2016-04-281-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The proper solution with qCalculateBlockSize will come for Qt 5.7. Change-Id: Ifea6e497f11a461db432ffff14490788fc522eb7 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | | * QString: Fix UBs (signed overflow) in hashed string searchMarc Mutz2016-04-261-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Similar change to 390ea21873cf229447c2dcaea85a40e472fab03c, but more extensive because the hash variables were not, yet, of unsigned type. This brings the three hashed string search algorithms in QtBase (in QString, QByteArray and QByteArrayMatcher) in line again. Found by UBSan, fixing the following bunch of errors: tools/qstring.cpp:3080:38: runtime error: left shift of negative value -1291179264 tools/qstring.cpp:3081:42: runtime error: left shift of negative value -1291179264 tools/qstring.cpp:3091:13: runtime error: left shift of 73 by 26 places cannot be represented in type 'int' tools/qstring.cpp:3091:13: runtime error: left shift of negative value -1255957171 tools/qstring.cpp:3091:13: runtime error: signed integer overflow: 1783052986 - -1207959552 cannot be represented in type 'int' tools/qstring.cpp:3097:37: runtime error: left shift of negative value -1298753576 tools/qstring.cpp:3098:41: runtime error: left shift of negative value -1298753576 tools/qstring.cpp:3107:13: runtime error: left shift of negative value -1508912760 tools/qstring.cpp:3158:38: runtime error: left shift of negative value -677037574 tools/qstring.cpp:3159:42: runtime error: left shift of negative value -677037574 tools/qstring.cpp:3169:13: runtime error: left shift of negative value -1657715810 tools/qstring.cpp:3173:38: runtime error: left shift of negative value -677037574 tools/qstring.cpp:3174:42: runtime error: left shift of negative value -677037574 tools/qstring.cpp:3183:13: runtime error: left shift of negative value -1657715810 Change-Id: I1436eb61369919df9fe34251f863dd54fb58af98 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | | * Silence MSVC warnings when using certain std algorithmsMarc Mutz2016-04-265-6/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The MSVC STL warns when passing naked pointers as non-bounded iterators to algorithms such as std::equal and std::copy, in an attempt to inform users that the range specified by that iterator has an implicit minimum size that the caller of the algorithm must ensure is met: warning C4996: 'std::_Equal1': Function call with parameters that may be unsafe - \ this call relies on the caller to check that the passed values are correct. To \ disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to \ use Visual C++ 'Checked Iterators' When building Qt, as well as when building user projects with qmake (cf. 0a76b6bc7f98900ea884cd10ccca1a332e5bdba5), we globally disable this warning (with -D_SCL_SECURE_NO_WARNINGS), but since we started using STL algorithms in public headers (e.g. in qvector.h), users get this warning in their own projects now, unless they, too, define said macro. But such a requirement is against the Qt policy to have headers that are warning-free as much as possible. The suggested way of fixing this warning is to wrap the naked pointer in a stdext::unchecked_array_iterator before passing it to the algorithm, cf. examples in https://msdn.microsoft.com/en-us/library/ttcz0bys%28v=vs.120%29.aspx or, together with the capacity-made-explicit, in a stdext::checked_array_iterator. To avoid ifdefs for platforms that don't have these extensions (which, incidentally, for the unchecked case, includes MSVC 2012), wrap the calls in macros. The end game here is to drop -D_SCL_SECURE_NO_WARNINGS, at least for public headers, even though this commit also adds the wrapper to implementation and private header files. An alternative to the wrapper would have been the version of std::equal that takes four iterators. However, that is a C++14 library feature, while this version of Qt still needs to compile with a C++98 compiler, and, more importantly, there isn't, and never will be, a corresponding 4-iterator version of std::copy. Task-number: QTBUG-47948 Done-with: Stephen Kelly <steveire@gmail.com> Change-Id: I1bbab257fb5f1c5042939c382a412b596112ff26 Reviewed-by: Stephen Kelly <ske@ableton.com>
| | | * Add missing initializersTimur Pocheptsov2016-04-251-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Coverity, CIDs: 10724, 10725. Data member _iterator is not initialized. Change-Id: I0c94f5cef031e208aab1687209282fae0317f0ab Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
| * | | QDateTime: use default ctor to create invalid objectAnton Kudryavtsev2016-04-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't perform some internal init functions. Change-Id: I9986e7a8adab35499aea804d1019012547aefd5d Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | | QDateTimeParser: enable RVO in format()Anton Kudryavtsev2016-04-301-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I3d9f84d03519b2b8fb37c7d2e773e68bc4b9a1d3 Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * | | Don't bother asking if Linux supports a monotonic clock: it doesThiago Macieira2016-04-301-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Id5480807d25e49e78b79ffff144a0e61bd001dff Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
| * | | Decompress QResources only when needed.Volker Krause2016-04-301-9/+18
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | In particular, just creating a QFileInfo (or a QDirIterator, which uses QFileInfo internally) no longer triggers decompression. This doubles the performance when using a QDirIterator/QFile combo for loading a bunch of files. Change-Id: I7f53354e890ad6360693b7848d21a0cd5d595628 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | Add an early-out to QVector::operator+= and QHash::unite for empty LHSUlf Hermann2016-04-282-21/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the container being added to is default constructed and has never been modified, we don't have to do all the checking and iterating. Instead we can just assign with operator=. If the LHS is merely empty, we could lose reserve()d capacity, so only do this for a shared-null LHS. Change-Id: If1e3342662d10833babc7ab847ada0285073723b Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
| * | Improve the script itemization algorithm to match Unicode 8.0Konstantin Ritt2016-04-271-47/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Override preceding Common-s with a subsequent non-Inherited, non-Common script. This produces longer script runs, which automagically improves the shaping quality (as we don't lose the context anymore), the shaping performance (as we're typically shape a fewer runs), and the fallback font selection (when the font supports more than just a single language/script). Task-number: QTBUG-29930 Change-Id: I1c55af30bd397871d7f1f6e062605517f5a7e5a1 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-04-276-12/+57
| |\| | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qprocess_win.cpp src/widgets/itemviews/qheaderview.cpp Change-Id: I0a59ade9cd6e91f770fdf298a7d72a41e79fd761
| | * Also update filter rules if there is a custom filter installed.Volker Krause2016-04-241-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is relevant if the custom filter passes through some categories to the previous one (which might be the default one). In this case changes to the filter rules never took effect. Change-Id: I1a3ab569857d43621ce5df4e690c6e64e6bc7a66 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
| | * QMessagePattern: Fix indentation and use QVector for a large structThiago Macieira2016-04-231-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | struct BacktraceParams is too big (more than one pointer), so using it with QList is inefficient. Let's use QVector instead. Change-Id: Id75834dab9ed466e94c7ffff144572c1eb3fb0e5 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | * QMimeDatabase: fix mimeTypeForUrl for mailto URLsDavid Faure2016-04-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "path" of a mailto URL isn't a file, so we shouldn't try to do glob-based matching. I was getting application/x-ms-dos-executable for a .com domain and application/x-perl for a .pl domain... Change-Id: Ifc346c3bba83ba1a8476db3202492f4c2e4d52bb Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>