forked from qt-creator/qt-creator
QmlDesigner: Update MCU Wizard template for 2.4
Task-number: QDS-4729 Change-Id: I17c07e87542ad140c55e8cde5bc75086b0e05cd0 Reviewed-by: Sivert Krøvel <sivert.krovel@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
committed by
Tim Jenssen
parent
f45080e619
commit
0e8dcb8862
@@ -1,6 +1,6 @@
|
|||||||
/* File generated by Qt Creator */
|
/* File generated by Qt Design Studio */
|
||||||
|
|
||||||
import QmlProject 1.1
|
import QmlProject 1.3
|
||||||
|
|
||||||
Project {
|
Project {
|
||||||
mainFile: "%{MainQmlFileName}"
|
mainFile: "%{MainQmlFileName}"
|
||||||
@@ -32,6 +32,21 @@ Project {
|
|||||||
filter: "*.ttf;*.otf"
|
filter: "*.ttf;*.otf"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ModuleFiles {
|
||||||
|
files: [
|
||||||
|
"imports/Constants/constants_module.qmlproject"
|
||||||
|
]
|
||||||
|
|
||||||
|
MCU.qulModules: [
|
||||||
|
"Controls",
|
||||||
|
"ControlsTemplates",
|
||||||
|
"Timeline",
|
||||||
|
"Shapes"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Following entries are for Qt Design Studio compatibility: */
|
||||||
Environment {
|
Environment {
|
||||||
QT_QUICK_CONTROLS_CONF: "qtquickcontrols2.conf"
|
QT_QUICK_CONTROLS_CONF: "qtquickcontrols2.conf"
|
||||||
}
|
}
|
||||||
@@ -39,8 +54,7 @@ Project {
|
|||||||
qtForMCUs: true
|
qtForMCUs: true
|
||||||
|
|
||||||
/* List of plugin directories passed to QML runtime */
|
/* List of plugin directories passed to QML runtime */
|
||||||
importPaths: [ "imports", "asset_imports" ]
|
importPaths: [ "imports" ]
|
||||||
|
|
||||||
/* Required for deployment */
|
|
||||||
targetDirectory: "/opt/%{ProjectName}"
|
targetDirectory: "/opt/%{ProjectName}"
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required (VERSION 3.15)
|
cmake_minimum_required (VERSION 3.21.1)
|
||||||
|
|
||||||
project(%{ProjectName} VERSION 0.0.1 LANGUAGES C CXX ASM)
|
project(%{ProjectName} VERSION 0.0.1 LANGUAGES C CXX ASM)
|
||||||
|
|
||||||
@@ -6,57 +6,61 @@ if (NOT TARGET Qul::Core)
|
|||||||
find_package(Qul)
|
find_package(Qul)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (Qul_VERSION VERSION_GREATER_EQUAL "1.7")
|
if (Qul_VERSION VERSION_GREATER_EQUAL "2.4")
|
||||||
qul_add_target(%{ProjectName})
|
qul_add_target(%{ProjectName} QML_PROJECT %{ProjectName}.qmlproject GENERATE_ENTRYPOINT)
|
||||||
|
app_target_setup_os(%{ProjectName})
|
||||||
else()
|
else()
|
||||||
|
if (Qul_VERSION VERSION_GREATER_EQUAL "1.7")
|
||||||
|
qul_add_target(%{ProjectName})
|
||||||
|
else()
|
||||||
add_executable(%{ProjectName})
|
add_executable(%{ProjectName})
|
||||||
target_link_libraries(%{ProjectName}
|
target_link_libraries(%{ProjectName}
|
||||||
Qul::QuickUltralite
|
Qul::QuickUltralite
|
||||||
Qul::QuickUltralitePlatform)
|
Qul::QuickUltralitePlatform)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (Qul_VERSION VERSION_GREATER_EQUAL "2.0")
|
if (Qul_VERSION VERSION_GREATER_EQUAL "2.0")
|
||||||
file(GLOB_RECURSE fontSources "${CMAKE_CURRENT_SOURCE_DIR}/fonts/*.ttf")
|
file(GLOB_RECURSE fontSources "${CMAKE_CURRENT_SOURCE_DIR}/fonts/*.ttf")
|
||||||
set_property(TARGET %{ProjectName} APPEND PROPERTY QUL_FONT_FILES ${fontSources})
|
set_property(TARGET %{ProjectName} APPEND PROPERTY QUL_FONT_FILES ${fontSources})
|
||||||
elseif (Qul_VERSION VERSION_GREATER_EQUAL "1.7")
|
elseif (Qul_VERSION VERSION_GREATER_EQUAL "1.7")
|
||||||
set_property(TARGET %{ProjectName} APPEND PROPERTY QUL_FONTS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/fonts")
|
set_property(TARGET %{ProjectName} APPEND PROPERTY QUL_FONTS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/fonts")
|
||||||
else()
|
else()
|
||||||
set(QUL_FONTS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/fonts,${QUL_FONTS_DIR}")
|
set(QUL_FONTS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/fonts,${QUL_FONTS_DIR}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Using recurse search to find image files in project directory
|
# Using recurse search to find image files in project directory
|
||||||
# Excluding MCUDefaultStyle because it exists for compatibility purposes with QDS
|
# Excluding MCUDefaultStyle because it exists for compatibility purposes with QDS
|
||||||
file(GLOB_RECURSE imgSources "*.png" "*.svg" "*.jpg" "*.jpeg")
|
file(GLOB_RECURSE imgSources "*.png" "*.svg" "*.jpg" "*.jpeg")
|
||||||
list(FILTER imgSources EXCLUDE REGEX ".*/MCUDefaultStyle/.*")
|
list(FILTER imgSources EXCLUDE REGEX ".*/MCUDefaultStyle/.*")
|
||||||
|
|
||||||
if(imgSources)
|
if(imgSources)
|
||||||
qul_add_resource(%{ProjectName} FILES ${imgSources})
|
qul_add_resource(%{ProjectName} FILES ${imgSources})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Registering singletons as qml module
|
# Registering singletons as qml module
|
||||||
qul_add_qml_module(ConstantsModule
|
qul_add_qml_module(ConstantsModule
|
||||||
URI Constants
|
URI Constants
|
||||||
QML_FILES
|
QML_FILES
|
||||||
imports/Constants/Constants.qml
|
imports/Constants/Constants.qml
|
||||||
)
|
)
|
||||||
|
|
||||||
message(WARNING "It is recommended to replace the recursive search with the actual list of .qml files in your project.")
|
message(WARNING "It is recommended to replace the recursive search with the actual list of .qml files in your project.")
|
||||||
file(GLOB_RECURSE qmlSources "*.qml")
|
file(GLOB_RECURSE qmlSources "*.qml")
|
||||||
# Excluding Constants folder because it is part of another qml module
|
# Excluding Constants folder because it is part of another qml module
|
||||||
list(FILTER qmlSources EXCLUDE REGEX ".*/imports/Constants/.*")
|
list(FILTER qmlSources EXCLUDE REGEX ".*/imports/Constants/.*")
|
||||||
# Excluding MCUDefaultStyle because it exists for compatibility purposes with QDS
|
# Excluding MCUDefaultStyle because it exists for compatibility purposes with QDS
|
||||||
list(FILTER qmlSources EXCLUDE REGEX ".*/MCUDefaultStyle/.*")
|
list(FILTER qmlSources EXCLUDE REGEX ".*/MCUDefaultStyle/.*")
|
||||||
# Excluding binary directory because it can break builds in source dir
|
# Excluding binary directory because it can break builds in source dir
|
||||||
list(FILTER qmlSources EXCLUDE REGEX "${CMAKE_CURRENT_BINARY_DIR}/.*")
|
list(FILTER qmlSources EXCLUDE REGEX "${CMAKE_CURRENT_BINARY_DIR}/.*")
|
||||||
qul_target_qml_sources(%{ProjectName} ${qmlSources})
|
qul_target_qml_sources(%{ProjectName} ${qmlSources})
|
||||||
|
|
||||||
if (Qul_VERSION VERSION_GREATER_EQUAL "2.0")
|
if (Qul_VERSION VERSION_GREATER_EQUAL "2.0")
|
||||||
target_link_libraries(%{ProjectName} PRIVATE
|
target_link_libraries(%{ProjectName} PRIVATE
|
||||||
Qul::Timeline
|
Qul::Timeline
|
||||||
Qul::Controls
|
Qul::Controls
|
||||||
Qul::Shapes
|
Qul::Shapes
|
||||||
ConstantsModule)
|
ConstantsModule)
|
||||||
else()
|
else()
|
||||||
target_link_libraries(%{ProjectName}
|
target_link_libraries(%{ProjectName}
|
||||||
Qul::QuickUltraliteTimeline
|
Qul::QuickUltraliteTimeline
|
||||||
Qul::QuickUltraliteControlsStyleDefault
|
Qul::QuickUltraliteControlsStyleDefault
|
||||||
@@ -66,12 +70,13 @@ else()
|
|||||||
target_link_libraries(%{ProjectName}
|
target_link_libraries(%{ProjectName}
|
||||||
Qul::QuickUltraliteShapes)
|
Qul::QuickUltraliteShapes)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
app_target_setup_os(%{ProjectName})
|
app_target_setup_os(%{ProjectName})
|
||||||
|
|
||||||
if (Qul_VERSION VERSION_GREATER_EQUAL "1.7")
|
if (Qul_VERSION VERSION_GREATER_EQUAL "1.7")
|
||||||
app_target_default_entrypoint(%{ProjectName} %{RootItemName})
|
app_target_default_entrypoint(%{ProjectName} %{RootItemName})
|
||||||
else()
|
else()
|
||||||
app_target_default_main(%{ProjectName} %{RootItemName})
|
app_target_default_main(%{ProjectName} %{RootItemName})
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
@@ -8,8 +8,8 @@ QtObject {
|
|||||||
|
|
||||||
readonly property color backgroundColor: "#e8e8e8"
|
readonly property color backgroundColor: "#e8e8e8"
|
||||||
|
|
||||||
/* DirectoryFontLoader doesn't work with Qt Ultralite.
|
/* DirectoryFontLoader doesn't work with Qt Quick Ultralite.
|
||||||
However you may want to uncomment this block to load fonts in real qml environment */
|
However you may want to uncomment this block to load fonts in QtQuick environment: */
|
||||||
/*
|
/*
|
||||||
property alias fontDirectory: directoryFontLoader.fontDirectory
|
property alias fontDirectory: directoryFontLoader.fontDirectory
|
||||||
property alias relativeFontDirectory: directoryFontLoader.relativeFontDirectory
|
property alias relativeFontDirectory: directoryFontLoader.relativeFontDirectory
|
||||||
|
@@ -0,0 +1,13 @@
|
|||||||
|
import QmlProject 1.3
|
||||||
|
|
||||||
|
Project {
|
||||||
|
MCU.Module {
|
||||||
|
uri: "Constants"
|
||||||
|
}
|
||||||
|
|
||||||
|
QmlFiles {
|
||||||
|
files: [
|
||||||
|
"Constants.qml"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
@@ -164,6 +164,10 @@
|
|||||||
"source": "DirectoryFontLoader.qml.tpl",
|
"source": "DirectoryFontLoader.qml.tpl",
|
||||||
"target": "%{ProjectDirectory}/imports/Constants/DirectoryFontLoader.qml"
|
"target": "%{ProjectDirectory}/imports/Constants/DirectoryFontLoader.qml"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"source": "constants_module.qmlproject.tpl",
|
||||||
|
"target": "%{ProjectDirectory}/imports/Constants/constants_module.qmlproject"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"source": "Screen01.ui.qml.tpl",
|
"source": "Screen01.ui.qml.tpl",
|
||||||
"target": "%{ProjectDirectory}/Screen01.ui.qml",
|
"target": "%{ProjectDirectory}/Screen01.ui.qml",
|
||||||
|
Reference in New Issue
Block a user