summaryrefslogtreecommitdiffstats
path: root/src/gui/util
Commit message (Collapse)AuthorAgeFilesLines
* Improve QDoubleValidator's docsEdward Welbourne7 days1-14/+28
| | | | | | | | | | | | | | | | | | Mention that the C locale is an exception on group separators. Rewrite a "It is thus recommended to use" - which is garblage induced by addiction to passive voice ("We recommend use of ..." would be better) - to actually say what needs to be said. Actually say what the standard and scientific notations are, explain which parts are locale-dependent, \sa some relevant QLocale docs (from which the other relevant docs are easily reached). Rephrase the explanations for validate()'s returns. Address validity of the string before constraints on the value it wouldn't represent if it weren't valid. Change-Id: I5e677f00e5146a44eea5b08c5e0146cd235b95b1 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Don't skip QDoubleConverter's digit-count check for non-whole boundEdward Welbourne7 days1-1/+5
| | | | | | | | | | | | | | | | Using convertDoubleTo() to get a whole number, from which to determine the number of digits we're allowed before the fractional part, fails if the double isn't a whole number, which lead to the skip being checked. Use qFloor() of the double (as this should have as many digits as the double had before its decimal point, which is what we care about; qCeil() might round up to a power of ten). This amends commit ff6d2cb0d5779d81e89d94d65c8d164602fa2567 Fixes: QTBUG-105341 Pick-to: 6.4 6.3 6.2 Change-Id: I4e0105d4602682c59e9830ec9a37556c96db884e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QEdidParser: fix number of data blocksJonathan Liu2022-06-041-1/+2
| | | | | | | | | | | | | | | | | | | | The EDID standard defines 4 x 18 byte descriptors: 54-71: Descriptor 1 72-89: Descriptor 2 90-107: Descriptor 3 108-125: Descriptor 4 Immediately following the 4th 18 byte descriptor are the following: 126: Number of extensions 127: Checksum Therefore the number of data blocks (known as descriptors in the EDID standard) should be 4 instead of 5. Pick-to: 5.15 6.2 6.3 Change-Id: I63555b9142125df17b26401d81a6717936832162 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Liang Qi <liang.qi@qt.io>
* Make it possible to create QTextureFileData from imagesPaul Olav Tvete2022-05-272-17/+55
| | | | | | | | | | | | | Currently it is only possible to create a cube map texture from a single compressed texture file. In many cases, the cubemap asset is available as a set of individual image files. Making it possible to use these images directly will make the development process more efficient, and will reduce the size of the assets needed to be shipped with demos and examples. Task-number: QTBUG-103191 Change-Id: Icd12548e2dab55ec2123804cb28353cbf29926ce Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-1630-1144/+64
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* QtGui: includemocsMarc Mutz2022-04-292-0/+4
| | | | | | | | | | | Including moc files directly into their classes' TU tends to improve codegen and enables extended compiler warnings, e.g. about unused private functions or fields. Pick-to: 6.3 6.2 5.15 Task-number: QTBUG-102886 Change-Id: I1945741794c25679a9d94c0d68c8642e2c823502 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QtGui: use _L1 for for creating Latin-1 string literalsSona Kurazyan2022-04-282-3/+7
| | | | | | Task-number: QTBUG-98434 Change-Id: Idcb71c1d27125333a53b6bdd3e1af0d4c66617fa Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QtGui: stop using QLatin1Char constructor for creating char literalsSona Kurazyan2022-04-133-6/+8
| | | | | | | | | Required for porting away from QLatin1Char/QLatin1String in scope of QTBUG-98434. Change-Id: I308d86cefcbfd126929b68f9a853d420840c965f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Fix use-after-free because QByteArray::data() was copying dataDimitrios Apostolou2022-04-121-3/+3
| | | | | | | | | | | | | | | | | | | Previously there was a mixture of buf.constData() and buf.data() with buf not being const QByteArray. As a result, buf.data() returned a re-allocated buffer and texData was keeping pointers to that one, which became invalid once the function returned and the re-allocated buffer was cleaned up by destructor. Change buf to const QByteArray so that there is no difference between data() and constData(). Additionally convert all constData() calls to data() to avoid confusion. Detected by Address Sanitizer on testcase tst_qtexturefilereader::checkMetadata() Pick-to: 6.3 6.2 Change-Id: Idb6f6141898678bf95ed9233a92b7bb3ad12e250 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Fix a few more {QString, QByteArray}::count() deprecation warningsSona Kurazyan2022-03-171-1/+1
| | | | | Change-Id: I0be2d5e7a8f6af3bc1077ae6d1f20cc5da8f2266 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Misc: Do not depend on transitive includesFabian Kosmale2022-03-171-0/+1
| | | | | | | | As a drive-by, remove superfluous includes from qnetworkmanagerservice.h and obey the coding conventions for includes in a few more places. Change-Id: I65b68c0cef7598d06a125e97637040392d4be9ff Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Gui: Do not depend on transitive includesFabian Kosmale2022-03-171-1/+3
| | | | | Change-Id: I27321235d9c8428de0cff1e22a618299b9e5a97f Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* De-inline dtors of QTextureFileHandler hierarchyMarc Mutz2022-03-118-1/+12
| | | | | | | | | | | Destructors of polymorphic classes should be out-of-line to pin vtable and type_info objects to a single TU. Pick-to: 6.3 Task-number: QTBUG-45582 Change-Id: I541437a3ff53852527f6278355f7b549e62e17f7 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix off-by-one for "typically" lowest value INT_MINClemens Werther2022-03-031-2/+2
| | | | | | Pick-to: 6.3 6.2 5.15 Change-Id: I0e1115dc21e700dc79fb54be953573c75b41e70f Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Make sure all qtbase private headers include at least one otherThiago Macieira2022-02-243-1/+5
| | | | | | | | | | See script in qtbase/util/includeprivate for the rules. Since these files are being touched anyway, I also ran the updatecopyright.pl script too. Change-Id: Ib056b47dde3341ef9a52ffff13ef677e471674b6 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QDesktopServices: make QOpenUrlHandlerRegistry a non-QObjectMarc Mutz2022-02-181-7/+5
| | | | | | | | | | | | | | | | | | It seems to have been a QObject solely for its single slot. But since Qt 5, slots need no longer be defined on QObjects, so we can remove the inheritance from QObject now. We still need a QObject as the context object in connect(), but that can be just be an aggregated naked QObject. Saves 26 relocations, ~1.5KiB in TEXT and ~0.3KiB in DATA on optimized GCC 11.2 Linux AMD64 C++20 builds. Pick-to: 6.3 6.2 Change-Id: Ic45a8e892ec2bd5de5de8fbd32ec7a167c501803 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDesktopServices: deprecate destroying URL handlers w/o explicit ↵Marc Mutz2022-02-151-0/+18
| | | | | | | | | | | | | | | | | | | unsetUrlHandler() [ChangeLog][QtGui][QDesktopServices] URL handlers that have been passed to setUrlHandler() must now be removed by calling unsetUrlHandler() before they are destroyed. Relying on the handler's destructor to implicitly unset it is now deprecated, because it may already be in use by concurrent openUrl() calls. Support for implicit unsetting will be removed in 6.6 and, until then, a qWarning() is raised if it is exercised. Fixes: QTBUG-100775 Fixes: QTBUG-100779 Pick-to: 6.3 6.2 5.15 Change-Id: I0c4f91b78f847b135fdeb38766babc892bdc1379 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* QPkmHandler: make const what it never modifiedMarc Mutz2022-02-121-1/+1
| | | | | | Pick-to: 6.3 6.2 5.15 Change-Id: I0bda0d93ebe60d4923f3e9eb059cddb61192b1b5 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QDesktopServices: fix ABA problem in QOpenUrlHandlerRegistryMarc Mutz2022-02-121-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The registry is designed to be thread-safe, as is openUrl(), and handlers are required to be thread-safe, too: "the handler will always be called from within the same thread that calls QDesktopServices::openUrl()". The handlerDestroyed() slot was invoked using AutoConnection semantics, which, if the registry and the handler happen to not be on the same thread, is QueuedConnection, which means there's a window in which the handler is destroyed, but it's still listed in the registry, and a call to openUrl() may make a call to the (deleted) handler. Worse, if a handler is deleted and new one registered they may end up on the same address (ABA, or rather, AA problem), and then the delayed call to handlerDestroyed() may remove the entries to the new handler, as well as those to the old. Fix by using Qt::DirectConnection. This fixes the ABA problem, but doesn't completely fix the partially-destroyed problem, since QObject::destroyed() is simply too late. We need to require explicit unsetUrlHandler() calls, which should happen before destruction of the handler object starts. [ChangeLog][QtGui][QDesktopServices] Fixed a bug where destroying and re-creating a handler object in quick succession could cause the registration for the handler to be lost. Fixes: QTBUG-100778 Pick-to: 6.3 6.2 5.15 Change-Id: I76fd81724504cc7f38ac262b43e3e9539fe5ebca Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDesktopServices: fix UB (data race on handlers)Marc Mutz2022-02-121-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | The handlerDestroyed() function is connected to the handler QObject's destroyed() signal and removes all entries from the registry for which the destroyed object was listed as the handler. While handlerDestroyed() is always executed in the context of the thread owning QOpenUrlHandlerRegistry-as-a-QObject, the documentation explicitly states that "the handler will always be called from within the same thread that calls QDesktopServices::openUrl()", implying that calling openUrl() from a non-GUI thread is supported. The presence of the mutex also indicates that this should work. But then the unprotected access to the handlers variable in handlerDestroyed() is a data race, because nothing prevents a handler object from being destroyed concurrent to an openUrl() call. Fix by locking the mutex. Fixes: QTBUG-100777 Pick-to: 6.3 6.2 5.15 Change-Id: I9ef857efa609b4d16ee21063ccccd316e119576b Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Doc: Use \inmodule for all classes and headersTopi Reinio2022-01-171-0/+1
| | | | | | | | | | | | | | | QDoc made some assumptions about the module a class/header belongs to, based on the source file path. This feature is rather error-prone and unnecessarily complex and will be removed from QDoc. Define modules explicitly to avoid documentation warnings when this removal happens. Pick-to: 6.2 6.3 Change-Id: I7947d197db5ac36c12e816caa19bb2f74eda8849 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* QLayoutPolicy: fix annoying -Wdeprecated-enum-enum-conversionMarc Mutz2021-12-031-10/+10
| | | | | | | | | | | | | | | | | | | | Says GCC -std=c++20: src/gui/util/qlayoutpolicy_p.h:127:30: warning: bitwise operation between different enumeration types ‘QLayoutPolicy::Policy’ and ‘QLayoutPolicy::PolicyFlag’ is deprecated [-Wdeprecated-enum-enum-conversion] 127 | if (verticalPolicy() & ExpandFlag) | ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~ Fix by making Policy a QFlags<PolicyFlag>, which we can do because the class is private. In QSizePolicy, this would break BC. Since a QFlags cannot be opened for constants like an enum, we need to define the ex-Policy-enumerators as static inline constexpr objects instead. Pick-to: 6.2 Change-Id: I29bc938f86508deed3f99ad9d1c1892547206c05 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QLayoutPolicy: un-export the classMarc Mutz2021-11-271-5/+5
| | | | | | | | | | | | The class is almost completely inline. Don't export it wholesale, only export the few out-of-line members. Also acts as a test-case for the new Q_GADGET_EXPORT feature. Task-number: QTBUG-55458 Change-Id: I699a774614183960d7ac4e0afcdb57cfef76db15 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* gui: Fix typos in source code commentsJonas Kvinge2021-10-121-1/+1
| | | | | | Pick-to: 5.15 6.2 Change-Id: Ie53e5542a8f93856470982939ecd8ec90b323d69 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Remove qshadergraph filesJuan Casafranca2021-10-0516-2840/+0
| | | | | | | | | | | | - Those files were moved as part of Qt3D as its the sole user of these - Also removed associated unit tests Pick-to: 6.2 5.15 Change-Id: I302bc219218a58071c86d2447cb4449601fca32c Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Introduce QDoubleValidator::setRange overload with two parametersIvan Solovev2021-09-202-4/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The QDoubleValidator::setRange() used to have 3 parameters, with the third one (the number of decimals) having a default value of 0. Such default value does not make much sense for a *double* validator. Also, since a default value was used, omitting the decimals was silently overwriting the previous decimals value, discarding the value that could be previously explicitly specified by user. [ChangeLog][QtCore][QDoubleValidator][Important Behavior Changes] The QDoubleValidator::setRange() method now has two overloads. The first overload takes 3 parameters, but does not support a default value for decimals. The second overload takes only two parameters, not changing the number of decimals at all. Hence, the number of decimals will only be changed if the user explicitly specifies it. To maintain the old behavior of setRange(), pass 0 as the 3rd argument explicitly. Note that it is a source-incompatible change. But it should be fine, because using QDoubleValidator with 0 digits after decimal point does not make much sense and so, hopefully, is not that common. At the same time, change the default-constructed QDoubleValidator to use -1 for decimals, which allows arbitrarily many digits in the fractional part. The value was previously 1000, which allowed more than anyone would reasonably use, so this should make no practical difference. Some more unit tests to cover the behavior of the setRange() overloads are also added. As a dirve-by: remove unnecessary QValidator::State to int conversions in the unit tests. QCOMPARE is capable of comparing these enums and provides a better output in case of failure for enums. Task-number: QTBUG-90719 Change-Id: I523d6086231912e4c07555a89cacd45854136978 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Introduce QDoubleValidator::fixup()Ivan Solovev2021-09-172-2/+89
| | | | | | | | | | | | | The provided implementation tries to fix positions for the group separator. In case of scientific notation it can also converts the value to normalized form. It uses QLocale::FloatingPointShortest internally to convert the double value back to string, so the number of decimals may change after calling this method. Change-Id: I963bc5f97b653e2bb912f4b95b09a4d1ee201e7f Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Android: Enable QDesktopServiceLars Schmertmann2021-09-101-11/+40
| | | | | | | | | | | | QDesktopServices::openUrl(const QUrl &url) is already implemented on Android. But even if it is possible to set an URL handler, the mechanism to invoke it is missing. With this commit the URL handler will work on Android like it is already working on iOS. Task-number: QTBUG-84382 Pick-to: 6.2 Change-Id: Ic560bd380f1cc59586861aa1a6a3ea064276a39e Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* QDoubleValidator: fix NaN check in validateWithLocaleIvan Solovev2021-09-011-2/+1
| | | | | | | | We can't really compare two NaN's. Should use qIsNaN() for that. Pick-to: 6.2 Change-Id: Ia514cabe65cfcdeafb39cab91ecdb66f8fae725c Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Rework QLocalePrivate::bytearrayToU?LongLong()Edward Welbourne2021-08-301-3/+3
| | | | | | | | | | | | Change it to take a QByteArrayView instead of a plain char *; all its callers do know the size and propagating it enables the implementation to call strntou?ll() rather than strtou?ll(), thereby escaping the need for '\0'-termination. Fixes: QTBUG-74286 Change-Id: Ie9394786e9fcf25c1d1be2421805f47c018d13bb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Correct examples for int validation in QValidator documentationVolker Hilsheimer2021-06-081-2/+2
| | | | | | | | | | | | QIntValidator::validate documents correctly that any input with "at most as many digits as the top of the range" returns Intermediate. This is needed to avoid input deadlocks where one can't go from 9 to 15 if the range is 8 to 16. Fixes: QTBUG-94269 Pick-to: 6.1 5.15 Change-Id: I6776e09fc231249fe78f9e6106492f8454b70a03 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Edid parser: fix performance issuesGiuseppe D'Angelo2021-05-052-34/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A) When a QEdidParser gets built, the code populates a QMap by parsing the system's pnp ids file. With > 2000 entries in the file, that's 2000+ allocations for the QMap, plus 4000+ allocations for key/value (QStrings), plus a bunch of temporaries created for processing. What's more, on XCB and EGLFS, a QEdidParser gets built *per screen*; the map is not shared and gets rebuilt for each screen. It's however completely unnecessary to keep this map in memory. The lookup is required only once per monitor change event, which, apart from application startup, is an extremely rare event. When such an event happens, and we have to lookup a vendor id, we can just process the pnp database "on the fly", therefore removing the constant memory usage from the application run. In order to also avoid an allocation spike, just don't build a map at all: simply process the file, using no memory allocations, one line at a time while searching for the vendor id. I was unable to find information about the file format, so I am not sure if it's guaranteed that it's kept sorted by id (this could allow for a faster fail path). B) In case of a cache miss, a hardcoded vendor table is used to try and identify the manufacturer. Look up in the hardcoded table using binary search, rather than a linear scan, and don't allocate memory for each element processed in the list (!). The size of the list (2000+) is big enough to completely justify binary search. C) Drive-by, remove a TOCTOU bug when opening the system file. D) Drive-by, fix the includes in the header to IWYU. Change-Id: I57c7cbd09a145c6efe3023c227ed36b24bed96f9 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Edid vendor table generator (3/N): regenerate the tableGiuseppe D'Angelo2021-04-211-37/+271
| | | | | | | Use an updated output from the script. Change-Id: I85c4706c637bd5ceda6667257e48c16943637f9b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Edid vendor table generator (2/N): use idiomatic C++Giuseppe D'Angelo2021-04-211-2/+2
| | | | | | | | In C++ we can give names to classes, so just use that, without C-isms (typedef struct). Change-Id: I27239d8d5c28864b3f4f7bd4013cc47c045b4b04 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix compiler warnings in 32-bit buildsRobert Löhning2021-03-171-2/+2
| | | | | | | | | comparison of integers of different signs: 'unsigned int' and 'qsizetype' (aka 'int') [-Wsign-compare] Pick-to: 6.1 Change-Id: Ia27f79ab4abca8b757b65ef5f1d30151842088fe Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* QTextureFileData: support key value metadataJonas Karlsson2021-02-094-3/+56
| | | | | | | Task-Id: QTBUG-76970 Pick-to: 6.1 Change-Id: I9dba1b373250cea4d0c806997290a7afcdc900d7 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Support cubemap ktx filesJonas Karlsson2021-02-011-16/+36
| | | | | | Change-Id: I6905c393647d31fab958cdd9471bb0a6ffe83596 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Add QPlatformScreen::colorSpace()Allan Sandfeld Jensen2021-01-252-1/+94
| | | | | | | | Added for macOS and X11 screens Task-number: QTBUG-90535 Change-Id: Ifafe7a07ee2abc3c42cd12785db2d7329878375b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Add face support to texture fileJonas Karlsson2021-01-215-39/+85
| | | | | | Task-Id: QTBUG-76970 Change-Id: I3bbd43357c7fcce8949522b089a4572b948f08f4 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Remove the qmake project filesJoerg Bornemann2021-01-071-64/+0
| | | | | | | | | | | | | | | | Remove the qmake project files for most of Qt. Leave the qmake project files for examples, because we still test those in the CI to ensure qmake does not regress. Also leave the qmake project files for utils and other minor parts that lack CMake project files. Task-number: QTBUG-88742 Change-Id: I6cdf059e6204816f617f9624f3ea9822703f73cc Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Add getDataView() method to QTextureFileDataJonas Karlsson2020-12-292-0/+13
| | | | | | | | | | This method will return a QByteArrayView of the data range corresponding to the level. This avoids a leaky abstraction by moving the needed data pointer arithmetic from the caller to the method. It will also make it easier adding cubemap support in the future. Change-Id: I2415bd88365d8d69ba14aefc77f5f1117f9e0033 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Replace discouraged Q_MOVABLE_TYPE by Q_RELOCATABLE_TYPEAndreas Buhr2020-11-309-12/+12
| | | | | | | | | | | | | | Q_MOVABLE_TYPE was conceived before C++ had move semantics. Now, with move semantics, its name is misleading. Q_RELOCATABLE_TYPE was introduced as a synonym to Q_MOVABLE_TYPE. Usage of Q_MOVABLE_TYPE is discouraged now. This patch replaces all usages of Q_MOVABLE_TYPE by Q_RELOCATABLE_TYPE in QtBase. As the two are synonymous, this patch should have no impact on users. Pick-to: 6.0 Change-Id: Ie653984363198c1aeb1f70f8e0fa189aae38eb5c Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Remove some code checker issues (L218 & L243)Jan Arve Sæther2020-11-131-36/+7
| | | | | | | An addition, avoid code duplication. Change-Id: I26d1d8d65ba330a2024eb5c17c3bceb21e014200 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Doc: fix \inmodule for classes moved to QtGuiv6.0.0-beta4Volker Hilsheimer2020-11-092-3/+3
| | | | | Change-Id: If7a42dde8c728356e0e5646743a1425b08fccbcb Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix Clang compiler warnings (-Wrange-loop-analysis)David Skoland2020-10-172-7/+7
| | | | | | | | | | | | | | | In a macOS environment, Clang throws a number of compiler warnings about loop variables when building qtbase. See task for more info about the environment. This changes a handful of loop variables, like QJsonValue references into QJsonValueRefs. Task-number: QTBUG-87216 Pick-to: 5.15 Change-Id: I26006efd7c75c2d56ebc7f7efb4c9bdcabe92e8b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Make QStringList an alias to QList<QString>Lars Knoll2020-09-121-1/+0
| | | | | | | | | | | | | | | | | | Fix our API, so that QStringList and QList<QString> are the same thing. This required a bit of refactoring in QList and moving the indexOf(), lastIndexOf() and contains() method into QListSpecialMethods. In addition, we need to ensure that the QStringList(const QString&) constructor is still available for compatibility with Qt 5. Once those two are done, all methods in QStringList can be moved into QListSpecialMethods<QString>. Change-Id: Ib8afbf5b6d9df4d0d47051252233506f62335fa3 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Compile GUI util snippetsPaul Wicking2020-09-011-0/+1
| | | | | | | | | Fix minor issues (e.g. whitespace, missing semi-colon) in passing. Change-Id: Ieec8deb8aaf4358ffc35502fae6ea7c043d34672 Done-with: Nico Vertriest <nico.vertriest@qt.io> Task-number: QTBUG-81486 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Use QMetaType in QMetaCallEventLars Knoll2020-08-241-5/+5
| | | | | | | And don't use int based type mapping anymore. Change-Id: I456e76d1933ef646a7bd39ce565886b89e938a44 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Clean up int based convert() APILars Knoll2020-08-241-5/+5
| | | | | | | Pass QMetaType instances instead. Change-Id: I07366cea566fdebf5bb793aa8087f8109216ec0c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Deprecate the static int based API in QMetaTypeLars Knoll2020-08-242-6/+6
| | | | | | | | | | | | | And remove one of the type id to name mapping that still existed in QMetaType. QMetaTypeInterface can provide that, so there's no need to have a second copy of the data. qMetaTypeTypeInternal() can still map all the names of all builtin types to ids. That functionality is for now still required by moc and can't be removed yet. Change-Id: Ib4f8e9c71e1e7d99d52da9e44477c9a1f1805e57 Reviewed-by: Lars Knoll <lars.knoll@qt.io>