Skip to content

Commit

Permalink
Move all resources from qml.qrc into CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielMcInnes committed Nov 6, 2023
1 parent b41001f commit b63e04a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 13 deletions.
12 changes: 7 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ if(QT_KNOWN_POLICY_QTP0001)
qt_policy(SET QTP0001 NEW) # >Qt6.5 only. Enabling this policy ensures that your QML module is placed under a default import path, and its types can be found without manual calls to QQmlEngine::addImportPath.
endif()

qt_add_resources(QML_QRC_RESOURCES
qml.qrc
)

include_directories(src/veutil/inc src .)

set (VENUS_QML_MODULE_SINGLETON_SOURCES # All qml singletons have to be added here
Expand Down Expand Up @@ -620,7 +616,6 @@ add_custom_command(
COMMENT "Manually updating translations files"
COMMAND ${QT_CMAKE_EXPORT_NAMESPACE}::lupdate
ARGS
${CMAKE_CURRENT_SOURCE_DIR}/qml.qrc
${SOURCES}
src
-ts ${TRANSLATIONS_TS_FILES}
Expand Down Expand Up @@ -668,6 +663,13 @@ else()
)
endif()

qt_add_qml_module( ${PROJECT_NAME}
URI ${PROJECT_NAME}
VERSION 1.0
RESOURCE_PREFIX /
QML_FILES Main.qml
)

qt_add_qml_module(VenusQMLModule
URI Victron.VenusOS
VERSION 2.0
Expand Down
File renamed without changes.
7 changes: 0 additions & 7 deletions qml.qrc

This file was deleted.

2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ int main(int argc, char *argv[])
engine.setProperty("screenSize", Victron::VenusOS::Theme::SevenInch);
#endif

QQmlComponent component(&engine, QUrl(QStringLiteral("qrc:/main.qml")));
QQmlComponent component(&engine, QUrl(QStringLiteral("qrc:/venus-gui-v2/Main.qml")));
if (component.isError()) {
qWarning() << component.errorString();
return EXIT_FAILURE;
Expand Down

0 comments on commit b63e04a

Please sign in to comment.