summaryrefslogtreecommitdiffstats
path: root/examples/xml
Commit message (Collapse)AuthorAgeFilesLines
* CMake: Add deployment API to our examplesAlexandru Croitor2024-03-221-9/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Projects were modified using the tool at: https://git.qt.io/alcroito/cmake_refactor A couple of examples had to be adapted manually, due to them including more than one app per example subdirectory. The INSTALL_EXAMPLESDIR and INSTALL_EXAMPLEDIR assignments were removed. The install(TARGETS) calls were modified according to our documentation snippets for qt_generate_deploy_app_script. A qt_generate_deploy_app_script call was added for each executable target. Note that the deployment step will be skipped in the CI for now, because we enable QT_DEPLOY_MINIMAL_EXAMPLES and thus QT_INTERNAL_SKIP_DEPLOYMENT, and also because standalone examples are not enabled yet, and deployment is disabled for in-tree (so no-standalone-example) prefix builds. The install(TARGETS) calls for each example will still run, installing the examples into an installed_examples directory, that will not be archived by the CI. Pick-to: 6.7 Task-number: QTBUG-102056 Task-number: QTBUG-102057 Change-Id: Ida389bbad41710b2ae5da4d95e2d85be9e0cd9ce Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Correct license for examples filesLucie Gérard2024-03-072-2/+2
| | | | | | | | | | | | | | Example takes precedent over build system file type. According to QUIP-18 [1], all examples file should be LicenseRef-Qt-Commercial OR BSD-3-Clause [1]: https://contribute.qt-project.org/quips/18 Pick-to: 6.7 Task-number: QTBUG-121787 Change-Id: Id348a89884bb309b96abb31077f14a51086b5d0c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Kai Köhne <kai.koehne@qt.io>
* Add missing \l to DOM bookmarks exampleEdward Welbourne2023-07-251-1/+1
| | | | | | | | | It tried to reference the QXmlStream equivalent example, putting its title in {...}, but neglected the \l prefix to that. Change-Id: Iedc556ecd65103057d0dea65debe628b50d1190e Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
* XBEL DOM example: update the screenshotEdward Welbourne2023-07-103-1/+1
| | | | | | | | | | | The old one showed an old XBEL file's content, with trolltech URLs. Update to match the new XBEL file's content. Pick-to: 6.6 6.5 Task-number: QTBUG-111228 Change-Id: I2b3bb7d67c6f96b04208fe4b1f9af10055dc0496 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Kimmo Leppälä <kimmo.leppala@qt.io>
* Update XBEL examples' sample data fileEdward Welbourne2023-07-101-23/+23
| | | | | | | | | | Most links are now https, several have relocated, one entirely rebranded. Same example in both QXmlStream and DOM forms. Pick-to: 6.6 6.5 Task-number: QTBUG-111228 Change-Id: Ifbc58dadc834cf51113adb1c82de971a8768ee58 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Update Qt Documentation link title in XBEL examplesEdward Welbourne2023-07-101-1/+1
| | | | | | | | | | doc.qt.io was described as Qt 5 documentation; no need to version-limit it. Pick-to: 6.6 6.5 Task-number: QTBUG-111228 Change-Id: I1c5abe3d805c2b845a74b9fe454c494fa1eff4c7 Reviewed-by: Topi Reiniö <topi.reinio@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Doc: Update example category namesKai Köhne2023-07-101-1/+1
| | | | | | Pick-to: 6.5 6.6 Change-Id: If4a50c403ed0fb299ac0d9a66f1f606151c55930 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Examples: "About &Qt" should show info about Qt, not quitEdward Welbourne2023-06-161-1/+1
| | | | | | | | | | | A few examples seem to have copied and pasted a help action "About &Qt" that triggered QCoreApplication::quit. This does not look like best practice. Use QApplication::aboutQt instead. Pick-to: 6.6 6.5 Task-number: QTBUG-111228 Change-Id: I1887a3c999d752a24c7c4d3cabc4a5d63b29b966 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QMessageBox: Remove include of qdebug.hFriedemann Kleint2023-06-161-0/+1
| | | | | | | | | | | | | | | | | Move the implementation qRequireVersion() to prevent having to include qdebug.h which pulls in many other headers. Amends b5d874e36fd39fa6e57ff27db27ae0b029949749. Fix missing include introduced by 3a553507a134bee1562d34ebbf786a053d36fc05. Pick-to: 6.6 Task-number: QTBUG-114214 Task-number: QTBUG-97601 Change-Id: Iba68ffca95061666d9458ffa5700d07c7669da5b Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Brush up the DOM bookmarks exampleFriedemann Kleint2023-06-134-54/+71
| | | | | | | | | | | | | | | | | | | - Use modern string literals (use QStringLiteral instead of QLatin1StringView for strings that go into the DOM API). - Use mime types in the file dialog handling - Streamline code - Remove mentions of SAX - Use per class includes - Do not use QObject::tr() - Use the configure system instead of QT_NO... defines - Fix some doc text typos Complements 3dd3268ded4dd74c64d7ec726fd534375ab9f018. Pick-to: 6.6 6.5 Task-number: QTBUG-111974 Change-Id: If0dc7b61e729d0a71f37743efc9b82e285d3f451 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* XBEL examples: construct the text of the separators cleanlyEdward Welbourne2023-06-121-1/+3
| | | | | | | | | | | Create the fixed string once and reuse it. Also give a name to the escape code that's its repeated character. Pick-to: 6.6 6.5 Task-number: QTBUG-111228 Change-Id: I3d6416070f1d5490ec137e251daff0e1637fb788 Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* There is no frank.xbel so don't tell qmake to find itEdward Welbourne2023-06-091-1/+1
| | | | | | | | | | | | Both the DOM and XML stream versions of the XBEL bookmarks example had a frank.xbel in their EXAMPLE_FILES, but there is no such file. So asking qmake to include it is spurious. Pick-to: 6.6 6.5 Task-number: QTBUG-111228 Change-Id: Iec08042d181fc09c2c428685ce841a13161ab273 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Doc: Add XML, Json, CBOR examples to IO categoryKai Köhne2023-05-091-1/+1
| | | | | | | | Pick-to: 6.5 6.5.1 Task-number: QTBUG-112372 Change-Id: I867bd33ff08629e03b35eccd4b7418573abe7c68 Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Revamp DOM Bookmarks exampleØystein Heskestad2023-05-045-4/+106
| | | | | | | | Fixes: QTBUG-111974 Pick-to: 6.5 Change-Id: Ia62eaf36f616278e49112884db8aec37e2b1dcc5 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
* Move streambookmarks example into corelibe/serializationØystein Heskestad2023-03-3116-768/+1
| | | | | | | | | | | | The stream-based XML serialization API resides in corelib/serialization. Move the steambookmarks example there. The Qt XML documentation is updated to no longer refer to this example code directly and refer to the direct location in the example documentation instead. Task-number: QTBUG-110647 Pick-to: 6.5 Change-Id: Id36fb04a6acb7b8d1eb008f61568fe0abc221e3d Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Move rsslisting example into corelibe/serializationØystein Heskestad2023-03-217-344/+0
| | | | | | | | | | The implementation of the stream-based XML parser resides in coreslib/serialization. Moving the rsslisting example there. Task-number: QTBUG-110647 Pick-to: 6.5 Change-Id: I862909e767301250750b6ee0d8ac7e20d6bad2b1 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Remove libQt6Xml dependency in rsslisting exampleØystein Heskestad2023-03-212-3/+2
| | | | | | | | | This example does not use libQt6Xml, remove dependency. Task-number: QTBUG-110647 Pick-to: 6.5 6.2 Change-Id: Ida8c4df0e274cbc2e0a5f7151f18693d7e1c2401 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Remove libQt6Xml dependency in streambookmarks exampleØystein Heskestad2023-03-212-3/+2
| | | | | | | | | This example does not use libQt6Xml, remove dependency. Task-number: QTBUG-110647 Pick-to: 6.5 6.2 Change-Id: I40e5976121ddc97a78b540d17784b3357b87adf7 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Move xmlstreamlint example into tests/manualØystein Heskestad2023-03-026-185/+0
| | | | | | | | | | This example is useful but not a typical starting point for an application. Task-number: QTBUG-110647 Pick-to: 6.5 Change-Id: Ic4af8ed648c587b91110a7403fa80c619549289d Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Remove htmlinfo exampleØystein Heskestad2023-03-0211-3494/+1
| | | | | | | | | | This example is removed because what it does is already covered by the other XML examples. Task-number: QTBUG-110647 Pick-to: 6.5 Change-Id: If33e3fc55dcd9c7c10cfdfa86405f8bcf5cb6187 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* examples: port xml examples to new connection styleSamuel Gaist2022-12-211-9/+9
| | | | | | Task-number: QTBUG-106893 Change-Id: I1cab8949700d7449f0615731c85a77bb9136b0d3 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Examples: Use PRIVATE CMake linkageKai Köhne2022-11-305-5/+5
| | | | | | | We (almost) only build apps, for which PRIVATE linkage makes more sense. Change-Id: I09a509c3fb33a00cdfdede687b3f95d638f42091 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Examples: Use qt_standard_project_setup()Kai Köhne2022-11-175-10/+10
| | | | | Change-Id: I0ceab08108b7e58e4e2ed25db9e3c289f5c0ddac Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Examples: Use Qt6:: to qualify Qt CMake packagesKai Köhne2022-11-176-18/+18
| | | | | | | This is what we promote also in the documentation. Change-Id: If91aebafe861b0c934acbb2c69afd182abc3345d Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-111-1/+1
| | | | | | | | | | | | | | | | 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, with manual unstaging of the actual definition and documentation in dist/, src/corelib/doc/ and src/corelib/global/. Task-number: QTBUG-99313 Change-Id: I4c7114444a325ad4e62d0fcbfd347d2bbfb21541 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Change the license of all CMakeLists.txt and *.cmake files to BSDLucie Gérard2022-08-236-6/+6
| | | | | | | Task-number: QTBUG-105718 Change-Id: I5d3ef70a31235868b9be6cb479b7621bf2a8ba39 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* QDomDocument: deprecate old setContent() overloads in favor of new onesSona Kurazyan2022-08-171-9/+6
| | | | | | | | | | | | And use the new overloads in examples and tests. [ChangeLog][QtXml][QDomDocument] Deprecated the old setContent() overloads in favor of the new ones that take ParseOptions and ParseError. Task-number: QTBUG-104507 Change-Id: I61b37eba2fe3002c03bddc90f6877676d539f7ec Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add license headers to cmake filesLucie Gérard2022-08-036-0/+18
| | | | | | | | | | | | CMakeLists.txt and .cmake files of significant size (more than 2 lines according to our check in tst_license.pl) now have the copyright and license header. Existing copyright statements remain intact Task-number: QTBUG-88621 Change-Id: I3b98cdc55ead806ec81ce09af9271f9b95af97fa Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-1620-911/+40
| | | | | | | | | | | | | 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: Remove unneeded CMake optionsKai Köhne2022-01-245-20/+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>
* Examples: Fix whitespace issues in CMakeLists.txtKai Köhne2021-12-135-6/+15
| | | | | | 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-136-13/+1
| | | | | | Pick-to: 6.3 Change-Id: Ia5d474a3efd6aadbd0ef1537318f2f24e6c24fee Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Prefer unversioned commandsKai Köhne2021-12-131-1/+1
| | | | | | 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-105-15/+5
| | | | | | | | | 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>
* Remove .prev_CMakeLists.txtKai Köhne2021-12-062-79/+0
| | | | | | | | These are left-overs from the initial qmake2cmake conversion. Pick-to: 6.2 Change-Id: Ie15c9ff022ea4566d10c1ba74599de9af83d29a7 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Raise cmake_minimum_required to VERSION 3.16 in examplesJoerg Bornemann2021-08-175-5/+5
| | | | | | | Pick-to: 6.2 Task-number: QTBUG-95636 Change-Id: I1270b4846d8a23bc3563b6942c0910e095d2be4a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Build examples in isolated sub-builds using ExternalProjectCraig Scott2021-05-261-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* CMake: Regenerate examples to set the WIN32_EXECUTABLE propertyAlexandru Croitor2020-10-276-0/+24
| | | | | | | | | 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-196-6/+6
| | | | | | Task-number: QTBUG-87661 Change-Id: I0dacfdc97a3fb7d88da85b67800f2c1b084d869b Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Another round of replacing 0 with nullptrAllan Sandfeld Jensen2020-10-072-4/+4
| | | | | | | | | This time based on grepping to also include documentation, tests and examples previously missed by the automatic tool. Change-Id: Ied1703f4bcc470fbc275f759ed5b7c588a5c4e9f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Port the QXmlStream API from QStringRef to QStringViewKarsten Heimrich2020-08-191-2/+2
| | | | | | | | | | | | | | 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-097-11/+33
| | | | | | Change-Id: I1c51b10af4e2b26f54740f257164c56a0e2a03ce Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* examples: avoid int -> QChar conversionsMarc Mutz2020-04-292-2/+2
| | | | | | | They're being made explicit/deprecated/removed. Change-Id: I61d8c40dc86035813b85724beb21a65b6f8dffef Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Do not mention Qt XML's SAX API anymore in examples/xml/READMEKai Koehne2020-04-241-5/+3
| | | | | | | | | The SAX API in in Qt XML got deprecated, and examples using it removed in commit 82d02b7b95908. Pick-to: 5.15 Change-Id: I39b71378c0f797e82431c8a0e12255626ed145ed Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devLars Knoll2020-03-041-1/+1
|\ | | | | | | Change-Id: I99ee6f8b4bdc372437ee60d1feab931487fe55c4
| * QNetworkReply: Deprecate 'error' signal, use 'errorOccurred' insteadMårten Nordheim2020-03-031-1/+1
| | | | | | | | | | | | | | [ChangeLog][Deprecation Notice] QNetworkReply::error() (the signal) is deprecated; superseded by errorOccurred() Change-Id: I4f1ef410fd22d34ddf87e89cc5709cc60703af95 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | Regenerate examplesAlexandru Croitor2020-02-047-9/+114
| | | | | | | | | | | | Change-Id: I04b2adbe370ffea81d7787ad90e4ae69d2c165cb Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Post Merge FixesLeander Beernaert2020-01-241-1/+0
| | | | | | | | | | Change-Id: I1e06c01b76b119c3f23b6e6ecbaae8df719b70ce Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Merge remote-tracking branch 'origin/dev' into merge-devLeander Beernaert2020-01-2414-927/+1
|\| | | | | | | Change-Id: I31b761cfd5ea01373c60d02a5da8c33398d34739
| * Deprecate SAX classes in Qt XMLSona Kurazyan2020-01-0612-895/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Deprecated the SAX classes and disabled or replaced their uses in tests if applicable. Removed the saxbookmarks example, no point in keeping examples for the deprecated code. [ChangeLog][QtXml] SAX classes are now deprecated. Use QXmlStreamReader, QXmlStreamWriter in QtCore instead. Task-number: QTBUG-76177 Change-Id: Ic171d62fa0527b0f36f94cf09a69586092269957 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io>