diff options
-rw-r--r-- | share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/Constants.qml.tpl | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/Constants.qml.tpl b/share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/Constants.qml.tpl index 98c1927f2e..6fcae14ea6 100644 --- a/share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/Constants.qml.tpl +++ b/share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/Constants.qml.tpl @@ -1,12 +1,15 @@ pragma Singleton import QtQuick %{QtQuickVersion} +@if %{IsQt6Project} +import QtQuick.Studio.Application +@else +@endif QtObject { readonly property int width: %{ScreenWidth} readonly property int height: %{ScreenHeight} - property alias fontDirectory: directoryFontLoader.fontDirectory - property alias relativeFontDirectory: directoryFontLoader.relativeFontDirectory + property string relativeFontDirectory: "fonts" /* Edit this comment to add your custom font */ readonly property font font: Qt.font({ @@ -20,7 +23,14 @@ QtObject { readonly property color backgroundColor: "#c2c2c2" + +@if %{IsQt6Project} + property StudioApplication application: StudioApplication { + fontPath: Qt.resolvedUrl("../../content/" + relativeFontDirectory) + } +@else property DirectoryFontLoader directoryFontLoader: DirectoryFontLoader { id: directoryFontLoader } +@endif } |