commit 6d6bd6fe8fc7a59bbad2f6426d7b34957c187048 Author: tanaevms Date: Sun Sep 3 18:49:20 2023 +0300 Окно 1 diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..e58a820 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,24 @@ +cmake_minimum_required(VERSION 3.18) + +project(QML_BalancerApp LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) +set(CMAKE_AUTOMOC ON) + +find_package(Qt6 COMPONENTS Gui Qml Quick) +qt_add_executable(QML_BalancerApp src/main.cpp) + +qt_add_resources(QML_BalancerApp "configuration" + PREFIX "/" + FILES + qtquickcontrols2.conf +) + +target_link_libraries(QML_BalancerApp PRIVATE + Qt${QT_VERSION_MAJOR}::Core + Qt${QT_VERSION_MAJOR}::Gui + Qt${QT_VERSION_MAJOR}::Quick + Qt${QT_VERSION_MAJOR}::Qml +) + +include(${CMAKE_CURRENT_SOURCE_DIR}/qmlmodules) diff --git a/QML_Balancer.qmlproject b/QML_Balancer.qmlproject new file mode 100644 index 0000000..cd9ec43 --- /dev/null +++ b/QML_Balancer.qmlproject @@ -0,0 +1,99 @@ +import QmlProject + +Project { + mainFile: "content/App.qml" + + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "content" + } + + QmlFiles { + directory: "imports" + } + + JavaScriptFiles { + directory: "content" + } + + JavaScriptFiles { + directory: "imports" + } + + ImageFiles { + directory: "content" + } + + Files { + filter: "*.conf" + files: ["qtquickcontrols2.conf"] + } + + Files { + filter: "qmldir" + directory: "." + } + + Files { + filter: "*.ttf;*.otf" + } + + Files { + filter: "*.wav;*.mp3" + } + + Files { + filter: "*.mp4" + } + + Files { + filter: "*.glsl;*.glslv;*.glslf;*.vsh;*.fsh;*.vert;*.frag" + } + + Files { + filter: "*.mesh" + directory: "asset_imports" + } + + Environment { + QT_QUICK_CONTROLS_CONF: "qtquickcontrols2.conf" + QT_AUTO_SCREEN_SCALE_FACTOR: "1" + QT_LOGGING_RULES: "qt.qml.connections=false" + QT_ENABLE_HIGHDPI_SCALING: "0" + /* Useful for debugging + QSG_VISUALIZE=batches + QSG_VISUALIZE=clip + QSG_VISUALIZE=changes + QSG_VISUALIZE=overdraw + */ + } + + qt6Project: true + + /* List of plugin directories passed to QML runtime */ + importPaths: [ "imports", "asset_imports" ] + + /* Required for deployment */ + targetDirectory: "/opt/QML_Balancer" + + qdsVersion: "3.5" + + quickVersion: "6.2" + + /* If any modules the project imports require widgets (e.g. QtCharts), widgetApp must be true */ + widgetApp: true + + /* args: Specifies command line arguments for qsb tool to generate shaders. + files: Specifies target files for qsb tool. If path is included, it must be relative to this file. + Wildcard '*' can be used in the file name part of the path. + e.g. files: [ "content/shaders/*.vert", "*.frag" ] */ + ShaderTool { + args: "-s --glsl \"100 es,120,150\" --hlsl 50 --msl 12" + files: [ "content/shaders/*" ] + } + + multilanguageSupport: true + supportedLanguages: ["en"] + primaryLanguage: "en" + +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/content/App.qml b/content/App.qml new file mode 100644 index 0000000..2289075 --- /dev/null +++ b/content/App.qml @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** Copyright (C) 2021 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Quick Studio Components. +** +** $QT_BEGIN_LICENSE:GPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 6.2 +import QtQuick.Window 6.2 +import QML_Balancer +import QtQuick.Controls.Material + +Window { + width: mainScreen.width + height: mainScreen.height + + //Material.theme: darkModeToggle.checked ? Material.Dark : Material.Light + + + + visible: true + title: "Балансировщик" + + Screen01 { + id: mainScreen + } + +} + diff --git a/content/CMakeLists.txt b/content/CMakeLists.txt new file mode 100644 index 0000000..6811415 --- /dev/null +++ b/content/CMakeLists.txt @@ -0,0 +1,13 @@ +### This file is automatically generated by Qt Design Studio. +### Do not change + +qt_add_library(content STATIC) +qt6_add_qml_module(content + URI "content" + VERSION 1.0 + QML_FILES + App.qml + Screen01.ui.qml + RESOURCES + fonts/fonts.txt +) diff --git a/content/LabelGTL.qml b/content/LabelGTL.qml new file mode 100644 index 0000000..e889926 --- /dev/null +++ b/content/LabelGTL.qml @@ -0,0 +1,11 @@ +import QtQuick 2.15 +import QtQuick.Controls 2.15 +import QML_Balancer 1.0 + +Label { + width: Constants.width + height: Constants.height + font.weight: Font.Normal + font.pointSize: 40 + verticalAlignment: Text.AlignVCenter +} diff --git a/content/Screen01.ui.qml b/content/Screen01.ui.qml new file mode 100644 index 0000000..a212cba --- /dev/null +++ b/content/Screen01.ui.qml @@ -0,0 +1,248 @@ + +/* +This is a UI file (.ui.qml) that is intended to be edited in Qt Design Studio only. +It is supposed to be strictly declarative and only uses a subset of QML. If you edit +this file manually, you might introduce QML code that is not supported by Qt Design Studio. +Check out https://doc.qt.io/qtcreator/creator-quick-ui-forms.html for details on .ui.qml files. +*/ +import QtQuick 6.2 +import QtQuick.Controls 6.2 +import QML_Balancer +import QtQuick.Controls.Material + +Pane { + width: Constants.width + height: Constants.height + + //color: "#606060" + Material.theme: darkModeToggle.checked ? Material.Dark : Material.Light + property url pathImg: "images/textinput.png" + property string headerText: "Шаг 0: Ввод информации(необязательный этап)" + + //textfield0.text: "" //введенные данные с textfield0 + //textfield1.text: "" //введенные данные с textfield1 + //textfield2.text: "" //введенные данные с textfield2 + + + /*SettingsBar { + id: settings + x: 0 + y: 0 + }*/ + Column { + x: -12 + y: -8 + width: 1920 + height: 1072 + rotation: 0 + spacing: 52 + Row { + Toggle { + id: darkModeToggle + text: qsTr("Dark mode") + anchors.top: parent.top + } + ListView { + width: 1097 + height: 62 + //anchors.verticalCenterOffset: -456 + //anchors.horizontalCenterOffset: 1 + + //anchors.centerIn: parent + delegate: TextGTL.mycomponent + + TextGTL { + id: text0 + x: 55 + + text: headerText + elide: Text.ElideNone + leftPadding: 200 + } + } + } + Row { + anchors.top: parent.top + leftPadding: 50 + layoutDirection: Qt.LeftToRight + spacing: 48 + anchors.left: parent.middle + Column { + id: column0 + x: 0 + y: 184 + width: 602 + height: 565 + rotation: 0 + clip: true + spacing: 54 + padding: 0 + //anchors.top: parent.middle + + //add: touchStyle + //add1: touchStyle + //children: [ touchStyle, touchStyle] + LabelGTL { + //anchors.fill: parent + width: 600 + height: 140 + text: "Скорость вращения, об/мин" + font.pointSize: 30 + anchors.top: bottom + rightInset: 0 + verticalAlignment: Text.AlignVCenter + //delegate: TextFieldGTL.mycomponent + + + /*TextFieldGTL { + id: textfield01 + }*/ + } + + LabelGTL { + //anchors.fill: parent + width: 600 + height: 140 + text: "Радиус установки грузов, мм" + //topPadding: 0 + verticalAlignment: Text.AlignVCenter + + font.pointSize: 30 + //delegate: TextFieldGTL.mycomponent + + + /*TextFieldGTL { + id: textfield01 + }*/ + } + LabelGTL { + //anchors.fill: parent + width: 600 + height: 140 + text: "Масса ротора, гр." + + font.pointSize: 30 + + //delegate: TextFieldGTL.mycomponent + + + /*TextFieldGTL { + id: textfield01 + }*/ + } + + + /*ListView { + //anchors.fill: parent + width: 600 + height: 140 + model: 5 + delegate: TextFieldGTL.mycomponent + + TextFieldGTL { + id: textfield11 + } + } + + ListView { + //anchors.fill: parent + width: 600 + height: 140 + model: 5 + delegate: TextFieldGTL.mycomponent + + TextFieldGTL { + id: textfield21 + x: 0 + y: -8 + } + }*/ + } + Column { + id: column1 + x: 792 + y: 184 + width: 602 + height: 565 + rotation: 0 + clip: true + spacing: 54 + padding: 0 + + //add: touchStyle + //add1: touchStyle + //children: [ touchStyle, touchStyle] + ListView { + //anchors.fill: parent + width: 600 + height: 140 + model: 5 + delegate: TextFieldGTL.mycomponent + + TextFieldGTL { + id: textfield0 + } + } + + ListView { + //anchors.fill: parent + width: 600 + height: 140 + model: 5 + delegate: TextFieldGTL.mycomponent + + TextFieldGTL { + id: textfield1 + } + } + + ListView { + //anchors.fill: parent + width: 600 + height: 140 + model: 5 + delegate: TextFieldGTL.mycomponent + + TextFieldGTL { + id: textfield2 + x: 0 + y: -8 + } + } + } + } + } + Button { + id: button + x: 21 + y: 776 + width: 286 + height: 87 + text: qsTr("Button") + } + + /* Rectangle { + id: backButton + width: 0 + //width: opacity ? 60 : 0 + anchors.left: parent + //anchors.leftMargin: 20 + //opacity: stackView.depth > 1 ? 1 : 0 + //anchors.verticalCenter: parent.verticalCenter + antialiasing: true + height: 60 + radius: 4 + color: backmouse.pressed ? "#222" : "transparent" + //Behavior on opacity { NumberAnimation{} } + Image { + anchors.verticalCenter: parent.verticalCenter + source: "images/navigation_previous_item.png" + } + MouseArea { + id: backmouse + anchors.fill: parent + anchors.margins: -10 + //onClicked: stackView.pop() + } + }*/ +} diff --git a/content/SettingsBar.ui.qml b/content/SettingsBar.ui.qml new file mode 100644 index 0000000..8c5beac --- /dev/null +++ b/content/SettingsBar.ui.qml @@ -0,0 +1,405 @@ +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Design Studio. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.10 +//import ebikeDesign 1.0 +//import EbikeData 1.0 +import QtQuick.Studio.Components 1.0 +import QtQuick.Controls 2.3 +import QtQuick.Timeline 1.0 +import QtQuick.Layouts 1.3 + +Item { + id: settings + width: Constants.width + height: Constants.height + + state: "closed" + + Rectangle { + id: blocker + x: 0 + width: Constants.width + color: "#464646" + opacity: 0 + anchors.bottom: parent.bottom + anchors.top: stack.bottom + + MouseArea { + id: mouseArea2 + anchors.fill: parent + } + } + + Image { + id: close + x: 564 + y: 44 + source: "images/top_curtain_drag_back.png" + + MouseArea { + id: mouseArea + anchors.rightMargin: -16 + anchors.leftMargin: -16 + anchors.bottomMargin: -16 + anchors.fill: parent + } + } + + Rectangle { + id: stack + x: 0 + y: 44 + width: Constants.width + height: 200 + color: "#0d0d0d" + clip: true + + MouseArea { + anchors.fill: parent + } + + StackLayout { + id: stackLayout + width: Constants.width + currentIndex: tabbar.index + anchors.fill: parent + + Info {} + + GeneralSettings {} + + ViewSettings {} + } + } + + Rectangle { + id: topBar + x: 0 + y: 0 + width: Constants.width + height: 45 + color: "#0d0d0d" + + Image { + id: image4 + x: 1240 + y: 5 + source: "images/search_cancel.png" + } + + Image { + id: image3 + x: 1193 + y: 5 + source: "images/info.png" + } + } + + Image { + id: open + x: 564 + y: 44 + source: "images/top_curtain_drag.png" + + MouseArea { + id: mouseArea1 + anchors.rightMargin: -16 + anchors.leftMargin: -16 + anchors.bottomMargin: -16 + anchors.fill: parent + } + + CustomLabel { + id: customLabel + x: -245 + y: 316 + text: Backend.time + font.pixelSize: 22 + horizontalAlignment: Text.AlignHCenter + anchors.fill: parent + } + } + + Timeline { + id: timeline + animations: [ + TimelineAnimation { + id: openAnimation + onFinished: settings.state = "Open" + loops: 1 + duration: 250 + from: 0 + to: 1000 + running: false + }, + TimelineAnimation { + id: closeAnimation + onFinished: settings.state = "Closed" + loops: 1 + duration: 250 + from: 1000 + to: 0 + running: false + } + ] + endFrame: 1000 + enabled: true + startFrame: 0 + + KeyframeGroup { + target: stack + property: "height" + + Keyframe { + value: 0 + frame: 0 + } + + Keyframe { + easing.bezierCurve: [0.39, 0.575, 0.565, 1, 1, 1] + value: 320 + frame: 1000 + } + + Keyframe { + value: 0 + frame: 89 + } + } + + KeyframeGroup { + target: close + property: "opacity" + Keyframe { + easing.bezierCurve: [0.39, 0.575, 0.565, 1, 1, 1] + value: 1 + frame: 1000 + } + + Keyframe { + value: 0 + frame: 850 + } + + Keyframe { + value: 0 + frame: 0 + } + } + + KeyframeGroup { + target: close + property: "y" + Keyframe { + value: 315 + frame: 850 + } + + Keyframe { + easing.bezierCurve: [0.39, 0.575, 0.565, 1, 1, 1] + value: 360 + frame: 1000 + } + } + + KeyframeGroup { + target: open + property: "opacity" + + Keyframe { + value: 1 + frame: 0 + } + + Keyframe { + value: 0 + frame: 88 + } + } + + KeyframeGroup { + target: tabbar + property: "opacity" + + Keyframe { + value: 0 + frame: 0 + } + + Keyframe { + value: 1 + frame: 1000 + } + } + + KeyframeGroup { + target: blocker + property: "opacity" + Keyframe { + value: 0 + frame: 0 + } + + Keyframe { + value: 0.2 + frame: 1000 + } + + Keyframe { + frame: 794 + value: "0" + } + } + + KeyframeGroup { + target: stackLayout + property: "opacity" + + Keyframe { + value: 0 + frame: 0 + } + + Keyframe { + value: 0 + frame: 300 + } + + Keyframe { + value: 1 + frame: 1000 + } + } + + KeyframeGroup { + target: blocker + property: "anchors.bottomMargin" + Keyframe { + value: 708 + frame: 0 + } + + Keyframe { + value: 0 + frame: 1000 + } + } + } + + Connections { + target: mouseArea + onClicked: { + settings.state = "Closing" + } + } + + Connections { + target: mouseArea1 + onClicked: { + if (settings.state != "Open") + settings.state = "Opening" + } + } + + Tabbar { + id: tabbar + x: 0 + y: 0 + index: 0 + } + + states: [ + State { + name: "Open" + + PropertyChanges { + target: timeline + currentFrame: 1000 + enabled: true + } + }, + State { + name: "Closed" + + PropertyChanges { + target: timeline + currentFrame: 0 + enabled: true + } + }, + State { + name: "Opening" + + PropertyChanges { + target: timeline + enabled: true + } + + PropertyChanges { + target: openAnimation + running: true + } + }, + State { + name: "Closing" + + PropertyChanges { + target: timeline + enabled: true + } + + PropertyChanges { + target: closeAnimation + running: true + } + } + ] +} diff --git a/content/Tabbar.qml b/content/Tabbar.qml new file mode 100644 index 0000000..22de1fc --- /dev/null +++ b/content/Tabbar.qml @@ -0,0 +1,197 @@ +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Design Studio. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.10 +//import ebikeDesign 1.0 +import QtQuick.Studio.Components 1.0 +import QtQuick.Controls 2.3 +import QtQuick.Timeline 1.0 +import QtQuick.Layouts 1.3 + +Rectangle { + id: tabbar + width: 1200 + height: 50 + color: "#0d0d0d" + + property int index: 0 + + RowLayout { + y: 0 + anchors.left: parent.left + anchors.right: parent.right + + Image { + id: info + Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter + source: "images/info.png" + + MouseArea { + id: infoClicked + anchors.rightMargin: -64 + anchors.leftMargin: -64 + anchors.bottomMargin: -4 + anchors.topMargin: -4 + anchors.fill: parent + } + } + + Image { + id: list + Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter + source: "images/list.png" + + MouseArea { + id: listClicked + anchors.topMargin: -4 + anchors.bottomMargin: -4 + anchors.rightMargin: -64 + anchors.leftMargin: -64 + anchors.fill: parent + } + } + + Image { + id: settings + Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter + source: "images/settings.png" + + MouseArea { + id: settingsClicked + anchors.rightMargin: -64 + anchors.leftMargin: -64 + anchors.bottomMargin: -4 + anchors.topMargin: -4 + anchors.fill: parent + } + } + } + + Rectangle { + id: rectangle + x: 8 + y: 38 + width: 365 + height: 4 + color: "#ffffff" + Behavior on x { + + PropertyAnimation { + duration: 140 + } + } + } + + Connections { + target: listClicked + onClicked: { + tabbar.index = "1" + } + } + + Connections { + target: infoClicked + onClicked: { + tabbar.index = "0" + } + } + + Connections { + target: settingsClicked + onClicked: { + tabbar.index = "2" + } + } + states: [ + State { + name: "Left" + when: tabbar.index === 0 + + PropertyChanges { + target: info + source: "images/info_selected.png" + } + + PropertyChanges { + target: rectangle + x: 8 + } + }, + State { + name: "Middle" + when: tabbar.index === 1 + + PropertyChanges { + target: list + source: "images/list_selected.png" + } + + PropertyChanges { + target: rectangle + x: 418 + } + }, + State { + name: "Right" + when: tabbar.index === 2 + + PropertyChanges { + target: settings + source: "images/settings_selected.png" + } + + PropertyChanges { + target: rectangle + x: 827 + } + } + ] +} + diff --git a/content/TextFieldGTL.qml b/content/TextFieldGTL.qml new file mode 100644 index 0000000..b236025 --- /dev/null +++ b/content/TextFieldGTL.qml @@ -0,0 +1,35 @@ +import QtQuick 2.15 +import QtQuick.Controls 2.15 +import QML_Balancer 1.0 + +//Item { + + TextField { + id: textfieldgtl + width: 600 + height: 140 + //selectedTextColor: "white" + //placeholderTextColor: "white" + layer.enabled: false + focus: false + antialiasing: false + font.weight: Font.Normal + font.pointSize: 40 + background: Item { + + implicitHeight: 140 + implicitWidth: 600 + BorderImage { + + source: pathImg + border.left: 8 + border.right: 8 + anchors.bottom: parent.bottom + anchors.left: parent.left + anchors.right: parent.right + } + } + + placeholderText: qsTr("Введите значение") + } +//} diff --git a/content/TextGTL.qml b/content/TextGTL.qml new file mode 100644 index 0000000..03a2d1e --- /dev/null +++ b/content/TextGTL.qml @@ -0,0 +1,14 @@ +import QtQuick 2.15 +import QtQuick.Controls 2.15 + +Text { + color: "#b7b7b7" + text: headerText + transformOrigin: Item.Top + font.pointSize: 32 + minimumPointSize: 16 + minimumPixelSize: 16 + font.family: "Verdana" + font.styleName: "Полужирный" + +} diff --git a/content/Toggle.ui.qml b/content/Toggle.ui.qml new file mode 100644 index 0000000..bb8bb9c --- /dev/null +++ b/content/Toggle.ui.qml @@ -0,0 +1,84 @@ +/* +This is a UI file (.ui.qml) that is intended to be edited in Qt Design Studio only. +It is supposed to be strictly declarative and only uses a subset of QML. If you edit +this file manually, you might introduce QML code that is not supported by Qt Design Studio. +Check out https://doc.qt.io/qtcreator/creator-quick-ui-forms.html for details on .ui.qml files. +*/ +/**************************************************************************** +** +** Copyright (C) 2022 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Design Studio. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +/* +This is a UI file (.ui.qml) that is intended to be edited in Qt Design Studio only. +It is supposed to be strictly declarative and only uses a subset of QML. If you edit +this file manually, you might introduce QML code that is not supported by Qt Design Studio. +Check out https://doc.qt.io/qtcreator/creator-quick-ui-forms.html for details on .ui.qml files. +*/ +import QtQuick +import QtQuick.Controls + +Item { + property string text + property alias checked: toggleIndicator.checked + readonly property alias hasFocus: toggleIndicator.activeFocus + implicitWidth: toggleText.width + toggleIndicator.width + implicitHeight: 50 + + Label { + id: toggleText + text: parent.text + anchors.verticalCenter: toggleIndicator.verticalCenter + } + Switch { + id: toggleIndicator + anchors.left: toggleText.right + anchors.rightMargin: 8 + } +} diff --git a/content/fonts/fonts.txt b/content/fonts/fonts.txt new file mode 100644 index 0000000..ab96122 --- /dev/null +++ b/content/fonts/fonts.txt @@ -0,0 +1 @@ +Fonts in this folder are loaded automatically. diff --git a/content/images/NOTICE.txt b/content/images/NOTICE.txt new file mode 100644 index 0000000..93a9afc --- /dev/null +++ b/content/images/NOTICE.txt @@ -0,0 +1,2 @@ +Notice some of these images are derived from Google applications resources. They were provided under the following license: +You may use the materials in this directory without restriction to develop your apps and to use in your apps. diff --git a/content/images/button_default.png b/content/images/button_default.png new file mode 100644 index 0000000..6d6cfd9 Binary files /dev/null and b/content/images/button_default.png differ diff --git a/content/images/button_pressed.png b/content/images/button_pressed.png new file mode 100644 index 0000000..ab78b6e Binary files /dev/null and b/content/images/button_pressed.png differ diff --git a/content/images/curtain_shadow_handle.png b/content/images/curtain_shadow_handle.png new file mode 100644 index 0000000..afaf3ec Binary files /dev/null and b/content/images/curtain_shadow_handle.png differ diff --git a/content/images/info.png b/content/images/info.png new file mode 100644 index 0000000..6ad9192 Binary files /dev/null and b/content/images/info.png differ diff --git a/content/images/info_selected.png b/content/images/info_selected.png new file mode 100644 index 0000000..25056ff Binary files /dev/null and b/content/images/info_selected.png differ diff --git a/content/images/list.png b/content/images/list.png new file mode 100644 index 0000000..2e1633d Binary files /dev/null and b/content/images/list.png differ diff --git a/content/images/list_selected.png b/content/images/list_selected.png new file mode 100644 index 0000000..1c61a5e Binary files /dev/null and b/content/images/list_selected.png differ diff --git a/content/images/navigation_next_item.png b/content/images/navigation_next_item.png new file mode 100644 index 0000000..6665c9d Binary files /dev/null and b/content/images/navigation_next_item.png differ diff --git a/content/images/navigation_previous_item.png b/content/images/navigation_previous_item.png new file mode 100644 index 0000000..f8be011 Binary files /dev/null and b/content/images/navigation_previous_item.png differ diff --git a/content/images/search_cancel.png b/content/images/search_cancel.png new file mode 100644 index 0000000..679ce32 Binary files /dev/null and b/content/images/search_cancel.png differ diff --git a/content/images/settings.png b/content/images/settings.png new file mode 100644 index 0000000..9651de6 Binary files /dev/null and b/content/images/settings.png differ diff --git a/content/images/tab_selected.png b/content/images/tab_selected.png new file mode 100644 index 0000000..2345f7a Binary files /dev/null and b/content/images/tab_selected.png differ diff --git a/content/images/tabs_standard.png b/content/images/tabs_standard.png new file mode 100644 index 0000000..7140ab7 Binary files /dev/null and b/content/images/tabs_standard.png differ diff --git a/content/images/textinput.png b/content/images/textinput.png new file mode 100644 index 0000000..b0256db Binary files /dev/null and b/content/images/textinput.png differ diff --git a/content/images/toolbar.png b/content/images/toolbar.png new file mode 100644 index 0000000..e9eba4c Binary files /dev/null and b/content/images/toolbar.png differ diff --git a/content/images/top_curtain_drag_back.png b/content/images/top_curtain_drag_back.png new file mode 100644 index 0000000..c0eb9c5 Binary files /dev/null and b/content/images/top_curtain_drag_back.png differ diff --git a/imports/CMakeLists.txt b/imports/CMakeLists.txt new file mode 100644 index 0000000..c8721d9 --- /dev/null +++ b/imports/CMakeLists.txt @@ -0,0 +1,4 @@ +### This file is automatically generated by Qt Design Studio. +### Do not change + +add_subdirectory(QML_Balancer) diff --git a/imports/QML_Balancer/CMakeLists.txt b/imports/QML_Balancer/CMakeLists.txt new file mode 100644 index 0000000..25e6186 --- /dev/null +++ b/imports/QML_Balancer/CMakeLists.txt @@ -0,0 +1,18 @@ +### This file is automatically generated by Qt Design Studio. +### Do not change + +qt_add_library(QML_Balancer STATIC) +set_source_files_properties(Constants.qml + PROPERTIES + QT_QML_SINGLETON_TYPE true + ) + +qt6_add_qml_module(QML_Balancer + URI "QML_Balancer" + VERSION 1.0 + QML_FILES + Constants.qml + DirectoryFontLoader.qml + EventListModel.qml + EventListSimulator.qml +) diff --git a/imports/QML_Balancer/Constants.qml b/imports/QML_Balancer/Constants.qml new file mode 100644 index 0000000..c81d605 --- /dev/null +++ b/imports/QML_Balancer/Constants.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: "#c2c2c2" + + + property StudioApplication application: StudioApplication { + fontPath: Qt.resolvedUrl("../../content/" + relativeFontDirectory) + } +} diff --git a/imports/QML_Balancer/DirectoryFontLoader.qml b/imports/QML_Balancer/DirectoryFontLoader.qml new file mode 100644 index 0000000..758f736 --- /dev/null +++ b/imports/QML_Balancer/DirectoryFontLoader.qml @@ -0,0 +1,60 @@ +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Quick Designer Components. +** +** $QT_BEGIN_LICENSE:GPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +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")) + } + } + } + } +} diff --git a/imports/QML_Balancer/EventListModel.qml b/imports/QML_Balancer/EventListModel.qml new file mode 100644 index 0000000..bef214e --- /dev/null +++ b/imports/QML_Balancer/EventListModel.qml @@ -0,0 +1,41 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Quick Designer Components. +** +** $QT_BEGIN_LICENSE:GPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 6.2 + +ListModel { + id: eventListModel + + ListElement { + eventId: "enterPressed" + eventDescription: "Emitted when pressing the enter button" + shortcut: "Return" + parameters: "Enter" + } +} diff --git a/imports/QML_Balancer/EventListSimulator.qml b/imports/QML_Balancer/EventListSimulator.qml new file mode 100644 index 0000000..3d538c8 --- /dev/null +++ b/imports/QML_Balancer/EventListSimulator.qml @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Quick Designer Components. +** +** $QT_BEGIN_LICENSE:GPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +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() + } +} diff --git a/imports/QML_Balancer/designer/plugin.metainfo b/imports/QML_Balancer/designer/plugin.metainfo new file mode 100644 index 0000000..f2d89bd --- /dev/null +++ b/imports/QML_Balancer/designer/plugin.metainfo @@ -0,0 +1,13 @@ +MetaInfo { + Type { + name: "QML_Balancer.EventListSimulator" + icon: ":/qtquickplugin/images/item-icon16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeDroppedInView3D: false + } + } +} diff --git a/imports/QML_Balancer/qmldir b/imports/QML_Balancer/qmldir new file mode 100644 index 0000000..ad3cbf8 --- /dev/null +++ b/imports/QML_Balancer/qmldir @@ -0,0 +1,6 @@ +Module QML_Balancer +singleton Constants 1.0 Constants.qml +EventListSimulator 1.0 EventListSimulator.qml +EventListModel 1.0 EventListModel.qml +DirectoryFontLoader 1.0 DirectoryFontLoader.qml + diff --git a/main.qml b/main.qml new file mode 100644 index 0000000..2c4f857 --- /dev/null +++ b/main.qml @@ -0,0 +1,8 @@ +/* This file is generated and only relevant for integrating the project into a Qt 6 and cmake based +C++ project. */ + +import QtQuick +import content + +App { +} diff --git a/qmlmodules b/qmlmodules new file mode 100644 index 0000000..41b43e8 --- /dev/null +++ b/qmlmodules @@ -0,0 +1,17 @@ +### This file is automatically generated by Qt Design Studio. +### Do not change + +qt6_add_qml_module(QML_BalancerApp + URI "Main" + VERSION 1.0 + NO_PLUGIN + QML_FILES main.qml +) + +add_subdirectory(content) +add_subdirectory(imports) + +target_link_libraries(QML_BalancerApp PRIVATE + contentplugin + QML_Balancerplugin +) diff --git a/qtquickcontrols2.conf b/qtquickcontrols2.conf new file mode 100644 index 0000000..4802d8e --- /dev/null +++ b/qtquickcontrols2.conf @@ -0,0 +1,15 @@ +; This file can be edited to change the style of the application +; Read "Qt Quick Controls 2 Configuration File" for details: +; http://doc.qt.io/qt-5/qtquickcontrols2-configuration.html + +[Controls] +Style=Material +;FallbackStyle=Material + +[Material] +Theme=System +Variant=Normal +Accent=#067fff +;Primary=Red +;Foreground=Red +;Background=Red diff --git a/src/app_environment.h b/src/app_environment.h new file mode 100644 index 0000000..1409873 --- /dev/null +++ b/src/app_environment.h @@ -0,0 +1,14 @@ +/* + * This file is automatically generated by Qt Design Studio. + * Do not change. +*/ + +#include + +void set_qt_environment() +{ + qputenv("QT_AUTO_SCREEN_SCALE_FACTOR", "1"); + qputenv("QT_ENABLE_HIGHDPI_SCALING", "0"); + qputenv("QT_LOGGING_RULES", "qt.qml.connections=false"); + qputenv("QT_QUICK_CONTROLS_CONF", ":/qtquickcontrols2.conf"); +} diff --git a/src/import_qml_plugins.h b/src/import_qml_plugins.h new file mode 100644 index 0000000..cdd3b65 --- /dev/null +++ b/src/import_qml_plugins.h @@ -0,0 +1,9 @@ +/* + * This file is automatically generated by Qt Design Studio. + * Do not change. +*/ + +#include + +Q_IMPORT_QML_PLUGIN(contentPlugin) +Q_IMPORT_QML_PLUGIN(QML_BalancerPlugin) diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..aaf1817 --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,62 @@ +/**************************************************************************** +** +** Copyright (C) 2021 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Quick Studio Components. +** +** $QT_BEGIN_LICENSE:GPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include + +#include "app_environment.h" +#include "import_qml_plugins.h" + +int main(int argc, char *argv[]) +{ + set_qt_environment(); + + QGuiApplication app(argc, argv); + + QQmlApplicationEngine engine; + const QUrl url(u"qrc:Main/main.qml"_qs); + QObject::connect( + &engine, &QQmlApplicationEngine::objectCreated, &app, + [url](QObject *obj, const QUrl &objUrl) { + if (!obj && url == objUrl) + QCoreApplication::exit(-1); + }, + Qt::QueuedConnection); + + engine.addImportPath(QCoreApplication::applicationDirPath() + "/qml"); + engine.addImportPath(":/"); + + engine.load(url); + + if (engine.rootObjects().isEmpty()) { + return -1; + } + + return app.exec(); +}