summaryrefslogtreecommitdiffstats
path: root/examples/corelib
Commit message (Collapse)AuthorAgeFilesLines
* savegame ex.: fix include order [2/2]: game.hMarc Mutz2023-02-081-3/+3
| | | | | | | | | | | | | | | Includes should be ordered from most specific to most general. This means that project-specific includes always come before Qt includes. This example didn't follow that guideline. Fix. Amends 88e8094f18e6581f2b652eb3d82f514ecf687046. Task-number: QTBUG-108857 Change-Id: Iafdae9dd8e70ff99882c4344a023a21d15fa3c54 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit ac6e8b3b21c2ae25e7a4fe483b604ea6ddecd3ff) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* savegame ex.: make Level ctor explicitMarc Mutz2023-02-081-1/+1
| | | | | | | | | | | A QString is not a full representation of a Level, so the Level(QString) ctor should be explicit. Task-number: QTBUG-108857 Change-Id: I24b705139e61c4aaf59cb0aad3b536013e0d07df Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit fa55d46e1f09ddf45dbe5700d4637b003363c559) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* savegame ex.: use ranged instead of indexed loopsMarc Mutz2023-02-082-4/+4
| | | | | | | | | | Modernizes the code, and fixes qsizetype/int mismatch. Task-number: QTBUG-108857 Change-Id: Id4262ee0bcb673d62135a81c30976903eef3e5e2 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 44933343937d7a6d9f6afe1f8e0b0f93a387b100) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* savegame ex.: use NSDMI, =default the default ctorMarc Mutz2023-02-082-6/+4
| | | | | | | | | | Modernizes the code. Task-number: QTBUG-108857 Change-Id: I6ddf1de3699506ffc0fc4b1034ab48defafcf174 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 35b94f8b4349581c548b7aac2e858750072efa19) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* savegame ex.: fix include orderMarc Mutz2023-02-082-3/+4
| | | | | | | | | | | | | Includes should be ordered from most specific to most general. This means that project-specific includes always come before Qt includes. This example didn't follow that guideline. Fix. Task-number: QTBUG-108857 Change-Id: I42727ff8bdef5336368cde349cbcb8d10bb6289f Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 88e8094f18e6581f2b652eb3d82f514ecf687046) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* savegame ex.: fix extra ';' after Q_GADGETMarc Mutz2023-02-081-1/+1
| | | | | | | | | | | | Fixes compiler warnings. Amends 1ff52e478bab33f3aaba5ec185295411a0e6867d. Task-number: QTBUG-108857 Change-Id: Id8b81c67e55baf490aabd0483b5800b3e61965ee Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 06a9b85f8fec8d039aa0e63cea0e16037611bf79) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Link update for Data Input Output in the save game exampleJaishree Vyas2023-01-081-1/+1
| | | | | | | Change-Id: I2a886766d59b9e75f42e401fca9c258fcbe02809 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> (cherry picked from commit aae855bd6f87533590b5f91ab7104276d58763ce) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Fix broken linkAndreas Eliasson2023-01-021-5/+5
| | | | | | | | | | | Also, adjust line length to be < 80 columns and make link parenthetical. Fixes: QTBUG-107026 Change-Id: I5f7efa5d572103a6fb432d79a52a57363efd9dd7 Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io> (cherry picked from commit b556d6227f848d42a10d4f0fc5424bd094e56288) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Wait conditions example: fix an incorrect condition variable usageGiuseppe D'Angelo2022-12-292-15/+16
| | | | | | | | | | | | | | | | | | | | | 3a449bbb69c9a3c3a5bc6a052f2de98ab79be7e9 amended the code to remove acquiring a lock when waking up a condition variable. It is fine to not have a lock associated when waking a condition variable; what I misunderstood was the scope of the lock, which (and this underlines the importance of commenting _what exactly_ a lock protects, for each and ever lock) protected both the buffer as well as the counter of the buffer. This made my reasoning flawed: it is necessary to keep the lock while notifying, otherwise the counterpart could verify the condition isn't satisfied and wait (e.g. see numUsedBytes==0), missing the wake from the other thread (which could arrive between the check and the wait). Amends the previous commit. Change-Id: If7db2d045331f1b33b976fb6bf6aa9117c41678f Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> (cherry picked from commit fddeec60cba806b88c5eb0e4758c3951457518a2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Wait conditions example: code tidiesGiuseppe D'Angelo2022-12-062-29/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | In no particular order: * Clean up #includes. * Document what is protected by the mutex. * Use explicit, nullptr. * Use lock managers, not manual calls to lock/unlock. * Unlock the mutex before notifying the condition variables. * Condition variables are always meant to be used in a while loop, and never with a plain if, because of spurious wakeups. * Don't lock a mutex just to protect a plain integer. We have atomics for that use case. * Remove an unneeded signal, therefore also the need of using Q_OBJECT and the inclusion of the moc-generated file. Fixes: QTBUG-108860 Change-Id: I2afc77955b95de8aa5fb88048cd9feb217f83b4f Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 3a449bbb69c9a3c3a5bc6a052f2de98ab79be7e9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Port from qAsConst() to std::as_const()Marc Mutz2022-11-182-7/+7
| | | | | | | | | | | | | | | | We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace. This is a 6.4 re-run of the script we ran in dev, in order to avoid conflicts between the branches when cherry-picking. Change-Id: I5eca3df3179dfb2b2682c75a479ba9a4259cc703 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* examples: fix configuring with -no-feature-widgetsJohannes Kauffmann2022-11-021-1/+3
| | | | | | | | | | It also fails for -no-feature-gui, but since the example depends on QtWidgets, which implies depending on QtGui, we only check for QtWidgets here. Change-Id: I777e540e6c2101ce8f08a5f80ba01b37ff858373 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 5143670855174d5c86768daf2a4a43c6a0302727)
* Add CBOR documentationØystein Heskestad2022-09-027-5/+145
| | | | | | | | | | | | Add documentation of usage of CBOR in convert and cbordump examples, add a CBOR overview, and add links to them other places in the documentation. Task-number: QTBUG-85912 Change-Id: I518792db63647bf9ddd4507d8d4b7ef056192f82 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 855a9ca217ad3b9d8eb8f6544698a174323843fc) Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
* Support pinch zoom gesture in the Mandelbrot exampleNicholas Bennett2022-07-214-15/+59
| | | | | | | | | | | | | | | | | | | Used QGesture for this as per the gesture example. Moved the help and info text to separate lines. Enabled word wrap to prevent text going off screen. As a drive-by, the code to center the window at a size that's a fraction of the screen is replaced with a simple sizeHint() override. The user should have control over placement, particularly now that it should be placed manually onto a touchscreen if the user has one. Done-with: Shawn Rutledge Fixes: QTBUG-96702 Change-Id: I8dba8b09bed474f585341e9a7a8c71fb60293eee Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit fc5482cac6e69364c9d09fb8d994065e2a5fb542) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix typos in docs and commentsKai Köhne2022-06-154-4/+4
| | | | | | | | | | Found by codespell Change-Id: Ie3e301a23830c773a2e9aff487c702a223d246eb Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 9d2cc4dd766ca6538e17040b6ac845ed880ab0fe) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Use SPDX license identifiersLucie Gérard2022-05-1690-4111/+180
| | | | | | | | | | | | | 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>
* Examples: Do not depend on transitive includesFabian Kosmale2022-03-171-0/+1
| | | | | Change-Id: I7bba855a14289edbedbaa07a1234213f59085c1d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Use QDebugStateSaver in example operator<<()Kai Köhne2022-03-161-1/+2
| | | | | | | | | | This makes sure that changes in the debug stream - like nospace() - do not "leak". Also use the example snippet in QDebugStateSaver documentation. Pick-to: 6.2 6.3 Change-Id: I934976d2c7c2335abfec68c763526a5cbb0e6f1e Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Examples: Remove unneeded CMake optionsKai Köhne2022-01-2417-65/+0
| | | | | | | | | | | | | | | CMAKE_INCLUDE_CURRENT_DIR is not necessary anymore for moc since CMake 3.8: https://cmake.org/cmake/help/latest/release/3.8.html#other-changes CMAKE_AUTORCC should not be used anymore. Instead, we now use qt_add_resources() or similar Enable CMAKE_AUTOUIC only if .ui files are present. Pick-to: 6.3 Task-number: QTBUG-87643 Change-Id: I835e2994cd5dba9918136999499b9077961b616c Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* bindablesubscription: Remove duplicated file entryKai Köhne2021-12-191-1/+0
| | | | | | Pick-to: 6.2 6.3 Change-Id: I7f24425c8ccfb11bda926373099d377f808a70dd Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* mandelbrot example: Remove explicit linking against libmKai Köhne2021-12-172-8/+0
| | | | | | | | It seems not needed anymore with modern toolchains. Pick-to: 6.3 Change-Id: Ic5386cad4576b10f49fd74212f3514e26cfb0abe Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Examples: Clean up WIN32_EXECUTABLE, MACOSX_BUNDLE propertiesKai Köhne2021-12-175-25/+0
| | | | | | | | | | | | Both are FALSE by default, so no point in explicitly setting them to FALSE. In addition, dbus/listnames is a command line tool. No reason to set WIN32_EXECUTABLE, MACOSX_BUNDLE here. Pick-to: 6.3 Change-Id: I99aaf27a0267c5575bd2ee5b6183991fce721f44 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* androidnotifier: Simplify example CMakeLists.txtKai Köhne2021-12-171-33/+35
| | | | | | | | | Building the example when not on android makes little sense. Therefore just error out in this case. Pick-to: 6.3 Change-Id: Ib7325156bcd8ffd1b9b3e67174d878f5731a4a4f Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Examples: Fix whitespace issues in CMakeLists.txtKai Köhne2021-12-1317-18/+47
| | | | | | Pick-to: 6.3 Change-Id: I8e6dd1f250f8be6016ee4164cb2ab7034cbb1203 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Examples: Remove remaining conversion markers in CMakeLists.txtKai Köhne2021-12-1320-40/+0
| | | | | | Pick-to: 6.3 Change-Id: Ia5d474a3efd6aadbd0ef1537318f2f24e6c24fee Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Prefer unversioned commandsKai Köhne2021-12-133-3/+3
| | | | | | Pick-to: 6.3 Change-Id: Ib32700ab82cf6b271c49e25d12fbad8c9c6bc1d1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Examples: Use find_package(Qt6 REQUIRED COMPONENTS ...) idiomKai Köhne2021-12-1017-41/+17
| | | | | | | | | Also consolidate several find_package(Qt6 ...) calls in one call. Task-number: QTBUG-98867 Change-Id: Idfd5e71f46d4489fac7411cbfadb84437a0658f3 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Do not support Qt5 build in androidnotifier exampleKai Köhne2021-12-061-6/+3
| | | | | | | | We can expect that users use Qt 6 to try out Qt 6 examples. Pick-to: 6.2 Change-Id: Ifa7bd9471a712fa1d63107b7ff2d392b7aefdcfe Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Document the example showing the benefits of using bindable propertiesSona Kurazyan2021-12-0212-0/+267
| | | | | | | | | | | And mention the example in the bindable properties docs. Pick-to: 6.2 Task-number: QTBUG-97655 Change-Id: I676e90dbda66c2e718c7f6c2240fac608a8653df Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add example showing the benefits of using bindable propertiesSona Kurazyan2021-12-0224-0/+1492
| | | | | | | | | | | | | Added two examples for modeling a subscription service: signal/slot connection-based and bindable property-based. The examples are based on the example from Fabian's Qt WS talk about the bindable properties. Pick-to: 6.2 Task-number: QTBUG-97655 Change-Id: I0345913b8b6e5c40b8477e128d36483598bdfcaa Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Doc: Centralize RFC documentation-links in rfc.qdocLuca Di Sera2021-09-161-1/+1
| | | | | | | | | | | | | | | | | | | | In the effort of repairing broken links as per QTBUG-96127, a series of RFC links referring to `tools.ietf.org/html/*` were modified to point to the new address that the site redirected to. To simplify executing a similar task and to diminish the duplication of manually inserted urls, the already existing `rfc.qdoc` file, containing `\externalpage` commands directing to RFC locations, was enhanced with links to all RFCs that were mentioned in the current documentation, so as to aggregate this common category of links. All links pointing to a `ietf` domain inside QDoc documentation blocks were then changed to use the newly provided external-references. Task-number: QTBUG-96127 Pick-to: 6.2 Change-Id: I2a52eb6aa8c9e346f64ef1a627b039220d9f6c2a Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Port to QImage and QPixmap deviceIndependentSize()Morten Sørvig2021-09-011-2/+2
| | | | | | | | | Replace the “size() / devicePixelRatio()” pattern with a call to deviceIndependentSize(). Change-Id: I9d9359e80b9e6643e7395028cd43e3261d449ae7 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Raise cmake_minimum_required to VERSION 3.16 in examplesJoerg Bornemann2021-08-1715-15/+15
| | | | | | | Pick-to: 6.2 Task-number: QTBUG-95636 Change-Id: I1270b4846d8a23bc3563b6942c0910e095d2be4a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Android: trim down the examples manifests from obsolete tagsAssam Boudjelthia2021-07-011-62/+39
| | | | | | Pick-to: 6.2 Change-Id: I4a1fe025e59f724fb9aad8078198474f14d29feb Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* Remove ministro codeAssam Boudjelthia2021-07-011-2/+0
| | | | | | | | | | | | | | Since Ministro no longer work on recent Android versions (Android 8+), and it hasn't been maintained and the repos are not updated, the existing code is practically a dead code. [ChangeLog][Android] Remove ministro code since it's been unmaintained and not working with recent Android versions. Task-number: QTBUG-85201 Pick-to: 6.2 Change-Id: I18d7b1e209cba3cfd04674060e9bf39aa5a5510f Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* Move notification example from androidextras to qtbaseAssam Boudjelthia2021-06-0422-1/+613
| | | | | | | | | | | | Refactor android notification example to fit in qtbase. The example demonstrates how to use JNI and work with Java APIs and add custom Java code to a Qt app targeting Android. Task-number: QTBUG-84382 Change-Id: I5fcbbf77b36eb47a0acaa13835ef3d773e63885c Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* Build examples in isolated sub-builds using ExternalProjectCraig Scott2021-05-265-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Examples are intended to show how to build against an installed Qt. Building them as part of the main build means the way the Qt targets are defined and created are not representative of an end user's build. By building them as separate projects using ExternalProject, we can more closely replicate the intended audience's environment. This should allow us to catch more problems earlier. Having examples built as part of the main build also creates problems with some static builds where a tool built by the main build is needed during configure time. This happens with other repos like qtdeclarative but not (currently) with qtbase. Converting the examples in qtbase to be built using ExternalProject is intended as a demonstrator for how other repos can do similar. Until other repos are converted, they will continue to work as they did before, with examples as part of the main build for non-static builds only. The new build-externally behavior is only supported for non-prefix builds with this change. Prefix builds will continue to use the old non-external method. Support for building examples externally in prefix builds will be a separate change. Task-number: QTBUG-90820 Fixes: QTBUG-91068 Change-Id: I2304329940568dbdb7da18d54d5595ea7d8668bc Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Brush up the mandelbrot exampleFriedemann Kleint2021-04-145-12/+77
| | | | | | | | | | | | | | | | | | | The example refines the image by running a number of passes with increasing number of iterations, which is not really visible to the user. Set an informational text string on the generated image which provides this information along with the elapsed time. The idea is to do the same to the corresponding Qt for Python example to have some sort of speed comparison for number crunching. Add a command line option for the number of passes. Make the window a bit larger to accommodate the information. Change-Id: I2afc1009ab53b580123d82a6aa645d9ffaa63ea2 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Doc: Fix link issues for QtCoreTopi Reinio2020-10-291-3/+2
| | | | | | | | | - Fix linking to CMake manual. - Remove references to the state machine framework. Task-number: QTBUG-86295 Change-Id: I01a61088da8eb36760949f39be5e71d92de956f2 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* CMake: Regenerate examples to set the WIN32_EXECUTABLE propertyAlexandru Croitor2020-10-2714-0/+56
| | | | | | | | | As well as the MACOSX_BUNDLE properties as necessary. Task-number: QTBUG-87664 Task-number: QTBUG-86827 Change-Id: I7677449a26d51fa853bd67bab6b3b61afbd2b12f Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Regenerate examples to use qt_add_executableAlexandru Croitor2020-10-1914-14/+14
| | | | | | Task-number: QTBUG-87661 Change-Id: I0dacfdc97a3fb7d88da85b67800f2c1b084d869b Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Port from devicePixelRatioF() to devicePixelRatio()Morten Johan Sørvig2020-09-101-6/+6
| | | | | | | This ports all of QtBase. Change-Id: If6712da44d7749b97b74f4614a04fac360f69d9e Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Deliver Quit event when calling QCoreApplication::quit()Tor Arne Vestbø2020-09-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of QCoreApplication::quit() directly calling exit(0), which would leave QGuiApplication and client code out of the loop, we now send the Quit event, and let it pass through event delivery, before finally ending up in QCoreApplication::event(), where we call exit(0). This has the advantage that QGuiApplication can ensure all windows are closed before quitting, and if any of those windows ignore the close event the quit will be aborted. This aligns the behavior of synthetic quits via QCoreApplication::quit() with spontaneous quits from the platform via QGuiApplicationPrivate::processApplicationTermination. Clients who wish to exit the application without any event delivery or potential user interaction can call the lower level exit() function directly. [ChangeLog][QtGui] Application termination via qApp->quit() will now deliver Quit events to the application, which in turn will result in application windows being closed as part of the application quit, with an option to cancel the application quit by ignoring the close event. Clients who explicitly want to exit the application without any user interaction should call QCoreApplication::exit() explicitly. Task-number: QTBUG-45262 Task-number: QTBUG-33235 Task-number: QTBUG-72013 Task-number: QTBUG-59782 Change-Id: Id4b3907e329b9ecfd936fe9a5f8a70cb66b76bb7 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* High-DPI: Remove usage of Qt::AA_EnableHighDpiScalingTor Arne Vestbø2020-08-281-1/+0
| | | | | | | | This attribute is now on by default. Change-Id: I7c9d2e3445d204d3450758673048d514bc9c850c Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Deprecate the static int based API in QMetaTypeLars Knoll2020-08-241-3/+3
| | | | | | | | | | | | | 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>
* Automatically register data/debug stream operations in QMetaTypeLars Knoll2020-08-242-3/+0
| | | | | | | | | | | | | | | | | | | | | | And remove the old manual registration code for those operators. Add some special handling for long/ulong, as these types could be streamed as a QVariant so far, but are not directly streamable through QDataStream. [ChangeLog][QtCore][QMetaType] The QMetaType::registerStreamOperators() and QMetaType::registerDebugStreamOperator() methods have been removed. The streaming operators for a type are now automatically registered together with the type registration. This implies that the operators should be visible wherever the type is visible and being used. [ChangeLog][Behavior Incompatible Changes] Because the QDataStream and QDebug serialization operators are automatically registered with QMetaType, the declarations of those functions must be present at any point where the type is used with QMetaType and QVariant. Change-Id: I4a0732651b20319af4a8397ff90b848ca4580d99 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Move QStringRef and remains to Qt5CompatKarsten Heimrich2020-08-202-4/+3
| | | | | | | | | Export some private functions from QUtf8 to resolve undefined symbols in Qt5Compat after moving QStringRef. Task-number: QTBUG-84437 Change-Id: I9046dcb14ed520d8868a511d79da6e721e26f72b Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Port the QXmlStream API from QStringRef to QStringViewKarsten Heimrich2020-08-191-4/+4
| | | | | | | | | | | | | | This gives some source incompatibilities, most of them can be handled by using auto instead of QStringRef explicitly. [ChangeLog][Important API changes] QXmlStream now uses QStringView insteead of QStringRef in it's API. Using auto forvariables returning a QStringRef in Qt 5 should lead to code that can be used against both Qt versions. Fixes: QTBUG-84317 Change-Id: I6df3a9507276f5d16d044a6bdbe0e4810cf99440 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* CMake: Regenerate examplesAlexandru Croitor2020-07-0919-25/+79
| | | | | | Change-Id: I1c51b10af4e2b26f54740f257164c56a0e2a03ce Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Use QList instead of QVector in examplesJarek Kobus2020-06-238-18/+18
| | | | | | Task-number: QTBUG-84469 Change-Id: Id14119168bb1bf11f99bda7ef6ee9cf51bcfab2e Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>