summaryrefslogtreecommitdiffstats
path: root/examples/corelib/bindableproperties/bindablesubscription
Commit message (Collapse)AuthorAgeFilesLines
* Correct license for examples filesLucie Gérard2024-03-071-1/+1
| | | | | | | | | | | | | | 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>
* Revamp Bindable Subscription ex: Cretae QString using a Literal operatorRym Bouabid2023-09-221-8/+10
| | | | | | | | | | | Create QString at compile time using the literal operator""s instead of using pointer to characters. This way, no conversion or allocation will occur at runtime. Task-number: QTBUG-117422 Pick-to: 6.6 6.5 Change-Id: I92eed0a371bf6383ddb1e938646029f1c24242bf Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Revamp Bindable Subscription ex: Fix includesRym Bouabid2023-09-223-5/+4
| | | | | | | | | | | | | Reorder the includes following the coding conventions. Remove unneeded includes. Add needed includes to avoid Transitive includes. Task-number: QTBUG-117422 Pick-to: 6.6 6.5 Change-Id: Iaf2b939bc160312de8aa4035da03b648cf76f17d Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Make examples/bindableproperties a proper projectKai Köhne2023-09-221-40/+5
| | | | | | | | | | | | Both executables (subscription, bindablesubscription) are documented as one project. Make sure that e.g. Qt Creator can also load this project. Fixes: QTBUG-117109 Pick-to: 6.5 6.6 6.6.0 Change-Id: I3912f2f76379940b02f3a57a7a55440a30366755 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* examples/: compile with QT_NO_CONTEXTLESS_CONNECTAhmad Samir2023-09-081-6/+6
| | | | | | | | | | | | | | | | | Examples are usually a good way to get to know a new codebase, do not teach developers who are new to Qt about the 3-arg connect() to begin with. Drive-by changes: - `this` can't be implicitly captured with [=] in a lambda, instead capture by reference - Update docs related to the sqlbrowser example; the overloaded signal it mentions has been removed in Qt6 - In the sqlbrowser example, rename addConnection() (no-arg) overload to openNewConnectionDialog, suggested in code review Change-Id: I30c9f35bda4ac2f460d767ab7f84422ae3ed09f7 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* examples/: fix compiler warnings -Wdeprecated-enum-float-conversionAhmad Samir2023-08-181-1/+2
| | | | | | | This is with GCC. Change-Id: I52dcb6881f36c740129b699db7db9241a4e75da1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Revamp bindable subscription exampleAmanda Hamblin-Trué2023-06-281-0/+2
| | | | | | | | | Silence a bogus warning. Pick-to: 6.6 6.5 Task-number: QTBUG-114689 Change-Id: I7267b752e780b0c48cc57a513d12ad504e4c7a30 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QBindable example: Replace SpinBox connection with QBindableAmanda Hamblin-Trué2023-06-281-3/+6
| | | | | | | | | | Made this change because there was no example of the interaction between QBindable and non-bindable properties. Pick-to: 6.6 6.5 Task-number: QTBUG-114689 Change-Id: Ief7662f8af5e6fab32491418fa35f0daa937819d Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Revamp Bindable Properties ExampleAmanda Hamblin-Trué2023-06-261-2/+1
| | | | | | | | | | | | The use of Q_ASSERT(false) is bogus as we don't need to test here, but want to signal unreachability. Q_UNREACHABLE_RETURN allows us to tell the compiler that the point can't be reached while also getting rid of the no return error. Task-number: QTBUG-114689 Pick-to: 6.6 6.5 Change-Id: I007cd243055237bcc21772a4130a6c1a44fd882d Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Update the bindable properties exampleJames DeLisle2023-03-094-15/+13
| | | | | | | | | | | | - Fix the number of months in each duration - Move the user Country enum to use QLocale::Territory - Properly calculate the cost per month to match the UI label - Use QLocale to format the price display text - Fix some misspellings and grammar in the doc Pick-to: 6.2 6.5 Change-Id: I78a64f344073070cd94d5cb4a8a4c7c13afa337f Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Examples: Use PRIVATE CMake linkageKai Köhne2022-11-301-1/+1
| | | | | | | 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-171-3/+2
| | | | | Change-Id: I0ceab08108b7e58e4e2ed25db9e3c289f5c0ddac Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Examples: Use Qt6:: to qualify Qt CMake packagesKai Köhne2022-11-171-3/+3
| | | | | | | This is what we promote also in the documentation. Change-Id: If91aebafe861b0c934acbb2c69afd182abc3345d Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Change the license of all CMakeLists.txt and *.cmake files to BSDLucie Gérard2022-08-231-1/+1
| | | | | | | 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>
* Add license headers to cmake filesLucie Gérard2022-08-031-0/+3
| | | | | | | | | | | | 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-165-245/+10
| | | | | | | | | | | | | 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-241-3/+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>
* Examples: Fix whitespace issues in CMakeLists.txtKai Köhne2021-12-131-1/+2
| | | | | | Pick-to: 6.3 Change-Id: I8e6dd1f250f8be6016ee4164cb2ab7034cbb1203 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-101-3/+1
| | | | | | | | | 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>
* Document the example showing the benefits of using bindable propertiesSona Kurazyan2021-12-025-0/+23
| | | | | | | | | | | 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-027-0/+510
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>