From 8388a45d743ae9f1747d73cd1c7226d4f1be6e77 Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Thu, 5 Dec 2024 01:47:24 +0100 Subject: [PATCH] Track qml files in qrc --- CMakeLists.txt | 9 +-------- generate_qrc.sh | 1 + main.cpp | 2 +- qml.qrc | 14 ++++++++++++++ 4 files changed, 17 insertions(+), 9 deletions(-) create mode 100644 qml.qrc diff --git a/CMakeLists.txt b/CMakeLists.txt index 78fd10c..bbdb8de 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,19 +16,12 @@ set(CMAKE_AUTORCC ON) qt_add_executable(appSolitare main.cpp images.qrc + qml.qrc ) qt_add_qml_module(appSolitare URI Solitare 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 playingcard.h playingcard.cpp gamestate.h gamestate.cpp diff --git a/generate_qrc.sh b/generate_qrc.sh index 983dc41..5ee591d 100755 --- a/generate_qrc.sh +++ b/generate_qrc.sh @@ -35,4 +35,5 @@ EOF pushd "$CUR_DIR" >/dev/null generate_qrc "img" "images.qrc" "*.svg" +generate_qrc "qml" "qml.qrc" "*.qml" popd >/dev/null diff --git a/main.cpp b/main.cpp index e892220..82c586c 100644 --- a/main.cpp +++ b/main.cpp @@ -18,6 +18,6 @@ int main(int argc, char *argv[]) auto gameState = engine.singletonInstance("Solitare", "GameState"); gameState->setupWinningDeck(); - engine.loadFromModule("Solitare", "Main"); + engine.load(QStringLiteral("qrc:/qml/Main.qml")); return app.exec(); } diff --git a/qml.qrc b/qml.qrc new file mode 100644 index 0000000..7a72752 --- /dev/null +++ b/qml.qrc @@ -0,0 +1,14 @@ + + + + qml/Main.qml + qml/ScoreBar.qml + qml/Tableau.qml + qml/ThrowawayPile.qml + qml/FoundationPiles.qml + qml/CardModel.qml + qml/DrawPile.qml + + +