Commit Graph

27 Commits

Author SHA1 Message Date
Axel Spoerl a86081100d Revert "Port samegame to qt_add_qml_module"
This reverts commit 8fc3cd6675.

Reason for revert: As opposed to the commit message, this is not a minimal port. It changes the directory structure of the example, by starting to popuplate the previously empty samegame/samgame directory inconsistently. It breaks qtdoc build with examples.

Change-Id: I0749043047b21a34b613f73e36f2ade629e41f8d
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2024-01-17 07:16:10 +00:00
Ulf Hermann 8fc3cd6675 Port samegame to qt_add_qml_module
This is a minimal port that only establishes the module structure
without touching any of the actual QML code.

Change-Id: I122156d15c0ee391f519b0894a51acad99551c5c
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
2023-12-21 17:32:56 +01:00
Kai Köhne bc427f00da samegame: Fix warning about undeclared function parameter
Task-number: QTBUG-119203
Pick-to: 6.5 6.6
Change-Id: I92497a7c907d0382d037690bf7803650c665b77e
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2023-12-03 10:38:16 +01:00
Kai Köhne 662d283ba3 Categorize Same Game as Application Example
Also simplify name to 'Same Game'.

Pick-to: 6.5 6.6
Task-number: QTBUG-117207
Change-Id: I6c16698bea3bc853ac7632d058e5f6c65a55a1d8
Reviewed-by: Mats Honkamaa <mats.honkamaa@qt.io>
2023-10-17 06:56:02 +00:00
Friedemann Kleint 17e7109f01 Examples: Use consistent organization names and settings paths
Set the organization name to "QtProject".
Set an application name to Hangman to be used by QSettings.
Remove unused QSettings instance from Thermostat.
Let QSettings in Document Viewer use defaults.

Pick-to: 6.6
Change-Id: I8ebaeb444cd18bab95424f0efea670b02d41e657
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2023-07-04 13:43:26 +00:00
Kai Köhne 5d65a35fc9 Examples: Use private linkage where possible
Pick-to: 6.5
Change-Id: Ib5e0b7c7ace6f399b4742eec5879eb06cf67debf
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-05-02 14:03:52 +02:00
Kai Köhne d02810b25f Examples: Use unversioned CMake commands
Prefer unversioned commands over qt6_ ones - even though the
target-based qt_add_resources command is actually new in Qt 6.
But we will evolve the API also between major Qt versions,
so it's better to work with the Qt policies mechanism instead
of relying on version numbers in the command API.

Pick-to: 6.5
Change-Id: If302abb1f22a7ab96c98a8ad2e9c871b9bedb0e9
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-05-02 14:03:48 +02:00
Kai Köhne 835f15cfbb Use versioned CMake targets for Qt modules
Use e.g. Qt6::Core instead of Qt::Core. This is better matching the
find_package(Qt6 ...) call, and also avoids issues that the versionless
targets have.

Pick-to: 6.5
Task-number: QTBUG-113277
Change-Id: I9bc7963d8524ef2ab061e32aef428711646247a7
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-05-02 12:03:42 +00:00
Kai Köhne bc21f7f606 Examples: Add tags for the welcome screen
Only the coffee machine example had some tags already. Add them
also for the rest, but inside the .qdoc file, instead of the
more clunky/verbose tagging in the .qdocconf file.

Pick-to: 6.4
Change-Id: I37640c2296c67413361f7987122c5e7daa1f12b0
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2022-10-09 21:10:07 +02:00
Lucie Gérard d490baa159 Change the license of all CMakeLists.txt and *.cmake files to BSD
Task-number: QTBUG-105718
Change-Id: Iec124e0bceb4335370674a222970cd9c1b90763f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-08-23 10:01:38 +02:00
Lucie Gérard 37540e46fb Add license headers to cmake files
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: I9499ba4c20f610ffe8af0fc3e29e6581247f2c40
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-07-07 14:45:33 +02:00
Lucie Gérard 6f57506953 Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.
License files are organized under LICENSES directory.

Pick-to: 6.4
Task-number: QTBUG-67283
Change-Id: Idfd176b7f7b077a5b7c66b7738dc9bcac94ab290
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-06-07 18:23:52 +02:00
Kai Köhne 0e7a4b0593 Examples: Remove unneeded CMake options
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

Enable CMAKE_AUTOUIC only if .ui files are present.

Pick-to: 6.3
Change-Id: Ic34418e3306de0ee1769bc3153bb833f7951da19
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-01-25 10:17:05 +01:00
Kai Köhne 3dae1461ac Examples: Improve CMakeLists.txt files
Pick-to: 6.2 6.3
Change-Id: I7582f6c1b9daacaf694355269663b1d6616e0c05
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-01-20 18:05:52 +01:00
Joerg Bornemann 02524fb04f Remove CMAKE_AUTORCC from demos
All demos are using qt6_add_resources.

Pick-to: 6.2 6.3
Task-number: QTBUG-87643
Change-Id: I14c7d876b2ac3b1a24cec78fbd4463a46c71e564
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-01-20 12:59:29 +01:00
Alexandru Croitor c401aaa21e CMake: Bump almost all cmake_minimum_required calls to 3.16
Needed for subsequent change that will check and error out if the
version is lower than 3.16. We do that to ensure all policies
introduced by CMake up to version 3.16 have their behavior set to
NEW.

Pick-to: 6.2
Task-number: QTBUG-95018
Change-Id: I23a59d7bfa89ffdacf8002b03657b7da38669ee2
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2021-09-22 19:51:30 +02:00
Fabian Kosmale 9cd6e10458 samegame: resolve URL correctly
The url resolution change in Qt 6 broke the example.

Fixes: QTBUG-89040
Pick-to: 6.0
Change-Id: I80fa6083ab4c86f2752162f4e34bbfb639cfb027
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-12-02 16:49:40 +01:00
Kai Koehne 7b7d6936a5 samegame: Fix deprecation warnings
Fixes warnings for

  QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }

Pick-to: 6.0
Change-Id: Ifa6065856e4947b779ab75922d05e50e8be985bd
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-12-02 15:05:08 +00:00
Kai Koehne 9194f8602b examples: Do not use versioned QML import
Ignore .ui.qml files though for now, until they are properly handled
by Qt Design Studio.

Task-number: QTBUG-89033
Change-Id: I85ea1dc2f85928e9fa1f473535687ab8b0288e9d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-12-02 16:04:51 +01:00
Alexandru Croitor 07b7d54679 CMake: Regenerate examples to set the WIN32_EXECUTABLE property
As well as the MACOSX_BUNDLE properties as necessary.

Task-number: QTBUG-87664
Change-Id: I474b13a0a78a33fff1d06b283a88b0c33a7dd524
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-10-26 21:19:52 +01:00
Robert Loehning 01b88573eb Examples: Don't enable high DPI scaling explicitly
Compiler complains that's deprecated and always on.

Change-Id: Ic42db6288cde5c95093715afd5df98368d67bd1f
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-10-23 13:07:39 +02:00
Alexandru Croitor 8097af244f CMake: Regenerate examples to use qt_add_executable
Task-number: QTBUG-87661
Change-Id: Id97b3405ce69eb5db61790e8187a48762f3067db
Reviewed-by: Daniel Smith <Daniel.Smith@qt.io>
2020-10-20 09:13:19 +02:00
Alexandru Croitor a48182cb96 CMake: Regenerate projects before API change
Task-number: QTBUG-86815
Change-Id: Id8da24b8a26f0263324a8fed5fd9cedbfa3ee11a
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2020-10-01 14:36:23 +02:00
Venugopal Shivashankar de6cc8c379 CMake: Port the build setup to CMake
Fixes: QTBUG-83910
Change-Id: If0ebd9d0b528cd84ffe92955b7d1c4d580d397fb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-05-04 23:00:45 +02:00
Kai Koehne cc1a7a75ec Make examples self-contained
Remove shared main entry function and shared resources (that were not
used anyway), and simplify the entry point:
* Get rid of special handling of QT_QUICK_CORE_PROFILE,
  QT_QUICK_MULTISAMPLE environment variables.
* Remove QQmlFileSelector, which is not used in the examples.
* Do set QtCoreAppication::organizationName to 'QtExamples', so that the
  settings are separate from QtProject. This follows recent changes in
  Qt WebEngine examples.

Change-Id: I01851b3434901fefc2738136a2f1795d682a3233
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-01-24 11:00:51 +00:00
Frederik Gladhorn bf8e5b17c1 Move shared example folder to examples/demos/shared
The root examples directory should not contains shared folders. In the
past multimedia was the only module installing things there, now the
qtdoc module started doing the same. Let's clean up both.

Fixes: QTBUG-69784
Change-Id: Id9f98711e1dff3f610bafddc2a8bebbb764e1504
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2018-08-20 15:00:50 +00:00
Venugopal Shivashankar 70ce5f4d3e Move demos to qtdoc repository
These demos use several modules and moving them allows to use for
example Qt Quick Controls 2 in them.

The shared directory should be removed and the examples made
self-contained.

Change-Id: I5dc667d22388651894d7d145b65752bc5c5cf6cf
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2018-07-09 12:43:59 +00:00