Track qml files in qrc

This commit is contained in:
ItsDrike 2024-12-05 01:47:24 +01:00
parent a49140512f
commit 8388a45d74
Signed by: ItsDrike
GPG key ID: FA2745890B7048C0
4 changed files with 17 additions and 9 deletions

View file

@ -16,19 +16,12 @@ set(CMAKE_AUTORCC ON)
qt_add_executable(appSolitare qt_add_executable(appSolitare
main.cpp main.cpp
images.qrc images.qrc
qml.qrc
) )
qt_add_qml_module(appSolitare qt_add_qml_module(appSolitare
URI Solitare URI Solitare
VERSION 1.0 VERSION 1.0
QML_FILES
qml/Main.qml
qml/CardModel.qml
qml/DrawPile.qml
qml/FoundationPiles.qml
qml/ScoreBar.qml
qml/Tableau.qml
qml/ThrowawayPile.qml
SOURCES SOURCES
playingcard.h playingcard.cpp playingcard.h playingcard.cpp
gamestate.h gamestate.cpp gamestate.h gamestate.cpp

View file

@ -35,4 +35,5 @@ EOF
pushd "$CUR_DIR" >/dev/null pushd "$CUR_DIR" >/dev/null
generate_qrc "img" "images.qrc" "*.svg" generate_qrc "img" "images.qrc" "*.svg"
generate_qrc "qml" "qml.qrc" "*.qml"
popd >/dev/null popd >/dev/null

View file

@ -18,6 +18,6 @@ int main(int argc, char *argv[])
auto gameState = engine.singletonInstance<GameState*>("Solitare", "GameState"); auto gameState = engine.singletonInstance<GameState*>("Solitare", "GameState");
gameState->setupWinningDeck(); gameState->setupWinningDeck();
engine.loadFromModule("Solitare", "Main"); engine.load(QStringLiteral("qrc:/qml/Main.qml"));
return app.exec(); return app.exec();
} }

14
qml.qrc Normal file
View file

@ -0,0 +1,14 @@
<!DOCTYPE RCC>
<RCC version="1.0">
<qresource>
<file>qml/Main.qml</file>
<file>qml/ScoreBar.qml</file>
<file>qml/Tableau.qml</file>
<file>qml/ThrowawayPile.qml</file>
<file>qml/FoundationPiles.qml</file>
<file>qml/CardModel.qml</file>
<file>qml/DrawPile.qml</file>
</qresource>
</RCC>
<!-- vi: ft=xml
-->