summaryrefslogtreecommitdiffstats
path: root/src/corelib/doc/snippets
Commit message (Collapse)AuthorAgeFilesLines
* Doc: Document how to treat qt_add_big_resources args as source filesCristian Adam2022-06-161-0/+5
| | | | | | | | | | | | | | The arguments to qt_add_big_resources are not known to CMake as source files. They need to be added explicitly to a CMake target in order for Qt Creator to treat them as source files and in the case of a qrc file to expand the contents in the project view. Fixes: QTBUG-104320 Pick-to: 6.4 6.3 Change-Id: Iea755d998e8f9814a82983272731b0c654f80644 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Fix doc and example of QLoggingCategory::installCategory()Edward Welbourne2022-06-131-7/+10
| | | | | | | | | | | | | | | | | | | | | Snippet [22] was unused and the example using snippet [21] neglected to show how its oldCategoryFilter got initialized, which is what [22] does. But it turns out the example code was crashy in any case, as it left the oldCategoryFilter uninitialized (albeit probably null) until the call to installFilter() had returned, and installFilter() calls the new filter, so the new filter needs to check oldCategoryFilter before calling it. The doc also failed to explain why it's OK to not defer to the prior filter in these calls during installFilter(), so revise the doc and example so that the latter behaves sensibly and readers of the former are likely to use the function safely. This amends commit 8f0654ceb878b6c8a08c7f5b790027c26e007c13 which added the snippets and the use of one of them, but not the other. Fixes: QTBUG-49704 Pick-to: 6.4 6.3 6.2 5.15 Change-Id: Iddb8d97b0bef417d8f16e7910730cfa59ea3e715 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* QMap: remove more docs referring to multiple values for the same keyGiuseppe D'Angelo2022-05-291-16/+0
| | | | | | | | Such semantics have been dropped from Qt 6. Change-Id: I12f3478833afafa34f9075faf9ed030d06cd86f9 Pick-to: 6.2 6.3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use SPDX license identifiersLucie Gérard2022-05-16164-8039/+331
| | | | | | | | | | | | | 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>
* Add support for unwrapping QFuture<QFuture<T>>Sona Kurazyan2022-04-211-0/+34
| | | | | | | | | | | | | | | | Added QFuture::unwrap() for unwrapping the future nested inside QFuture<QFuture<T>>. QTBUG-86725 suggests doing the unwrapping automatically inside .then(), but this will change the return type of .then() that used to return QFuture<QFuture<T>> and might cause SC breaks. Apart from that, QFuture::unwrap() might be helpful in general, for asynchronous computations that return a nested QFuture. [ChangeLog][QtCore][QFuture] Added QFuture::unwrap() for unwrapping the future nested inside QFuture<QFuture<T>>. Task-number: QTBUG-86725 Change-Id: I8886743aca261dca46f62d9dfcaead4a141d3dc4 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Replace uses of _qs with _s in sources and examplesSona Kurazyan2022-04-191-1/+1
| | | | | | Task-number: QTBUG-101408 Change-Id: I48360ba3b23965cd3d90ac243c100a0656a4cde8 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QDate: add conversions for std::chrono calendaring classesGiuseppe D'Angelo2022-04-131-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | std::chrono::year_month_day and related classes offer very convenient to specify dates. This patch adds implicit constructors to QDate to support this convenience, e.g.: // YYYY-MM-DD, DD-MM-YYYY, MM-DD-YYYY formats: QDate d1 = 1985y / December / 8; QDate d2 = 8d / December / 1985; QDate d3 = December / 8d / 1985; // Indexed weekday: QDate d4 = 2000y / January / Monday[0]; QDate d5 = 2000y / January / Monday[last]; and so on. These are all implemented using the conversion from the std calendaring classes to sys_days. Conversions between sys_days and QDate are also added, since they're basically "for free". I don't expect "ordinary" users to stumble upon it, but it's worthy mentioning that std::chrono::year *does* have a year zero (hence, year_month_day in year 0 or below are offset by one with the corresponding QDate). I've left a note in the documentation. [ChangeLog][QtCore][QDate] QDate (and therefore QDateTime) is now constructible using the year/month/day/week classes available in the std::chrono library. Moreover, it now features conversions from and to std::chrono::sys_days. Change-Id: I2a4f56423ac7d1469541cbb6a278a65b48878b4a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Document QT_NO_[SIGNALS_SLOTS_]KEYWORDS definesJoerg Bornemann2022-03-291-0/+5
| | | | | | | Pick-to: 6.2 6.3 Fixes: QTBUG-70564 Change-Id: I8ed1a30567dabdcb95cdfce009f1d9e0645d3226 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtCore: Replace remaining uses of QLatin1String with QLatin1StringViewSona Kurazyan2022-03-262-2/+2
| | | | | | | Task-number: QTBUG-98434 Change-Id: Ib7c5fc0aaca6ef33b93c7486e99502c555bf20bc Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QtCore: replace QLatin1String/QLatin1Char with _L1/u'' where applicableSona Kurazyan2022-03-256-21/+31
| | | | | | | | | | | As a drive-by, did also minor refactorings/improvements. Task-number: QTBUG-98434 Change-Id: I81964176ae2f07ea63674c96f47f9c6aa046854f Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
* Add QByteArray::percentDecoded() as an instance methodEdward Welbourne2022-03-181-2/+7
| | | | | | | | | | | | | Percent-decoding was previously only present as a static method taking a QBA parameter; it might as well be an instance method of that parameter. Change most QBA tests to use it rather the static method. [ChangeLog][QtCore][QByteArray] percentDecoded() is now available as an instance method of the byte array to be decoded, equivalent to the static QByteArray::fromPercentEncoding(). Change-Id: I982101c44bdac5cc4041e85598d52ac101d38fa1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Associative containers: add a way to obtain a key/value rangeGiuseppe D'Angelo2022-03-043-0/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our associative containers' iterator's value_type isn't a destructurable type (yielding key/value). This means that something like for (auto [k, v] : map) doesn't even compile -- one can only "directly" iterate on the values. For quite some time we've had QKeyValueIterator to allow key/value iteration, but then one had to resort to a "traditional" for loop: for (auto i = map.keyValueBegin(), e = keyValueEnd(); i!=e; ++i) This can be easily packaged in an adaptor class, which is what this commmit does, thereby offering a C++17-compatible way to obtain key/value iteration over associative containers. Something possibly peculiar is the fact that the range so obtained is a range of pairs of references -- not a range of references to pairs. But that's easily explained by the fact that we have no pairs to build references to; hence, for (auto &[k, v] : map.asKeyValueRange()) doesn't compile (lvalue reference doesn't bind to prvalue pair). Instead, both of these compile: for (auto [k, v] : map.asKeyValueRange()) for (auto &&[k, v] : map.asKeyValueRange()) and in *both* cases one gets references to the keys/values in the map. If the map is non-const, the reference to the value is mutable. Last but not least, implement pinning for rvalue containers. [ChangeLog][QtCore][QMap] Added asKeyValueRange(). [ChangeLog][QtCore][QMultiMap] Added asKeyValueRange(). [ChangeLog][QtCore][QHash] Added asKeyValueRange(). [ChangeLog][QtCore][QMultiHash] Added asKeyValueRange(). Task-number: QTBUG-4615 Change-Id: Ic8506bff38b2f753494b21ab76f52e05c06ffc8b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Add documentation for qt_finalize_project commandAlexey Edelev2022-02-021-0/+13
| | | | | | | | Task-number: QTBUG-100207 Pick-to: 6.3 Change-Id: I902ae827efad422771494ae3ad2da48d48d5c9cb Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QVersionNumber: port fromString() to QAnyStringViewMarc Mutz2022-01-181-2/+2
| | | | | | | | | | | | | | | | | We can handle the UTF-8 case by reinterpreting it as Latin-1. This way, the suffixIndex stays valid as a return value. As a drive-by, optimize away toLatin1() calls by using a QVLA. We really need a better way of converting UTF-16 -> L1 than qt_to_latin1()... [ChangeLog][QtCore][QVersionNumber] fromString() now takes QAnyStringView (was: QString, QStringView, QLatin1String) and a qsizetype pointer (was: int pointer). Change-Id: I86abaadba2792658fbf93ccd1e0b86e3302c697c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Make QListIterator snippets more robustKai Köhne2022-01-176-18/+22
| | | | | | | | | | | qDebug() << i.next(); can become a NOOP if the code is compiled with QT_NO_DEBUG_OUTPUT. Pick-to: 5.15 6.2 6.3 Fixes: QTBUG-97535 Change-Id: I9085b40ac9b4de2bb06f16e03fd5100902b08d4f Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Doc: Fix snippet to match actual QFileInfo behaviorKai Köhne2022-01-131-1/+1
| | | | | | | | | | The documentation was already updated in abfac029ceaf6c3199694a50, but the snippet still incorrectly suggested QFileInfo::size would report the actual size of an .lnk file on Windows. Pick-to: 5.15 6.2 6.3 Change-Id: I03b96b2efcb713fbc4dd30fc526e1209806bf5cf Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Doc: Replace "C:\Documents and Settings" pathsKai Köhne2022-01-122-4/+4
| | | | | | | | | | "C:\Documents and Settings" isn't a real path anymore since Windows Vista. Replace it by C:\Users, or - in the snippet for QDesktopServices that is for demoing a path with space - with C:\Program Files. Pick-to: 6.2 6.3 5.15 Change-Id: I1bef97b6482180a6467fffcd1d62d6c168bcb389 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Use find_package(Qt6 REQUIRED COMPONENTS ...) idiomKai Köhne2021-12-092-2/+2
| | | | | | | | | | Using REQUIRED as a prefix instead of suffix works better with OPTIONAL_COMPONENTS, and is also the order in the CMake manual. Task-number: QTBUG-98867 Pick-to: 6.2 Change-Id: I1ab68408b95d8edf06272a3b9fceccd8d8e597fc Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Repair parameter typeChunLin Wang2021-12-033-3/+3
| | | | | | | | | Fix the parameter types corresponding to the sample code and subclasses Fixes: QTBUG-98578 Pick-to: 6.2 Change-Id: I06e342ae1210ed53c5deec3e2711457cf2ac5b15 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add support for combining multiple QFuturesSona Kurazyan2021-11-201-0/+87
| | | | | | | | | | | [ChangeLog][QtCore] Added QtFuture::whenAll() and QtFuture::whenAny() functions, returning a QFuture that becomes ready when all or any of the supplied futures complete. Task-number: QTBUG-86714 Change-Id: I2bb7dbb4cdc4f79a7a4fd494142df6a0f93a2b39 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Add missing QT_TRID_N_NOOP definitionLucie Gérard2021-11-181-0/+14
| | | | | | | | | | | | | Amends c74bd2b93, properly following up on qttools/bc47b5190. [ChangeLog][QtCore] Added missing QT_TRID_N_NOOP() macro. Lupdate actually recognizes it since Qt 5.12. Fixes: QTBUG-98277 Fixes: QTBUG-3945 Change-Id: I0ea15ceb49b2ead5c8bb40d2a55a0ae8577e8850 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* QFuture: extend the docs to explain how to cancel continuation chainSona Kurazyan2021-11-151-0/+17
| | | | | | | Task-number: QTBUG-97582 Change-Id: Ib31d0dfb7a74bb88802a21c5875edd789e412529 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QObjectComputedProperty docs: move example to snippetIvan Solovev2021-10-261-0/+37
| | | | | | | | | | | This patch amends 89a4c8d40d2ee1b8794dd7fcf80d226c5c87ba6c. It moves the code sample into a separate snippet file, which allows us to use Q_OBJECT macro in it without complaints from moc. Task-number: QTBUG-97656 Pick-to: 6.2 Change-Id: I368d8dd8c00dbbebd8a6bf3788be796c8ca4bce8 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QPoint: Don't claim that QPoint[F]::dotProduct() produces length squaredIevgenii Meshcheriakov2021-10-121-2/+2
| | | | | | | | | | | | | The documentation snippets name the result of dotProduct() "lengthSquared", but it is just a coincidence, not the property of dot product of two different points. Just name the result `dotProduct` without claiming any properties. Also fix the type of the result in the QPointF case. Fixes: QTBUG-94979 Change-Id: I4c337dd8335953489eac86c07a219c0a2d232369 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* corelib: Fix typos in source code commentsJonas Kvinge2021-10-121-1/+1
| | | | | | Pick-to: 6.2 Change-Id: Ic78afb67143112468c6f84677ac88f27a74b53aa Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QMetaType: Expand and clean up converter/view function documentationFabian Kosmale2021-09-301-0/+101
| | | | | | | | | | | | | | This adds a few snippets to show how the functions can be used, and also removes workarounds for oldver versions of qdoc that weren't clang based - those workarounds also seem to have caused some bitrot. Remove documentation for an overload of registerMutableView that currently does not exist (for a member function with an ok parameter). Fixes: QTBUG-96963 Pick-to: 6.2 Change-Id: Ibc867d08bcacbc7add8c965df9864d6f339a5d54 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Improve version-related docs in qglobal.cppEdward Welbourne2021-09-211-2/+2
| | | | | | | | | | Give a more pragmatic illustration for QT_DEPRECATED_BEFORE. Make various minor tweaks to wording, use slightly less antique versions in examples. Make usage of "runtime" standard in qglobal.cpp, at least, since "run-time" seems to be less used generally. Change-Id: I1db4950d0d0e97903b1586d98ecba75576493b1c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Encourage use of QT_VERSION_CHECK()Edward Welbourne2021-09-201-2/+2
| | | | | | | | | | | | Document that QT_VERSION should normally be compared against it, rather than raw hex, and mildly update the example versions used in docs. (Left the snippets testing old version, since the code in which the #if-ery is used might actually make sense for those versions.) Improve related documentation in the process. Change-Id: Id3e97f41bfb0f81a117cf7b3a3ccd5f244e2a99a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Rewrite Qt Resource System overviewKai Köhne2021-09-1610-18/+131
| | | | | | | | | | | | | | | | | | | | | | | | Restructure the Qt Resource System page to make the content more accessible, and coherent: - Focus less on the .qrc file format, but the overall use cases - Treat CMake as first-class citizen - Make it more obvious when to use :/, and when qrc:/ Some details that were deemed unnecessary were removed: - details about the internal naming of the .cpp file when qmake is used. - References to QDir::addSearchPath() and the search path list were removed. They relate IMO only indirectly to the Qt resource system. - A lot of the explanation around Q_INIT_RESOURCE/Q_CLEANUP_RESOURCE were dubious at best. Pick-to: 6.2 6.2.0 Fixes: QTBUG-95126 Fixes: QTBUG-94977 Fixes: QTBUG-59394 Task-number: QTBUG-88044 Change-Id: I04b64f2366631b2106f047de121daf5fdb01073d Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Update Qt5:: namespaced targets in snippets to versionless Qt::Craig Scott2021-09-101-4/+4
| | | | | | | | | | | | The docs for CMake commands all show the versionless commands as the primary name, with versioned commands added as a note. Use the same preference for targets for consistency and update the Qt5:: namespaces to Qt:: rather than Qt6::. Task-number: QTBUG-95712 Pick-to: 6.2 6.2.0 Change-Id: I6bf1929a11656f88e27bb5877e9521a3a651361e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Remove unused qt5_... CMake command snippetsCraig Scott2021-09-101-38/+0
| | | | | | | Task-number: QTBUG-95712 Pick-to: 6.2 6.2.0 Change-Id: I92535fd96937638bb8997a63455ba5152055b72a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Teach QByteArrayView how to parse numbersEdward Welbourne2021-08-301-1/+22
| | | | | | | | | | | | Now that we don't need '\0'-termination on the data, this is possible. Moved QByteArray's tests to tst_QByteArrayApiSymmetry and added some more test-cases. [ChangeLog][QtCore][QByteArrayView] Added numeric parsing methods. Change-Id: Ic0df91ecfe5dbf6f008d344dd0464d7927f32273 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QLocale: improve documentation snippetIvan Solovev2021-08-261-9/+11
| | | | | | | | | | | | QString::toDouble() now always uses C locale, so the previous code snippet does not make much sense, as the results do not depend on the selected default locale. The updated snippet uses the default locale, which allows to show the difference between locales. Pick-to: 6.2 Change-Id: I76a00429fa5b75cf109cf45bc25280a7fd427e0f Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Doc: Replace the example for QFileInfo::setFileLuca Di Sera2021-08-252-10/+20
| | | | | | | | | | | | | | | | The example in the documentation of `QFileInfo::setFile` made no use of `setFile` and only showed a use of `QDir::setCurrent`. The example was replaced with a new example showing how `setFile` changes the file that the information are retrieved from. The old example was moved under the documentation for `QDir::setCurrent` as it shows its working. Fixes: QTBUG-87128 Pick-to: 6.2 6.1 5.15 Change-Id: I8227876cfcb4d582040bda9b4b7f3f7debea1e07 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* QRegularExpressionMatch: add a way to know if a capturing group capturedGiuseppe D'Angelo2021-08-251-0/+12
| | | | | | | | | | | | | | | | | | | | | | | Relying on the fact that a given capturing group captured a null string doesn't allow users to distinguish whether a capturing group did not capture anything, or captured a null substring (say, from a null subject string). Perl allows for the distinction: the entries in the @- and @+ arrays are set to values in case there is a capture, but they're undef otherwise. PCRE2 gives us the information already in the results "ovector", but it was simply not exposed to QREM users. So, expose it. [ChangeLog][QtCore][QRegularExpressionMatch] Added the hasCaptured() family of functions to know if a given capturing group has captured something. Change-Id: Ic1320933d4554e2e313c0a680be1b1b9dd95af0b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Improve docs for QFuture continuationsSona Kurazyan2021-08-101-6/+6
| | | | | | | | | | | Replace phrases like "future has been running", "parent" with more precise descriptions. Pick-to: 6.1 6.2 Fixes: QTBUG-95273 Change-Id: Ibd5a464007d41cc437da49ba250b9ea0a46078c6 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Remove app permission API from QCoreApplicationAssam Boudjelthia2021-07-301-141/+0
| | | | | | | | | | | | | From the API review session, a potential deadlock behavior might occur when using QFuture's synchronous APIs on the UI thread. Also the fact that this api currently have an implementation only for Android. For those reasons we thought this API could be postponed until Qt 6.3, when the QFuture concern is addressed and other platforms other than Android are implemented as well. Pick-to: 6.2 Change-Id: I1aef025488c24791da85d15fb57367d3e5e681be Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Rename QPermission namespace to QApplicationPermissionAssam Boudjelthia2021-07-151-16/+16
| | | | | | | | Pick-to: 6.2 Task-number: QTBUG-94407 Change-Id: Ie9c05dbe498cd372c015b5125e6cb8d59ca96b59 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QObject: optimize the common case of findChildren(QString())Marc Mutz2021-07-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Outside tests, all in-tree callers of QObject::findChildren() pass no name to match, and in my experience that is also true for the vast majority of out-of-tree users. Avoid the temporary QString creation in the caller and the repeated QString::isNull() checks in the implementation by overloading findChildren() without a name argument and checking for name.isNull() only once, forking off into separate helper functions. Adjust in-tree callers that used an explicit `QString()` argument in order to pass options, which goes to show that `name` should never have been the first argument of findChilden() in the first place, even though I appreciate the symmetry with findChild() (the use-cases of which, however, are radically different). Change a `findChildren().size() == 0` call found while scanning for findChildren() calls to `!findChild()` as a drive-by. Modernize loops in the various qt_qFindChild{,ren}_helper() overloads to match how the new code looks. [ChangeLog][QtCore][QObject] Added findChildren() overload taking no name (thus optimizing this common case). Change-Id: Ifc56e5438023d079b40c67f11ae274a3e128ad5e Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Fix QStringEncoder code exampleNicolas Fella2021-07-061-1/+1
| | | | | | | | Make sure the right variable is used Pick-to: 6.2 Change-Id: Iec6d8392b320b704423ecbd4434270883fa9fd96 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Doc: Use https for links to unicode.orgPaul Wicking2021-06-251-1/+1
| | | | | | | | | | * Change all outbound links in user-facing documentation. * Reflow lines that exceed 100 cols as mandated by clang-format. * Add unicode.org as a global \externalsite. Pick-to: 6.2 6.1 5.15 Change-Id: I2ba1e434aa913e678406d62c2801f1a8b2d9e4f4 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Doc: Fix snippet for QRandomGenerator64 docsPaul Wicking2021-06-141-1/+1
| | | | | | | Pick-to: 6.2 6.1 5.15 Fixes: QTBUG-94347 Change-Id: Iaf007534214cffc83858833e80dad447df9b297a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Doc: Fix QVariant documentationKai Köhne2021-06-091-9/+5
| | | | | | | | | | Update documentation to not reference API that is obsolete in Qt 6. Also fix documentation for changed behavior (isNull()), and fix snippets. Pick-to: 6.1 6.2 Change-Id: I526efeff63d907bbadd5e8a539ccf237cb992125 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add a const JNINativeMethod[] overload for registerNativeMethods()Assam Boudjelthia2021-06-021-2/+3
| | | | | | | | | | | The JNI interface expects a const JNINativeMethod[] and our wrapper takes a non-const. Also, this was causing refactoring of exisisting code with a const JNINativeMethod[] to fail because the call expects a non-const. Change-Id: If790c401650cb33fe31f93bafe41aab7714488e9 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix QSettings documentationFriedemann Kleint2021-06-011-4/+6
| | | | | | | | | | QMainWindow::saveGeometry()/restoreGeometry() should be used to save and restore geometries instead of saving pos/size since it also works in multiscreen settings. Pick-to: 6.1 Change-Id: I27cc5ec13e69266367f035796e208d214f84b043 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* CMake: Replace qt_finalize_executable with qt_finalize_targetAlexandru Croitor2021-05-201-1/+1
| | | | | | | | | | | | | | | | | | It's very likely that we'll have to run certain finalizer code for targets other than executables. Rename qt_finalize_executable to _qt_internal_finalize_executable so it's internal. Introduce a new function qt_finalize_target which will call the above internal one when the target is an executable. This should future proof the API so we have a hook to call code for any user CMake project that intends to use Qt CMake API. Change-Id: I03f6f4dcba22461351c247a20241ca7de1a59c1d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Doc: Extend qt_add_resource documentationJoerg Bornemann2021-05-191-0/+7
| | | | | | | Pick-to: 6.1 Change-Id: Ia76b1e681eb15cc8ad9de04bb80654e35442c82b Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Doc: Add CMake to the "Resource System" documentationJoerg Bornemann2021-05-161-0/+23
| | | | | | Pick-to: 6.1 Change-Id: I4c6a7cfb2f6351e9587d47ab6708d92a1a4e42a4 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Add new app permissions API under QCoreApplicationAssam Boudjelthia2021-05-051-0/+141
| | | | | | | | | | | | | | | | | | | | | The API allows users to request and check the status of various permissions. A predefined enum class of the common permission types on different platforms is used to allow requesting permission with a common code. Platform specific permissions are defined only on their relevant platform. For permissions that are not predefined, they can be requested via a string variant of this API. This adds the Android implementation only. [ChangeLog][QtCore] Add new API for handling app permissions with an initial implementation for Android. Task-number: QTBUG-90498 Change-Id: I3bc98c6ab2dceeea3ee8edec20a332ed8f56ad4f Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Make QLocale documentation more honestEdward Welbourne2021-04-151-4/+0
| | | | | | | | | | | | | | Documented the fall-back process by which QLocale selects an actual locale based on what it is asked for. The prior documentation was wrong. In the process, removed some out-of-date claims about QString's toInt() and toDouble() caring about the default locale; and caught a few more cases (in \internal docs) of country -> territory. Fixes: QTBUG-90962 Change-Id: I5e7cfa66443c9335a71fb2048c3f2ebf7af64573 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>