forked from qt-creator/qt-creator
QmlDesigner: Remove DirectoryFontLoader from MCU template
Change-Id: Ida0f6fa699b2b8d755f13ac0beb7b03d862470e7 Reviewed-by: Aleksei German <aleksei.german@qt.io>
This commit is contained in:
@@ -7,26 +7,4 @@ QtObject {
|
||||
|
||||
|
||||
readonly property color backgroundColor: "#e8e8e8"
|
||||
|
||||
/* DirectoryFontLoader doesn't work with Qt Quick Ultralite.
|
||||
However you may want to uncomment this block to load fonts in QtQuick environment: */
|
||||
/*
|
||||
property alias fontDirectory: directoryFontLoader.fontDirectory
|
||||
property alias relativeFontDirectory: directoryFontLoader.relativeFontDirectory
|
||||
|
||||
readonly property font font: Qt.font({
|
||||
family: Qt.application.font.family,
|
||||
pixelSize: Qt.application.font.pixelSize
|
||||
})
|
||||
readonly property font largeFont: Qt.font({
|
||||
family: Qt.application.font.family,
|
||||
pixelSize: Qt.application.font.pixelSize * 1.6
|
||||
})
|
||||
|
||||
|
||||
|
||||
property DirectoryFontLoader directoryFontLoader: DirectoryFontLoader {
|
||||
id: directoryFontLoader
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
@@ -1,34 +0,0 @@
|
||||
// Copyright (C) 2021 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0
|
||||
|
||||
import QtQuick 2.15
|
||||
import Qt.labs.folderlistmodel 2.15
|
||||
|
||||
QtObject {
|
||||
id: loader
|
||||
|
||||
property url fontDirectory: Qt.resolvedUrl("../../" + relativeFontDirectory)
|
||||
property string relativeFontDirectory: "fonts"
|
||||
|
||||
function loadFont(url) {
|
||||
var fontLoader = Qt.createQmlObject('import QtQuick 2.15; FontLoader { source: "' + url + '"; }',
|
||||
loader,
|
||||
"dynamicFontLoader");
|
||||
}
|
||||
|
||||
property FolderListModel folderModel: FolderListModel {
|
||||
id: folderModel
|
||||
folder: loader.fontDirectory
|
||||
nameFilters: [ "*.ttf", "*.otf" ]
|
||||
showDirs: false
|
||||
|
||||
onStatusChanged: {
|
||||
if (folderModel.status == FolderListModel.Ready) {
|
||||
var i
|
||||
for (i = 0; i < count; i++) {
|
||||
loadFont(folderModel.get(i, "fileURL"))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -160,10 +160,6 @@
|
||||
"source": "Constants.qml.tpl",
|
||||
"target": "%{ProjectDirectory}/imports/Constants/Constants.qml"
|
||||
},
|
||||
{
|
||||
"source": "DirectoryFontLoader.qml.tpl",
|
||||
"target": "%{ProjectDirectory}/imports/Constants/DirectoryFontLoader.qml"
|
||||
},
|
||||
{
|
||||
"source": "constants_module.qmlproject.tpl",
|
||||
"target": "%{ProjectDirectory}/imports/Constants/constants_module.qmlproject"
|
||||
|
Reference in New Issue
Block a user