summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Don't send posted events from QWindowSystemInterface::sendWindowSystemEventsTor Arne Vestbø2013-09-169-30/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The responsibility of sendWindowSystemEvents() is to process events from the window system. Historially that logic was part of the QPA/QWS event dispatcher, which naturally also sent posted events. Through refactoring, the code at some point ended up in in the QWindowSystemInterface class, still with the posting of events in place. This resulted in QPA event dispatchers adopting a pattern of just calling sendWindowSystemEvents(), as that would cover both posted and window system events. Other event dispatchers would call sendWindowSystemEvents(), and then use a base-class implementation from QtCore for processing events, resulting in two calls to QCoreApplication::sendPostedEvents() per iteration of processEvents(). This breaks the contract that processEvents will only process posted events that has been queued up until then. We fix this entanglement by removing the sendPostedEvents() call from QWindowSystemInterface::sendWindowSystemEvents() and move it to the respective event dispatchers. For some EDs it means an explicit call to sendPostedEvents, while others were already doing sendPostedEvents though a separate source (GLib), or using a base-class (UNIX/BB), and did not need an extra call. We still keep the ordering of the original sendWindowSystemEvents() function of first sending posted events, and then processing any window system events. Task-number: QTBUG-33485 Change-Id: I8b069e76cea1f37875e72a034c11d09bf3fe166a Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* remove unnecessary beginPaint and endPaint overridesShawn Rutledge2013-09-1614-50/+2
| | | | | | | | | | | | | QPlatformBackingStore::endPaint does not take a QRegion parameter. 6ce6b8a378b0d97ba950240ffb048a4b7e485235 set the API, but the platform implementations were not all synced up since then. There was anyway no point in overriding beginPaint and endPaint on platforms which don't need to do anything there. This fixes clang warnings of the form QXcbBackingStore::endPaint hides overloaded virtual function Change-Id: Id6cd0fc2c831a34576ac2c73eeb0d5741d26e622 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* WinRT: Disable PCRE JITAndrew Knight2013-09-161-0/+1
| | | | | | | | | That is what we do on on other "limited" platforms. Change-Id: I608880698d60ab10ecbb2f3ce12ff6c5eaab7eed Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com> Reviewed-by: Andrew Knight <andrew.knight@digia.com> Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
* Simplify QFileSystemModel::remove by using QDir::removeRecursivelyDavid Faure2013-09-162-28/+4
| | | | | | | | This also fixes it in case of hidden or system files, which were missing from the filter (found by Denis Kovalskiy). Change-Id: Ic12de12ec51c20de52d040514e90be5e783add43 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Don't depend on QtQuick plugin in QtWidgetsEskil Abrahamsen Blomfeldt2013-09-161-2/+2
| | | | | | | | | | The accessible plugins directory contains a QtQuick plugin as well as a widgets plugin. We need to specify the correct one to avoid all widgets applications implicitly depending on QtQuick on Android. Change-Id: I72b2ee4fcd2d7914fc2ed7996f504ce2df79842d Reviewed-by: Christian Stromme <christian.stromme@digia.com>
* Implement windowsErrorString for WinRTOliver Wolff2013-09-161-0/+12
| | | | | | | | | FORMAT_MESSAGE_ALLOCATE_BUFFER isn't available for WinRT Change-Id: Ib9cf2a11a4e84f3ff010665bd53b4ffb0d0bfcce Reviewed-by: Andrew Knight <andrew.knight@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* qelapsedtimer for WinRTOliver Wolff2013-09-151-1/+7
| | | | | Change-Id: Ic31fa667bdc746776d8e29564ea8a1ba6e7384f3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix QTextEngine build on MSVC2008 debug mode.Nicolás Alvarez2013-09-151-0/+1
| | | | | | | | | | | This was broken in 7ac6ce21 which removed some unused functions; but MSVC2008 in debug mode requires this particular operator overload. I'm re-adding it in an appropriate #ifdef so it doesn't cause "unused" warnings in other platforms/compilers. Task-number: QTBUG-33473 Change-Id: I6dfba0fa5f835e848e8a1e4213efb030fb5def3d Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Disable sqlite for Windows Phone 8 buildsOliver Wolff2013-09-151-0/+2
| | | | | | | | | | | sqlite cannot be supported as Windows phone is missing the needed memory mapping functionality. Change-Id: I20e89292b9c7802c7402e8095854b72a9f21e614 Reviewed-by: Andrew Knight <andrew.knight@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
* qmake: added file deployment support for winrt and winphone targetsKamil Trzcinski2013-09-155-60/+123
| | | | | | | | | | | | | The user needs to specify the DEPLOYMENT variable. The syntax is the same as previously used for DEPLOYMENT. For more info please refer to the qmake documentation. The change adds a new itemgroup, "Deployment Files". All files in this itemgroup are marked as DeploymentContent and are then packaged with the application either as XAP or the WinRT specific file format. Change-Id: Icf85887287c1c97eb782704340eaa3f8dde6719e Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* qmake: added support for WindowsMetadataFileKamil Trzcinski2013-09-153-0/+19
| | | | | | | | | In order to be able to use the linker's /WINMD and /WINMDFILE options Change-Id: I2673e20aa073c6b807e8c9f191fd408c7976efc4 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* qmake: added CompileAsWinRT switch to the VCCLCompilerTool (the cl /ZW option)Kamil Trzcinski2013-09-153-0/+10
| | | | | | Change-Id: I2a67779bcb38af85a2c43d3e9a15aa3ba45b4788 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Use correct toolset version for winphone buildsOliver Wolff2013-09-152-4/+5
| | | | | | Change-Id: I9ecd9f632d0201e060de5cce4782912efdc6bd32 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* qmake: enable default reference for all winphone targetsKamil Trzcinski2013-09-151-0/+10
| | | | | | | | | The change adds a new ItemGroup with a single library reference: platform.winmd. Change-Id: I0c7f4c46654b520afb79b6c6f49b5f2d1af400d3 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* qmake: added VCPROJ_ARCH variable.Kamil Trzcinski2013-09-151-4/+13
| | | | | | | | | | | | It's a generic way to configure the Visual Studio Solution architecture. It's added to support different project architectures, ARM specifically. It may be a good idea to replace the Win32 and x64 with VCPROJ_ARCH=Win32 and VCPROJ_ARCH=x64 defined in corresponding qmakespecs. Change-Id: I9b23f7393bf248a629c425187d6dd8859092c45c Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* qmake: added WinRT and WinPhone configuration switchKamil Trzcinski2013-09-154-2/+29
| | | | | | | | | qmakespec for either WinRT or WinPhone have to specify QMAKE_PLATFORM with winrt and/or winphone. Change-Id: I87e0063881e6edd65de14adb006949247ce49904 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Fixed sqlite build for WinRTOliver Wolff2013-09-151-0/+1
| | | | | Change-Id: Idf5bfa8b55e8d7db46207e55de1e9176def503a6 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Create clean makefiles for winrt buildsAndrew Knight2013-09-151-0/+93
| | | | | Change-Id: I33b74b98e04c1a9ca15ae07fad88f88dd4ce0669 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Revert "Reimplement qBinaryFind in terms of std::lower_bound"Giuseppe D'Angelo2013-09-141-3/+2
| | | | | | | | | | | | | | After a bit of discussion, we should actually deprecate qBinaryFind too. This puts the old code back (to avoid behavior changes / source breaks). This reverts commit 23d7f6ee5dea3dd9f47f4ab538b25dc0ffe3df92. Task-number: QTBUG-33473 Change-Id: I7f7d25171e14061e51543c501c30a7b6b184a8fd Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Use Q_STATIC_ASSERT to report error about missing Q_OBJECTOlivier Goffart2013-09-146-13/+38
| | | | | | | | | | Q_STATIC_ASSERT gives better error with C++11 enabled. Aslo the qt_check_for_QOBJECT_macro had warning on some compiler since it used null reference Change-Id: Ic6115da800064b00c50a5762f0b79f5f656bf750 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Do 64-bit loops in QBitArray::count(bool)Thiago Macieira2013-09-141-1/+6
| | | | | | | | | | | On 64-bit platforms, with unaligned loads, this is defintely an improvement since we can run fewer instructions. On 32-bit platforms with unaligned loads, we'll do the exact same number of loads. On platforms without unaligned loads, it's no worse. Change-Id: Idd5dd5213975d77bbc3adf486adbf6f8ef071341 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Let the compiler do the unaligned loads in QBitArray::count(bool)Thiago Macieira2013-09-141-2/+21
| | | | | | | | | | | For platforms where the CPU can do unaligned loads on its own, like x86, the compiler will generate actual loads. On other CPUs, it will do the byte-by-byte load like we were doing. The compiler cannot generate worse code than our hand-rolled load, so this change can only improve performance. Change-Id: I32a89e64aa64d8af504be6c5a10b04d7573cdb98 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QDateTime - Store Qt::TimeSpec, remove Daylight StatusJohn Layt2013-09-142-102/+116
| | | | | | | | | | | | | | Change storing the spec from QDateTimePrivate::Spec to Qt::TimeSpec. Remove the storage and use of the Daylight Status as it is almost never set or used, and would be inaccurate if the tz were to change. It will be replaced later with proper daylight transition support. This simplifies the code and makes the msecs storage change easier. Change-Id: I78a70905025d7eddf1c2dc6001f6b490e5a2b3b8 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDateTime - Switch to using msecs based functionsJohn Layt2013-09-143-199/+42
| | | | | | | | | | | | | | | | | | | | | | A number of QDateTime functions directly use or modify the data stored in the private, but future changes to store msecs and status make this maintenance more complicated. Where possible simplify this code to use the standard msecs functions, standard constructors, or public api instead. This greatly simplifies the functions and the following msecs storage code changes. This is an intermim step towards storing the time in msecs. Some functions will be slower as a result of this change, optimization will take place after all the msecs changes are completed. Note this also removes a test that used valid QDates outside the range of msecs, this change in behavior will be documented in the final mscs change. Change-Id: I6ef710f24babc7024091010064082e9be0b5bbfe Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Mitch Curtis <mitch.curtis@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* winmain for winrtAndrew Knight2013-09-143-2/+157
| | | | | | | | | | | | | WinRT passes the executable and Appx server info to the CRT main, and supports several additional activation arguments as well. This handles the arguments passed to main as well as the case where a modern app is launched from an external application (e.g. Qt Creator). Task-number: QTBUG-30198 Change-Id: Ia843e98c7843d5705f5f6d1c809de0b6bcdb5d26 Done-with: Kamil Trzcinski Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
* Remove qSort usages from qtbase examplesGiuseppe D'Angelo2013-09-143-4/+10
| | | | | | | | QtAlgorithms is getting deprecated, see http://www.mail-archive.com/development@qt-project.org/msg01603.html Change-Id: I68dec0cb6efa1f164ba9f1671b55332ee4ad2e23 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QDateTime - Add test case for Daylight Time TransitionsJohn Layt2013-09-141-0/+377
| | | | | | | | | | Test the Daylight Time transitions. QDateTime does not correctly deal with many of these scenarios so those tests are marked as QEXPECTFAIL. These bugs will be progressively addressed in coming commits. Change-Id: I01eba9d6143a792f081542cb198e221efcf28e98 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
* build system support for WinRTOliver Wolff2013-09-1412-5/+408
| | | | | | | | | Done-With: Andrew Knight Done-With: Oswald Buddenhagen Change-Id: Ief4e921072a03229bb342480a85024a1fc09fa56 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Drop leftovers after 02651060b6ce5b16b06721378a239a6d2bd9f528Konstantin Ritt2013-09-141-6/+0
| | | | | Change-Id: I011359a47ed47308a7d25e306fbf45a83a3a5715 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Fix build with -WerrorKonstantin Ritt2013-09-141-1/+1
| | | | | | | | | The actual warning is: src/gui/text/qharfbuzzng.cpp:589:67: error: cast from ‘void*’ \ to ‘uint {aka unsigned int}’ loses precision [-fpermissive] Change-Id: I75cc7bad2147cd5e5e7c17bc22fe613280e86755 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* ICC 13.0 supports atomicsThiago Macieira2013-09-141-0/+1
| | | | | | | See http://software.intel.com/en-us/articles/c0x-features-supported-by-intel-c-compiler Change-Id: I45ba6aa640f82df4d06fd4412264892bfd58ffc3 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Update ICC warnings disabled by default.Thiago Macieira2013-09-141-1/+1
| | | | | | | Warnings 654 and 411 appear to have disappeared by ICC 14. Change-Id: Ic200f239a4a4377015d13b2f4ae85595ce864ace Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Base64: Implement the "base64url" encoding and the stripping of '='Thiago Macieira2013-09-145-14/+151
| | | | | | | | | The "base64url" encoding is defined in RFC 4648, which is the newest version of Base64. There are also a few situations where the ending '=' is not desired. Change-Id: I9bb9fa55817b57d125189e4e795d6fde97caea6d Reviewed-by: Richard J. Moore <rich@kde.org>
* Whitespace: re-indent the {to,from}Base64 functionsThiago Macieira2013-09-141-44/+52
| | | | | | | | The code must have been copied from somewhere, a sample implementation. Change-Id: Ieb6ac5d69824fe8a3f38710a22beb79ac986e182 Reviewed-by: Richard J. Moore <rich@kde.org>
* QStandardPaths: add a test that just dumps the valuesThiago Macieira2013-09-141-0/+36
| | | | | Change-Id: I79bcc1974988b3d712a40e89a3ec4aeb7be1fb5e Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
* Merge "Merge branch 'stable' into dev" into refs/staging/devSergio Ahumada2013-09-1446-8954/+8953
|\
| * Merge branch 'stable' into devSergio Ahumada2013-09-1346-8954/+8953
| |\ | | | | | | | | | | | | | | | | | | | | | Conflicts: src/concurrent/qtconcurrentmedian.h src/corelib/itemmodels/qabstractitemmodel.cpp Change-Id: Iac46a90bbb2958cef7670031a4b59c3becd8538a
| | * Fix highdpi CE_HeaderLabel pixmaps in fusion styleMorten Johan Sørvig2013-09-131-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make sure enough pixels is sourced by multiplying the layout rect size with the pixmaps devicePixelRatio. Task-number: QTBUG-31477 Change-Id: I742603c09a65a520587da3eef9479ef7f0c87022 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
| | * QNX: new signals for foreign windows creation/closingMyoungSeok Song2013-09-132-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | Implement the foreignWindowCreated and foreignWindow closed signals, emitted when foreign windows are created and closed, respectively. Change-Id: I72dd5380e6061f191eb8362fda5dd8fb8e9ed06b Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com> Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com> Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
| | * QNX: add nativeResourceForScreenMyoungSeok Song2013-09-122-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implemented nativeResourceForScreen api to return QObject* which can be used to connect foreignWindowCreated, foreignWindowClosed signal in QQnxScreen. Usecase is to connect signal in custom QML component as below QObject * obs = interface->nativeResourceForScreen("QObject*", screen); connect(obs, SIGNAL(foreignWindowCreated(void*)), d, SLOT(newForeignWindowCreated(void*))); Change-Id: I512c3b6d188a2e90ef7b8e89c413ca420a29dd9b Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com> Reviewed-by: Fabian Bumberger <fbumberger@rim.com> Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
| | * Windows style: Support underlined mnemonics from Qt Quick ControlsGabriel de Dietrich2013-09-121-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | We use the usual accessibility + private property combo pattern. Task-number: QTBUG-33030 Change-Id: I7fbb704c949ff2df163536534f6f46d2e226402d Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
| | * QtConcurrent: fix median calculationMarc Mutz2013-09-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The median, for arrays of odd size, is found in [size/2], not [size/2+1]. For arrays of even size, the code doesn't work anyway, so nothing to do there. Change-Id: Id23ff3fe9538c2d8ef8f88e23127cb92af08b444 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
| | * standarddialogs example: add detailed textShawn Rutledge2013-09-121-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Demonstrates that you can have mnemonic buttons which don't conflict with the Ctrl-A and Ctrl-C shortcuts. Task-number: QTBUG-6731 Change-Id: I41ce64e6f3bd0cf387af13c5c37894b721b5a3bb Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| | * QMessageBox: implemented shortcut for selectAllShawn Rutledge2013-09-121-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The context menu all along has indicated that Ctrl-A selects all the text, so now that is actually implemented. Task-number: QTBUG-6731 Change-Id: I82dac3aea530e5a3fcd59217c4c0118025061c7d Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| | * QMessageBox: shortcuts for selectAll, copy don't conflict with buttonsShawn Rutledge2013-09-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | You can hit a key with no modifier to select a dialog button that has the corresponding mnemonic, but it doesn't make sense to do that if the Control or Meta key is being held. Now you can hit Ctrl-A, Ctrl-C to select all the message detail text and copy it to the clipboard, even if the dialog has buttons with mnemonics like &Continue and Save &Again. But as before, Alt-C, plain C, Alt-A and plain A select the mnemonic buttons on the dialog. Change-Id: I40c052dbb7730bde444ac2de405724a3203d1472 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| | * Windows: Fix window opacity for non-translucent windows.Friedemann Kleint2013-09-122-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Use the UpdateLayeredWindow() functions only for windows with alpha. Task-number: QTBUG-33025 Change-Id: I64b0c28ee0997cd3d09dc76babe105ed474c6835 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
| | * Compilation fix for libjpeg release 9aavit2013-09-111-23/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the latest libjpeg version, the "boolean" type is changed so that true and false no longer can be used instead of TRUE and FALSE. Also, purge some ancient code remains meant to support a now defunct OS´s idea about the boolean type. Task-number: QTBUG-33166 Change-Id: Iebbdf300cfdc22775954de65f985358424ed2b49 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
| | * fix configure -commercialJoerg Bornemann2013-09-113-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 0aad3fc742a7aa15c21fe75e2b1b001f1f73468c broke "configure -commercial". The license check needs to know where Qt's source directory is. Change-Id: I5e53135b6b628eb5e413b2c2b3b8721dae02b503 Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com> Reviewed-by: Kalle Viironen <kalle.viironen@digia.com> Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
| | * Fix echoplugin docs: Q_INTERFACES expects a space-separated list.Mitch Curtis2013-09-111-1/+1
| | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-25580 Change-Id: I736d5743b7901bf207c31795c96acc02fd149277 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
| | * Fix the internal QDir sortingGiuseppe D'Angelo2013-09-101-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If two items are equal according to the current sorting criterion, the sorting predicate uses the address of the items to break the tie. The problem is that the items themselves are being moved during the sort; therefore, this will break the Strict Weak Ordering that std::sort requires. For instance, suppose to be sorting case-insensitively the following array: ("b", "a", "A") Simulating a swapped-based sorting can lead to: Array before Evaluated predicate Array after ("b", "a", "A") "a" < "A" (1) ("b", "a", "A") ^ ^ ("b", "a", "A") "b" < "A" (2) ("A", "a", "b") ^ ^ ("A", "a", "b") "A" < "a" (3) (XXXXXXXXXXXXX) ^ ^ (1) True, because of the array ordering (they're equal otherwise) (2) False: swap them (3) True, because of the array ordering (they're equal otherwise) (1) and (3) say that "a" < "A" and "A" < "a", SWO gets violated, leading to undefined behavior. This problem was causing QFileSystemModel autotests failures (cf. [1]) after switching to STL algorithms instead of using qSort. The array to be ordered in that case is ("a", "c", "C"), cf. tst_QFileSystemModel::caseSensitivity. (STL algorithms are much smarter than good ol' quicksort in qSort; if we're ordering on an array which fits in a cache line, they turn to the much faster (~1 robe) insertion sort. Violating SWO with a quick sort usually just gets to a non-sorted container; insertion sort is implementable in ways that rely on SWO, otherwise they will overflow the iterator; cf. Cormen/Leiserson/Rivest and the other literature on the topic.) This commit reverts commit fa5f3a44 (in Qt 4). [1] http://testresults.qt-project.org/ci/QtBase_dev_Integration/build_01749/linux-g++_shadow-build_Ubuntu_11.10_x86/log.txt.gz Change-Id: I5d8ac0d0907675c501717969abee2816b41eca18 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>