summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
Commit message (Collapse)AuthorAgeFilesLines
* QByteArrayList: add indexOf(const char*) overloadDavid Faure2018-11-062-0/+26
| | | | | | | | | | | This avoids memory allocation and data copying in e.g. QObject::property(). Detected by heaptrack's "Temporary allocations" counter in an application using the breeze widget style (many animations). Change-Id: Iabdb58a3e504cb121cce906ef707b0722de89df6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* doc: Fix all clang parse errors in QtBase during PCH buildMartin Smith2018-11-051-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This update eliminates ALL parsing errors when clang parses the Qt headers to build the precompiled header qdoc needs. These errors are often cases where an old use of Q_QDOC no longer works because clang sees the enclosed fake declarations as erroneous. In a few cases, clang reported errors because two dummy function declartations under the Q_CLANG_QDOC guard were indistinguishable, so one of them was removed, and the documentation was patched accordingly. Using the macro Q_DECLARE_INTERFACE(...) causes clang to report errors because the class parametewr is abstract. These uses of the macro are not needed, so they are removed with #ifndef Q_CLANG_QDOC. Some declarations of default GL types that had been provided for qdoc were no longer needed, so they are removed. Now there are some member function signatures in QDBusPendingReply and QDBusPendingCall that have very long template clauses and qualifiers in their signatures. These unwieldy signatures will be unnecessary in the documentation and will look bad there, but for now they are correct. The ultimate solution will be to add a metacommand to qdoc, something like \simplify-signature to tell qdoc to generate the documentation for these member functions without the long template caluses and qualifiers. Change-Id: I012cf17a544fbba2ebc71002f31bdc865119bb8e Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@qt.io> Reviewed-by: Martin Smith <martin.smith@qt.io>
* QLocale: add const version of formattedDataSizeChristian Ehrlicher2018-11-022-1/+17
| | | | | | | | | | | | | | QLocale::formattedDataSize() was not marked const when it was added although the function is const. Add a const overload and mark the non-const version as deprecated and remove it with Qt6 Fixes: QTBUG-71445 Change-Id: I56d051d9928b5e00cdaca7a874c543fed27a888d Reviewed-by: Luca Beldi <v.ronin@yahoo.it> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-11-011-0/+1
|\ | | | | | | Change-Id: I6f8d3abd3247dc980dc7834801a017a89c8f4286
| * Fix leak in QContiguousCache::setCapacityJoni Poikelin2018-10-301-0/+1
| | | | | | | | | | | | Fixes: QTBUG-52125 Change-Id: Id0073e73279d049cf3f89ef6ea3a5ca1027efb0d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | doc: Add \since 6.0 to future functionsMartin Smith2018-10-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qdoc needs to know that a qdoc comment should not be part of the documentation until a future version. In this case, some new functions were declared to become active in Qt 6.0, but qdoc had no way of detecting this and reported errors about them incorrectly. Adding \since 6.0 to the qdoc comments for these functions allows qdoc to ignore them without printing the errors. It is also not allowed to document static functions declared in .cpp files, because these functions are not in the public API. The qdoc comment marker was removed from the comments for a few such static functions. Change-Id: I55ce0e8fb823b1dcf498d5a2436ddb20ad0a7527 Reviewed-by: Martin Smith <martin.smith@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2018-10-2510-216/+50
|\| | | | | | | | | | | | | | | | | Conflicts: src/corelib/animation/qpropertyanimation.cpp src/gui/image/qicon.cpp tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp Change-Id: I3698172b7b44ebb487cb38f50fd2c4a9f8a35b21
| * Fix QString latin1 conversion and comparison for -optimize-size buildKirill Burtsev2018-10-181-0/+8
| | | | | | | | | | Change-Id: I5f0ae946151e9733cbe21cb24387636ba68bc177 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| * Doc: Move literal code block to a separate fileCristian Maureira-Fredes2018-10-1510-216/+42
| | | | | | | | | | | | | | | | | | | | | | We need to override this snippet for the documentation we generate for Qt for Python, and it is easier to have it on a separate file. Task-number: PYSIDE-801 Task-number: PYSIDE-691 Change-Id: Ideb5b6af25024279f167137d3b65660bb9c96a7e Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | Avoid races on TZ in environment via tzset() callsEdward Welbourne2018-10-221-16/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | POSIX specifies that tzset() consults environment variable TZ and modifies some globals; it also specifies mktime(), localtime() and strftime() to behave as if they called tzset(). Fortunately, we only call strftime() from a test and only call localtime() when not threaded. Provide wrappers for tzset() and mktime() that share the lock used by our environment-access code, to prevent races on the environment (and tzset()'s globals) when we call them. In the process, re-use tst_QDateTime's TimeZoneRollback in its older test systemTimeZoneChange() and presume that this can now be tested cross-platform, since TimeZoneRollback is used in another test where this works. Fixes: QTBUG-71030 Change-Id: I79f559b8857ea2803e73501008bf0d7158c6731f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | qdbuserror: Use qOffsetStringArray instead of script generated codeMikhail Svetkin2018-10-161-0/+3
| | | | | | | | | | Change-Id: I2498702bcf4706cb717a7481cf6f81ceebb29ae8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-10-095-8/+32
|\| | | | | | | Change-Id: I5cbfd39cf728036bbdfdeec8e8739568e0a3025b
| * Fix UB (invalid pointer comparison) in QList, QVector, QVLAMarc Mutz2018-10-083-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QList, QVector and QVarLengthArray check the validity of iterators passed to member functions using isValidIterator(), which checks that the underlying pointers are in the range [begin, end]. This check is well-defined when the outcome is positive, ie. when the iterator is valid. But if the iterator is not valid, and does not happen to point into [end, begin + capacity], the comparison, which uses normal operator<, invokes UB. Fix by using std::less<T*>, which defines a total ordering. Change-Id: I1e5757789b4b9779f5e3e298e7f2b2dd0b27576c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Merge remote-tracking branch 'origin/5.11' into 5.12Qt Forward Merge Bot2018-10-082-5/+26
| |\ | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qtimezoneprivate.cpp Change-Id: Icbb5999d378711ce3786a4fe0aba176a45ac702c
| | * QDateTimeParser: avoid using an invalid hour by defaultEdward Welbourne2018-10-021-4/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a time-zone does a spring-forward, skipping an hour (either to start DST or to move its standard time), there's an hour that doesn't exist on the day in question. That hour can be the first hour of the day, in which case using 0:0 as the default time is broken. So catch this case and use the first time that day that makes sense. Fixes: QTBUG-70823 Change-Id: I23dae9320a3cdd2c988841a7db1b111edb945730 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * Scale seconds by a thousand to get millisecondsEdward Welbourne2018-10-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | QTimeZonePrivate::dataForLocalTime()'s handling of times in a spring-forward gap added offsets in seconds to values in milliseconds. Supply the missing factor of a thousand. Change-Id: Ic32d87675f902e1c7fd85025fb70c8272a4f2db2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QString: documentation fixesSamuel Gaist2018-10-081-15/+15
| | | | | | | | | | | | | | | Change-Id: I01cb7502514224cfb340bf8b8982340c29027689 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QOffsetStringArray: fix compilation error with clang-802.0.42Mikhail Svetkin2018-10-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces] return StaticString<N1 + N2>{ls[I1]..., rs.data[I2]...}; Change-Id: I30f5f50378f1faed648d092eefc5edb46e940239 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-10-011-1/+5
|\| | | | | | | | | | | Change-Id: Ic8cdb1c2b7c0a786b1313b6c3a3bf7e9ec288712
| * | Merge remote-tracking branch 'origin/5.11' into 5.12Qt Forward Merge Bot2018-09-301-1/+5
| |\| | | | | | | | | | Change-Id: Iaa438d14357be1bf75bb645cb8d3245947c055b8
| | * QCommandLineParser: Ensure that an option text ends with a newlineAlexander Akulich2018-09-281-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this change we inserted newline only if an option has a description and ended up with an arbitrary long line with all options. [ChangeLog][QtCore][QCommandLineParser] Fixed a bug that caused the help output to show two options or more in the same line if the options didn't have a description. Task-number: QTBUG-70174 Change-Id: Id54b9ae13ee596869e4dc14e09301aea19eed2f8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-09-297-86/+88
|\| | | | | | | | | | | Change-Id: I6083c3e61b7dbe188f83676f7e7bb268e5ccf2f3
| * | Merge remote-tracking branch 'origin/5.11' into 5.12Liang Qi2018-09-276-58/+60
| |\| | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qconfig-bootstrapped.h src/widgets/util/qcompleter.cpp Change-Id: I4f44f0f074982530f2f2e750ce696230b2754cf3
| | * Modernize the "datestring" featureLiang Qi2018-09-246-41/+43
| | | | | | | | | | | | | | | | | | Change-Id: I2236a456fe3758d9054b22e36fe6316f3522d533 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| | * Modernize the "textdate" featureLiang Qi2018-09-243-17/+17
| | | | | | | | | | | | | | | | | | Change-Id: Ic0b6f13e17c301ed66d6a8297c242086c94ac87d Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * | Doc: Fix QEasingCurve code snippetsTopi Reinio2018-09-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Commit ff2a71e3 accidentally removed a code snippet used in documenting EasingCurve::EasingFunction. This commit restores it and fixes other minor issues in QEasingCurve code snippets. Change-Id: Ib19f602a4abbca3511d3d26c5f6da4910f7104a3 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
| * | Fix some infelicities in the Q(Date|Time)+ docsEdward Welbourne2018-09-251-28/+28
| | | | | | | | | | | | | | | | | | | | | | | | Some of the claims made were not strictly acurate. Change-Id: Ia7c83ce44257acce32814c0bbb3b787bb6b8596b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | | QOffsetStringArray: fix compilation error with ICC18Mikhail Svetkin2018-09-141-9/+6
| | | | | | | | | | | | | | | | | | | | | | | | error: expression must have a constant value static constexpr const auto messages = qOffsetStringArray( Change-Id: I80a6bf5b83f99a8325511ac8a14e0c9819e3d2b7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Make updateSystemPrivate() local to qlocale.cppEdward Welbourne2018-09-113-11/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's not thread-safe so should only be used within systemData()'s locked code. This eliminates the last callers of it by making it a local function of the compilation unit, exposing a method from QSystemLocale() to get round its use of private parts. Make the constructor for QSystemLocale only stomp its _systemLocale global if previously unset, but let instantiation still clear globalLocaleData.m_language_id, so that it can be used as a way to trigger an update to system locale data. Change-Id: I908dca9fd30bbf20f42321ab8f9094f2fa37b7b0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-09-113-4/+16
|\| | | | | | | | | | | Change-Id: I1df9adea124326ef7c7802839eb93efc4302b287
| * | QStringList: restore binary compatibility with Qt 5.11David Faure2018-09-102-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 8b6100d512 removed bool QtPrivate::QStringList_contains(const QStringList *that, const QString &str, ...) (in favor of a QStringView overload). However this was used inline in qstringlist.h, so apps were referencing that symbol directly. As a result, upgrading to Qt 5.12 gave errors like libKF5ConfigCore.so.5.50.0: undefined reference to `QtPrivate::QStringList_contains(QStringList const*, QString const&, Qt::CaseSensitivity)@Qt_5' collect2: error: ld returned 1 exit status Change-Id: I862263a9b06157052df894a201dfd86df8c3f4fe Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
| * | Merge remote-tracking branch 'origin/5.11' into 5.12Liang Qi2018-09-101-4/+4
| |\| | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/common/macx.conf Change-Id: I8576493b417912fa5e5501bc2c1b935d186ac209
| | * Merge remote-tracking branch 'origin/5.11.2' into 5.11Qt Forward Merge Bot2018-09-091-4/+4
| | |\ | | | | | | | | | | | | Change-Id: I2fa26fa061cbf5d2bded203a299a19b7d1c31d0a
| | | * Doc: Fix typos in QRectF documentationPaul Wicking2018-08-271-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add missing 's'. Fixes: QTWEBSITE-823 Change-Id: I1acd3b7ae18982248bf3402fa5943ee95c1efdbe Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* | | | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-09-091-13/+4
|\| | | | | | | | | | | | | | | Change-Id: I36cda712b4cf960de70e497aef52fbc491099f1c
| * | | Merge remote-tracking branch 'origin/5.11' into 5.12Qt Forward Merge Bot2018-09-071-13/+4
| |\| | | | | | | | | | | | | | Change-Id: I66c7f18a2abd13601da0947919436f7da3549ae9
| | * | Doc: Move the literal code blocks to a separate fileVenugopal Shivashankar2018-09-031-13/+4
| | |/ | | | | | | | | | | | | | | | | | | | | | It's easier to override the code blocks this way. Change-Id: I98d40626a94fdb70a95c50332c2da141e9277070 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | | QOffsetStringArray/msvc: fix compilation warnings C4100Mikhail Svetkin2018-09-071-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | C4100 - identifier' : unreferenced formal parameter It happens when we call StaticStringBuilder::concatenate(StaticString<N>, StaticString<0>). StaticString<0> is ignored. Change-Id: Ic687bc865aa5d5e7425cbddbd614bde7dbb801df Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QOffsetStringArray: fix compilation error with MSVC15/17Mikhail Svetkin2018-09-061-42/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MSVC 2015/2017 has a bug with constexpr. It is internal compiler error when we are using QtPrivate::IndexSequence with more than 1024 items. Example: template<int ... I> void foo(QtPrivate::IndexSequence<I...>) { } void bar() { foo(QtPrivate::makeIndexSequence<1024>()); // works foo(QtPrivate::makeIndexSequence<1025>()); // error: C1202: recursive type or function dependency context too complex } Workaround: template<typename> struct Foo; template<int ... I> struct Foo<QtPrivate::IndexSequence<I...>>{ static constexpr void call() { } }; void bar() { Foo<QtPrivate::makeIndexSequence<1025>>::call(); // works } Change-Id: Iedbf5291ac4a9f51f8b5f6b76b83baba920c092d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-09-065-4/+46
|\| | | | | | | | | | | Change-Id: I2f6e1c0f649c5098723b776c774a8a689bb60582
| * | ASAN: Disable SSE4.1 code in qstricmp because of heap-buffer-overflowErik Verbruggen2018-09-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Although it is safe to slightly overread a string (provided it doesn't cross page boundaries), ASAN is extremely picky about this kind of behavior. So, do not run with this vectorized code when ASAN is enabled. Task-number: QTBUG-70269 Change-Id: I2b59b524d608afec8985227285feab55158d7247 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | QStringList: add contains(QStringView) overloadAlbert Astals Cid2018-09-032-2/+24
| | | | | | | | | | | | | | | Change-Id: I953e4ef3167011d0348ea482890e29478bd6f761 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | Add QString::compare(QStringView, CaseSensitivity)Albert Astals Cid2018-09-032-1/+21
| | | | | | | | | | | | | | | | | | | | | | | | There was a QStringView::compare(QString, CaseSensitivity) but it's good that the symmetric also exists Change-Id: Ic789f11d41eb8cfa393cb51c19bd1f89bb87d912 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Remove QConditional in favor of std::conditional/std::is_unsignedMikhail Svetkin2018-09-055-16/+10
| | | | | | | | | | | | | | | Change-Id: I5e0b9f640eb49aa7f5afdd4f3f15e027659e78ea Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-09-032-11/+10
|\| | | | | | | | | | | Change-Id: I8303ca41d0ca9ce1fdb27259db4f9f8448c74bcb
| * | Windows code: Fix to prefer ranged-for, as clang-tidy advisesFriedemann Kleint2018-09-021-3/+3
| | | | | | | | | | | | | | | | | | | | | Change-Id: Id9bb21855ae832cdbbc456326226ec72b634672e Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Luca Beldi <v.ronin@yahoo.it> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | Windows code: Fix clang-tidy warnings about else after jumpsFriedemann Kleint2018-09-022-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | Replace by switch() where appropriate, remove else and unindent code or simplify the return value. Change-Id: Ie988b9068a9579ae5a899b3765e43aad480b564e Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-09-025-15/+30
|\| | | | | | | | | | | Change-Id: I33e0abc771a2a772d3334172d50e7b0efe896590
| * | WebAssembly for QtBaseMorten Johan Sørvig2018-08-303-5/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the squashed diff from wip/webassembly to dev. Done-with: Peng Wu <peng.wu@intopalo.com> Done-with: Sami Enne <sami.enne@intopalo.com> Done-with: Morten Johan Sørvig <morten.sorvig@qt.io> Started-by: Andrew Knight <andrew.knight@intopalo.com> Change-Id: I6562433c0a38d6ec49ab675e0f104f2665f3392d Reviewed-by: Lorn Potter <lorn.potter@gmail.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
| * | Windows code: Fix clang-tidy warnings about C-style castsFriedemann Kleint2018-08-302-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace by reinterpret_cast or const_cast, respectively. Use auto when initializing a variable to fix Clang warnings about repeating the type name, do minor tidying along the way, and a few conversions of 0 or NULL to nullptr. Change-Id: Ieb271a87ddcf064f536e1ff05d23b1e688b1b56a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>