summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
Commit message (Collapse)AuthorAgeFilesLines
* Add Q_REQUIRED_RESULT in several placesSérgio Martins2015-05-042-2/+2
| | | | | | Change-Id: Icda3000f1d9f0d41612a50a816aa5de5e32028d4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QRegularExpression: add error strings from PCRE 8.37Giuseppe D'Angelo2015-05-011-1/+2
| | | | | | | Change-Id: Id62abd91c1584e4e63b95afec0520995125fe807 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Bring QSizeF/QPointF::isNull() documentation up to dateTopi Reinio2015-04-272-12/+4
| | | | | | | | | | | | Since Qt 5.0 (commit 09dd19df) sign is ignored when testing whether a QPointF or QSizeF is null. This updates the documentation accordingly. Change-Id: I3de1c748f3caa63b8bd8990006de5ba572eac83e Task-number: QTBUG-45669 Reviewed-by: Mitch Curtis <mitch.curtis@digia.com> Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
* QVector: Save one copy-CTOR call if we don't reallocSérgio Martins2015-04-241-5/+12
| | | | | Change-Id: Ie0f2eb922500bc3d76852939cf2c5d28d65a43ae Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* qdoc: Remove #ifdef Q_QDOC for uses of QPrivateSignalMartin Smith2015-04-201-20/+4
| | | | | | | | | | | | Signals marked with QPrivateSignal had the QPrivateSignal marker ifdefed out for qdoc. This is no longer necessary, so the #ifdefs are removed. Change-Id: Idb334ed311c6ed6883d7b7b5a3fcdede60c4a1f8 Task-number: QTBUG-45535 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* QScopedValueRollback: add two strategic qMove()sMarc Mutz2015-04-161-2/+2
| | | | | | | | Use moves instead of copies when the rhs is no longer needed afterwards. Change-Id: If053bfce03b886099688452ada74f6a6f36db5c2 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* QScopedValueRollback: use ctor-init-listMarc Mutz2015-04-161-4/+2
| | | | | | | Avoids calls to the default ctor for member 'oldValue'. Change-Id: Ieb9570b74e4a46b28c04625fac3ce267074c4a76 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* QList: make QListSpecialMethods dtors protectedMarc Mutz2015-04-163-1/+14
| | | | | | | | | QList publicly inherits from QListSpecialMethods. Thus, any specialisation of QListSpecialMethods should make their destructor protected, to avoid deletion through a pointer to QListSpecialMethods invoking UB. Change-Id: I7e317606f84826cc0faf1bfc05dee97da6eaf2eb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/5.4' into 5.5Liang Qi2015-04-153-10/+10
|\ | | | | | | Change-Id: I004854a25ebbf12b1fda88900162fe7878716c58
| * Doc: Fix using Apple-related terminology in Qt CoreAlexander Volkov2015-03-313-10/+10
| | | | | | | | | | | | | | | | | | | | | | Use the name "OS X" instead of "Mac OS X", "Mac OS" and "OSX", and mention iOS. Replace "Carbon Preferences API" by "CFPreferences API" in the QSettings documentation. Change-Id: Ia7f9fb874276c7c445a1649df521b96ff43daa0c Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* | QByteArray: begin()/end() are not \internalMarc Mutz2015-04-071-8/+26
| | | | | | | | | | | | | | Docs copied from corresponding QString functions. Change-Id: Ia2b0f0521780246d82003a1fda539c132823b294 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | docs: QString contains characters, not itemsMarc Mutz2015-04-071-2/+2
| | | | | | | | | | Change-Id: I479a731780dfce81e138d1aca950385437266763 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Remove unnecessary QDateTime::detach() functionThiago Macieira2015-04-072-22/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Last commit changed QDateTime::d to be a QSharedDataPointer that implicitly detaches on non-const operator->() calls. That means we no longer need to explicitly call detach(). More than that, we should not do it, so we avoid checking the ref count and try to detach on every use. To do that, in functions where the d pointer was accessed more than once, I detach at the top and shadow the "d" variable with a local plain pointer. We don't compile our sources with -Wshadow, so this should not be a problem. Change-Id: Ic5d393bfd36e48a193fcffff13b969c281c36d0c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Use QT_WARNING_.. instead of #pragma GCC diagnostic ..Konstantin Ritt2015-04-071-7/+3
| | | | | | | | | | Change-Id: I0bb55a7f1074f3b8d6fb681b1d4dab5105ae7569 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QQueue: unhide QList::swap(int, int)Marc Mutz2015-04-071-0/+5
| | | | | | | | | | | | Task-number: QTBUG-34197 Change-Id: I0b405ab0fabff8852b2705d651848fbff74fc4c2 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* | Removed unused code on QT_STRING_UCS4 macroThiago Macieira2015-04-051-6/+0
| | | | | | | | | | | | | | This isn't defined or used anywhere else. Change-Id: I9a75ad8521ae4e5cbbe5ffff13d2356883b82dbc Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | QVLA: Add operator= for initializer listsKai Koehne2015-04-042-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a dedicated operator=(std::initializer_list) that first resizes the QCLA, and then replaces the elements one by one. This should be usually faster than creating a temporary QCLA and then copying it, except for the case where the new array does not fit into the allocated stack - but this is IMO nothing to optimize for. Task-number: QTBUG-45041 Change-Id: I147d6d01186b1ca3c635b2c8365d8f6e638ce6fe GPush-Base: 08de3113051e1289f0de0651ec5647c9ee6feb27 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge "Merge remote-tracking branch 'origin/5.4' into 5.5" into refs/staging/5.5Liang Qi2015-04-012-21/+32
|\ \
| * | Merge remote-tracking branch 'origin/5.4' into 5.5Liang Qi2015-03-312-21/+32
| |\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/android-g++/qmake.conf qmake/generators/unix/unixmake2.cpp src/gui/image/qimage_conversions.cpp Change-Id: Ib76264b8c2d29a0228438ec02bd97d4b97545be0
| | * Core: fix crash in QCollator if ucol_open() failedLiang Qi2015-03-111-13/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | If ucol_open() failed, call back to QString::compare() implementation. Task-number: QTBUG-44796 Change-Id: I03446e5227e1dedac6c5f824ac6d74a494fc0ace Reviewed-by: Gergely Nagy <ngg@tresorit.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| | * Windows Embedded: GetTickCount64 won't be available so just remove itAndy Shaw2015-03-111-8/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since GetTickCount64 still relies on the usage of kernel32, then it will not find the function anyway as the library does not exist for Windows Embedded. Therefore it is best to remove it altogether to save time trying to locate something we know is not there. Change-Id: Id879382fdd0692fb9443231a405c0e28d9bcc328 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Split out some inline qdebug formatting helpers to qdebug_p.h.Friedemann Kleint2015-04-014-18/+44
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extract helpers to be able to format classes without type names and use those for formatting QEvents to reduce clutter. For example: QWidgetWindow/"MainWindowClassWindow" QMouseEvent(QEvent::Type(MouseMove), buttons=QFlags<Qt::MouseButtons>(LeftButton), localPos=QPointF(50,116), screenPos=QPointF(948,652)) QWidget/"qt_scrollarea_viewport" QMouseEvent(QEvent::Type(MouseMove), buttons=QFlags<Qt::MouseButtons>(LeftButton), localPos=QPointF(45,32), screenPos=QPointF(948,652)) becomes QWidgetWindow/"MainWindowClassWindow" QMouseEvent(MouseMove, LeftButton, localPos=50,116, screenPos=948,652) QWidget/"qt_scrollarea_viewport" QMouseEvent(MouseMove, LeftButton, localPos=45,32, screenPos=948,652) Change-Id: Ie5441d922962a05caed6b7079a74ea8a2b8a64fb Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* | Re-generate the time zones database from CLDR v.27Konstantin Ritt2015-03-271-954/+974
| | | | | | | | | | | | | | [ChangeLog][QtCore] QTimeZone data updated to CLDR v.27 Change-Id: Ic25229d86ac4752ed70f5a729fd33c1a837241dc Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Fix time offset for several time zonesKonstantin Ritt2015-03-271-6/+6
| | | | | | | | | | | | | | They are in UTC-03:00, not in UTC+03:00 (just a C&P typo). Change-Id: Ib342b65967404b8756c62953258b17421b9245af Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Update CLDR to v27Konstantin Ritt2015-03-274-4519/+4952
| | | | | | | | | | | | | | | | | | | | | | | | | | + A bunch of fixes in the locale data + New scripts from Unicode 7.0 + New locales - Some locales disappeared (aa_DJ, aa_ER, st_LS, ss_SZ, swc_CD, tn_BW) - Some locales lost their contents (i.e. en_Dsrt_US) [ChangeLog][QtCore] QLocale data updated to CLDR v.27 Change-Id: Iba8c7884f8087e577cbb25a8fc106dd7bd3ebb5d Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | [QLocaleData] Extract defaultContent localesKonstantin Ritt2015-03-271-1795/+1822
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds some locales missing in the common/main/ directory, namely: bss_CM, cch_NG, dv_MV, gaa_GH, gez_ET, ha_Arab_NG, iu_Cans_CA, kaj_NG, kcg_NG, kpe_LR, ku_Latn_TR, mi_NZ, ms_Arab_MY, mn_Mong_CN, nds_DE, ny_MW, oc_FR, sa_IN, sid_ET, tk_Latn_TM, trv_TW, tt_RU, ug_Arab_CN, wa_BE, wo_Latn_SN See http://www.unicode.org/reports/tr35/tr35-info.html#Default_Content for more info. Change-Id: I6b3082d370a21da64fbd5e72ab6344e1d7a6a3c9 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Re-generate Unicode data tablesKonstantin Ritt2015-03-272-6294/+7321
| | | | | | | | | | Change-Id: I289537377f37c36f88de9662bbb7ad108bdc9383 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Update Unicode data up to v7.0Konstantin Ritt2015-03-273-4/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Two newly adopted currency symbols: the Azerbaijan manat and the Russia ruble * Pictographic symbols (including many emoji), geometric symbols, arrows, and ornaments originating from the Wingdings and Webdings sets * Twenty-three new lesser-used and historic scripts extending support for written languages of North America, China, India, other Asian countries, and Africa * Letters used in Teuthonista and other transcriptional systems, and a new notational set, Duployan For more details, see http://www.unicode.org/versions/Unicode7.0.0/ The Properties struct's .*Diff members were narrowed down to signed 15 bits and the unicodeVersion has been expanded to 8 bits. [ChangeLog][QtCore] Unicode data updated to v.7.0 Change-Id: I93ab6f79fa3b05f61abc7279f1d046834c1c1a0b Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | QDateTime: remove unused parameter from localMSecsToEpochMSecs()Marc Mutz2015-03-261-10/+4
| | | | | | | | | | | | | | | | ...a namespace-level static function. The ok parameter was never set by any caller. Change-Id: I668f78fe198f09fb0a9a52c10c8dea2fab070653 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QDate: further optimize toString()Marc Mutz2015-03-261-11/+23
| | | | | | | | | | | | | | | | | | | | | | | | Factor the TextDate and ISODate legs into separate functions and replace a chain of QString::arg() with QStringBuilder. Saves 76B in text size. More importantly, restores (N)RVO for these code paths. Change-Id: I8b99bb672f5a4b5506d53487eca189d48b4025e9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Update strtoll and strtoull from upstream FreeBSDThiago Macieira2015-03-261-214/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There appears to be at least one fix, related to sign- or zero-extension in the call to isspace(). So it's a good idea to update again. This also brings the behavior to match strtoll and strtoull on Linux, including the fact that strtoull will parse negative numbers. For that reason, qstrtoll and qstrtoull are now wrappers that try and keep the behavior that we used to have. This update also changes the code from a 4-clause BSD license (bad) to a 3-clause BSD license (good). Change-Id: I73b01b02ebd1551bf924599d52284ad25cc1def0 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | QDateTimePrivate: replace out parameters with return-by-value in getDateTime()Marc Mutz2015-03-252-35/+35
| | | | | | | | | | | | | | | | | | | | | | | | Compilers don't like out parameters. Effects on Linux GCC 4.9 stripped release builds: text -584B data +-0B relocs +-0 Change-Id: Ie00c89b9edaced3a6adeb2707734c8f5238e67c1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QDateTime: prevent aggressive inliningMarc Mutz2015-03-251-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The function getDateFromJulianDay() is simple arithmetic, but still ~400 bytes in executable size. Yet GCC inlines this everywhere I looked, which makes some sense, as different users of the class only use parts of the return value and the optimizer has a field day removing all that dead code. However, that function has only one conditional, so presumably it executes at full pipeline speed and it doesn't matter that it calculates too much in some cases. More important is to use the I-cache more conservatively. That's what not inlining the function achieves. The function returns its result in registers and doesn't spill registers when called (at least on AMD64), so the effect on runtime should be negligible. Effects on Linux GCC 4.9 stripped release builds: text -1536B data +-0B relocs +-0 Change-Id: Ia16838102d29ad67ee5efdc8b7b0a26f2f921df1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QTime: optimize toString()Marc Mutz2015-03-251-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Instead of using a QString::arg() cascade, which creates tons of temporaries, use good 'ol sprintf(). Effects on Linux GCC 4.9 stripped release builds: text -308B data +-0B relocs +-0 Change-Id: I348577491d1399b5040f7ed9e9f6b111a9528e5d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Micro-optimize QDate::{long,short}{Day,Month}Name()Marc Mutz2015-03-251-32/+28
| | | | | | | | | | | | | | | | | | Save one return statement per function. I don't see why the compiler can't fuse these itself, but apparently it cannot, since this transformation saves 72B in text size. Change-Id: I3a661456554bf451ed53110ad546946ff7b84ec5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QDate: don't spend code size covering the impossible caseMarc Mutz2015-03-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | All other similar functions in QDate just return an empty string in case none of the switch labels would trigger (which would now cause a compiler warning, after removing the default case label), so do that here, too. Saves 44B in text size. Change-Id: I80ee4975082706adcd15fe89511d08c67e149324 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QDate: remove some useless default case labelsMarc Mutz2015-03-251-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | They're pure whitespace, since in each case there is a fallback after the switch, anyway, and their presence prevents compiler warnings about unhandled enumeration values in switch statements, which is nice-to-have, when adding to the enum, eventually. No change in executable code size. Change-Id: I77aecaeff990601f957ec9ee827eff5ead25aaa1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QVarLengthArray: Do not require operator!= for element comparisonKai Koehne2015-03-231-5/+4
| | | | | | | | | | | | | | | | | | | | The documentation claims that operator== is needed, not operator!=. While at it, we can also replace the loop with std::equal, which might even allow STL implementations to choose a hand-optimized version of the algorithm for C++ builtin types ... Change-Id: I988b326d6af3b767526952e303468e18ff6594f9 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | QVarLengthArray: Add initializer_list constructorKai Koehne2015-03-232-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement an initializer_list constructor, which was probably just forgotten so far. Technically this is a SC incompatible change, since QVarLengthArray<int> array = {10}; will now create an array with one element 10, instead of an empty array with a reserved size of 10. Anyhow, keeping the inconsistency with the STL / other Qt containers here would certainly do more harm than good in the long run. Task-number: QTBUG-45047 Change-Id: I4675880f93e141181250939942fa32300916b0e3 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Report a correct Unicode version used by QtKonstantin Ritt2015-03-232-3/+3
| | | | | | | | | | | | | | The version bump was forgotten in edfce46a6c0406af749ca7ef659df6315e36cd5d Change-Id: I99501bb314baab68f037417db4b3b14e11f2de02 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Build bundled PCRE copy as qt_helper_libKonstantin Ritt2015-03-201-6/+2
| | | | | | | | | | | | | | We already have an infrastructure for that. Change-Id: I9110b74dcf7f93362586687da6f112e72cb663a4 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | Introduce icu_dependency.priKonstantin Ritt2015-03-201-13/+2
| | | | | | | | | | | | | | Simply to hide the magic bahind the scenes. Change-Id: I69a159eb14712e68117f10e78745bdfbad46b6f2 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | Doc: Fix QVector constructor documentationKai Koehne2015-03-191-1/+1
| | | | | | | | | | Change-Id: Ib16df599553e482e981573afadf3c3f4e70ed5b1 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
* | Fix QCollator::compare documentationLars Knoll2015-03-182-8/+8
| | | | | | | | | | | | | | | | | | We don't guarantee -1, 0 and 1, but simply negative 0 or positive numbers. This is in line with e.g. QString::compare() Task-number: QTBUG-42860 Change-Id: I6009b2eb732ae3b4726cec06ec0eacc2c46a3c93 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QString: Don't force unrolling of the tail loop if optimizing for sizeThiago Macieira2015-03-151-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | This is quite good if space isn't a constraint: the unrolling ensures faster execution and limits the number of iterations. But it's long. Both Clang and GCC set the predefined macro __OPTIMIZE_SIZE__ if -Os is in effect. ICC does not; MSVC is untested but there are no macros for this effect listed in its documentation. Change-Id: I1a800c709d3543699131ffff13c48919a9a79ec3 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Track modifications of white space in QString::simplified().Friedemann Kleint2015-03-121-4/+6
| | | | | | | | | | | | | | | | | | | | The existing check fails to detect the case where white space characters other than the space character are replaced by space characters without the length actually changing and returns the original string. Task-number: QTBUG-44936 Change-Id: Ice6faa975f8b41f185c76f6d0d4ff81603e25eb3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QDateTime: ensure we always use the daylight status if knownThiago Macieira2015-03-111-19/+28
| | | | | | | | | | | | | | | | | | Refactor the code so that the localMSecsToEpochMSecs function always gets the daylight status as input. The calculation can be very wrong if we forget to set it. Change-Id: I39e2a3fa6dc7c4a417f23288f10b303e450b8b98 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* | Fix regression in time zone handlingFrederik Gladhorn2015-03-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | In QtScript we use the msecs since epoch conversion (JS date is based on the concept). After a8c74ddcf78604c9038ba2a2bea81e445e4b3c58 the date conversion test in qtscript started to fail. Instead of relying on the code working by chance, simply update the date when setting it with setMSecsSinceEpoch. Task-number: QTBUG-44885 Change-Id: I9f95c9cdccea52e7d1f808f3cb9e18570ef0df13 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Simplify calculation of week numberLars Knoll2015-03-101-50/+17
| | | | | | | | | | | | | | This also removes a dependency to 3rd party licensed code. Change-Id: Ia4818a5cf306501bdb7192265edc4bcba8e597d8 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Doc: corrected doc QString::operator[]Nico Vertriest2015-03-091-2/+2
| | | | | | | | | | | | | | Task-number: QTBUG-43337 Change-Id: I379dfe3f6909de5a63a67261834ea0edff875f9d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Martin Smith <martin.smith@digia.com>