summaryrefslogtreecommitdiffstats
path: root/src/corelib
Commit message (Collapse)AuthorAgeFilesLines
* Fix Windows ICU build break in QCollator after commit c17563ec.Michael Brüning2014-09-161-1/+1
| | | | | | | | It used LCID without including qt_windows.h while QT_USE_ICU was defined. Change-Id: I3d4cf0e6bd0e299729d23d9a36c5a87adde774c9 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Speed up QStringList::removeDuplicates by ~2xDaniel Teske2014-09-151-2/+4
| | | | | | | | | QSet::contains needs to hash the string, which is unnecessary, since we can just check if the size of the set changed. Change-Id: I2c7a42bae6cdf351533d5a582a42079658fa7729 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Fix 64 bit issues in QIODevicePrivateLinearBufferLars Knoll2014-09-152-9/+13
| | | | | | | | | The API was using int, not qint64 leading to implicit truncation of numbers in a few places Task-number: QTBUG-40974 Change-Id: I13aedc84557a19b6f74fe6825764e7b5827f27b0 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* QVariant::compare shouldn't return match when QVariant::cmp does notAllan Sandfeld Jensen2014-09-111-2/+12
| | | | | | | | | | | | | | If the types doesn't match in QVariant::compare we do a comparison based on QString, this may end up indicating a full match, though the we don't match according to cmp. In this case it would be better if we preserved the non-matching to avoid breaking ordering. [ChangeLog][QtCore][QVariant] Fixed ordered comparison between QVariants that do not match but produce identical toString output. Task-number: QTBUG-40363 Change-Id: I84a8eca11e8875dba9948bde2906ae7c5aa35704 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Doc: corrected link/autolink errors in corelib/doc/srcNico Vertriest2014-09-113-12/+14
| | | | | | Task-number: QTBUG-40362 Change-Id: I0ff1523c76724e0662bafed08515ea06bbdd8381 Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Use a dedicated timer for the animation driver.Gunnar Sletta2014-09-112-3/+4
| | | | | | | | | | | | | | | | | QUnifiedTimer::elapsed() was implemented using driverStartTime + time.elapsed() while the driver was running, but time.elapsed already contains driverStartTime so that was counted twice. This caused repeating timers to fire immediately once they first had fired, if the animation driver was started while it was running. Separate the two timers. Animation driver time restarts from 0 every time it starts. Change-Id: Icf5cd0381b121b2355d7c6ec3edd0997721cbcdf Task-number: QTBUG-41198 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Revert "Reading QJsonObject property should not modify the object itself."Jędrzej Nowacki2014-09-114-83/+11
| | | | | | | | | | This reverts commit 20cf632ad5f3ffe7b0fd231724c971f4e07304eb. The commit produced to many problems during statics destruction. For example causing QtCreator crash (QTBUG-40987). Change-Id: Ib52f6a449c2d84deab2de792559a6a065ca45e8d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QLockFile: on Windows, retry deleting the lock file if it is being read.David Faure2014-09-112-2/+15
| | | | | | | | | | | | | | | | A "sharing violation" happens when trying to delete the lock file and another thread/process is reading it at that very moment. Detect the error and try again, up to 10000 times - to avoid an infinite loop if QFile::remove fails for another reason such as a sudden change of permissions preventing us from deleting our own lock file. On Unix the deletion can't fail because of readers, but it doesn't hurt to check the return value there too, to catch other reasons for failures such as a sudden permission change. Task-number: QTBUG-38853 Change-Id: Icf12a74faed4a4916e3427abc09d9c33aa141476 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix several issues in QCollatorLars Knoll2014-09-107-227/+207
| | | | | | | | | | | | | Refactor the code and move more things into the cross platform code path. Make sure the flags survive changing the locale of QCollator. Use the correct locale on Windows, WinRT and OS X. We now pass all QCollator autotests on these platforms. Task-number: QTBUG-40778 Change-Id: Ic2d3334b5018c323a35a3ea8fc1d7ab5f99b4e62 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix user defined conversions to numeric typesLars Knoll2014-09-101-2/+1
| | | | | | | | | The old code was completely broken. It did dereference val for user types, but val does in this case only contain garbage. Instead use the pointer to the correct data. Change-Id: I20ccf0bfa3dd3774c787d08c51cc8dd7b1ec9a1a Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Don't accept json strings with trailing garbageLars Knoll2014-09-102-1/+14
| | | | | | | | | | A well formed JSON document is not allowed to contain trailing garbage at the end. Don't accept this in the parser. Task-number: QTBUG-40062 Change-Id: I0a09dbd099a8c643f58023342546c4e67d026fec Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Fix bugs in internal comparison operatorsLars Knoll2014-09-101-3/+20
| | | | | | | | | | | The comparison operators between QJsonPrivate::String and QJsonPrivate::Latin1String weren't all correct, leading to wrong sorting of keys in QJsonObjects when the keys were outside of the latin1 range and resulting lookup errors. Task-number: QTBUG-41100 Change-Id: Idceff615f85d7ab874ad2a8e4a6c1ce8c2aa0f65 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Expose screen change event to widgets so that they can check the dprLaszlo Agocs2014-09-102-0/+2
| | | | | | | | | | Unlike ordinary widgets, the ones that have OpenGL framebuffers must know about screen changes because the device pixel ratio may be different on the new screen. Add an internal event, ScreenChangeInternal, as the counterpart to WindowChangeInternal. Change-Id: I5e55999838e4c0284e7d9832299f7cc6b541ee3f Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Add an option to share between TLWsLaszlo Agocs2014-09-102-0/+6
| | | | | | Task-number: QTBUG-41191 Change-Id: I510d1631926ed0d9e371703d22229aed92432aa6 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Fix typo in QMetaType documentation.Mitch Curtis2014-09-091-1/+1
| | | | | Change-Id: I934b68978fb32a518ed7cf9b47f1600982f58f66 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Bump Q_COMPILER_INITIALIZER_LISTS to GCC 4.5Adam Majer2014-09-061-1/+3
| | | | | | | | | | | | | | | | | | | | | | While GCC 4.4 has the required header, it is missing important typedefs requiring use of pointers instead. This is acceptable if only used in one or two places, but a quick search through the source code lists quite a few usages of const_iterator typedef. $ git grep -c initializer_list\<.\*\>::const_iterator src/corelib/global/qflags.h:2 src/corelib/json/qjsonarray.h:1 src/corelib/json/qjsonobject.h:1 src/corelib/tools/qhash.h:2 src/corelib/tools/qmap.h:2 src/corelib/tools/qset.h:1 The lesser-evil is to bump Q_COMPILER_INITIALIZER_LISTS to version GCC 4.5 and retain usage of required (by standard) initializer_list typedefs. Change-Id: I38d6fa0ef3dc7d958587b406d33e3e3a7378c026 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDateTimeParser: remove unused local variablesMaks Naumov2014-09-051-2/+0
| | | | | Change-Id: Id78fde8a720961c448d1aa3983ad296974796fdf Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Use expiry_date field to check for evaluation timespanKai Koehne2014-09-051-2/+4
| | | | | | | | | Use the new dedicated field instead of just assuming that the evaluation timespan is buildtime + 30 days. Change-Id: Ibf4078f030ea609d823fe01889a106a5da345817 Reviewed-by: Janne Anttila <janne.anttila@digia.com> Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Doc: QRect::isEmpty's documentation didn't match the code.David Faure2014-09-051-1/+1
| | | | | | | | | The code says bool QRect::isValid() const { return x1 <= x2 && y1 <= y2; } so the documentation should say <= as well, rather than <. Change-Id: If52005879d2a758b5d1d64b552e6cd96341fae76 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Fix endianness part of QSysInfo::buildAbi() stringAlex Trotsenko2014-09-041-3/+3
| | | | | | | | | | | Both Q_LITTLE_ENDIAN and Q_BIG_ENDIAN macros are always defined on all architectures. So, byte order detection results in "little_endian" value for big endian systems. Test the system endianness in a right way, according to Q_BYTE_ORDER macro documentation. Change-Id: I5523f90567e78d679a3ff2902a8f5377ed39ceb1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Make QElapsedTimer default to invalid (and now non-POD).Robin Burchell2014-09-033-2/+22
| | | | | | | | | | | The practical uses of a POD QElapsedTimer are not really that clear, and the number of misuses of this API are quite high. Default the state to invalid to prevent against mistakes. [ChangeLog][QtCore][QElapsedTimer] Is no longer a POD. Change-Id: I267292acf2bfca7404e3e449dd04410441d7ce26 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix headercheck failure introduced by 67c83f329e7fb6fbf5d8e402f42Thiago Macieira2014-08-301-0/+4
| | | | | | | | | That commit exposed part of qfunctions_winrt.h for non-WinRT use (Windows 8) without wrapping with Q_OS_WIN. That meant the headercheck pass failed to compile when outside of Windows. Change-Id: Ie731cce21e5102f5e5879b147b7738a7d0a91ecd Reviewed-by: Andrew Knight <andrew.knight@digia.com>
* Doc: Fixed typo "lamda".Jerome Pasion2014-08-301-1/+1
| | | | | | Change-Id: I17a3b324927407b64cabc39a0b90f0ab2e0676be Reviewed-by: Martin Smith <martin.smith@digia.com> Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
* Fix nativeRead() for maxlen greater than UINT_MAXLars Knoll2014-08-291-4/+4
| | | | | | | | | | Don't truncate the maxlen to a DWORD. Instead read all data incrementally up t maxlen. Task-number: QTBUG-27796 Change-Id: I21c34d11046f1106244dcd77420cc472e7240e68 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: properties, add missing parenthesisSamuel Gaist2014-08-281-1/+1
| | | | | Change-Id: I97b5a96b29416ca7af145edb1a6a96595c9524da Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* Mark QByteArrayList as metatype built-in type.Jędrzej Nowacki2014-08-285-3/+25
| | | | | | | As a side effects it also adds core templates types to the tests Change-Id: I0e3338e0bffdf21982aa83d404c83288e54411f4 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Micro-optimize QVector::count()Marc Mutz2014-08-281-1/+3
| | | | | | | | | | | ...by instantiating std::count() not with QVector::const_iterator, which is a class, but with const T*, thus increasing the chance that the instantiation can be shared with other instantiations in the executable. It might also enable STL implementations to choose a hand-optimized version of the algorithm for C++ builtin types. Change-Id: I93df4e58f76838d98b565f229c19e317774b7b4c Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QList: check d for equality before d->size for inequalityMarc Mutz2014-08-281-2/+2
| | | | | | | Same change as was already applied to QVector::operator==(). Change-Id: Ic2e140a52ee95f2e215668077951de0b4450d194 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QVector: check d for equality before d->size for inequalityMarc Mutz2014-08-281-2/+2
| | | | | | | | | | | | | | | | Assuming the CPU has already loaded 'this', the value of 'd' is just an indirect load away. The value of d->size, however, is two indirect loads away, one of which is the load of 'd'. So it makes more sense to check for d-pointer equality first, as that can proceed in parallel with the fetch for d->size, which the CPU may speculatively trigger. In addition, at least GCC in release mode after this change doesn't set up the stack frame if the d-pointer check succeeds. Change-Id: I61f9b245070dd1742fca6ccb8d4936a0b1aa7c07 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Doc: language corrections QStorageInfo classNico Vertriest2014-08-271-55/+55
| | | | | | | Task-number: QTBUG-40984 Change-Id: Idf8c6ecedb25f6c55b3fe8db69e6de9d9f2eaf74 Reviewed-by: Topi Reiniö <topi.reinio@digia.com> Reviewed-by: Martin Smith <martin.smith@digia.com>
* Add operator-> to QJson iteratorsAllan Sandfeld Jensen2014-08-255-7/+67
| | | | | | | | | | | | | The iterators for QJsonArray and QJsonObject are currently lacking an operator-> definition. Unfortunately it is not possible to do in clean way without redefining either the iterators or QJsonValueRef class. This patch instead adds two fake pointer classes that are only used to handle the operator-> return value. Task-number: QTBUG-29573 Change-Id: Ief785a6afbbedc9e89cf3b6f3958c2c755997a66 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Use std::vector range ctor in QVector::toStdVector()Marc Mutz2014-08-241-1/+1
| | | | | | | | | | | | | | | | | There are three reasons to do so: 1. This could be more efficient, depending on the STL implementation. 2. By using QTypedArrayData iterators (T*) instead of QVector ones, we actually invoke the non-templated range ctor of std::vector, at least in the common case that std::vector<T>::const_iterator is also const T*. 3. The change turns a former NRVO return into a RVO one, potentially allowing more compilers to perform the copy elision. Change-Id: I70b35aaeae70ba06a971a36b8b1b1da997e8094f Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Incorporate fixes from QQmlAnimationTimer into QAnimationTimer.Michael Brasser2014-08-221-16/+13
| | | | | | | | | | | | | | Incorporates animation timer fixes in: * 7da483bfbefcaabb1dbbf3e2f1d5b5f7aadc3b06 * b02eeeee586abe343b8866385c1327ac009b3ef0 * 59d5c5cf555a51cd7559cea197a198ef3a792614 from qtdeclarative. With these changes, we no longer need to call updateAnimationTimers in QUnifiedTimer::startTimers. Change-Id: Ic24501cfdc3cb572bd891d84f684f11c3bef1b50 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Tighten Q_OS_WINRT ifdefs in qfunctions_winrt.hAndrew Knight2014-08-211-3/+4
| | | | | | | | This allows the convenience macros to be used on desktop Windows 8 when interacting with Windows Runtime types. Change-Id: I09c6b18a6ee9711371ef7dc23fb1d3354198db1c Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
* QTextCodec::codecForHtml looks at the first 1024 bytesShawn Rutledge2014-08-211-1/+1
| | | | | | | | The HTML 5 spec requires it, instead of only looking at the first 512. Task-number: QTBUG-40383 Change-Id: Ie10cf8c745ed1a3402914e126a02bc43d5035fff Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
* Debug logging support for QNativeGestureEventShawn Rutledge2014-08-212-0/+2
| | | | | | | | | | The most useful information is what kind of gesture the event represents, but it was missing until now. Also added a line of documentation about the NativeGesture event type. Change-Id: I1ba3c951dcc5751e937d762d9b647ab0bf8d93b8 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
* Rework how animationsystem interoperate with an animation driver.Gunnar Sletta2014-08-203-38/+95
| | | | | | | | | | | | | | | | | We need to keep track of both wall time which are used for pauses and actual animation driver time which is used for actual animations. When switching between these, we need to also maintain the temporal drift potentially introduced by the driver and also the time that has passed in wall-time from when a pause has started until an action animation takes over. This change introduces a well defined elapsed() function in QUnifiedTimer which will return the right value based on which mode we are currently in. It also introduces start/stopAnimationDriver functions which helps us maintain the temporal drift and pause-delta. Change-Id: I5b5100432a6db444a413d1bca4f2d5f800e8cf3e Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Restore foreach macro for GCC 4.3 and 4.4 in C++11 modeThiago Macieira2014-08-191-1/+6
| | | | | | | | | | | | | In C++98, typename can only be used for argument-dependent types and that's not the case here. This was tracked as language defect 382 and was fixed in the final C++11 standard, but the fix didn't make it to GCC 4.3 and 4.4 (which do have decltype). qthreadpool.cpp:274: error: using 'typename' outside of template Task-number: QTBUG-40783 Change-Id: I0eb702b33d2e8c95284f52841b0021dbfc743874 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* WinRT: Do not forget the path specificationMaurice Kalinowski2014-08-191-1/+1
| | | | | | | | The path value can be used to access any container or subcontainer in the settings, even if it is not created by Qt. Change-Id: I431d8a8b129dafb4ec85227421dc37ec76c18ecf Reviewed-by: Andrew Knight <andrew.knight@digia.com>
* Merge "Merge remote-tracking branch 'origin/5.3' into 5.4" into refs/staging/5.4Giuseppe D'Angelo2014-08-194-12/+100
|\
| * Merge remote-tracking branch 'origin/5.3' into 5.4Frederik Gladhorn2014-08-124-12/+100
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Manually included changes from 3a347a4e70e5a10ee92dd2578316c926a399e894 in src/opengl/qgl.cpp. Conflicts: src/opengl/qgl_qpa.cpp src/plugins/platforms/android/androidjnimain.cpp Change-Id: Ic26b58ee587d4884c9d0fba45c5a94b5a45ee929
| | * Fix disconnect()ing from signals declared in a base classOlivier Goffart2014-08-111-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix disconnection from pointer to member signal that belongs to the base class, but whose type is a pointer to a member of the derived class. Commit 9cc106d9d7d951fcf30f4b0f8606afa6b50892ec fixed connect, so apply the same fix in disconnect [ChangeLog][QtCore][QObject] Fixed disconnecting from pointer to member signal that belongs in the base class but whose type is explicitly given as a pointer to a member in the derived class Task-number: QTBUG-40638 Change-Id: Ia546fc8f36e1ea0dd0645bdd820aea47f43677ac Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * Document missing QLatin1String methodsThiago Macieira2014-08-071-0/+88
| | | | | | | | | | | | | | | | | | | | | Most of them were added before 5.0, but it's ok to just list as 5.0. Change-Id: I6e83a210a0165659f710d47ed595e9e89d5dbac9 Reviewed-by: Martin Smith <martin.smith@digia.com>
| | * Android: Fix recursion bug in callStaticMethod()Christian Strømme2014-08-061-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | calling callStaticMethod() with template type jlong, jdouble or jboolean would cause the call to loop indefinitely. Change-Id: I99caa576e761fdef623ece04e0779e4cf2535592 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
| | * Undo: Fix state entry bug for parallel state groupsPeter Kümmel2014-08-061-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit reverts c4cef6fae9f2a55f21fc9517855dfcf659c89081. The above fix for QTBUG-25958 (cloned in QTBUG-40219) is not complete and introduces the regression QTBUG-30049. Task-number: QTBUG-30049, QTBUG-25958, QTBUG-40219 Change-Id: I3c4b774dce06c13cb4e089f8413a7747cedfd212 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Compile on Android without statfs.f_flagsAllan Sandfeld Jensen2014-08-161-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not all Android versions appear to have f_flags in statfs, but we can check for the presence using a feature define. Change-Id: Ib2acf6063d6211b871f462ee491459ac8675aa37 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QMimeData: replace an inefficient QList with a QVectorMarc Mutz2014-08-151-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QMimeDataStruct is larger than a pointer, so holding it in a QList is horribly inefficient. Fix by marking as movable and holding in a QVector instead. Change-Id: If285dd31546066db0b240ea0d4d30668f50b5f2c Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | | Remove redundant code from QMetaProperty.Jędrzej Nowacki2014-08-141-9/+1
| | | | | | | | | | | | | | | | | | | | | | | | The code contained old Qt4 logic. There is no point in checking values of QVariant as they are in sync with QMetaType. Change-Id: I58ace52f69939488e6ea7e7bab98df38419420a8 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | | winrt: Fix deadlock in thread dispatcher accessAndrew Knight2014-08-131-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An event dispatcher fetching the core dispatcher can deadlock when looking up the window. Simplify this by only looking up the view, and treating the event dispatcher as one which will never obtain the core dispatcher. This fixes a deadlock which occurs when starting network delegates. Change-Id: Ic27f4ab6f168eb95f3de70d78d64f035c331a7f5 Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
* | | Add the QStorageInfo classIvan Komissarov2014-08-139-7/+1646
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allows to retrieve information about mounted volumes such as label, total/available size, filesystem type and so on. Possible use cases are: - allows to do checks about filesystem before performing actual operation (such as available/maximum volume size) - allows to retrive information about volume that can be shown in file dialogs - allows to retrieve volume for specific path and check if two or more paths belong to the same volume or not [ChangeLog][QtCore] Added QStorageInfo class to retrive information about mounted volumes and drives Change-Id: Ibf9c2e6b53ef39c5605894a4422acdbbca4030c4 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>