native: add qt import foulder
This commit is contained in:
parent
d964cdfa4b
commit
6852a052eb
11 changed files with 346 additions and 4 deletions
4
native/QTprojeckt/NativGuiAlisa/imports/CMakeLists.txt
Normal file
4
native/QTprojeckt/NativGuiAlisa/imports/CMakeLists.txt
Normal file
|
@ -0,0 +1,4 @@
|
|||
### This file is automatically generated by Qt Design Studio.
|
||||
### Do not change
|
||||
|
||||
add_subdirectory(NativGuiAlisa)
|
|
@ -0,0 +1,19 @@
|
|||
### This file is automatically generated by Qt Design Studio.
|
||||
### Do not change
|
||||
|
||||
qt_add_library(NativGuiAlisa STATIC)
|
||||
set_source_files_properties(Constants.qml
|
||||
PROPERTIES
|
||||
QT_QML_SINGLETON_TYPE true
|
||||
)
|
||||
|
||||
qt6_add_qml_module(NativGuiAlisa
|
||||
URI "NativGuiAlisa"
|
||||
VERSION 1.0
|
||||
RESOURCE_PREFIX "/qt/qml"
|
||||
QML_FILES
|
||||
Constants.qml
|
||||
DirectoryFontLoader.qml
|
||||
EventListModel.qml
|
||||
EventListSimulator.qml
|
||||
)
|
|
@ -0,0 +1,27 @@
|
|||
pragma Singleton
|
||||
import QtQuick 6.2
|
||||
import QtQuick.Studio.Application
|
||||
|
||||
QtObject {
|
||||
readonly property int width: 1920
|
||||
readonly property int height: 1080
|
||||
|
||||
property string relativeFontDirectory: "fonts"
|
||||
|
||||
/* Edit this comment to add your custom font */
|
||||
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
|
||||
})
|
||||
|
||||
readonly property color backgroundColor: "#EAEAEA"
|
||||
|
||||
|
||||
property StudioApplication application: StudioApplication {
|
||||
fontPath: Qt.resolvedUrl("../../content/" + relativeFontDirectory)
|
||||
}
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
// Copyright (C) 2019 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
||||
|
||||
import QtQuick 6.2
|
||||
import Qt.labs.folderlistmodel 6.2
|
||||
|
||||
QtObject {
|
||||
id: loader
|
||||
|
||||
property url fontDirectory: Qt.resolvedUrl("../../content/" + 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"))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
// Copyright (C) 2018 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
||||
|
||||
import QtQuick 6.2
|
||||
|
||||
ListModel {
|
||||
id: eventListModel
|
||||
|
||||
ListElement {
|
||||
eventId: "enterPressed"
|
||||
eventDescription: "Emitted when pressing the enter button"
|
||||
shortcut: "Return"
|
||||
parameters: "Enter"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
// Copyright (C) 2018 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
||||
|
||||
import QtQuick 6.2
|
||||
import QtQuick.Studio.EventSimulator 1.0
|
||||
import QtQuick.Studio.EventSystem 1.0
|
||||
|
||||
QtObject {
|
||||
id: simulator
|
||||
property bool active: true
|
||||
|
||||
property Timer __timer: Timer {
|
||||
id: timer
|
||||
interval: 100
|
||||
onTriggered: {
|
||||
EventSimulator.show()
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
EventSystem.init(Qt.resolvedUrl("EventListModel.qml"))
|
||||
if (simulator.active)
|
||||
timer.start()
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
MetaInfo {
|
||||
Type {
|
||||
name: "NativGuiAlisa.EventListSimulator"
|
||||
icon: ":/qtquickplugin/images/item-icon16.png"
|
||||
|
||||
Hints {
|
||||
visibleInNavigator: true
|
||||
canBeDroppedInNavigator: true
|
||||
canBeDroppedInFormEditor: false
|
||||
canBeDroppedInView3D: false
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
Module NativGuiAlisa
|
||||
singleton Constants 1.0 Constants.qml
|
||||
EventListSimulator 1.0 EventListSimulator.qml
|
||||
EventListModel 1.0 EventListModel.qml
|
||||
DirectoryFontLoader 1.0 DirectoryFontLoader.qml
|
Loading…
Add table
Add a link
Reference in a new issue