summaryrefslogtreecommitdiffstats
path: root/src/corelib
Commit message (Collapse)AuthorAgeFilesLines
* QWaitCondition: add notify_one/notify_all, i.e. STL namingDavid Faure2016-07-302-0/+18
| | | | | | | | This makes the API more consistent with the STL, which helps discovering the API. Much like QVector has push_back etc. Change-Id: I75f6b77ab94233c15e17f66605f4bf13aa03e61c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Introduce SCTP sockets supportAlex Trotsenko2016-07-272-0/+14
| | | | | | | Add protocol-specific code and the QSctpServer, QSctpSocket classes. Change-Id: Ie9a1d87bd1fda866a2405043d1c15c12ded5a96e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add QMetaEnum::isScoped to be able to destinguish C++11 enum classOlivier Goffart2016-07-263-1/+17
| | | | | | Change-Id: I67b1dbd069fa57bd60e50690abb5d876edc0d1d2 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* qFatal: unify the code path for aborting via std::abortGiuseppe D'Angelo2016-07-252-6/+4
| | | | | | | | | | [ChangeLog][QtCore][Important behavior changes] qFatal will now use std::abort to terminate the application on all operating systems. Previously, ::abort() or ::exit(1) were called, depending on the operating system. Change-Id: I43da912cce1db3c2229568da25000ea80060eed9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Q(Basic)Mutex: add try_lock{,_for,_until} for STL compatibilityGiuseppe D'Angelo2016-07-252-0/+112
| | | | | | | | | | | | | Now QBasicMutex is Lockable and QMutex is TimedLockable, which means they can be used in std::lock_guard, std::unique_lock, std::lock, etc. [ChangeLog][QtCore][QMutex] QMutex now fully models the TimedLockable concept by providing the try_lock, try_lock_for and try_lock_until functions, therefore making it usable in Standard Library lock management classes and functions. Change-Id: I7c691481a5781a696701e1ab78186b5cefbd6a87 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* QRingBuffer: add packet modeAlex Trotsenko2016-07-231-22/+24
| | | | | | | | | | | As a special case, setting the value of chunk size to zero forces QRingBuffer to produce a separate QByteArray on each call which appends the data. So, this enables a packet mode where portions of data are stored independently from each other. Change-Id: I2d0b331211901a289da7d4533e974f06830b5590 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QRingBuffer: allow to change the chunk size of the buffer dynamicallyAlex Trotsenko2016-07-232-0/+10
| | | | | | Change-Id: I0ac55713c7bb8c48d2c9c774376543caef781980 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge "Merge remote-tracking branch 'origin/5.7' into dev" into refs/staging/devEdward Welbourne2016-07-2225-231/+424
|\
| * Merge remote-tracking branch 'origin/5.7' into devEdward Welbourne2016-07-1925-231/+424
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/library/qmakebuiltins.cpp qmake/library/qmakeevaluator.cpp qmake/library/qmakeevaluator.h qmake/project.h QMakeEvaluator: * evaluateConditional(): one side changed return type, the other changed a parameter type. * split_value_list(): one side changed a parameter adjacent to where ... * expandVariableReferences(): ... the other killed one overload and changed the survivor src/corelib/io/qlockfile_unix.cpp One side changed a #if condition, the other moved NETBSD's part of what it controlled. src/corelib/tools/qdatetime.cpp One side fixed a reachable Q_UNREACHABLE in toMSecsSinceEpoch(), the other moved it from the private class to the public one, in the midst of the "short date-time" optimization, which confused diff entirely. One side changed a QStringLiteral to QLatin1String, the other rewrote adjoining code. src/network/kernel/qauthenticator.cpp Both rewrote a line, equivalently; kept the dev version. src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h One side changed #if-ery that the other removed. tools/configure/configureapp.cpp One side added a check to -target parsing; the other killed -target. tests/auto/testlib/selftests/expected_cmptest.lightxml tests/auto/testlib/selftests/expected_cmptest.teamcity tests/auto/testlib/selftests/expected_cmptest.txt tests/auto/testlib/selftests/expected_cmptest.xml tests/auto/testlib/selftests/expected_cmptest.xunitxml Regenerated using generate_expected_output.py I note that quite a few other expected_* come out changed, now. There was no git-conflict in src/widgets/kernel/qformlayout.cpp but it didn't compile; one side removed some unused methods; the other found uses for one of them. Put FixedColumnMatrix<>::removeRow(int) back for its new user. Change-Id: I8cc2a71add48c0a848e13cfc47b5a7754e8ca584
| | * Fix typo in doc snippets of qOverload and relatedFriedemann Kleint2016-07-191-6/+6
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-54808 Change-Id: Ic565710e4d3a95abf98d4696ae7c0001a9171697 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| | * Merge "Merge remote-tracking branch 'origin/5.6' into 5.7" into refs/staging/5.7Edward Welbourne2016-07-194-32/+62
| | |\
| | | * Merge remote-tracking branch 'origin/5.6' into 5.7Edward Welbourne2016-07-154-32/+62
| | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/library/qmakeevaluator.cpp One side changed the iterator to use ranged-for, the other changed its body; they only conflicted because the latter had to add braces around the body, intruding on the for-line. Trivial resolution. Change-Id: Ib487bc3bd6e3c5225db15f94b9a8f6caaa33456b
| | | | * FreeBSD: move order of includes for compilingRalf Nolden2016-07-131-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous patch works for FreeBSD 10 but however not for 9 and 11 due to the order of includes. Move <sys/user.h> down to fix those compile issues due to unknown types when user.h is included first. Change-Id: Ica3d3ddf335a543c4a473e8b80d1667cb81667cf Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | | | * QString::replace(): protect sought text and replacementEdward Welbourne2016-07-121-20/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When replacing each copy of one text with a copy of another, we do so in batches of 1024; if we get more than one batch, we need to keep a copy of the sought text and replacement if they're part of the string we're modifying, for use in later batches. Also do the replacements in full batches of 1024, not 1023 (which left the last entry in an array unused); marked some related tests as (un)likely; and move some repeated code out into a pair of little local functions to save duplcation. Those new functions can also serve replace_helper(); and it can shed a const_cast and some conditioning of free() by using them the same way replace() now does. (There was also one place it still used the raw after, rather than the replacement copy; which could have produced errors if memcpy were to exercise its right to assume no overlap in arrays. This error is what prompted me to notice all of the above.) Added tests. The last error proved untestable as my memcpy is in fact as fussy as memmove. The first two tests added were attempts to get a failure out of it. The third did get a failure, but also tripped over the problem in replace() itself. Added to an existing test function and renamed it to generally cover extra tests for replace. Change-Id: I9ba6928c84ece266dbbe52b91e333ea54ab6d95e Reviewed-by: Robin Burchell <robin.burchell@viroteck.net> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| | | | * QString::replace(): Commentary clarifications.Edward Welbourne2016-07-121-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also skip doing a += 0 when we had to test whether the relevant rhs was zero anyway (because we want to ++ there instead of +=ing). Change-Id: Ibd5f21eb9aaf410b09c9db8450b2d61618e628fc Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
| | | | * QMacTimeZonePrivate - correctly initialize m_nstz data-memberTimur Pocheptsov2016-07-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The default ctor never initializes m_nstz but calls init with [NSTimeZone systemTimeZone].name. Init (re)sets m_nstz _only_ if this ianaId is in [NSTimeZone knownTimeZoneName], which is not guaranteed (a good example is "US/Pacific" that can be returned by systemTimeZoneId() - the similar problem is described in [*]. Set m_nstz to nil in ctor, so if 'init' fails we still have a valid (nil) pointer. [*] http://stackoverflow.com/questions/19819268/convert-ios-localtimezone-to-a-knowntimezone. Task-number: QTBUG-54330 Change-Id: I68917926350aad3158d44a06f06721f25b3fdb74 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| | | | * QStringBuilderCommon: drop const from resolved() result typeMarc Mutz2016-07-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The const qualification prevented toUpper() etc from calling the rvalue overloads of the corresponding QString functions. Since resolved() always returns a non-shared object, the rvalue overloads can re-use the object's capacity for storing their result, saving up to one memory allocation per QStringBuilderCommon::to*() invocation. Change-Id: Ica97fcd906cdd949ffe56055654578b93407e2d3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | | | * QString: fix incomplete doc of chop()Anton Kudryavtsev2016-07-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I84de848681e793e68e0c290719a7f961aca48f4e Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * | | Doc: Fix snippet to use initializer listKai Koehne2016-07-181-4/+1
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | We can expect C++11 now, and using an initializer list is much shorter. Change-Id: I6424d24ce7660b342a629e836b94d62c8868a44d Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
| | * | Optimize string usageAnton Kudryavtsev2016-07-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use QStringBuilder more. Use QL1S directly, without QString construction. Change-Id: Iad844391367681fc1013b9725403d009e7c346e6 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| | * | QReadWriteLock fast path for tryLock without timeoutOlivier Goffart2016-07-151-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When one tries to lock without a timeout, there is no need to allocate a QReadWriteLockPrivate as we will not wait on it. Change-Id: I37c96a7fbc0c66fbdffe372f6089708cb2466fe3 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * | Remove (private) QString::expand(), port to (new) QString::resize(int, QChar)Marc Mutz2016-07-142-12/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We cannot really remove the function, since it's called from inline code (QCharRef::op=(QChar)), but we can schedule it for removal in Qt 6, and inline it into existing in-tree callers. Change-Id: I3499f101dcb5ae908726b3673bf3526a04408db6 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * | Fix the Q_ATOMIC_xxx_IS_www_NATIVE macros with C++11Thiago Macieira2016-07-131-31/+156
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When I introduced this code in Qt 5.0, I made INT and POINTER be SOMETIMES_NATIVE, but then later I made the specific sizes be ALWAYS_NATIVE. That doesn't make sense. Instead, use the macros from the C++11 <atomic> header. Note that the member isXxxxNative() functions should not have been constexpr. That's a defect I introduced in Qt 5.0. Task-number: QTBUG-51315 Change-Id: I0c94a5c2846b48c8aea7ffff1436013e8686c153 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| | * | Optimize QString::insert()Marc Mutz2016-07-131-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the insertion position is not beyond end(), call resize() instead of expand(), which fills the new size with spaces, which, however would just be overwritten by the following memmove(). Add some Q_UNLIKELY to indicate that we strongly expect the resize() case to be the more common. Change-Id: Iaf3215dd53c2cbd18f2fd8a5f80af8f6844944da Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Anton Kudryavtsev <a.kudryavtsev@netris.ru> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * | Correct indentation in qsettings.cppThiago Macieira2016-07-111-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduced in 9c49d8c41158287d4a7b7b9c950512cab692e6c5, despite my pointing out. Change-Id: Ie585843cfb684bc3b6e3fffd14600c99f7fde591 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Anton Kudryavtsev <a.kudryavtsev@netris.ru>
| | * | QSettings: optimize string usageAnton Kudryavtsev2016-07-091-66/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use QStringBuilder and QString::asprintf more. Use += operator to reserve extra capacity for possible free following append/prepend/+= call. Change-Id: Ia534bec28cb96b688a68a5051a855cda1eb5db4b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| | * | Use QStringLiteral more judiciouslyAnton Kudryavtsev2016-07-085-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace it with QL1S in QStringBuilder expressions and in overloaded functions. Replace patterns 'QString::number() + QStringLiteral' and 'QStringLiteral + QString::number()' with QString::asprintf. Saves some text size. Change-Id: Ib39b2332264dfc3df04e77f2c101b47a1030cef4 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * | QStorageInfo: update the algorithm for ignored filesystems on UnixThiago Macieira2016-07-061-14/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the criterion that GNU coreutils' df uses: if the total size of the filesystem is zero, then it's pseudo. After all, if it contains files in a zero-sized volume, it has to be pseudo; if it contains nothing, then it's not very useful anyway. This would have caught most Linux pseudo-fs anyway, but the mount point check beforehand allows us to skip quite a few statfs() syscalls. The new algorithm also solves the following cases which had been mistakenly interpreted: * fuse and ZFS (source devices don't usually start with /) * pseudo-fs that were mounted from a device starting with / (the source device is usually ignored by the OS) This change is not testable automatically. Manual testing shows it still reports the same entries it used to on Linux, plus now shows FUSE (sshfs) mounts. Task-number: QTBUG-54235 Change-Id: Ib57b52598e2f452985e9fffd1459f06dcefcc5c6 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| | * | Merge "Merge remote-tracking branch 'origin/5.6' into 5.7" into refs/staging/5.7Timur Pocheptsov2016-07-057-18/+34
| | |\ \
| | | * | Merge remote-tracking branch 'origin/5.6' into 5.7Edward Welbourne2016-07-047-18/+34
| | | |\| | | | | | | | | | | | | | | | Change-Id: Ibd81cd1df4a0650d93fcb556a57be90be2e1f569
| | | | * QEventLoop: better describe the exception safety of QtGiuseppe D'Angelo2016-07-021-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1) In general it's unsafe to let exceptions propagate through Qt code, so document that. 2) Add a note that overriding notify() makes sense only in Qt 5, in Qt 6 it's going away. 3) The advice applies also to applications not using QApplication, but just QCoreApplication. Change-Id: I4f6e74c53da757faf2eeaa9de226ceba55c52536 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
| | | | * Fix build: ftok(3) requires sys/ipc.hThiago Macieira2016-07-021-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-54069 Change-Id: Ib57b52598e2f452985e9fffd1457fa9c7ad3bac0 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
| | | | * QUrl: Test that we do correctly accept valid schemesThiago Macieira2016-07-021-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... and reject invalid ones. There was one error: we accepted schemes starting with pluses, dashes and dots. Change-Id: Ie585843cfb684bc3b6e3fffd145cfe12227ec4ad Reviewed-by: David Faure <david.faure@kdab.com>
| | | | * QTime: restore Qt3 compatibility in the QDataStream operatorsDavid Faure2016-07-021-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A Qt5 program writing a null QTime() using setVersion(QDataStream::Qt_3_3), and then a Qt3 program reading that, would lead to a weird QTime, with isNull=false, isValid=false, hour=1193, minute=2, second=47, ms=295. This commit restores interoperability, by writing out the expected value (0) for a null QTime rather than the -1 value used by Qt4 and Qt5. Change-Id: Icde468a8f6fc9434ef7018296725819b44d672af Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | | | * Doc: Improve QJsonDocument::fromJson documentationKai Koehne2016-07-011-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Be explicit on how to check whether parsing succeeds. Change-Id: I44f408cb6e5a830826b84dfb3a8af331f03e58cc Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
| | | | * QDir: Remove redundant QString wrappingAlexander Volkov2016-06-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I8368b137d15509cdec575a17f5dae3c0c343400f Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
| | | | * QDateTime: early return to make a Q_UNREACHABLE actually true.Edward Welbourne2016-06-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It could be reached when QT_BOOTSTRAPPED was defined. Change-Id: I632d6f908a3bcbde81a6ebbadcaf2800dfe1449d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | | | * winrt: fix conditionalMaurice Kalinowski2016-06-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Seems the previous check was a leftover from debugging. Tests still pass and loop checks properly now. Change-Id: Ic12cd49881f6d146687e257794b3028f6c8e874c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| | * | | Revert "CMake: Add imported target for qdoc."Kevin Funk2016-07-051-15/+0
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit dc0ae02ebc8e221f952829230c0301a718a6f10b. qdoc is a binary built inside the qttools repository, thus it should be added to the respective ConfigExtras.cmake.in there instead. Task-number: QTBUG-54446 Change-Id: I182e5889af164a89c68226a91abc4d9962a508ea Reviewed-by: Volker Krause <volker.krause@kdab.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
| | * | QDateTime: use the more efficient currentMSecsSinceEpoch()Thiago Macieira2016-07-022-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ... instead of creating a QDateTime object. Change-Id: Ib57b52598e2f452985e9fffd145a36911de4fa9a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| | * | QDataStream: unify deserialization of containersAlex Trotsenko2016-07-011-20/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Serialization of the Qt container classes is accomplished by breaking up the data into primitive units. On the receiver side, these units should be read atomically to guarantee integrity of the container. Deserialization procedures for QHash and QMap were already implemented in accordance with this strategy and have the following behavior: - a previously latched error status is saved for the caller. This overrides possible different errors in the current read. This is consistent with the treatment of primitive types. - if an error occurs during the deserialization, the container is cleared. To make the API consistent, this patch adjusts the behavior of QList, QLinkedList, QVector, and QSet deserialization. On the implementation side we accomplish this with a private StreamStateSaver RAII class that consolidates the handling of the stream status for all containers. [ChangeLog][Important Behavior Changes][QtCore][QDataStream] Incomplete reads of Qt containers are now handled same way as for primitive types, meaning that previous errors are latched. Task-number: QTBUG-54022 Change-Id: I5c77257fe2a4637e8a7e6cf3cd43091c8469340e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | | Improve precision of reported file times on Unix-style platformsSimon Hausmann2016-07-202-9/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of reporting the file times in the precision of seconds, our API allows us to report it up to millisecond precision. Change-Id: I8bcc6a1fb4116e8c5421d650a68f6fb00482e551 Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | | Make moc obey the preprocessor environment variable for include pathsThiago Macieira2016-07-201-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | C preprocessors augment their standard list of include paths from the environment: Unix preprocessors use $C_INCLUDE_PATH (for C) and $CPLUS_INCLUDE_PATH (for C++), plus CPATH for both, whereas MSVC uses the an environment variable simply called "INCLUDE". Handling this for MSVC is particularly important because the VCVARSALL.BAT script sets the necessary #include paths in the environment for important things. Without that being parsed, moc won't find some #defines, like WINAPI_DESKTOP_FAMILY. [ChangeLog][moc] qmake and moc now cooperate to use the Visual Studio environment variables (set by the VCVARSALL.BAT script) to find system include files. A possible consequence is that moc parses application headers slightly differently, depending on #if conditions that depended on macros that previous versions had not seen #define'd. Implementers of other buildsystems are advised to pass the --compiler-flavor=msvc option to moc. Change-Id: I7e06274214d1939b0124e5b4bf169cceaef9ca46 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | | Extend PLATFORM_SDK_EQUAL_OR_ABOVE and DEPLOYMENT_TARGET_BELOW macrosJake Petroules2016-07-191-17/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is now a DARWIN version for all four Apple platforms at once, a MACOS_IOS version for macOS and iOS (since many of the checks we need are prior to tvOS or watchOS's existence), and MAC and OSX have been relegated to synonyms for MACOS_IOS and MACOS, respectively. Change-Id: I54f587e26c6b46bf4b469c5d3039086c65566651 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* | | | QThread: make it fatal to destroy a running QThreadGiuseppe D'Angelo2016-07-191-2/+2
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Align ourselves to what std::thread does (and what's sensible to do anyhow, since we even document that "Deleting a running QThread [...] will probably result in a program crash"). [ChangeLog][QtCore][QThread] Destroying a QThread which is still running will now result in immediate and abnormal program termination. Change-Id: Ib481287915be01a1381df14abf6e0fb68c36b5b5 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Don't mention private classes in our docs.Lars Knoll2016-07-151-1/+1
| | | | | | | | | | | | | | | Change-Id: I2cb7443ffa9afac8160b9510df95a304936a01c9 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Add qtwidgetsglobal.h and qtwidgetsglobal_p.hLars Knoll2016-07-141-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new modular configuration system requires one global header per module, that is included by all other files in this module. That header will later on #include the configuration file for Qt Widgets. For now it defines the Q_WIDGETS_EXPORT macro for this library. Change-Id: I6698989b952b9bac94d086d9f219e03c000f7d53 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | | Clean up qwindowdefs_win.hLars Knoll2016-07-142-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The file lives in Qt Gui, but declares a few methods from Qt Core and Widgets. All of those methods are actually mostly unused, not documented and pretty trivial. This patch removes the last few places the methods got used and removes the declarations. The implementations should get removed in a future release. Change-Id: I2b609c29f403d2ed4824ff4346008be08b3fd067 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | qdoc: Documentation for qFuzzyIsNull() is addedMartin Smith2016-07-142-6/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | The two versions of this function are now documented on the global variables page. Change-Id: Iee95e251d616f6c8b1b42458d23cbf64a70a5315 Task-number: QTBUG-50654 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Add qHash(QHash) and qHash(QMultiHash)Marc Mutz2016-07-142-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The hash function is carefully designed to give the same result as the straight-forward implementation of qHash(unordered_map), which we'll probably add at some point, namely: std::accumulate over a container of std::pair. This is one reason to use std:: and not QPair in the implemen- tation of qHash(QHash). The other is that qHash(QPair) uses a bad hash combiner, which may xor out the 'seed' from the result. We can't fix that until Qt 6, but the qHash(std::pair) overload uses the well-known boost::hash_combine algorithm (implemented in Qt as QtPrivate::QHashCombine), so we can use that. I also trust std::pair to work without problems with reference template arguments, while QPair only very recently gained a very basic auto-test for reference parameters. [ChangeLog][QtCore] Added qHash() overloads for QHash, QMultiHash. Change-Id: I90879d8a99cf1aadb6e84ecc0c3704f52f3691da Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>