summaryrefslogtreecommitdiffstats
path: root/src/corelib
Commit message (Collapse)AuthorAgeFilesLines
* 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>
| * Windows/QProcess::startDetached(): Fall back to ShellExecuteEx() for UAC prompt.Friedemann Kleint2016-04-231-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | When running a process that requires elevated privileges (such as regedt32 or an installer), the Win32 API CreateProcess fails with error ERROR_ELEVATION_REQUIRED. Fall back to ShellExecuteEx() using the verb "runas" in that case, bringing up the UAC prompt. Task-number: QTBUG-7645 Change-Id: Iee82a86a30f78c5a49246d2c0d4566306f3afc71 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
| * qlockfile_unix - code cleanupTimur Pocheptsov2016-04-221-5/+7
| | | | | | | | | | | | | | | | | | | | Coverity's CID 157687: QCache::insert, indeed, can delete (immediately) the object we're trying to insert. While this never happens actually in qlockfile_unix since we have max cost 10 and insert with cost 1, the code does not look good and Coverity is not happy. Change-Id: I16a428017bf86e151afe5256906e4cab1ef4044a Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
| * QString: Avoid searching for a needle which is longer than the hayStephen Kelly2016-04-211-0/+3
| | | | | | | | | | | | | | | | | | | | Avoid incurring the cost of converting the latin1 data in that case. Several existing QString unit tests excercise the new code path. Task-number: QTBUG-52617 Change-Id: I27256d9e7db34f09543e244a79d754ff7932f0d0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Disallow non-character Unicode codepoints in QUrl/QUrlQueryThiago Macieira2016-04-261-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Since they are non-characters and should not be used for text interchange, it stands to reason that they should not appear in unencoded for in a URL. To change the behavior, we just need to toggle a simple flag for QUtf8Functions. This behavior also matches the recommendation from RFC 3987. We do not usually follow recommendations from that RFC (as it is generally believed to be a bad RFC), but this one seems like a good idea. Change-Id: Ifea6e497f11a461db432ffff1447486c623c12bd Reviewed-by: David Faure <david.faure@kdab.com>
* | QJsonObject: use reserve() to reduce memory allocationsAnton Kudryavtsev2016-04-261-0/+1
| | | | | | | | | | | | Change-Id: I97821ffa0c485815c781dc4f98012b0b490da90a Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Merge "Merge remote-tracking branch 'origin/5.6' into 5.7" into refs/staging/5.7Liang Qi2016-04-2614-24/+84
|\ \
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-04-2514-24/+84
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: config.tests/unix/compile.test configure src/android/jar/src/org/qtproject/qt5/android/QtMessageDialogHelper.java src/corelib/global/qglobal.cpp src/widgets/kernel/qapplication.cpp src/widgets/styles/qwindowsvistastyle.cpp tests/auto/corelib/kernel/qobject/tst_qobject.cpp Change-Id: I067083f34e5290aa5f7565e40c30a069cc37b83a
| | * Doc: Fix links to QProcess::start(const QString &, OpenMode)Joerg Bornemann2016-04-201-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | The startDetached(const QString &, OpenMode) overload and the QT_NO_PROCESS_COMBINED_ARGUMENT_START macro must point to the start(const QString &, OpenMode) overload. Change-Id: I7607fcb92b9f1ef3547a4a1aadc950532024225a Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
| | * Doc: Fix typo in QAtomicPointer::loadAcquire documentationKai Koehne2016-04-201-1/+1
| | | | | | | | | | | | | | | Change-Id: I1b0e6b0f230b2f17595a9cc91234a011ad0260b5 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
| | * Improve performance of socket notifications on WinCEAlex Trotsenko2016-04-192-2/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QEventDispatcherWin32 on WinCE uses a separate low-priority thread to monitor sockets activity, so changing the state of notifiers occurs asynchronously to the main thread. This makes a message-based socket activation mechanism ineffective. To avoid timeouts in the helper thread, update the thread's pool directly from the (un)registerSocketNotifier() functions. Change-Id: I702c32d69dce09323ca5f65dc2ee1407842e41ef Reviewed-by: Tobias Koenig <tobias.koenig@kdab.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
| | * Fix build on Linux/x32 systems (x86-64 ILP32)Thiago Macieira2016-04-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When I tested this, it compiled, but either I wasn't using the same compiler or the problem happens during linking: we can't use .quad (64-bit) with a relocation on x32. So instead, let's use .long (32-bit). Task-number: QTBUG-52658 Change-Id: Ifea6e497f11a461db432ffff14468d1a16f49c67 Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
| | * QWindowsLocalCodec::convertFromUnicode(): preclude stack overflow.Edward Welbourne2016-04-151-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This method is called by QString::toLocal8Bit_helper(), so using QString::toLocal8Bit() on the input in an error message on failure to decode would be apt to recurse on the same data (if such an error ever arises). Furthermore, the qWarning()'s format string even claimed what it was displaying was in UTF-8. Fix by using native fprintf and UTF-16. Thanks to Frédéric Marchal for spotting this and checking that such errors aren't (at present) possible. Change-Id: I1ad441f2e3700bc01256d6c1718d404e27bce488 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * QWinEventNotifier: compile with -Wzero-as-null-pointer-constantMarc Mutz2016-04-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Seems to be the last 5.6 QtBase public header that didn't, paving the way to add the warning to the headersclean check. Change-Id: Ib2655782e34ec58e5d9b1b9c0ec31a965a38f9b7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
| | * Fix QSysInfo::windowsVersion() on WinCETobias Koenig2016-04-141-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Use the GetVersionEx method on WinCE. The ntdll.dll does not exist on that platform, therefor a wrong version number was returned. Change-Id: I7b51757d0fb612dcd8832e0903a93b9d1c6746c0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
| | * Fix encoding of IDN hostnames with QUrl::hostThiago Macieira2016-04-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | When the formatting parameter wasn't exactly QUrl::EncodeUnicode, it wouldn't encode, despite having to. Change-Id: Id75834dab9ed466e94c7ffff1444bacc08dd109b Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
| | * Fix parsing of empty port sections in URLsThiago Macieira2016-04-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The RFC does allow it. It even has examples showing them as valid. In section 6.2.3, it shows: http://example.com http://example.com/ http://example.com:/ http://example.com:80/ Change-Id: Id75834dab9ed466e94c7ffff1444b7195ad21cab Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
| | * Work around Clang false-positive warning on returning default parametersThiago Macieira2016-04-131-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clang 3.8 and Apple Clang 7.x seem to think that the parameter is a temporary. See https://llvm.org/bugs/show_bug.cgi?id=26396 Task-number: QTBUG-52134 Change-Id: Id75834dab9ed466e94c7ffff1444b6f2424d7fb7 Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
| | * Fix build when Qt is used in an automatic reference-counted environmentTor Arne Vestbø2016-04-132-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When automatic reference-counting (ARC) is enabled on Darwin platforms the NSAutoReleasePool class should not be used directly, which caused a build error if qglobal.h was included after the Foundation.h in client code. The preferred alternative for ARC is the scoped @autoreleasepool construct, which allows the compiler to reason about needing to insert _objc_autoreleasePoolPush and _objc_autoreleasePoolPop calls. Note that ARC translation units can be combined with non-ARC translation units, so Qt and the QMacAutoReleasePool class can still be used in ARC client code even if Qt is not built with ARC. Task-number: QTBUG-51332 Change-Id: I7ef1c3146aa416a9d6a1dc299ce7b17f22f889e5 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
| | * Don't copy the functor object for each signal emissionOlivier Goffart2016-04-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The behavior was different in the variadic template code and in the C++98 code. The code without variadic template support was not copying the functor object (e.g. a lambda) before calling it. However, in the variadic template section, QtPrivate::FunctorCall::call took the functor by value instead of by reference resulting in a copy. QtPrivate::FunctorCall::call is a helper function for QtPrivate::FunctionPointer::call which is only needed for variadic template expension. [ChangeLog][QtCore][QObject] If the compiler supports variadic templates, no longer copy functor connected to a signal each time the signal is emitted. Restoring the C++98 behavior. Task-number: QTBUG-52542 Change-Id: I3ca20ef6910893b8a288e70af7de4c7b69502173 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * winrt: Try to acquire CoreDispatcher from multiple sourcesMaurice Kalinowski2016-04-131-2/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the system launches the application via different activation mode (eg. app registered for sharing) no main window will be created. Hence accessing the core window will return null and event dispatcher initialization will fail. In that case iterate through all available views and try to get access to their dispatcher to be able to invoke code on the xaml thread. Task-number: QTBUG-49276 Change-Id: I8c78baa27747a0465ff7a1b2ead6c9e03f0e05a8 Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
* | | QLockFile: move early out earlier to avoid allocations.Anton Kudryavtsev2016-04-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Saves reading two lines and allocating storage for them. Change-Id: I71f6c7019f4c097897945eea52851e4623b75dc2 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
* | | qTopLevelDomain: use QStringRef moreAnton Kudryavtsev2016-04-252-5/+14
| | | | | | | | | | | | | | | | | | | | | | | | qIsEffectiveTLD() and containsTLDEntry() now have overloaded versions with QStringRef arg. Change-Id: Ic2b7fd56c8ea1579d3e4bdf4ed0e10405515d417 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | QtCore: mark more types as primitive/movableMarc Mutz2016-04-254-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These types are held in QVarLengthArrays, so benefit from being trivially relocatable. They are also part of the private API, so there's no BC issues with potential uses of these types in QList. Change-Id: I8adc0c801885f8fffa05eb1f173d7e4bb085ba7b Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | QMutexPool: avoid QVarLengthArray of QAtomicPointersMarc Mutz2016-04-242-8/+8
|/ / | | | | | | | | | | | | | | | | | | | | | | | | QAtomicPointer is CopyConstructible, but std::atomic<T*> is not, for a reason. So avoid putting them in a QVarLengthArray, using a dynamic heap allocation instead. This sounds wasteful until you realize that virtually all users of QMutexPool (and we know them all) use the global instance(), and that each QMutex (131, by default) is heap-allocated, too. Change-Id: Ie9c95671ec42a1f51919c18631b623aad2c0d6ba Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Mime type browser example: Add documentation.Oswald Buddenhagen2016-04-192-2/+2
| | | | | | | | | | Change-Id: Ic5f2103b0771799bc9e5e5efceeadf153f8a2159 Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
* | QStringListModel: proper construction of vectorAnton Kudryavtsev2016-04-181-1/+1
| | | | | | | | | | | | | | | | | | | | ... with known size and known value by corresponding ctor. Don't use appending for this case. Change-Id: I70f5b943cda7e55eeb45becf439f79c9aee77278 Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | CoreLib: use const (and const APIs) moreAnton Kudryavtsev2016-04-1820-40/+44
| | | | | | | | | | | | | | | | | | | | For CoW types const methods will be called. Mark store_persistent_indexes() as const, because this method does not modify the object. Change-Id: Ic867913b4fb5aaebfbaaffe1d3be45cf7b646403 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Mark some QByteArray relational operators nothrowMarc Mutz2016-04-131-18/+18
| | | | | | | | | | | | | | | | | | | | | | | | Specifically, those that compare UTF-8 octet-streams: - QByteArray <-> QByteArray - QByteArray <-> const char* For more, Qt first needs to gain a nothrow UTF-8 <-> UTF-16 comparator. Change-Id: Ibccbdcdc3ebed5b1ac0e65c971f6f7d1bd15b6da Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>