diff options
author | Fabian Kosmale <[email protected]> | 2022-10-26 09:39:17 +0200 |
---|---|---|
committer | Fabian Kosmale <[email protected]> | 2022-10-26 14:00:54 +0200 |
commit | 0ddd032ffca22669e0da23bc4881f041376b1d90 (patch) | |
tree | 401db768ee34b6b1776ba17c3777be9d30e7a5c3 | |
parent | ab9d196432b54c652006f3832bb301f8642364d1 (diff) |
GameOfLife example: Fix qmllint warnings
GameOfLifeModel is a QAIM, but qmllint does not know what QAIM is by
default. Make it aware of it by explicitly depending on QtQml.Models.
Then fix the Layout related warnings found by the Quick lint plugin:
- remove the superfluous x and y values in the slider,
- and remove the empty padding Item in lieu of setting
Layout.rightMargin on the Button to achieve the same effect.
Change-Id: I2ef6f9a1ffa276b66415ce3374eb41c34d8673b6
Reviewed-by: Richard Moe Gustavsen <[email protected]>
-rw-r--r-- | examples/quick/tableview/gameoflife/CMakeLists.txt | 2 | ||||
-rw-r--r-- | examples/quick/tableview/gameoflife/main.qml | 7 |
2 files changed, 3 insertions, 6 deletions
diff --git a/examples/quick/tableview/gameoflife/CMakeLists.txt b/examples/quick/tableview/gameoflife/CMakeLists.txt index 136b7a557a..dcda42e397 100644 --- a/examples/quick/tableview/gameoflife/CMakeLists.txt +++ b/examples/quick/tableview/gameoflife/CMakeLists.txt @@ -37,6 +37,8 @@ qt_add_qml_module(gameoflife QML_FILES main.qml RESOURCES gosperglidergun.cells NO_RESOURCE_TARGET_PATH + DEPENDENCIES + QtQml.Models ) install(TARGETS gameoflife diff --git a/examples/quick/tableview/gameoflife/main.qml b/examples/quick/tableview/gameoflife/main.qml index 9e9f9e6905..bedb624223 100644 --- a/examples/quick/tableview/gameoflife/main.qml +++ b/examples/quick/tableview/gameoflife/main.qml @@ -73,17 +73,12 @@ ApplicationWindow { Button { text: qsTr("Next") onClicked: gameOfLifeModel.nextStep() + Layout.rightMargin: 50 } //! [next] - Item { - width: 50 - } - Slider { id: slider - x: 245 - y: 17 from: 0 to: 1 value: 0.9 |