summaryrefslogtreecommitdiffstats
path: root/src/corelib
Commit message (Collapse)AuthorAgeFilesLines
* Windows: Reintroduce copy of argv.Friedemann Kleint2015-02-102-7/+17
| | | | | | | | | | | | | | Since argc/argv is modified by QCoreApplication-derived classes, a copy of the original arguments is needed for comparison. This fixes a crash in Qt Quick 2 tests (which use the -qmljsdebugger=<port> argument) introduced by dff18b8e80609da91bf9e9134967dcf0d23eca9e . Task-number: QTBUG-30330 Change-Id: Ic145ac923e0a7c504ab16602c8686268e4fd9700 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Merge "Merge remote-tracking branch 'origin/5.4' into dev" into refs/staging/devLaszlo Agocs2015-02-1016-46/+61
|\
| * Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2015-02-1016-46/+61
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/3rdparty/harfbuzz-ng/harfbuzz-ng.pro src/gui/image/qimage_conversions.cpp src/gui/opengl/qopenglextensions_p.h src/gui/text/qtextengine.cpp src/network/ssl/qsslsocket_openssl.cpp src/plugins/platforms/eglfs/qeglfshooks_stub.cpp src/plugins/platforms/eglfs/qeglfsscreen.cpp src/plugins/platforms/eglfs/qeglfswindow.cpp src/plugins/platforms/windows/qwindowsfontdatabase.cpp src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp src/plugins/platforms/windows/qwindowsnativeinterface.cpp src/plugins/platforms/windows/qwindowsscreen.cpp src/plugins/platforms/windows/qwindowswindow.cpp src/plugins/platforms/windows/qwindowswindow.h src/plugins/platforms/xcb/qxcbdrag.h src/widgets/itemviews/qabstractitemview.cpp src/widgets/kernel/qwidget.cpp src/widgets/util/qsystemtrayicon_p.h tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp Thanks to Friedemann Kleint for resolving the qwindowsfontdatabase.cpp conflicts. Change-Id: I937232c30523d5121c195d947d92aec6f129b03e
| | * Fix QLineF Detailed DescriptionSamuel Gaist2015-02-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Currently angle() is used in place of angleTo() to describe the difference with intersect. This patch fixes that. Task-number: QTBUG-44309 Change-Id: Idfc521932247f76fe15fd980ff8e87e52feec1f1 Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
| | * QProcess/Win: fix sporadic crashJoerg Bornemann2015-02-052-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QProcessPrivate::_q_processDied() was potentially called twice if there was a slot connected to readyRead() that called processEvents(), because the processFinishedNotifier was still enabled when readyRead() was emitted. This led to a null pointer access in findExitCode. Change-Id: I4b796b81f050dc46bb9469602984accaa6ebfa28 Task-number: QTBUG-33731 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
| | * QPair: work around std::move not being constexpr in C++11Marc Mutz2015-02-041-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use a static_cast instead. This is not 100% equivalent, since it's missing remove_reference<>, which we don't want to depend on and whose emulation in qtypetraits.h is missing rvalue support. That will be fixed in dev. Change-Id: Ib03754c81c904932943d3a5415b54ff107f4719d Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | * CMake: Fix QObject::connect failing on ARMAlbert Astals Cid2015-02-031-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | We need PIE, doesn't matter if reduce_relocations is used or not Change-Id: I9a359b9d4443a6059980cd4c48058132ec4267fe Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | * Fix leaks in OS X bundle detectionDyami Caliri2015-02-021-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were several leaked CFStringRefs in the new OS X bundle detection code that is part of QFileSystemEngine. Change-Id: Id0817e9692da411c7eb8287b9bf71b99ae28f960 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Samuel Gaist <samuel.gaist@edeltech.ch> Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
| | * Merge remote-tracking branch 'origin/5.4.1' into 5.4Frederik Gladhorn2015-01-297-33/+49
| | |\ | | | | | | | | | | | | Change-Id: Idadb5639da6e55e7ac8cc30eedf76d147d8d5d23
| | | * Fix QXmlStreamReader parsing of files containing NULsThiago Macieira2015-01-242-25/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to a flaw in the internal API, QXmlStreamReader's internal buffering would mistake a NUL byte in the input stream for EOF during parsing, but wouldn't set atEnd == true because it hadn't yet processed all bytes. This resulted in an infinite loop in QXmlStreamReaderPrivate::parse. So, instead of returning zero (false) to indicate EOF, return -1 (but in unsigned form, ~0, to avoid ICC warnings of change of sign). In turn, this required enlarging a few variables to avoid ~0U becoming 0xffff, which is a valid QChar (could happen if the input is a QString, not a QIODevice). Task-number: QTBUG-43513 Change-Id: If5badcfd3e4176b79517da1fd108e0abb93a3fd1 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
| | | * QTemporaryDir: Remove directories on failureEskil Abrahamsen Blomfeldt2015-01-221-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When creating a temporary directory but failing to set its permissions, we need to remove the directory we created to avoid leaving 256 empty, unused directories in the destination folder. This happens on Android if you try creating a QTemporaryDir in the download path on the sdcard. Task-number: QTBUG-43352 Change-Id: Ic88fb7572f1abd65e5c7d8882b59c95f4b22ed72 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | | * QSortFilterProxyModel: fix a regressionGiuseppe D'Angelo2015-01-221-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bec1854cc023fb705319c582a636d5f484adafcc introduced a regression: when sorting a tree model, children items would not follow the sorted parents any more (they wouldn't be remapped correctly), resulting in crashes. So, the fix needs more reasoning; let's revert the fix, but leave the original test around for any subsequent attempt, and introduce a new test which looks for the right behavior when sorting trees. This commit partially reverts bec1854cc023fb705319c582a636d5f484adafcc. Task-number: QTBUG-43827 Change-Id: Ic83ac53aef639f870f6c36a8b4b2992f5b485b13 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Volker Krause <volker.krause@kdab.com> (cherry-picked from qtbase/e9ad46ed412987e3e46c5a641e5f30408b97ac90)
| | | * Fix memory leak in Qurl::toCFURL()Morten Johan Sørvig2015-01-191-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Release the temp CFString. Change-Id: I8a5b8f18a42a4a9b2c6671f0f5b32a3f0b14238d Task-number: QTBUG-43710 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | | * Merge 5.4 into 5.4.1Oswald Buddenhagen2015-01-167-12/+32
| | | |\ | | | | | | | | | | | | | | | Change-Id: I78d848c0bb396584a205a8066d253f2bcac8da56
| | | * | Bump copyright year to 2015Kai Koehne2015-01-152-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bump copyright year in tool output and user visible strings to 2015. Change-Id: I9b29907fe3f555e78005cb296a49d92f601fb7ec Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Martin Smith <martin.smith@digia.com>
| | * | | Fix typo in the docsKonstantin Ritt2015-01-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QEvent::ChildRemoved appeared twice. Change-Id: Ibd992f18d073a3ba47ab515368d2050d29e8c0e6 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
| | * | | Fix invalid memory access when a slot deletes the sender.Volker Krause2015-01-221-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Only happens with active signal spy callbacks. The Connection object can be deleted when returning from the slot here, so accessing it for the method index for the signal end callback will access invalid memory. Change-Id: I44643a171863c35a94e7a5ffa096fcaac5abd509 Reviewed-by: Milian Wolff <milian.wolff@kdab.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | * | | Doc: Improve description of QTextStream::readLine()Alexander Volkov2015-01-211-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't recommend a common value for maxlen, because we don't really know it. Soften a statement about not applying QString::trimmed() to the result because it may contain surrounding spaces. Change-Id: Ie90db6f033cfcc0dff0ef6796ba115028bcaaa77 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
| | * | | Fix QSharedPointer::create and QEnableSharedFromThisThiago Macieira2015-01-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We forgot to initialize the tracker if create() was used. Task-number: QTBUG-43696 Change-Id: Ic5d393bfd36e48a193fcffff13b740931ff2204b Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | | | QtCore: Use QDebugStateSaver in (almost) all QDebug operator<<Kai Koehne2015-02-0921-46/+75
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unify the behavior of the different operator<< by always using QDebugStateSaver (appending an optional space at exit), and making sure that the space(), nospace() setting isn't 'leaked'. Change-Id: I38e4f82fa6f7419d8b5edfc4dc37495af497e8ac Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | | | WinRT: fix QLibrary::isLibrary() due to incomplete #if statementJochen Seemann2015-02-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Q_OS_WINRT was missing in the Windows-condition. Condition was simplified through use of Q_OS_WIN. Change-Id: I1a49d2d9c413dc2156930b6915e1675abcdde36f Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* | | | QAbstractTableModel/QAbstractListModel: reimplement sibling()Marc Mutz2015-02-052-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This basically inlines the call to parent(), which unconditionally returns QModelIndex(). The change is binary compatible, because even though we newly override a previously non-overridden virtual method, it doesn't matter whether old code still calls the base class' method, as the new implementation is semantically equivalent, at least if subclasses don't inherit parent() (but why would they). [ChangeLog][QtCore][Important Behavior Changes] QAbstractTableModel and QAbstractListModel now reimplement sibling() to avoid calling parent() (which returns a constant). Subclasses of these models that override parent(), will likely also need to override sibling() now. Change-Id: I9e0cb5622a6d3826e40acaf0e0cd3fdea85cba2d Reviewed-by: David Faure <david.faure@kdab.com>
* | | | Add a qDebug operator overload to handle registered enumOlivier Goffart2015-02-052-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So if you stream enum type into qDebug, it will show the name of the enum value instead of the int Change-Id: Iec5e826623353560319890d3e7c4ab97d0645f4a Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* | | | Introduces QMetaEnum::fromTypeOlivier Goffart2015-02-052-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I1976c1844e52ef8d70a1bbe9945f3299428dbf87 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* | | | QMetatype: Register the QMetaObject of a Q_ENUM or Q_FLAGOlivier Goffart2015-02-052-2/+24
| | | | | | | | | | | | | | | | | | | | Change-Id: Id1343c3fb51d88a43d4d97e8859dbe2b0cfbea34 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* | | | introduce /dev variants of qmake propertiesOswald Buddenhagen2015-02-052-6/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | these reflect the on-target paths (unlike /raw, which are host paths, just without the -sysroot). this is necessary for anything deployment-related, starting with RPATH. Change-Id: I13d598995d0e4d6cb0dc1fc7938b8631cf3e3a95 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | | | write relative paths to qconfig.cpp as far as possibleOswald Buddenhagen2015-02-052-11/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this cuts down the bloat in the binaries and the binary patching requirements in the installer. as a side effect, the sysroot and makespecs are not binary patchable any more as well, which is ok, as the installer does not do it anyway. we now also warn if -[host]<foo>dir is not a subdir of -[host]prefix, as putting things outside the prefix is anti-thetical (the obvious exception being the (unix-only) -sysconfdir). Change-Id: I878f0e71a4dfcfd55b2f8b1cf3045b98b502569b Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | | | Windows: Allow for passing a modified argv to QCoreApplication.Friedemann Kleint2015-02-052-27/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Check by comparing __argc/__argv whether a modified argv was passed to QCoreApplication. If that is the case, build QCoreApplication::arguments() from that argv instead of using the command line. [ChangeLog][Important Behavior Changes][QCoreApplication] On Windows, QCoreApplication::arguments() now returns a list built from argv on Windows as well if a modified argv was passed to the class' constructor. Task-number: QTBUG-30330 Task-number: QTSOLBUG-184 Change-Id: I2498bb554130e7bfaeada3aebe786dfdd0eb534d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | | | Remove unnecessary math.h and limits.h includesAllan Sandfeld Jensen2015-02-041-2/+0
| | | | | | | | | | | | | | | | | | | | Change-Id: I28c898f869ed3f03b08ff55f2972a38667c755ad Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | | | Use Q_ENUM and Q_FLAG for types in QtCoreOlivier Goffart2015-02-049-12/+16
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I33590a9c4c6d87c5bbba1d201e32c6bf1bd3e00b Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | | Use Q_ENUM and Q_FLAG in the Qt namespaceOlivier Goffart2015-02-042-48/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | They need a special macro since they have a different metaobject Change-Id: I2fa50b4b2e45990fb01771378765b42f03139183 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | | Fix 1700 override warnings [-Winconsistent-missing-override]Sérgio Martins2015-02-031-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Classes should either use or not use override, otherwise it hurts code readability. Some inline keywords were removed because of an error with MSVC2010: error C2216: 'override' cannot be used with 'inline' Change-Id: I7276d5525a92281bd0d743beb11d0dc73441443b Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | | Allow exposing QItemSelectionModel to QMLGabriel de Dietrich2015-02-033-35/+144
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This requires being able to create a QItemSelectionModel without specifiying its model, and also setting the model later. Also, several classes, like QPersistentModelIndex, need to be declared as meta-type. Finally, and in order to introduce the 'model' property, we need to have a type compatible getter. Hence the new, non-const model() function. Where needed, meta-type declarations have been removed from auto-tests. [ChangeLog][QtCore][Item Models] QItemSelectionModel can now be created without a model and have one set later. Change-Id: If49bed061a5d1012331f335ca7f6e3959ecd3f1c Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com> Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* | | | QTextStream: remove a use of QString::sprintf()Marc Mutz2015-02-021-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of using QString::sprintf() (and converting the result back to QByteArray), simply do the conversion from uchar to hex digits ourselves, using QtMiscUtils. This function is a copy of a similar (but not identical) one in qprocess_unix.cpp, but it's not clear whether they can or should be merged (both are only conditionally compiled), so this patch does not attempt to do so. Change-Id: I0be87963f78a98e35a54c98c5fb444756c57b672 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | | | QTextStream: fix a warning with QTEXTSTREAM_DEBUG definedMarc Mutz2015-02-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The warning was: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘long unsigned int’ [-Wformat=] Change-Id: I37dc13ca864d408e02c69102ba5208f8bfe70980 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | | QProcess: fix warnings with QPROCESS_DEBUG definedMarc Mutz2015-02-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The warnings were: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘long int’ [-Wformat=] (2x) Change-Id: If8c2e8fab7388cb4aa7d6e7ceb5faee531e16006 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | | Call QDir::homePath() only when necessary in QSettings::initDefaultPaths()Maks Naumov2015-02-021-3/+2
| | | | | | | | | | | | | | | | | | | | Change-Id: I990520917ec65127ae554b5e872791cff78f0b56 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | | | fix relative path resolution inconsistency in qmake propertiesOswald Buddenhagen2015-02-021-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | suppose we queried QT_INSTALL_DOCS/get. if no [EffectivePaths] existed, we'd try [Paths]. if that didn't exist, either, we'd use the built-in, which is relative. so we'd query QT_INSTALL_PREFIX ... without the /get, which is technically wrong. this doesn't currently matter, as all groups have the same built-in defaults anyway, but it may (hint hint) matter later on. Change-Id: I5a3746e80ca1bfbf2f37db3604cc351bddeacd94 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | | | less preprocessor magic relating to qmake buildOswald Buddenhagen2015-02-021-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | it's not worth making things more complicated to remove the duplication of one real LOC. Change-Id: Iddbd0db7d0f81b80192b3980dbe2316b246a3b57 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | | | complete reversal of adding QLibraryInfo to the bootstrap libraryOswald Buddenhagen2015-02-022-30/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | amends 684028a64. Change-Id: I8dcc4b74c4c0328c07711cd7253ff19a74ea2fbf Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | | | Centralize use of __attribute__((noinline))Marc Mutz2015-01-293-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are currently only two users, but I have patches in the pipeline which mark some other function noinline, so proavtively centralize the ifdef'ery involved. Change-Id: I1f02351fdc903d4e026089e12b8a976ed6a8d603 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | | QString: optimize multiArg()Marc Mutz2015-01-291-18/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The function used a QMap<int,int> to map the %n's to the index in the args array. By way of construction, the key was sorted in ascending order while the values, initially all -1, were later reassigned to be 0...map.size()-1, ie. std::iota(). The only information this data structure stores is therefore the sorted %n's. For that, a sorted vector is a vastly superior data structure. Go one step further and use QVarLengthArray to avoid allocating any memory for the common case of just a few placeholders. As an artifact of the underlying refactoring, the management of that data structure has been moved to a separate class, ArgMapper. Runtime for the following test from tst_qstring: QString str("%1 %2 %3 %4 %5 %6 %7 %8 %9 foo %10 %11 bar"); // not timed str = str.arg("one", "2", "3", "4", "5", "6", "7", "8", "9"); str = str.arg("ahoy", "there"); went down from 2.2us to 1.5us. Change-Id: Ic552615fbac646b78ba05eb4e3215e63d202fd94 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | | QString: reduce template bloatMarc Mutz2015-01-291-11/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reduce the number of (non-regex) splitString instantiations from six to two by: - Passing separators by (const QChar*, int) and using qFindString() instead of indexOf() - Passing QString as QStringRef when the output is QVector<QStringRef>. Doing so also allows to drop the MidMethod template parameter since QString::midRef() is no longer being used. (Somewhat disappointing) effects on Linux GCC 4.9 stripped release builds: text -500B data +-0B relocs +-0 Change-Id: Id89e2814d5f7da5170181d863167517943c2e0cd Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | | qlogging: Fix build on FreeBSD after 63cd16d.Raphael Kubo da Costa2015-01-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pthread_getthreadid_np(3) is defined in pthread_np.h, not pthread.h. Additionally, it was added during the FreeBSD 9 time frame, so add a version check to use it only when we know it is present. Change-Id: I4d716d9bfb189d10128b6d458a47045e130b51e8 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | | corelib: Fix a faulty 5.4->dev merge.Raphael Kubo da Costa2015-01-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit b6191b16 ("Merge remote-tracking branch 'origin/5.4' into dev") merged commit 350c60b ("Link against QMAKE_LIBS_EXECINFO when using backtrace(3)") into the dev branch, but the conflict resolution left out the actual line that changed LIBS_PRIVATE. Change-Id: I6e716ed375abdc534a1f20e412ce7c56ee85d6c0 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* | | | Remove support for QT_QLOCALE_USES_FCVT.Erik Verbruggen2015-01-282-78/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We expect floating-point math to be IEEE754 compliant. Change-Id: I2b257177f2ef5fce38ac4d8fd76f746dc7b9fc15 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | | | Make Qt for Android compile when using errors for warningsAlex Blasche2015-01-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In file included from kernel/qsystemsemaphore_android.cpp:35:0: kernel/qsystemsemaphore_p.h: In constructor 'QSystemSemaphorePrivate::QSystemSemaphorePrivate()': kernel/qsystemsemaphore_p.h:104:10: error: 'QSystemSemaphorePrivate::createdSemaphore' will be initialized after [-Werror=reorder] bool createdSemaphore; ^ kernel/qsystemsemaphore_p.h:101:11: error: 'key_t QSystemSemaphorePrivate::unix_key' [-Werror=reorder] key_t unix_key; ^ kernel/qsystemsemaphore_android.cpp:43:1: error: when initialized here [-Werror=reorder] QSystemSemaphorePrivate::QSystemSemaphorePrivate() : ^ widgets/qdockwidget.cpp:208:6: error: unused parameter 'floating' [-Werror=unused-parameter] bool QDockWidgetLayout::nativeWindowDeco(bool floating) const ^ cc1plus: all warnings being treated as errors Change-Id: I69af3ba3883b4311477f0e4e991b5cc0900fb71b Reviewed-by: BogDan Vatra <bogdan@kde.org>
* | | | Itemviews: add ItemIsUserTristate flagDavid Faure2015-01-252-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ItemIsTristate is now again purely for enabling the automatic management of the check state of QTreeWidgetItems, while ItemIsUserTristate is separate from that and lets the user select the three states manually. This restores the original behavior of ItemIsTristate for QTreeWidgetItems, which got broken by letting the user cycle through the states too. [ChangeLog][QtWidgets][QTreeWidget] Restored Qt 5.1 behavior of QTreeWidgetItems with ItemIsTristate to enable automatic management of the check state. User-editable tristate checkboxes are now enabled by setting the new flag ItemIsUserTristate. Task-number: QTBUG-40060 Change-Id: I341f5e983804d3b4f27982520bb6647f3014cccc Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
* | | | Add conversion functions for C++11 u16string and u32stringAllan Sandfeld Jensen2015-01-242-4/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The patch adds convenience functions for working on C++11's new char width specific unicode strings u16string and u32string. [ChangeLog][QtCore][QString] Added methods for convenient conversion to and from std::u16string and std::u32string. Change-Id: I67c082e4755c592d61daaaaa70c8867ef0b23dcb Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | | src/corelib/tools/tools.pri: add missing qtools_p.hMarc Mutz2015-01-241-0/+1
| | | | | | | | | | | | | | | | | | | | Change-Id: If7af29fdaefddc1e3f08148610ba2720f5927b67 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>