Commit Graph

4 Commits

Author SHA1 Message Date
Sami Shalayel 73f1137648 maroon in trouble: use qt_add_qml_module + fix bugs
Use qt_standard_project_setup and qt_add_qml_module in the
CMakeLists.txt file.

Fix qmllint warnings:
* unqualifed access by adding the required id
  (note that setting the ids fixed some bugs in the game where the towers
  were placed on the wrong place on the grid, because the root's x and y
  coordinate were used instead of the sprite's  x and y coordinates)
* unqualified access by adding required properties where missing
* reformulated custom parsed PropertyChanges to not be custom parsed
  anymore
* fix the runtime warning when using injected parameters by explicitly
  declaring it via "function (mouse)"
* setting ComponentBehavior Bound wherever needed

Ignore qmllint warnings:
* about unresolved method name 'destroy' that seems to be a bug in
  qmllint
* about unknown properties inside of the logic.js: this is a bug in
  qmllint and can't be fixed in user projects.

In addition: fix the paths be relative to SoundEffect instead of
being relative to where the SoundEffect was instantiated and remove the
SoundEffect proxy to make the sounds work. This has the side-effect that
the games lags because of the poor sound implementation it seems: the
output prints `Failed wait for getting sink drained; was draining: true`
over and over again when a lots of sounds are happening, like lots of
fighting for example. Tracking this via QTBUG-127560.

Add extra self-imports "import Maroon" where needed to get the qmake
version working, as it does not have the fancy nested qml module that
was introduced in 6.8 that fixed this in CMake builds.

Adapt the documentation to the new Main.qml file name, the code snippets
that references the custom parsed PropertyChanges, and removed the
explanation about self-importing the module in Main.qml as that is not
needed anymore. Also remove the part about implementing a SoundEffect
proxy as that is removed and not needed.

Remove the .qmlproject file as it does not know about modules and
therefore can't load the demo's Maroon QML Module.

Move the Main.qml file into a Window to use QQmlApplicationEngine in the
main.cpp file.

Pick-to: 6.8
Task-number: QTBUG-100100
Task-number: QTBUG-127560
Change-Id: I79c7b18a6159208608ef97b271fc24fc9fc06230
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-07-29 08:56:58 +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 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
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