Init project finished
56
.gitignore
vendored
Normal file
@ -0,0 +1,56 @@
|
||||
# C++ objects and libs
|
||||
*.slo
|
||||
*.lo
|
||||
*.o
|
||||
*.a
|
||||
*.la
|
||||
*.lai
|
||||
*.so
|
||||
*.so.*
|
||||
*.dll
|
||||
*.dylib
|
||||
|
||||
# Qt-es
|
||||
object_script.*.Release
|
||||
object_script.*.Debug
|
||||
*_plugin_import.cpp
|
||||
/.qmake.cache
|
||||
/.qmake.stash
|
||||
*.pro.user
|
||||
*.pro.user.*
|
||||
*.qbs.user
|
||||
*.qbs.user.*
|
||||
*.moc
|
||||
moc_*.cpp
|
||||
moc_*.h
|
||||
qrc_*.cpp
|
||||
ui_*.h
|
||||
*.qmlc
|
||||
*.jsc
|
||||
Makefile*
|
||||
*build-*
|
||||
*.qm
|
||||
*.prl
|
||||
|
||||
# Qt unit tests
|
||||
target_wrapper.*
|
||||
|
||||
# QtCreator
|
||||
*.autosave
|
||||
|
||||
# QtCreator Qml
|
||||
*.qmlproject.user
|
||||
*.qmlproject.user.*
|
||||
|
||||
# QtCreator CMake
|
||||
CMakeLists.txt.user*
|
||||
|
||||
# QtCreator 4.8< compilation database
|
||||
compile_commands.json
|
||||
|
||||
# QtCreator local machine specific files for imported projects
|
||||
*creator.user*
|
||||
|
||||
*_qmlcache.qrc
|
||||
|
||||
build
|
||||
69
CMakeLists.txt
Normal file
@ -0,0 +1,69 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
project(Pretvorenit VERSION 0.1 LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
find_package(Qt6 REQUIRED COMPONENTS Quick QuickControls2) # Widgets QuickWidgets
|
||||
|
||||
add_subdirectory("pages/FigmaQmlInterface")
|
||||
|
||||
qt_standard_project_setup(REQUIRES 6.5)
|
||||
|
||||
set(QML_IMPORT_PATH "${CMAKE_BINARY_DIR}/pages/FigmaQmlInterface" CACHE STRING "QML import path")
|
||||
|
||||
qt_add_executable(appQtQuckApp
|
||||
main.cpp
|
||||
)
|
||||
|
||||
qt_add_qml_module(appQtQuckApp
|
||||
URI QtQuckApp
|
||||
VERSION 1.0
|
||||
QML_FILES
|
||||
Main.qml
|
||||
SOURCES figmaadapter.h figmaadapter.cpp
|
||||
SOURCES
|
||||
SOURCES callbackwrapper.h callbackwrapper.cpp
|
||||
SOURCES dynamicloader.h dynamicloader.cpp
|
||||
SOURCES
|
||||
SOURCES
|
||||
SOURCES mainpageactivity.h mainpageactivity.cpp
|
||||
SOURCES
|
||||
SOURCES quickhelper.h quickhelper.cpp
|
||||
QML_FILES qml/ScrollableTextList.qml
|
||||
QML_FILES
|
||||
SOURCES mainpagepresentor.h mainpagepresentor.cpp
|
||||
SOURCES FigmaQmlNames.h
|
||||
SOURCES settingsrepository.h settingsrepository.cpp
|
||||
SOURCES settingspageactivity.h settingspageactivity.cpp
|
||||
SOURCES quickupdater.h quickupdater.cpp
|
||||
)
|
||||
|
||||
# Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1.
|
||||
# If you are developing for iOS or macOS you should consider setting an
|
||||
# explicit, fixed bundle identifier manually though.
|
||||
|
||||
set_target_properties(appQtQuckApp PROPERTIES
|
||||
# MACOSX_BUNDLE_GUI_IDENTIFIER com.example.appQtQuckApp
|
||||
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
|
||||
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
|
||||
MACOSX_BUNDLE TRUE
|
||||
WIN32_EXECUTABLE TRUE
|
||||
QML_IMPORT_PATH "${QML_IMPORT_PATH}"
|
||||
QML_IMPORT_MAIN_MODULE TRUE
|
||||
)
|
||||
|
||||
target_include_directories(appQtQuckApp PRIVATE "pages/FigmaQmlInterface")
|
||||
|
||||
|
||||
target_link_libraries(appQtQuckApp
|
||||
PRIVATE Qt6::Quick Qt6::Qml Qt6::QuickControls2 FigmaQmlInterface
|
||||
)
|
||||
#Qt6::Widgets Qt6::QuickWidgets
|
||||
|
||||
include(GNUInstallDirs)
|
||||
install(TARGETS appQtQuckApp
|
||||
BUNDLE DESTINATION .
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
)
|
||||
21
FigmaQmlNames.h
Normal file
@ -0,0 +1,21 @@
|
||||
#ifndef FIGMAQMLNAMES_H
|
||||
#define FIGMAQMLNAMES_H
|
||||
namespace QML{
|
||||
namespace Windows{
|
||||
constexpr const char * MAIN= "pages/FigmaQmlInterface/qml/TestPage_MainWindow2_figma.qml";
|
||||
}
|
||||
namespace Pages{
|
||||
constexpr const char * MAIN= "pages/FigmaQmlInterface/qml/TestPage_MainPage2_figma.qml";
|
||||
constexpr const char * PROJECT= "pages/FigmaQmlInterface/qml/TestPage_ProjectPage2_figma.qml";
|
||||
|
||||
constexpr const char * SETTINGS= "pages/FigmaQmlInterface/qml/TestPage_SettingsPage2_figma.qml";
|
||||
|
||||
constexpr const char * TRANSFORM = "pages/FigmaQmlInterface/qml/TestPage_ColumnCenter_transform1_figma.qml";
|
||||
|
||||
constexpr const char * TRANSLATING = "pages/FigmaQmlInterface/qml/TestPage_ColumnCenter_translating1_figma.qml";
|
||||
|
||||
constexpr const char * FOLDER_ICON = "pages/FigmaQmlInterface/qml/FileComponent19_figma.qml";
|
||||
constexpr const char * FILE_ICON = "pages/FigmaQmlInterface/qml/FolderComponent18_figma.qml";
|
||||
}
|
||||
}
|
||||
#endif // FIGMAQMLNAMES_H
|
||||
92
Main.qml
Normal file
@ -0,0 +1,92 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Window
|
||||
import FigmaQmlInterface
|
||||
|
||||
Window {
|
||||
id: rootWindow
|
||||
width: 1600
|
||||
height: 900
|
||||
visible: true
|
||||
// flags: Qt.Window | Qt.FramelessWindowHint // Убираем рамку и заголовок
|
||||
//flags: Qt.Window | Qt.MSWindowsFixedSizeDialogHint
|
||||
color: "transparent" // Прозрачный фон (если нужно)
|
||||
title: "Заголовок" // Пустой заголовок
|
||||
|
||||
// Чёрная рамка 1px по краям
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
anchors.margins: -1 // Выступает за границы родителя
|
||||
color: "transparent"
|
||||
border.color: "#000000"
|
||||
border.width: 1
|
||||
}
|
||||
|
||||
// Верхняя панель управления
|
||||
Rectangle {
|
||||
id: titleBar
|
||||
width: parent.width
|
||||
height: 30
|
||||
|
||||
// Текст заголовка
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
text: "Custom Window"
|
||||
color: "white"
|
||||
font.pixelSize: 12
|
||||
}
|
||||
|
||||
// Обработчик перемещения окна
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||
|
||||
property point clickPos: "0,0"
|
||||
|
||||
onPressed: {
|
||||
if (mouse.button === Qt.LeftButton) {
|
||||
clickPos = Qt.point(mouse.x, mouse.y)
|
||||
} else if (mouse.button === Qt.RightButton) {
|
||||
contextMenu.popup()
|
||||
}
|
||||
}
|
||||
|
||||
onPositionChanged: {
|
||||
if (pressedButtons === Qt.LeftButton) {
|
||||
var delta = Qt.point(mouse.x - clickPos.x,
|
||||
mouse.y - clickPos.y)
|
||||
rootWindow.x += delta.x
|
||||
rootWindow.y += delta.y
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Контекстное меню
|
||||
Menu {
|
||||
id: contextMenu
|
||||
|
||||
MenuItem {
|
||||
text: "Скрыть"
|
||||
onTriggered: rootWindow.visibility = Window.Minimized
|
||||
}
|
||||
|
||||
MenuItem {
|
||||
text: "Закрыть"
|
||||
onTriggered: Qt.quit()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FigmaQmlUi {
|
||||
anchors.fill: parent
|
||||
}
|
||||
|
||||
// Обработчик события
|
||||
// FigmaQmlSingleton.onEventReceived: {
|
||||
// if (event === 'click_event' && element === 'temp_unit') {
|
||||
// currentUnitCelcius = !currentUnitCelcius; // Переключаем значение
|
||||
// console.log("Текущая единица измерения:", currentUnitCelcius ? "Цельсий" : "Фаренгейт");
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
2
callbackwrapper.cpp
Normal file
@ -0,0 +1,2 @@
|
||||
#include "callbackwrapper.h"
|
||||
|
||||
26
callbackwrapper.h
Normal file
@ -0,0 +1,26 @@
|
||||
#ifndef CALLBACKWRAPPER_H
|
||||
#define CALLBACKWRAPPER_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QtQuick/QQuickPaintedItem>
|
||||
|
||||
class CallbackWrapper : public QObject {
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(QString name READ name WRITE setName FINAL)
|
||||
QML_ELEMENT
|
||||
public:
|
||||
explicit CallbackWrapper(std::function<void()> callback, QObject* parent = nullptr)
|
||||
: QObject(parent), m_callback(std::move(callback)) {}
|
||||
|
||||
QString name() const {return m_name;}
|
||||
void setName(const QString &name) {m_name = name;}
|
||||
|
||||
Q_INVOKABLE void invoke() {
|
||||
if (m_callback) m_callback();
|
||||
}
|
||||
|
||||
private:
|
||||
QString m_name;
|
||||
std::function<void()> m_callback;
|
||||
};
|
||||
#endif // CALLBACKWRAPPER_H
|
||||
40
dynamicloader.cpp
Normal file
@ -0,0 +1,40 @@
|
||||
#include "dynamicloader.h"
|
||||
|
||||
DynamicLoader::DynamicLoader(QQmlEngine* engine, QObject* parent)
|
||||
: QObject(parent), m_engine(engine)
|
||||
{
|
||||
}
|
||||
|
||||
void DynamicLoader::createComponent(const QString& qmlFile, QQuickItem* parentItem, QQuickItem **createdComponent)
|
||||
{
|
||||
QQmlComponent component(m_engine, QUrl(qmlFile));
|
||||
|
||||
if (component.isError()) {
|
||||
emit errorOccurred(component.errorString());
|
||||
return;
|
||||
}
|
||||
|
||||
QObject* object = component.create();
|
||||
if (!object) {
|
||||
emit errorOccurred("Failed to create object");
|
||||
return;
|
||||
}
|
||||
|
||||
QQuickItem* item = qobject_cast<QQuickItem*>(object);
|
||||
|
||||
if (!item) {
|
||||
emit errorOccurred("Created object is not a QQuickItem");
|
||||
object->deleteLater();
|
||||
return;
|
||||
}
|
||||
|
||||
item->setParent(parentItem);
|
||||
item->setParentItem(parentItem);
|
||||
item->setWidth(parentItem->width());
|
||||
item->setHeight(parentItem->height());
|
||||
|
||||
if (createdComponent) {
|
||||
*createdComponent = item;
|
||||
}
|
||||
emit componentCreated(item);
|
||||
}
|
||||
23
dynamicloader.h
Normal file
@ -0,0 +1,23 @@
|
||||
#ifndef DYNAMICLOADER_H
|
||||
#define DYNAMICLOADER_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QQmlComponent>
|
||||
#include <QQuickItem>
|
||||
|
||||
class DynamicLoader : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit DynamicLoader(QQmlEngine* engine, QObject* parent = nullptr);
|
||||
|
||||
Q_INVOKABLE void createComponent(const QString& qmlFile, QQuickItem* parentItem, QQuickItem **createdComponent = 0);
|
||||
|
||||
signals:
|
||||
void componentCreated(QQuickItem* item);
|
||||
void errorOccurred(const QString& message);
|
||||
|
||||
private:
|
||||
QQmlEngine* m_engine;
|
||||
};
|
||||
#endif
|
||||
226
figmaadapter.cpp
Normal file
@ -0,0 +1,226 @@
|
||||
#include "figmaadapter.h"
|
||||
// #include "FigmaQmlInterface.hpp"
|
||||
#include "QDebug"
|
||||
#include "QQuickItem"
|
||||
#include <QJSEngine>
|
||||
#include <QQmlContext>
|
||||
#include <QQmlEngine>
|
||||
#include <callbackwrapper.h>
|
||||
|
||||
#include "dynamicloader.h"
|
||||
#include "quickhelper.h"
|
||||
|
||||
#include "mainpageactivity.h"
|
||||
#include "mainpagepresentor.h"
|
||||
#include "settingspageactivity.h"
|
||||
#include "settingsrepository.h"
|
||||
|
||||
const char * HOME_ITEM = "HomeItem";
|
||||
const char * PROJECT_ITEM = "ProjectsItem";
|
||||
const char * SETTINGS_ITEM = "SettingsItem";
|
||||
const char * CLOSE_ITEM = "CloseItem";
|
||||
|
||||
FigmaAdapter::FigmaAdapter(void * figmaQtInstance, QQmlApplicationEngine &engine, QObject *parent)
|
||||
: QObject{parent} , engine(engine)
|
||||
{
|
||||
figmaAdapter = figmaQtInstance;
|
||||
// connect(getFigmaAdapter(), &FigmaQmlSingleton::eventReceived, this, &FigmaAdapter::eventReceived);
|
||||
// connect(getFigmaAdapter(), &FigmaQmlSingleton::viewLoaded, this, &FigmaAdapter::viewLoaded);
|
||||
loader = new DynamicLoader(&engine,this);
|
||||
connect(loader,&DynamicLoader::componentCreated, this, &FigmaAdapter::componentCreated);
|
||||
connect(loader,&DynamicLoader::errorOccurred, this, &FigmaAdapter::errorOccurred);
|
||||
}
|
||||
|
||||
void FigmaAdapter::Init()
|
||||
{
|
||||
QObject *rootObject = engine.rootObjects().first();
|
||||
|
||||
updateElement(rootObject, HOME_ITEM, QuickHelper::addMouseArea, [this] {homeItemClick();});
|
||||
updateElement(rootObject, PROJECT_ITEM, QuickHelper::addMouseArea, [this] {projectsItemClick();});
|
||||
updateElement(rootObject, SETTINGS_ITEM, QuickHelper::addMouseArea, [this] {settingsItemClick();});
|
||||
updateElement(rootObject, CLOSE_ITEM, QuickHelper::addMouseArea, [this] {closeItemClick();});
|
||||
|
||||
labelAvailibleSizeButton = QuickHelper::getQuickItem(rootObject, LABEL_AVAILIBLE_SIZE);
|
||||
rectAvailibleSize = QuickHelper::getQuickItem(rootObject, RECT_AVAILIBLE_SIZE_BAR);
|
||||
rectPassedBar = QuickHelper::getQuickItem(rootObject, RECT_AVAILIBLE_PASSED_BAR);
|
||||
componentLabelAvailibleSize = QuickHelper::getQuickItem(rootObject, COMPONENT_LABEL_AVAILIBLE_SIZE);
|
||||
homeItemClick();
|
||||
updateStorageInfo();
|
||||
}
|
||||
|
||||
void FigmaAdapter::updateElement(QObject *rootObject, const QString &elementName,
|
||||
std::function<void(QObject*, std::function<void()>)> updateItemFunction,
|
||||
std::function<void()> onClick)
|
||||
{
|
||||
QuickHelper::updateElement(rootObject,elementName,updateItemFunction, onClick);
|
||||
}
|
||||
|
||||
void FigmaAdapter::homeItemClick()
|
||||
{
|
||||
qDebug()<< "homeItemClick";
|
||||
loadPage(MAIN_PAGE);
|
||||
|
||||
QObject *rootObject = engine.rootObjects().first();
|
||||
QQuickItem * mainViewItem = QuickHelper::getQuickItem(rootObject, "MainView");
|
||||
|
||||
if(!mainViewItem) return;
|
||||
// QObjectList listChildren = mainViewItem->children();
|
||||
|
||||
QQuickItem * mainPage;
|
||||
mainPage = QuickHelper::getQuickItem(mainViewItem, "MainPage");
|
||||
|
||||
MainPageActivity * mainPageActivity = 0;
|
||||
|
||||
if (rootObject && mainViewItem) {
|
||||
mainPageActivity = new MainPageActivity(mainViewItem,mainPage);
|
||||
}
|
||||
|
||||
MainPagePresentor *presentor = new MainPagePresentor(mainPageActivity, mainPage);
|
||||
engine.rootContext()->setContextProperty("mainViewPresentor", presentor);
|
||||
}
|
||||
|
||||
void FigmaAdapter::projectsItemClick()
|
||||
{
|
||||
qDebug()<< "projectsItemClick";
|
||||
loadPage(PROJECTS_PAGE);
|
||||
}
|
||||
|
||||
void FigmaAdapter::settingsItemClick()
|
||||
{
|
||||
qDebug()<< "settingsItemClick";
|
||||
loadPage(SETTINS_PAGE);
|
||||
|
||||
QObject *rootObject = engine.rootObjects().first();
|
||||
QQuickItem * mainViewItem = QuickHelper::getQuickItem(rootObject, "MainView");
|
||||
|
||||
if(!mainViewItem) return;
|
||||
|
||||
QQuickItem * settingsPage;
|
||||
settingsPage = QuickHelper::getQuickItem(mainViewItem, "SettingsPage");
|
||||
|
||||
SettingsPageActivity * settingsPageActivity = 0;
|
||||
|
||||
if (rootObject && mainViewItem) {
|
||||
settingsPageActivity = new SettingsPageActivity(mainViewItem, settingsPage);
|
||||
}
|
||||
}
|
||||
|
||||
void FigmaAdapter::closeItemClick()
|
||||
{
|
||||
qDebug()<< "closeItemClick";
|
||||
exit(0);
|
||||
}
|
||||
|
||||
void FigmaAdapter::loadPage(const QString& pageName)
|
||||
{
|
||||
QObject *rootObject = engine.rootObjects().first();
|
||||
|
||||
QString page = DEFAULT_PAGE_PATH + pageName;
|
||||
|
||||
auto updateFunc = [this, page](QObject* rootObject, std::function<void()>){
|
||||
|
||||
QQuickItem* parentItem = qobject_cast<QQuickItem*>(rootObject);
|
||||
|
||||
Helper::clearChildren(parentItem);
|
||||
|
||||
if (!parentItem) {
|
||||
qWarning() << "[C++] Root object is not a QQuickItem";
|
||||
return;
|
||||
}
|
||||
|
||||
QQmlEngine* engine = qmlEngine(rootObject);
|
||||
if (!engine) {
|
||||
qWarning() << "[C++] Failed to get QQmlEngine";
|
||||
return;
|
||||
}
|
||||
|
||||
loader->createComponent(page , parentItem);
|
||||
};
|
||||
|
||||
updateElement(rootObject,"MainView", updateFunc, 0);
|
||||
}
|
||||
|
||||
|
||||
#include <QStorageInfo>
|
||||
|
||||
quint64 getFreeDiskSpace(const QString &path)
|
||||
{
|
||||
QStorageInfo storage(path);
|
||||
|
||||
if (!storage.isValid() || !storage.isReady()) {
|
||||
qWarning() << "Неверный путь или диск не готов:" << path;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (storage.isReadOnly()) {
|
||||
qWarning() << "Диск доступен только для чтения:" << path;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return storage.bytesAvailable(); // свободное место в байтах
|
||||
}
|
||||
// #include <QQuickText>
|
||||
// #include <private/qquicktextnode_p.h>
|
||||
void FigmaAdapter::updateStorageInfo()
|
||||
{
|
||||
QString path = SettingsRepository::instance().defaultProjectDirectory();
|
||||
if (path == ""){
|
||||
if (componentLabelAvailibleSize) {
|
||||
componentLabelAvailibleSize->setVisible(false);
|
||||
}
|
||||
|
||||
if (rectAvailibleSize){
|
||||
rectAvailibleSize->setVisible(false);
|
||||
}
|
||||
|
||||
if (labelAvailibleSizeButton) {
|
||||
labelAvailibleSizeButton->setProperty("text", "Хранилище не задано");
|
||||
const QMetaObject *metaObject = labelAvailibleSizeButton->metaObject();
|
||||
int enumIndex = metaObject->indexOfEnumerator("FontSizeMode");
|
||||
QMetaEnum metaEnum = metaObject->enumerator(enumIndex);
|
||||
// Получаем числовое значение нужного enum
|
||||
int horizontalFitValue = metaEnum.keyToValue("HorizontalFit");
|
||||
// Устанавливаем свойство fontSizeMode
|
||||
labelAvailibleSizeButton->setProperty("fontSizeMode", horizontalFitValue);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
quint64 freeBytes = getFreeDiskSpace(path);
|
||||
QString numberFormat = QString::number(freeBytes / (1024 * 1024 * 1024),'g', 2);
|
||||
|
||||
if (labelAvailibleSizeButton) {
|
||||
labelAvailibleSizeButton->setProperty("text", numberFormat + " Гб");
|
||||
}
|
||||
}
|
||||
|
||||
void FigmaAdapter::eventReceived(const QString &element, const QString &event)
|
||||
{
|
||||
qDebug() << "event: "<< event << " element: " << element;
|
||||
}
|
||||
|
||||
void FigmaAdapter::componentCreated(QQuickItem *item)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void FigmaAdapter::errorOccurred(const QString &message)
|
||||
{
|
||||
qDebug()<< message;
|
||||
}
|
||||
|
||||
void FigmaAdapter::Helper::clearChildren(QQuickItem *parentItem)
|
||||
{
|
||||
const auto children = parentItem->children();
|
||||
|
||||
if (children.size()) {
|
||||
|
||||
for (QObject* child : children) {
|
||||
if (QQuickItem* item = qobject_cast<QQuickItem*>(child)) {
|
||||
item->setParentItem(nullptr);
|
||||
item->deleteLater();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
74
figmaadapter.h
Normal file
@ -0,0 +1,74 @@
|
||||
#ifndef FIGMAADAPTER_H
|
||||
#define FIGMAADAPTER_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QQmlApplicationEngine>
|
||||
|
||||
class DynamicLoader;
|
||||
class QQuickItem;
|
||||
|
||||
class FigmaAdapter : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
DynamicLoader* loader = 0;
|
||||
private:
|
||||
void * figmaAdapter;
|
||||
QQmlApplicationEngine &engine;
|
||||
|
||||
public:
|
||||
explicit FigmaAdapter(void * figmaQtInstance, QQmlApplicationEngine &engine, QObject *parent = nullptr);
|
||||
|
||||
void Init();
|
||||
|
||||
private:
|
||||
static void updateElement (
|
||||
QObject *rootObject,
|
||||
const QString& elementName,
|
||||
std::function<void(QObject*, std::function<void()>)> updateItemFunction,
|
||||
std::function<void()> onClick
|
||||
);
|
||||
|
||||
// void addMouseAreaWithClickAction(QObject *rootObject, std::function<void ()> onClickAction);
|
||||
|
||||
// handler clicks
|
||||
void homeItemClick();
|
||||
void projectsItemClick();
|
||||
void settingsItemClick();
|
||||
void closeItemClick();
|
||||
void loadPage(const QString& pageName);
|
||||
void updateStorageInfo();
|
||||
class Helper {
|
||||
public:
|
||||
static void clearChildren(QQuickItem* parentItem);
|
||||
};
|
||||
|
||||
|
||||
private:
|
||||
const QString LABEL_AVAILIBLE_SIZE = "LabelAvailibleSizeButton";
|
||||
QQuickItem * labelAvailibleSizeButton = 0;
|
||||
|
||||
const QString RECT_AVAILIBLE_SIZE_BAR = "AvailibleSizeProgressBar";
|
||||
QQuickItem * rectAvailibleSize = 0;
|
||||
|
||||
const QString COMPONENT_LABEL_AVAILIBLE_SIZE = "LabelAvailibleSizeComponent";
|
||||
QQuickItem * componentLabelAvailibleSize = 0;
|
||||
|
||||
|
||||
const QString RECT_AVAILIBLE_PASSED_BAR = "AvailibleSizeProgressBarPassedBar";
|
||||
QQuickItem * rectPassedBar = 0;
|
||||
const QString DEFAULT_PAGE_PATH = "pages/FigmaQmlInterface/qml/";
|
||||
const QString MAIN_PAGE = "TestPage_MainPage2_figma.qml";
|
||||
const QString SETTINS_PAGE = "TestPage_SettingsPage2_figma.qml";
|
||||
const QString PROJECTS_PAGE = "TestPage_ProjectPage2_figma.qml";
|
||||
public slots:
|
||||
void eventReceived(const QString& element, const QString& event);
|
||||
|
||||
private slots:
|
||||
void componentCreated(QQuickItem* item);
|
||||
void errorOccurred(const QString& message);
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif // FIGMAADAPTER_H
|
||||
47
main.cpp
Normal file
@ -0,0 +1,47 @@
|
||||
#include <QGuiApplication>
|
||||
#include <QQmlApplicationEngine>
|
||||
|
||||
#include "FigmaQmlInterface.hpp"
|
||||
#include "figmaadapter.h"
|
||||
|
||||
#include "FigmaQmlInterface.hpp"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QGuiApplication app(argc, argv);
|
||||
// QApplication app(argc, argv);
|
||||
QQmlApplicationEngine engine;
|
||||
QObject::connect(
|
||||
&engine,
|
||||
&QQmlApplicationEngine::objectCreationFailed,
|
||||
&app,
|
||||
[]() { QCoreApplication::exit(-1); },
|
||||
Qt::QueuedConnection);
|
||||
|
||||
FigmaQmlInterface::registerFigmaQmlSingleton(engine);
|
||||
|
||||
for (const auto &path : engine.importPathList()) {
|
||||
qDebug() << " - " << path;
|
||||
}
|
||||
|
||||
engine.addImportPath("qrc:/");
|
||||
engine.addImportPath(QCoreApplication::applicationDirPath() + "/qml");
|
||||
engine.addImportPath(QCoreApplication::applicationDirPath() + "/qml");
|
||||
|
||||
FigmaQmlSingleton * instance = FigmaQmlSingleton::instance(engine);
|
||||
|
||||
FigmaAdapter * figmaAdapter = 0;
|
||||
|
||||
if (instance) {
|
||||
figmaAdapter = new FigmaAdapter(instance, engine);
|
||||
}
|
||||
|
||||
qDebug() << "Before";
|
||||
engine.loadFromModule("QtQuckApp", "Main");
|
||||
|
||||
if (figmaAdapter) {
|
||||
figmaAdapter->Init();
|
||||
}
|
||||
|
||||
return app.exec();
|
||||
}
|
||||
186
mainpageactivity.cpp
Normal file
@ -0,0 +1,186 @@
|
||||
#include "mainpageactivity.h"
|
||||
#include <QJSEngine>
|
||||
#include <QQmlContext>
|
||||
#include <QQmlEngine>
|
||||
#include "QQuickItem"
|
||||
#include "quickhelper.h"
|
||||
#include <QDebug>
|
||||
#include "dynamicloader.h"
|
||||
#include <QGuiApplication>
|
||||
#include <QQmlApplicationEngine>
|
||||
|
||||
MainPageActivity::MainPageActivity(QQuickItem * item, QObject *parent)
|
||||
: QObject{parent}, root(item)
|
||||
{
|
||||
if (!item) {
|
||||
qWarning() << "[C++] Root object is null";
|
||||
return;
|
||||
}
|
||||
|
||||
engine = qmlEngine(item);
|
||||
|
||||
if (!engine) {
|
||||
qWarning() << "[C++] Failed to get QQmlEngine";
|
||||
return;
|
||||
}
|
||||
|
||||
loader = new DynamicLoader(engine,this);
|
||||
connect(loader, &DynamicLoader::errorOccurred, this, &MainPageActivity::errorOccurredDynamycLoaderHandler);
|
||||
MainPageActivity::init();
|
||||
}
|
||||
|
||||
void MainPageActivity::setProjectName(QString name)
|
||||
{
|
||||
projectNameTextField->setProperty("text",name);
|
||||
}
|
||||
|
||||
bool MainPageActivity::isVariablesSet(){
|
||||
bool ret_code = false; // Флаг ошибки
|
||||
|
||||
if (!buttonChooseFiles) {
|
||||
qWarning() << "Failed to get buttonChooseFiles:" << BUTTON_CHOOSE_FILES;
|
||||
ret_code = true;
|
||||
}
|
||||
|
||||
if (!contentMainPageTransform) {
|
||||
qWarning() << "Failed to get contentMainPageTransform:" << CONTENT_MAIN_PAGE_TRANSFORM;
|
||||
ret_code = true;
|
||||
}
|
||||
|
||||
columnLeft = QuickHelper::getQuickItem(root, COLUMN_LEFT);
|
||||
if (!columnLeft) {
|
||||
qWarning() << "Failed to get columnLeft:" << COLUMN_LEFT;
|
||||
ret_code = true;
|
||||
}
|
||||
|
||||
if (!columnCenter) {
|
||||
qWarning() << "Failed to get columnCenter:" << COLUMN_CENTER;
|
||||
ret_code = true;
|
||||
}
|
||||
|
||||
if (!columnRight) {
|
||||
qWarning() << "Failed to get columnRight:" << COLUMN_RIGHT;
|
||||
ret_code = true;
|
||||
}
|
||||
|
||||
if (!labelFileCount) {
|
||||
qWarning() << "Failed to get labelFileCount:" << LABEL_FILE_COUNT;
|
||||
ret_code = true;
|
||||
}
|
||||
|
||||
// После всех проверок можно использовать ret_code для определения успешности
|
||||
if (ret_code) {
|
||||
qCritical() << "One or more QML elements failed to load";
|
||||
// Дополнительная обработка ошибки
|
||||
}
|
||||
|
||||
return !ret_code;
|
||||
}
|
||||
|
||||
void MainPageActivity::loadElementsFromView() {
|
||||
buttonChooseFiles = QuickHelper::getQuickItem(root,BUTTON_CHOOSE_FILES);
|
||||
contentMainPageTransform = QuickHelper::getQuickItem(root,CONTENT_MAIN_PAGE_TRANSFORM);
|
||||
columnLeft = QuickHelper::getQuickItem(root,COLUMN_LEFT);
|
||||
columnCenter = QuickHelper::getQuickItem(root,COLUMN_CENTER);
|
||||
columnRight = QuickHelper::getQuickItem(root,COLUMN_RIGHT);
|
||||
labelFileCount = QuickHelper::getQuickItem(root,LABEL_FILE_COUNT);
|
||||
}
|
||||
|
||||
void MainPageActivity::init() {
|
||||
loadElementsFromView();
|
||||
|
||||
if (!isVariablesSet()) {
|
||||
return;
|
||||
}
|
||||
|
||||
setInitialView();
|
||||
}
|
||||
|
||||
void MainPageActivity::setInitialView() {
|
||||
listFilesItem = 0;
|
||||
loader->createComponent("QtQuckApp/qml/ScrollableTextList.qml", columnLeft, &listFilesItem);
|
||||
QuickHelper::addMouseArea(buttonChooseFiles,[this] {handleChooseFiles();});
|
||||
setColumnCenteTranslate();
|
||||
setDefaultValues();
|
||||
blockTranslate();
|
||||
}
|
||||
|
||||
void MainPageActivity::setDefaultValues()
|
||||
{
|
||||
if (projectNameTextField){
|
||||
projectNameTextField->setProperty("text", "Проект");
|
||||
}
|
||||
|
||||
if (labelFileCount) {
|
||||
labelFileCount->setProperty("width", 400);
|
||||
labelFileCount->setProperty("text", "Ни один файл не выбран");
|
||||
// labelFileCount->setWidth(labelFileCount->property("contentWidth").toFloat());
|
||||
labelFileCount->setProperty("wrapMode", "Text.NoWrap");
|
||||
labelFileCount->setProperty("elide", "Text.ElideNone");
|
||||
labelFileCount->setProperty("clip", false);
|
||||
}
|
||||
}
|
||||
|
||||
void MainPageActivity::setColumnCenteTranslate(){
|
||||
QuickHelper::clearChildren(columnCenter);
|
||||
columnCenterItem = 0;
|
||||
loader->createComponent("pages/FigmaQmlInterface/qml/TestPage_ColumnCenter_transform1_figma.qml", columnCenter, &columnCenterItem);
|
||||
|
||||
if (columnCenterItem) {
|
||||
transformButton = QuickHelper::getQuickItem(columnCenterItem, TRANSFORM_BUTTON);
|
||||
projectNameTextField = QuickHelper::getQuickItem(columnCenterItem, PROJECT_NAME_TEXT_FILED);
|
||||
}
|
||||
|
||||
if (transformButton) {
|
||||
QuickHelper::addMouseArea(transformButton,[this]{translateClick();});
|
||||
auto defaultColor = transformButton->property("color").toString();
|
||||
//auto newColor = "enabled ? \" + defaultColor + \" : \"black\"";//lightgray
|
||||
// auto newColor = "enabled ? \" + lightblue + \" : \"black\"";//lightgray
|
||||
// transformButton->setProperty("color",newColor);
|
||||
QuickHelper::updateColor(transformButton, qRgb(255,0,0),qRgb(0,255,0));
|
||||
}
|
||||
|
||||
if (projectNameTextField) {
|
||||
QuickHelper::moveTextFiledX(projectNameTextField);
|
||||
}
|
||||
}
|
||||
|
||||
void MainPageActivity::translateClick(){
|
||||
qDebug() << "TranslateClick";
|
||||
}
|
||||
void MainPageActivity::blockTranslate()
|
||||
{
|
||||
// Подкрашиваем окно перевода
|
||||
isBlockTranslate = true;
|
||||
transformButton->setEnabled(false);
|
||||
transformButton->setProperty("enabled",false);
|
||||
}
|
||||
|
||||
void MainPageActivity::allowTranslate()
|
||||
{
|
||||
// Разрешаем перевод
|
||||
isBlockTranslate = false;
|
||||
transformButton->setEnabled(true);
|
||||
transformButton->setProperty("enabled",true);
|
||||
|
||||
}
|
||||
|
||||
void MainPageActivity::listFilePathSet(QVariant listFiles)
|
||||
{
|
||||
allowTranslate();
|
||||
QString text = "Выбрано файлов: " + QString::number(listFiles.toStringList().count());
|
||||
labelFileCount->setProperty("text", text);
|
||||
}
|
||||
|
||||
void MainPageActivity::errorOccurredDynamycLoaderHandler(const QString &message)
|
||||
{
|
||||
qDebug()<<"Error: " << message;
|
||||
}
|
||||
|
||||
void MainPageActivity::handleChooseFiles()
|
||||
{
|
||||
if (listFilesItem) {
|
||||
QMetaObject::invokeMethod(listFilesItem, "openFileDialog");
|
||||
// Q_ARG(QVariant, variant));
|
||||
}
|
||||
}
|
||||
83
mainpageactivity.h
Normal file
@ -0,0 +1,83 @@
|
||||
#ifndef MAINPAGEACTIVITY_H
|
||||
#define MAINPAGEACTIVITY_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class QQuickItem;
|
||||
class DynamicLoader;
|
||||
class QQmlEngine;
|
||||
|
||||
class MainPageActivity : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit MainPageActivity(QQuickItem * item, QObject *parent = nullptr);
|
||||
void setProjectName(QString name);
|
||||
|
||||
private:
|
||||
QQuickItem * root;
|
||||
DynamicLoader* loader = 0;
|
||||
QQmlEngine * engine;
|
||||
|
||||
|
||||
const QString BUTTON_CHOOSE_FILES = "ButtonChooseFiles";
|
||||
QQuickItem * buttonChooseFiles = 0;
|
||||
|
||||
const QString CONTENT_MAIN_PAGE_TRANSFORM = "ContentMainPageTransform";
|
||||
QQuickItem * contentMainPageTransform = 0;
|
||||
|
||||
const QString COLUMN_LEFT = "ColumnLeft";
|
||||
QQuickItem * columnLeft = 0;
|
||||
|
||||
const QString COLUMN_CENTER = "ColumnCenter";
|
||||
QQuickItem * columnCenter = 0;
|
||||
|
||||
const QString COLUMN_RIGHT = "ColumnRight";
|
||||
QQuickItem * columnRight = 0;
|
||||
|
||||
const QString LABEL_FILE_COUNT = "ChosenFileCountLabel";
|
||||
QQuickItem * labelFileCount = 0;
|
||||
|
||||
QQuickItem *listFilesItem;
|
||||
QQuickItem *columnCenterItem;
|
||||
|
||||
const QString TRANSFORM_BUTTON = "TransformButton";
|
||||
QQuickItem * transformButton;
|
||||
const QString PROJECT_NAME_TEXT_FILED = "ProjectTextField";
|
||||
QQuickItem * projectNameTextField;
|
||||
|
||||
bool isBlockTranslate = true;
|
||||
|
||||
void handleChooseFiles();
|
||||
bool isVariablesSet();
|
||||
void init();
|
||||
void loadElementsFromView();
|
||||
// Загружаем qml подмодули
|
||||
void setInitialView();
|
||||
void setDefaultValues();
|
||||
|
||||
void translateClick();
|
||||
void blockTranslate();
|
||||
void allowTranslate();
|
||||
|
||||
void setColumnCenteTranslate();
|
||||
|
||||
public:
|
||||
QQuickItem* getButtonChooseFiles() const { return buttonChooseFiles; }
|
||||
QQuickItem* getContentMainPageTransform() const { return contentMainPageTransform; }
|
||||
QQuickItem* getColumnLeft() const { return columnLeft; }
|
||||
QQuickItem* getColumnCenter() const { return columnCenter; }
|
||||
QQuickItem* getColumnRight() const { return columnRight; }
|
||||
QQuickItem* getLabelFileCount() const { return labelFileCount; }
|
||||
QQuickItem* getTransformButton() const { return transformButton; }
|
||||
QQuickItem* getProjectNameTextField() const { return projectNameTextField; }
|
||||
|
||||
public slots:
|
||||
void listFilePathSet(QVariant);
|
||||
private slots:
|
||||
void errorOccurredDynamycLoaderHandler(const QString& message);
|
||||
signals:
|
||||
};
|
||||
|
||||
#endif // MAINPAGEACTIVITY_H
|
||||
34
mainpagepresentor.cpp
Normal file
@ -0,0 +1,34 @@
|
||||
#include "mainpagepresentor.h"
|
||||
#include "mainpageactivity.h"
|
||||
|
||||
#include <qdir.h>
|
||||
#include <qfileinfo.h>
|
||||
|
||||
void MainPagePresentor::init()
|
||||
{
|
||||
connect(this, &MainPagePresentor::listFilesSet, activity,&MainPageActivity::listFilePathSet);
|
||||
}
|
||||
|
||||
void MainPagePresentor::setlistFilePath(const QVariant &listFilePath) {
|
||||
model->m_listFilePath = listFilePath;
|
||||
auto list = listFilePath.toStringList();
|
||||
|
||||
if(list.count() == 0) return;
|
||||
|
||||
emit listFilesSet(model->m_listFilePath);
|
||||
QFileInfo fileInfo(list.first());
|
||||
QString lastFolderName = QDir(fileInfo.absolutePath()).dirName();
|
||||
activity->setProjectName(lastFolderName);
|
||||
}
|
||||
|
||||
void MainPagePresentor::transform() {
|
||||
QStringList stringList = model->m_listFilePath.toStringList();
|
||||
|
||||
auto it = stringList.begin();
|
||||
auto itEnd = stringList.end();
|
||||
|
||||
while (it != itEnd) {
|
||||
qDebug()<< "File: " << *it;
|
||||
++it;
|
||||
}
|
||||
}
|
||||
36
mainpagepresentor.h
Normal file
@ -0,0 +1,36 @@
|
||||
#ifndef MAINPAGEPRESENTOR_H
|
||||
#define MAINPAGEPRESENTOR_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QtQuick/QQuickPaintedItem>
|
||||
|
||||
class MainPageActivity;
|
||||
|
||||
class MainPagePresentor : public QObject {
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(QVariant listFilePath READ listFilePath WRITE setlistFilePath FINAL)
|
||||
QML_ELEMENT
|
||||
|
||||
public:
|
||||
explicit MainPagePresentor(MainPageActivity * activity, QObject* parent = nullptr)
|
||||
: QObject(parent), model(new MainPagePresentorModel), activity(activity) {
|
||||
init();
|
||||
}
|
||||
|
||||
void init();
|
||||
QVariant listFilePath() const {return model->m_listFilePath; }
|
||||
void setlistFilePath(const QVariant& listFilePath);
|
||||
|
||||
Q_INVOKABLE void transform();
|
||||
|
||||
signals:
|
||||
void listFilesSet(QVariant);
|
||||
private:
|
||||
MainPageActivity *activity;
|
||||
class MainPagePresentorModel{
|
||||
public:
|
||||
QVariant m_listFilePath;
|
||||
} *model;
|
||||
};
|
||||
|
||||
#endif // MAINPAGEPRESENTOR_H
|
||||
67
pages/FigmaQmlInterface/CMakeLists.txt
Normal file
@ -0,0 +1,67 @@
|
||||
cmake_minimum_required(VERSION 3.21)
|
||||
|
||||
project(FigmaQmlInterface VERSION 1.0.0 LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
set(CMAKE_AUTORCC ON)
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
find_package(Qt6 REQUIRED COMPONENTS Core Quick)
|
||||
qt_standard_project_setup()
|
||||
qt_add_library(${PROJECT_NAME} STATIC)
|
||||
|
||||
macro(add_files_to_list var_name search_dir base_dir extension)
|
||||
# Убедимся, что переменная списка существует
|
||||
if(NOT DEFINED ${var_name})
|
||||
set(${var_name} "")
|
||||
endif()
|
||||
|
||||
# Получаем абсолютные пути к директориям
|
||||
get_filename_component(base_dir_abs "${base_dir}" ABSOLUTE)
|
||||
get_filename_component(search_dir_abs "${search_dir}" ABSOLUTE)
|
||||
|
||||
# Проверяем существование директорий
|
||||
if(NOT EXISTS "${base_dir_abs}")
|
||||
message(WARNING "Base directory does not exist: ${base_dir_abs}")
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(NOT EXISTS "${search_dir_abs}")
|
||||
message(WARNING "Search directory does not exist: ${search_dir_abs}")
|
||||
return()
|
||||
endif()
|
||||
|
||||
# Ищем все файлы с заданным расширением
|
||||
file(GLOB_RECURSE files "${search_dir_abs}/*.${extension}")
|
||||
|
||||
# Добавляем найденные файлы в список
|
||||
foreach(file ${files})
|
||||
# Получаем относительный путь от базовой директории
|
||||
file(RELATIVE_PATH relative_path "${base_dir_abs}" "${file}")
|
||||
list(APPEND ${var_name} "${relative_path}")
|
||||
endforeach()
|
||||
|
||||
# Устанавливаем значение переменной списка
|
||||
set(${var_name} "${${var_name}}" PARENT_SCOPE)
|
||||
endmacro()
|
||||
|
||||
# Пример использования
|
||||
add_files_to_list(APP_QML_FILES "${CMAKE_CURRENT_SOURCE_DIR}/qml" "${CMAKE_CURRENT_SOURCE_DIR}" "qml")
|
||||
add_files_to_list(APP_IMAGE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/qml/images" "${CMAKE_CURRENT_SOURCE_DIR}" "png")
|
||||
|
||||
message(" APP_QML_FILES ${APP_QML_FILES}")
|
||||
message(APP_IMAGE_FILES)
|
||||
|
||||
qt_add_qml_module(${PROJECT_NAME}
|
||||
URI ${PROJECT_NAME}
|
||||
VERSION 1.0
|
||||
SOURCES FigmaQmlInterface.hpp
|
||||
QML_FILES FigmaQmlUi.qml ${APP_QML_FILES}
|
||||
RESOURCES ${APP_IMAGE_FILES}
|
||||
NO_PLUGIN
|
||||
)
|
||||
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Core Qt6::Quick)
|
||||
|
||||
192
pages/FigmaQmlInterface/FigmaQmlInterface.hpp
Normal file
@ -0,0 +1,192 @@
|
||||
#pragma once
|
||||
|
||||
#include <QObject>
|
||||
#include <QQmlComponent>
|
||||
#include <QQmlApplicationEngine>
|
||||
|
||||
/**
|
||||
* @brief Singleton to access FigmaQml properties and communicate between views.
|
||||
*
|
||||
*/
|
||||
class FigmaQmlSingleton : public QObject {
|
||||
Q_OBJECT
|
||||
QML_ELEMENT
|
||||
QML_SINGLETON
|
||||
/// Name of currently active view
|
||||
Q_PROPERTY(QString currentView MEMBER m_currentView NOTIFY currentViewChanged)
|
||||
/// Number of views
|
||||
Q_PROPERTY(int viewCount READ viewCount() CONSTANT)
|
||||
public:
|
||||
/**
|
||||
* @brief Number of available views
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
int viewCount() const {return static_cast<int>(m_elements.size());}
|
||||
|
||||
/**
|
||||
* @brief Static to fetch this instance from engine
|
||||
*
|
||||
* @param engine
|
||||
* @return FigmaQmlSingleton*
|
||||
*/
|
||||
static inline FigmaQmlSingleton* instance(QQmlEngine& engine);
|
||||
|
||||
signals:
|
||||
/// @brief emitted on applyValue
|
||||
/// @param element
|
||||
/// @param value
|
||||
void valueChanged(const QString& element, const QString& value);
|
||||
/// @brief emitted for asLoader source change
|
||||
/// @param element
|
||||
/// @param source
|
||||
void setSource(const QString& element, const QString& source);
|
||||
/// @brief emitted for asLoader component change
|
||||
/// @param element
|
||||
/// @param sourceComponent
|
||||
void setSourceComponent(const QString& element, const QQmlComponent* sourceComponent);
|
||||
/// @brief emitted on asLoader has changed
|
||||
/// @param element
|
||||
void sourceLoaded(const QString& element);
|
||||
/// @brief emitted on view has changed
|
||||
/// @param view
|
||||
void viewLoaded(const QString& view);
|
||||
/// @brief emitted on asLoader component error
|
||||
/// @param element
|
||||
void sourceError(const QString& element);
|
||||
/// @brief emitted on onClick
|
||||
/// @param element
|
||||
/// @param event
|
||||
void eventReceived(const QString& element, const QString& event);
|
||||
/// @brief emitted on integer value is passed to view
|
||||
/// @param key
|
||||
/// @param value
|
||||
void intReceived(const QString& key, int value);
|
||||
/// @brief emitted on real value is passed to view
|
||||
/// @param key
|
||||
/// @param value
|
||||
void realReceived (const QString& key, double value);
|
||||
/// @brief emitted on string value is passed to view
|
||||
/// @param key
|
||||
/// @param value
|
||||
void stringReceived(const QString& key, const QString& value);
|
||||
/// @brief emitted on object value is passed to view (QML JS object)
|
||||
/// @param key
|
||||
/// @param value
|
||||
void objectReceived(const QString& key, const QVariantMap& value);
|
||||
/// @brief emitted on array value is passed to view (QML JS array)
|
||||
/// @param key
|
||||
/// @param value
|
||||
void arrayReceived(const QString& key, const QVariantList& value);
|
||||
/// @brief emitted when current view has loaded and changed
|
||||
void currentViewChanged();
|
||||
public:
|
||||
/**
|
||||
* @brief applyValue
|
||||
* @param element
|
||||
* @param value
|
||||
*/
|
||||
Q_INVOKABLE void applyValue(const QString& element, const QString& value) {emit valueChanged(element, value);}
|
||||
|
||||
/**
|
||||
* @brief setView
|
||||
* @param index
|
||||
*/
|
||||
Q_INVOKABLE bool setView(int index) {
|
||||
if(index >= 0 && index < static_cast<int>(m_elements.size())) {
|
||||
const auto view = m_elements[index];
|
||||
if(view != m_currentView) {
|
||||
m_currentView = view;
|
||||
emit currentViewChanged();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief view
|
||||
* @param index
|
||||
* @return
|
||||
*/
|
||||
Q_INVOKABLE QString view(int index) const {return index < static_cast<int>(m_elements.size()) ? m_elements[index] : QString{};}
|
||||
|
||||
/**
|
||||
* Mediator functions - see https://doc.qt.io/QtForMCUs-2.5/qml-qtquick-loader.html
|
||||
* ...but more flexible as key value enables address unlike just a value exchange
|
||||
**/
|
||||
|
||||
/** @brief sendInt
|
||||
* @param key
|
||||
* @param value
|
||||
*/
|
||||
Q_INVOKABLE void sendInt(const QString& key, int value) {emit intReceived(key, value);}
|
||||
|
||||
/**
|
||||
* @brief intReceived
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @brief sendReal
|
||||
* @param key
|
||||
* @param value
|
||||
*/
|
||||
Q_INVOKABLE void sendReal(const QString& key, double value) {emit realReceived(key, value);}
|
||||
|
||||
/**
|
||||
* @brief sendString
|
||||
* @param key
|
||||
* @param value
|
||||
*/
|
||||
Q_INVOKABLE void sendString(const QString& key, const QString& value) {emit stringReceived(key, value);}
|
||||
|
||||
/**
|
||||
* @brief sendObject
|
||||
* @param key
|
||||
* @param value
|
||||
*/
|
||||
Q_INVOKABLE void sendObject(const QString& key, const QVariantMap& value) {emit objectReceived(key, value);}
|
||||
|
||||
/**
|
||||
* @brief sendArray
|
||||
* @param key
|
||||
* @param value
|
||||
*/
|
||||
Q_INVOKABLE void sendArray(const QString& key, const QVariantList& value) {emit arrayReceived(key, value);}
|
||||
|
||||
public: // for tooling access
|
||||
FigmaQmlSingleton() : m_currentView{m_elements.empty() ? QString{} : m_elements[0]} {}
|
||||
private:
|
||||
/**
|
||||
* @brief elements, static and sole
|
||||
*/
|
||||
const std::vector<QString> m_elements {"qml/TestPage_MainWindow2_figma.qml"};
|
||||
QString m_currentView;
|
||||
};
|
||||
|
||||
namespace FigmaQmlInterface {
|
||||
/**
|
||||
* @brief Register FigmaQmlSingleton into engine's context as a singleton
|
||||
*
|
||||
* @param engine
|
||||
*/
|
||||
inline
|
||||
void registerFigmaQmlSingleton(QQmlApplicationEngine& engine) {
|
||||
qmlRegisterSingletonType<FigmaQmlSingleton>("FigmaQmlInterface", 1, 0, "FigmaQmlSingleton", [](QQmlEngine *, QJSEngine *) {
|
||||
return new FigmaQmlSingleton();
|
||||
});
|
||||
engine.addImportPath(":/");
|
||||
}
|
||||
}
|
||||
|
||||
inline FigmaQmlSingleton* FigmaQmlSingleton::instance(QQmlEngine& engine) {
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 5, 0)
|
||||
const auto id = qmlTypeId("FigmaQmlInterface", 1, 0, "FigmaQmlSingleton");
|
||||
auto* singleton = engine.singletonInstance<FigmaQmlSingleton*>(id);
|
||||
#else
|
||||
auto* singleton = engine.singletonInstance<FigmaQmlSingleton*>("FigmaQmlInterface", "FigmaQmlSingleton");
|
||||
#endif
|
||||
return singleton;
|
||||
}
|
||||
|
||||
13
pages/FigmaQmlInterface/FigmaQmlUi.qml
Normal file
@ -0,0 +1,13 @@
|
||||
import QtQuick
|
||||
import FigmaQmlInterface
|
||||
|
||||
Item {
|
||||
implicitWidth: loader.width
|
||||
implicitHeight: loader.height
|
||||
Loader {
|
||||
id: loader
|
||||
anchors.centerIn: parent
|
||||
source: FigmaQmlSingleton.currentView
|
||||
onLoaded: FigmaQmlSingleton.viewLoaded(FigmaQmlSingleton.currentView);
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 110 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 916 B |
|
After Width: | Height: | Size: 50 KiB |
22
pages/FigmaQmlInterface/qml/ColumnaItemComponent32_figma.qml
Normal file
@ -0,0 +1,22 @@
|
||||
//Generated by FigmaQML 3.2.1
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Effects
|
||||
import QtQuick.Shapes
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Shapes
|
||||
import FigmaQmlInterface
|
||||
Rectangle {
|
||||
// component (Instance) level: 0 ColumnaItemComponent
|
||||
id: figma_139_46
|
||||
// # "ColumnaItemComponent"
|
||||
objectName:"ColumnaItemComponent"
|
||||
x:0
|
||||
y:0
|
||||
width:266
|
||||
height:27
|
||||
color: "transparent"
|
||||
clip: false
|
||||
Component.onCompleted: {
|
||||
}
|
||||
}
|
||||
153
pages/FigmaQmlInterface/qml/FileComponent20_figma.qml
Normal file
@ -0,0 +1,153 @@
|
||||
//Generated by FigmaQML 3.2.1
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Effects
|
||||
import QtQuick.Shapes
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Shapes
|
||||
import FigmaQmlInterface
|
||||
Rectangle {
|
||||
// component (Instance) level: 0 FileComponent
|
||||
id: figma_98_57
|
||||
// # "FileComponent"
|
||||
objectName:"FileComponent"
|
||||
x:0
|
||||
y:0
|
||||
width:266
|
||||
height:243
|
||||
color: "#fffcfbfe"
|
||||
radius:33.25
|
||||
clip: true
|
||||
property Component delegate_98_58: Item {
|
||||
// component (Instance) level: 0 file 1
|
||||
id: figma_98_58
|
||||
// # "file 1"
|
||||
objectName:"file 1"
|
||||
x:73
|
||||
y:9
|
||||
width:118.94
|
||||
height:157.502
|
||||
MultiEffect {
|
||||
maskEnabled: true
|
||||
anchors.fill:parent
|
||||
source: source_figma_98_58
|
||||
maskSource: maskSource_figma_98_58
|
||||
}
|
||||
Image {
|
||||
id: source_figma_98_58
|
||||
layer.enabled: true
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
visible: false
|
||||
mipmap: true
|
||||
anchors.fill:parent
|
||||
source: "images/e774f5e9c89c49d525aed5785d5bfcabb8cc67f3.png"
|
||||
}
|
||||
Shape {
|
||||
id: maskSource_figma_98_58
|
||||
anchors.fill: parent
|
||||
layer.enabled: true
|
||||
visible: false
|
||||
ShapePath {
|
||||
strokeColor: "transparent"
|
||||
strokeWidth:0.232703
|
||||
fillColor:"black"
|
||||
fillRule: ShapePath.WindingFill
|
||||
PathSvg {
|
||||
path: "M0 0L118.94 0L118.94 157.502L0 157.502L0 0Z"
|
||||
}
|
||||
}
|
||||
}
|
||||
Shape {
|
||||
anchors.fill: parent
|
||||
ShapePath {
|
||||
strokeColor: "transparent"
|
||||
strokeWidth:0.232703
|
||||
fillColor:"#00000000"
|
||||
// component (shapeFill) level: 0
|
||||
id: svgpath_figma_98_58
|
||||
fillRule: ShapePath.WindingFill
|
||||
PathSvg {
|
||||
id: path_0_figma_98_58
|
||||
path: "M0 0L118.94 0L118.94 157.502L0 157.502L0 0Z"
|
||||
}
|
||||
}
|
||||
}
|
||||
property alias path: path_0_figma_98_58.path
|
||||
}
|
||||
property Item i_delegate_98_58
|
||||
property matrix4x4 delegate_98_58_transform: Qt.matrix4x4(Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,)
|
||||
onDelegate_98_58_transformChanged: {if(i_delegate_98_58 && i_delegate_98_58.transform != delegate_98_58_transform) i_delegate_98_58.transform = delegate_98_58_transform;}
|
||||
property real delegate_98_58_x: NaN
|
||||
onDelegate_98_58_xChanged: {if(i_delegate_98_58 && i_delegate_98_58.x != delegate_98_58_x) i_delegate_98_58.x = delegate_98_58_x;}
|
||||
property real delegate_98_58_y: NaN
|
||||
onDelegate_98_58_yChanged: {if(i_delegate_98_58 && i_delegate_98_58.y != delegate_98_58_y) i_delegate_98_58.y = delegate_98_58_y;}
|
||||
property real delegate_98_58_width: NaN
|
||||
onDelegate_98_58_widthChanged: {if(i_delegate_98_58 && i_delegate_98_58.width != delegate_98_58_width) i_delegate_98_58.width = delegate_98_58_width;}
|
||||
property real delegate_98_58_height: NaN
|
||||
onDelegate_98_58_heightChanged: {if(i_delegate_98_58 && i_delegate_98_58.height != delegate_98_58_height) i_delegate_98_58.height = delegate_98_58_height;}
|
||||
property Component delegate_98_59: LabelHeaderComponentH2_bold20_figma {
|
||||
// component (Instance) level: 0 LabelHeaderComponentH2-bold
|
||||
id: figma_98_59
|
||||
// # "LabelHeaderComponentH2-bold"
|
||||
objectName:"LabelHeaderComponentH2-bold"
|
||||
x:44
|
||||
y:184
|
||||
width:178
|
||||
height:31
|
||||
Text {
|
||||
// component (Instance) level: 1 Label
|
||||
id: figma_i98_59_618_361
|
||||
// # "Label"
|
||||
objectName:"Label"
|
||||
x:0
|
||||
y:0
|
||||
width:171
|
||||
height:31
|
||||
color:"#ff000000"
|
||||
wrapMode: TextEdit.WordWrap
|
||||
text:"Информация"
|
||||
font.family: "Tahoma"
|
||||
font.italic: false
|
||||
font.letterSpacing: 0
|
||||
font.pixelSize: 26
|
||||
font.weight: Font.DemiBold
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
verticalAlignment: Text.AlignTop
|
||||
}
|
||||
}
|
||||
property Item i_delegate_98_59
|
||||
property matrix4x4 delegate_98_59_transform: Qt.matrix4x4(Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,)
|
||||
onDelegate_98_59_transformChanged: {if(i_delegate_98_59 && i_delegate_98_59.transform != delegate_98_59_transform) i_delegate_98_59.transform = delegate_98_59_transform;}
|
||||
property real delegate_98_59_x: NaN
|
||||
onDelegate_98_59_xChanged: {if(i_delegate_98_59 && i_delegate_98_59.x != delegate_98_59_x) i_delegate_98_59.x = delegate_98_59_x;}
|
||||
property real delegate_98_59_y: NaN
|
||||
onDelegate_98_59_yChanged: {if(i_delegate_98_59 && i_delegate_98_59.y != delegate_98_59_y) i_delegate_98_59.y = delegate_98_59_y;}
|
||||
property real delegate_98_59_width: NaN
|
||||
onDelegate_98_59_widthChanged: {if(i_delegate_98_59 && i_delegate_98_59.width != delegate_98_59_width) i_delegate_98_59.width = delegate_98_59_width;}
|
||||
property real delegate_98_59_height: NaN
|
||||
onDelegate_98_59_heightChanged: {if(i_delegate_98_59 && i_delegate_98_59.height != delegate_98_59_height) i_delegate_98_59.height = delegate_98_59_height;}
|
||||
Component.onCompleted: {
|
||||
const o_delegate_98_58 = {}
|
||||
if(!isNaN(delegate_98_58_transform.m11)) o_delegate_98_58['transform'] = delegate_98_58_transform;
|
||||
if(!isNaN(delegate_98_58_x)) o_delegate_98_58['x'] = delegate_98_58_x;
|
||||
if(!isNaN(delegate_98_58_y)) o_delegate_98_58['y'] = delegate_98_58_y;
|
||||
if(!isNaN(delegate_98_58_width)) o_delegate_98_58['width'] = delegate_98_58_width;
|
||||
if(!isNaN(delegate_98_58_height)) o_delegate_98_58['height'] = delegate_98_58_height;
|
||||
i_delegate_98_58 = delegate_98_58.createObject(this, o_delegate_98_58)
|
||||
delegate_98_58_x = Qt.binding(()=>i_delegate_98_58.x)
|
||||
delegate_98_58_y = Qt.binding(()=>i_delegate_98_58.y)
|
||||
delegate_98_58_width = Qt.binding(()=>i_delegate_98_58.width)
|
||||
delegate_98_58_height = Qt.binding(()=>i_delegate_98_58.height)
|
||||
const o_delegate_98_59 = {}
|
||||
if(!isNaN(delegate_98_59_transform.m11)) o_delegate_98_59['transform'] = delegate_98_59_transform;
|
||||
if(!isNaN(delegate_98_59_x)) o_delegate_98_59['x'] = delegate_98_59_x;
|
||||
if(!isNaN(delegate_98_59_y)) o_delegate_98_59['y'] = delegate_98_59_y;
|
||||
if(!isNaN(delegate_98_59_width)) o_delegate_98_59['width'] = delegate_98_59_width;
|
||||
if(!isNaN(delegate_98_59_height)) o_delegate_98_59['height'] = delegate_98_59_height;
|
||||
i_delegate_98_59 = delegate_98_59.createObject(this, o_delegate_98_59)
|
||||
delegate_98_59_x = Qt.binding(()=>i_delegate_98_59.x)
|
||||
delegate_98_59_y = Qt.binding(()=>i_delegate_98_59.y)
|
||||
delegate_98_59_width = Qt.binding(()=>i_delegate_98_59.width)
|
||||
delegate_98_59_height = Qt.binding(()=>i_delegate_98_59.height)
|
||||
}
|
||||
}
|
||||
153
pages/FigmaQmlInterface/qml/FolderComponent19_figma.qml
Normal file
@ -0,0 +1,153 @@
|
||||
//Generated by FigmaQML 3.2.1
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Effects
|
||||
import QtQuick.Shapes
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Shapes
|
||||
import FigmaQmlInterface
|
||||
Rectangle {
|
||||
// component (Instance) level: 0 FolderComponent
|
||||
id: figma_98_54
|
||||
// # "FolderComponent"
|
||||
objectName:"FolderComponent"
|
||||
x:0
|
||||
y:0
|
||||
width:266
|
||||
height:243
|
||||
color: "#fffcfbfe"
|
||||
radius:33.25
|
||||
clip: true
|
||||
property Component delegate_98_55: Item {
|
||||
// component (Instance) level: 0 Folder 1
|
||||
id: figma_98_55
|
||||
// # "Folder 1"
|
||||
objectName:"Folder 1"
|
||||
x:0
|
||||
y:50
|
||||
width:266
|
||||
height:196.383
|
||||
MultiEffect {
|
||||
maskEnabled: true
|
||||
anchors.fill:parent
|
||||
source: source_figma_98_55
|
||||
maskSource: maskSource_figma_98_55
|
||||
}
|
||||
Image {
|
||||
id: source_figma_98_55
|
||||
layer.enabled: true
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
visible: false
|
||||
mipmap: true
|
||||
anchors.fill:parent
|
||||
source: "images/2f16aa7c1fce22dea11dc59bd1e521a7a653e18e.png"
|
||||
}
|
||||
Shape {
|
||||
id: maskSource_figma_98_55
|
||||
anchors.fill: parent
|
||||
layer.enabled: true
|
||||
visible: false
|
||||
ShapePath {
|
||||
strokeColor: "transparent"
|
||||
strokeWidth:0.519531
|
||||
fillColor:"black"
|
||||
fillRule: ShapePath.WindingFill
|
||||
PathSvg {
|
||||
path: "M0 0L266 0L266 196.383L0 196.383L0 0Z"
|
||||
}
|
||||
}
|
||||
}
|
||||
Shape {
|
||||
anchors.fill: parent
|
||||
ShapePath {
|
||||
strokeColor: "transparent"
|
||||
strokeWidth:0.519531
|
||||
fillColor:"#00000000"
|
||||
// component (shapeFill) level: 0
|
||||
id: svgpath_figma_98_55
|
||||
fillRule: ShapePath.WindingFill
|
||||
PathSvg {
|
||||
id: path_0_figma_98_55
|
||||
path: "M0 0L266 0L266 196.383L0 196.383L0 0Z"
|
||||
}
|
||||
}
|
||||
}
|
||||
property alias path: path_0_figma_98_55.path
|
||||
}
|
||||
property Item i_delegate_98_55
|
||||
property matrix4x4 delegate_98_55_transform: Qt.matrix4x4(Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,)
|
||||
onDelegate_98_55_transformChanged: {if(i_delegate_98_55 && i_delegate_98_55.transform != delegate_98_55_transform) i_delegate_98_55.transform = delegate_98_55_transform;}
|
||||
property real delegate_98_55_x: NaN
|
||||
onDelegate_98_55_xChanged: {if(i_delegate_98_55 && i_delegate_98_55.x != delegate_98_55_x) i_delegate_98_55.x = delegate_98_55_x;}
|
||||
property real delegate_98_55_y: NaN
|
||||
onDelegate_98_55_yChanged: {if(i_delegate_98_55 && i_delegate_98_55.y != delegate_98_55_y) i_delegate_98_55.y = delegate_98_55_y;}
|
||||
property real delegate_98_55_width: NaN
|
||||
onDelegate_98_55_widthChanged: {if(i_delegate_98_55 && i_delegate_98_55.width != delegate_98_55_width) i_delegate_98_55.width = delegate_98_55_width;}
|
||||
property real delegate_98_55_height: NaN
|
||||
onDelegate_98_55_heightChanged: {if(i_delegate_98_55 && i_delegate_98_55.height != delegate_98_55_height) i_delegate_98_55.height = delegate_98_55_height;}
|
||||
property Component delegate_98_56: LabelHeaderComponentH2_bold20_figma {
|
||||
// component (Instance) level: 0 LabelHeaderComponentH2-bold
|
||||
id: figma_98_56
|
||||
// # "LabelHeaderComponentH2-bold"
|
||||
objectName:"LabelHeaderComponentH2-bold"
|
||||
x:19
|
||||
y:121
|
||||
width:171
|
||||
height:31.0351
|
||||
Text {
|
||||
// component (Instance) level: 1 Label
|
||||
id: figma_i98_56_618_361
|
||||
// # "Label"
|
||||
objectName:"Label"
|
||||
x:0
|
||||
y:0
|
||||
width:209
|
||||
height:31
|
||||
color:"#ff000000"
|
||||
wrapMode: TextEdit.WordWrap
|
||||
text:"ПапкаПроектов"
|
||||
font.family: "Tahoma"
|
||||
font.italic: false
|
||||
font.letterSpacing: 0
|
||||
font.pixelSize: 26
|
||||
font.weight: Font.DemiBold
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
verticalAlignment: Text.AlignTop
|
||||
}
|
||||
}
|
||||
property Item i_delegate_98_56
|
||||
property matrix4x4 delegate_98_56_transform: Qt.matrix4x4(Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,)
|
||||
onDelegate_98_56_transformChanged: {if(i_delegate_98_56 && i_delegate_98_56.transform != delegate_98_56_transform) i_delegate_98_56.transform = delegate_98_56_transform;}
|
||||
property real delegate_98_56_x: NaN
|
||||
onDelegate_98_56_xChanged: {if(i_delegate_98_56 && i_delegate_98_56.x != delegate_98_56_x) i_delegate_98_56.x = delegate_98_56_x;}
|
||||
property real delegate_98_56_y: NaN
|
||||
onDelegate_98_56_yChanged: {if(i_delegate_98_56 && i_delegate_98_56.y != delegate_98_56_y) i_delegate_98_56.y = delegate_98_56_y;}
|
||||
property real delegate_98_56_width: NaN
|
||||
onDelegate_98_56_widthChanged: {if(i_delegate_98_56 && i_delegate_98_56.width != delegate_98_56_width) i_delegate_98_56.width = delegate_98_56_width;}
|
||||
property real delegate_98_56_height: NaN
|
||||
onDelegate_98_56_heightChanged: {if(i_delegate_98_56 && i_delegate_98_56.height != delegate_98_56_height) i_delegate_98_56.height = delegate_98_56_height;}
|
||||
Component.onCompleted: {
|
||||
const o_delegate_98_55 = {}
|
||||
if(!isNaN(delegate_98_55_transform.m11)) o_delegate_98_55['transform'] = delegate_98_55_transform;
|
||||
if(!isNaN(delegate_98_55_x)) o_delegate_98_55['x'] = delegate_98_55_x;
|
||||
if(!isNaN(delegate_98_55_y)) o_delegate_98_55['y'] = delegate_98_55_y;
|
||||
if(!isNaN(delegate_98_55_width)) o_delegate_98_55['width'] = delegate_98_55_width;
|
||||
if(!isNaN(delegate_98_55_height)) o_delegate_98_55['height'] = delegate_98_55_height;
|
||||
i_delegate_98_55 = delegate_98_55.createObject(this, o_delegate_98_55)
|
||||
delegate_98_55_x = Qt.binding(()=>i_delegate_98_55.x)
|
||||
delegate_98_55_y = Qt.binding(()=>i_delegate_98_55.y)
|
||||
delegate_98_55_width = Qt.binding(()=>i_delegate_98_55.width)
|
||||
delegate_98_55_height = Qt.binding(()=>i_delegate_98_55.height)
|
||||
const o_delegate_98_56 = {}
|
||||
if(!isNaN(delegate_98_56_transform.m11)) o_delegate_98_56['transform'] = delegate_98_56_transform;
|
||||
if(!isNaN(delegate_98_56_x)) o_delegate_98_56['x'] = delegate_98_56_x;
|
||||
if(!isNaN(delegate_98_56_y)) o_delegate_98_56['y'] = delegate_98_56_y;
|
||||
if(!isNaN(delegate_98_56_width)) o_delegate_98_56['width'] = delegate_98_56_width;
|
||||
if(!isNaN(delegate_98_56_height)) o_delegate_98_56['height'] = delegate_98_56_height;
|
||||
i_delegate_98_56 = delegate_98_56.createObject(this, o_delegate_98_56)
|
||||
delegate_98_56_x = Qt.binding(()=>i_delegate_98_56.x)
|
||||
delegate_98_56_y = Qt.binding(()=>i_delegate_98_56.y)
|
||||
delegate_98_56_width = Qt.binding(()=>i_delegate_98_56.width)
|
||||
delegate_98_56_height = Qt.binding(()=>i_delegate_98_56.height)
|
||||
}
|
||||
}
|
||||
22
pages/FigmaQmlInterface/qml/HeaderValueComponent28_figma.qml
Normal file
@ -0,0 +1,22 @@
|
||||
//Generated by FigmaQML 3.2.1
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Effects
|
||||
import QtQuick.Shapes
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Shapes
|
||||
import FigmaQmlInterface
|
||||
Rectangle {
|
||||
// component (Instance) level: 0 HeaderValueComponent
|
||||
id: figma_94_14
|
||||
// # "HeaderValueComponent"
|
||||
objectName:"HeaderValueComponent"
|
||||
x:0
|
||||
y:0
|
||||
width:54
|
||||
height:13
|
||||
color:"#00ffffff"
|
||||
clip: false
|
||||
Component.onCompleted: {
|
||||
}
|
||||
}
|
||||
190
pages/FigmaQmlInterface/qml/InputComponent33_figma.qml
Normal file
@ -0,0 +1,190 @@
|
||||
//Generated by FigmaQML 3.2.1
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Effects
|
||||
import QtQuick.Shapes
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Shapes
|
||||
import FigmaQmlInterface
|
||||
Rectangle {
|
||||
// component (Instance) level: 0 InputComponent
|
||||
id: figma_219_72
|
||||
// # "InputComponent"
|
||||
objectName:"InputComponent"
|
||||
x:0
|
||||
y:0
|
||||
width:231
|
||||
height:40
|
||||
color: "transparent"
|
||||
clip: false
|
||||
property Component delegate_219_73: Text {
|
||||
// component (Instance) level: 0 Label
|
||||
id: figma_219_73
|
||||
// # "Label"
|
||||
objectName:"Label"
|
||||
x:0
|
||||
y:0
|
||||
width:231
|
||||
height:13
|
||||
color:"#ff302f38"
|
||||
wrapMode: TextEdit.WordWrap
|
||||
text:"Имя проекта"
|
||||
font.family: "Tahoma"
|
||||
font.italic: false
|
||||
font.letterSpacing: 0
|
||||
font.pixelSize: 11
|
||||
font.weight: Font.Normal
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
verticalAlignment: Text.AlignTop
|
||||
}
|
||||
property Item i_delegate_219_73
|
||||
property matrix4x4 delegate_219_73_transform: Qt.matrix4x4(Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,)
|
||||
onDelegate_219_73_transformChanged: {if(i_delegate_219_73 && i_delegate_219_73.transform != delegate_219_73_transform) i_delegate_219_73.transform = delegate_219_73_transform;}
|
||||
property real delegate_219_73_x: NaN
|
||||
onDelegate_219_73_xChanged: {if(i_delegate_219_73 && i_delegate_219_73.x != delegate_219_73_x) i_delegate_219_73.x = delegate_219_73_x;}
|
||||
property real delegate_219_73_y: NaN
|
||||
onDelegate_219_73_yChanged: {if(i_delegate_219_73 && i_delegate_219_73.y != delegate_219_73_y) i_delegate_219_73.y = delegate_219_73_y;}
|
||||
property real delegate_219_73_width: NaN
|
||||
onDelegate_219_73_widthChanged: {if(i_delegate_219_73 && i_delegate_219_73.width != delegate_219_73_width) i_delegate_219_73.width = delegate_219_73_width;}
|
||||
property real delegate_219_73_height: NaN
|
||||
onDelegate_219_73_heightChanged: {if(i_delegate_219_73 && i_delegate_219_73.height != delegate_219_73_height) i_delegate_219_73.height = delegate_219_73_height;}
|
||||
property Component delegate_219_155: Rectangle {
|
||||
// component (Instance) level: 0 Frame 798
|
||||
id: figma_219_155
|
||||
// # "Frame 798"
|
||||
objectName:"Frame 798"
|
||||
x:0
|
||||
y:17
|
||||
width:231
|
||||
height:23
|
||||
color: "transparent"
|
||||
radius:5
|
||||
clip: false
|
||||
Shape {
|
||||
anchors.fill: parent
|
||||
ShapePath {
|
||||
strokeColor: Qt.rgba(0, 0, 0, 1)
|
||||
strokeWidth: 1
|
||||
fillColor: "transparent"
|
||||
PathMove { x: 5; y: 0 }
|
||||
PathLine { x: 5; y: 0.5 }
|
||||
PathLine { x: 226; y: 0.5 }
|
||||
PathLine { x: 226; y: 0 }
|
||||
PathLine { x: 226; y: -0.5 }
|
||||
PathLine { x: 5; y: -0.5 }
|
||||
PathLine { x: 5; y: 0 }
|
||||
PathLine { x: 5; y: 0 }
|
||||
PathMove { x: 231; y: 5 }
|
||||
PathLine { x: 230.5; y: 5 }
|
||||
PathLine { x: 230.5; y: 18 }
|
||||
PathLine { x: 231; y: 18 }
|
||||
PathLine { x: 231.5; y: 18 }
|
||||
PathLine { x: 231.5; y: 5 }
|
||||
PathLine { x: 231; y: 5 }
|
||||
PathLine { x: 231; y: 5 }
|
||||
PathMove { x: 226; y: 23 }
|
||||
PathLine { x: 226; y: 22.5 }
|
||||
PathLine { x: 5; y: 22.5 }
|
||||
PathLine { x: 5; y: 23 }
|
||||
PathLine { x: 5; y: 23.5 }
|
||||
PathLine { x: 226; y: 23.5 }
|
||||
PathLine { x: 226; y: 23 }
|
||||
PathLine { x: 226; y: 23 }
|
||||
PathMove { x: 0; y: 18 }
|
||||
PathLine { x: 0.5; y: 18 }
|
||||
PathLine { x: 0.5; y: 5 }
|
||||
PathLine { x: 0; y: 5 }
|
||||
PathLine { x: -0.5; y: 5 }
|
||||
PathLine { x: -0.5; y: 18 }
|
||||
PathLine { x: 0; y: 18 }
|
||||
PathLine { x: 0; y: 18 }
|
||||
PathMove { x: 5; y: 23 }
|
||||
PathLine { x: 5; y: 22.5 }
|
||||
PathCubic { control1X: 2.51472; control1Y: 22.5; control2X: 0.5; control2Y: 20.4853; x: 0.5; y: 18 }
|
||||
PathLine { x: 0; y: 18 }
|
||||
PathLine { x: -0.5; y: 18 }
|
||||
PathCubic { control1X: -0.5; control1Y: 21.0376; control2X: 1.96243; control2Y: 23.5; x: 5; y: 23.5 }
|
||||
PathLine { x: 5; y: 23 }
|
||||
PathLine { x: 5; y: 23 }
|
||||
PathMove { x: 231; y: 18 }
|
||||
PathLine { x: 230.5; y: 18 }
|
||||
PathCubic { control1X: 230.5; control1Y: 20.4853; control2X: 228.485; control2Y: 22.5; x: 226; y: 22.5 }
|
||||
PathLine { x: 226; y: 23 }
|
||||
PathLine { x: 226; y: 23.5 }
|
||||
PathCubic { control1X: 229.038; control1Y: 23.5; control2X: 231.5; control2Y: 21.0376; x: 231.5; y: 18 }
|
||||
PathLine { x: 231; y: 18 }
|
||||
PathLine { x: 231; y: 18 }
|
||||
PathMove { x: 226; y: 0 }
|
||||
PathLine { x: 226; y: 0.5 }
|
||||
PathCubic { control1X: 228.485; control1Y: 0.5; control2X: 230.5; control2Y: 2.51472; x: 230.5; y: 5 }
|
||||
PathLine { x: 231; y: 5 }
|
||||
PathLine { x: 231.5; y: 5 }
|
||||
PathCubic { control1X: 231.5; control1Y: 1.96243; control2X: 229.038; control2Y: -0.5; x: 226; y: -0.5 }
|
||||
PathLine { x: 226; y: 0 }
|
||||
PathLine { x: 226; y: 0 }
|
||||
PathMove { x: 5; y: 0 }
|
||||
PathLine { x: 5; y: -0.5 }
|
||||
PathCubic { control1X: 1.96243; control1Y: -0.5; control2X: -0.5; control2Y: 1.96243; x: -0.5; y: 5 }
|
||||
PathLine { x: 0; y: 5 }
|
||||
PathLine { x: 0.5; y: 5 }
|
||||
PathCubic { control1X: 0.5; control1Y: 2.51472; control2X: 2.51472; control2Y: 0.5; x: 5; y: 0.5 }
|
||||
PathLine { x: 5; y: 0 }
|
||||
PathLine { x: 5; y: 0 }
|
||||
}}
|
||||
TextField {
|
||||
// component (Instance) level: 0 TextField
|
||||
id: figma_219_74
|
||||
// # "TextField"
|
||||
objectName:"TextField"
|
||||
x:3
|
||||
y:0
|
||||
width:225
|
||||
height:23
|
||||
color:"#ff7d7e82"
|
||||
wrapMode: TextEdit.WordWrap
|
||||
text:"1"
|
||||
background: Rectangle {color: "transparent"} font.family: "Tahoma"
|
||||
font.italic: false
|
||||
font.letterSpacing: 0
|
||||
font.pixelSize: 16
|
||||
font.weight: Font.Normal
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
}
|
||||
property Item i_delegate_219_155
|
||||
property matrix4x4 delegate_219_155_transform: Qt.matrix4x4(Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,)
|
||||
onDelegate_219_155_transformChanged: {if(i_delegate_219_155 && i_delegate_219_155.transform != delegate_219_155_transform) i_delegate_219_155.transform = delegate_219_155_transform;}
|
||||
property real delegate_219_155_x: NaN
|
||||
onDelegate_219_155_xChanged: {if(i_delegate_219_155 && i_delegate_219_155.x != delegate_219_155_x) i_delegate_219_155.x = delegate_219_155_x;}
|
||||
property real delegate_219_155_y: NaN
|
||||
onDelegate_219_155_yChanged: {if(i_delegate_219_155 && i_delegate_219_155.y != delegate_219_155_y) i_delegate_219_155.y = delegate_219_155_y;}
|
||||
property real delegate_219_155_width: NaN
|
||||
onDelegate_219_155_widthChanged: {if(i_delegate_219_155 && i_delegate_219_155.width != delegate_219_155_width) i_delegate_219_155.width = delegate_219_155_width;}
|
||||
property real delegate_219_155_height: NaN
|
||||
onDelegate_219_155_heightChanged: {if(i_delegate_219_155 && i_delegate_219_155.height != delegate_219_155_height) i_delegate_219_155.height = delegate_219_155_height;}
|
||||
Component.onCompleted: {
|
||||
const o_delegate_219_73 = {}
|
||||
if(!isNaN(delegate_219_73_transform.m11)) o_delegate_219_73['transform'] = delegate_219_73_transform;
|
||||
if(!isNaN(delegate_219_73_x)) o_delegate_219_73['x'] = delegate_219_73_x;
|
||||
if(!isNaN(delegate_219_73_y)) o_delegate_219_73['y'] = delegate_219_73_y;
|
||||
if(!isNaN(delegate_219_73_width)) o_delegate_219_73['width'] = delegate_219_73_width;
|
||||
if(!isNaN(delegate_219_73_height)) o_delegate_219_73['height'] = delegate_219_73_height;
|
||||
i_delegate_219_73 = delegate_219_73.createObject(this, o_delegate_219_73)
|
||||
delegate_219_73_x = Qt.binding(()=>i_delegate_219_73.x)
|
||||
delegate_219_73_y = Qt.binding(()=>i_delegate_219_73.y)
|
||||
delegate_219_73_width = Qt.binding(()=>i_delegate_219_73.width)
|
||||
delegate_219_73_height = Qt.binding(()=>i_delegate_219_73.height)
|
||||
const o_delegate_219_155 = {}
|
||||
if(!isNaN(delegate_219_155_transform.m11)) o_delegate_219_155['transform'] = delegate_219_155_transform;
|
||||
if(!isNaN(delegate_219_155_x)) o_delegate_219_155['x'] = delegate_219_155_x;
|
||||
if(!isNaN(delegate_219_155_y)) o_delegate_219_155['y'] = delegate_219_155_y;
|
||||
if(!isNaN(delegate_219_155_width)) o_delegate_219_155['width'] = delegate_219_155_width;
|
||||
if(!isNaN(delegate_219_155_height)) o_delegate_219_155['height'] = delegate_219_155_height;
|
||||
i_delegate_219_155 = delegate_219_155.createObject(this, o_delegate_219_155)
|
||||
delegate_219_155_x = Qt.binding(()=>i_delegate_219_155.x)
|
||||
delegate_219_155_y = Qt.binding(()=>i_delegate_219_155.y)
|
||||
delegate_219_155_width = Qt.binding(()=>i_delegate_219_155.width)
|
||||
delegate_219_155_height = Qt.binding(()=>i_delegate_219_155.height)
|
||||
}
|
||||
}
|
||||
22
pages/FigmaQmlInterface/qml/LabelComponent22_figma.qml
Normal file
@ -0,0 +1,22 @@
|
||||
//Generated by FigmaQML 3.2.1
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Effects
|
||||
import QtQuick.Shapes
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Shapes
|
||||
import FigmaQmlInterface
|
||||
Rectangle {
|
||||
// component (Instance) level: 0 LabelComponent
|
||||
id: figma_94_20
|
||||
// # "LabelComponent"
|
||||
objectName:"LabelComponent"
|
||||
x:0
|
||||
y:0
|
||||
width:146
|
||||
height:19
|
||||
color:"#00ffffff"
|
||||
clip: false
|
||||
Component.onCompleted: {
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
//Generated by FigmaQML 3.2.1
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Effects
|
||||
import QtQuick.Shapes
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Shapes
|
||||
import FigmaQmlInterface
|
||||
Rectangle {
|
||||
// component (Instance) level: 0 LabelHeaderComponentH1
|
||||
id: figma_94_18
|
||||
// # "LabelHeaderComponentH1"
|
||||
objectName:"LabelHeaderComponentH1"
|
||||
x:0
|
||||
y:0
|
||||
width:128
|
||||
height:39
|
||||
color:"#00ffffff"
|
||||
clip: false
|
||||
Component.onCompleted: {
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
//Generated by FigmaQML 3.2.1
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Effects
|
||||
import QtQuick.Shapes
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Shapes
|
||||
import FigmaQmlInterface
|
||||
Rectangle {
|
||||
// component (Instance) level: 0 LabelHeaderComponentH3
|
||||
id: figma_94_10
|
||||
// # "LabelHeaderComponentH3"
|
||||
objectName:"LabelHeaderComponentH3"
|
||||
x:0
|
||||
y:0
|
||||
width:110
|
||||
height:20
|
||||
color:"#00ffffff"
|
||||
clip: false
|
||||
Component.onCompleted: {
|
||||
}
|
||||
}
|
||||
23
pages/FigmaQmlInterface/qml/ProgressBarComponent24_figma.qml
Normal file
@ -0,0 +1,23 @@
|
||||
//Generated by FigmaQML 3.2.1
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Effects
|
||||
import QtQuick.Shapes
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Shapes
|
||||
import FigmaQmlInterface
|
||||
Rectangle {
|
||||
// component (Instance) level: 0 ProgressBarComponent
|
||||
id: figma_94_16
|
||||
// # "ProgressBarComponent"
|
||||
objectName:"ProgressBarComponent"
|
||||
x:0
|
||||
y:0
|
||||
width:209
|
||||
height:10
|
||||
color: "transparent"
|
||||
radius:5
|
||||
clip: true
|
||||
Component.onCompleted: {
|
||||
}
|
||||
}
|
||||
22
pages/FigmaQmlInterface/qml/Rectangle_134_figma.qml
Normal file
@ -0,0 +1,22 @@
|
||||
//Generated by FigmaQML 3.2.1
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Effects
|
||||
import QtQuick.Shapes
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Shapes
|
||||
import FigmaQmlInterface
|
||||
Rectangle {
|
||||
// component (Instance) level: 0 Rectangle 1
|
||||
id: figma_139_41
|
||||
// # "Rectangle 1"
|
||||
objectName:"Rectangle 1"
|
||||
x: (figma_139_41.width - width) / 2
|
||||
y:0
|
||||
width:70.132
|
||||
height:70.132
|
||||
color:"#00ffffff"
|
||||
clip: false
|
||||
Component.onCompleted: {
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,256 @@
|
||||
//Generated by FigmaQML 3.2.1
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Effects
|
||||
import QtQuick.Shapes
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Shapes
|
||||
import FigmaQmlInterface
|
||||
Rectangle {
|
||||
// component (Instance) level: 0 ColumnCenter-transform
|
||||
id: figma_94_92
|
||||
// # "ColumnCenter-transform"
|
||||
objectName:"ColumnCenter-transform"
|
||||
x:0
|
||||
y:0
|
||||
width:344
|
||||
height:607
|
||||
color:"#ffffffff"
|
||||
clip: true
|
||||
|
||||
Rectangle {
|
||||
// component (Instance) level: 0 Frame 797
|
||||
id: figma_219_154
|
||||
// # "Frame 797"
|
||||
objectName:"Frame 797"
|
||||
x: (figma_94_92.width - width) / 2 + 1.5
|
||||
y: (figma_94_92.height - height) / 2 + 0.5
|
||||
width:255
|
||||
height:254
|
||||
color: "transparent"
|
||||
clip: false
|
||||
|
||||
Rectangle {
|
||||
// component (Instance) level: 0 TransformButton
|
||||
id: figma_94_93
|
||||
// # "TransformButton"
|
||||
objectName:"TransformButton"
|
||||
x: (figma_219_154.width - width) / 2
|
||||
y: (figma_219_154.height - height) / 2 + 27
|
||||
width:255
|
||||
height:200
|
||||
color:"#fffcfbfc"
|
||||
radius:30
|
||||
clip: true
|
||||
|
||||
Item {
|
||||
// component (Instance) level: 0 RefreshIcon
|
||||
id: figma_94_94
|
||||
// # "RefreshIcon"
|
||||
objectName:"RefreshIcon"
|
||||
x: (figma_94_93.width - width) / 2 + 0.5
|
||||
y:10
|
||||
width:100
|
||||
height:100
|
||||
MultiEffect {
|
||||
maskEnabled: true
|
||||
anchors.fill:parent
|
||||
source: source_figma_94_94
|
||||
maskSource: maskSource_figma_94_94
|
||||
}
|
||||
Image {
|
||||
id: source_figma_94_94
|
||||
layer.enabled: true
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
visible: false
|
||||
mipmap: true
|
||||
anchors.fill:parent
|
||||
source: "images/8500eafa1c0b05136ba0d949af53c060439d9230.png"
|
||||
}
|
||||
Shape {
|
||||
id: maskSource_figma_94_94
|
||||
anchors.fill: parent
|
||||
layer.enabled: true
|
||||
visible: false
|
||||
ShapePath {
|
||||
strokeColor: "transparent"
|
||||
strokeWidth:1
|
||||
fillColor:"black"
|
||||
fillRule: ShapePath.WindingFill
|
||||
PathSvg {
|
||||
path: "M0 0L100 0L100 100L0 100L0 0Z"
|
||||
}
|
||||
}
|
||||
}
|
||||
Shape {
|
||||
anchors.fill: parent
|
||||
ShapePath {
|
||||
strokeColor: "transparent"
|
||||
strokeWidth:1
|
||||
fillColor:"#00000000"
|
||||
// component (shapeFill) level: 0
|
||||
id: svgpath_figma_94_94
|
||||
fillRule: ShapePath.WindingFill
|
||||
PathSvg {
|
||||
id: path_0_figma_94_94
|
||||
path: "M0 0L100 0L100 100L0 100L0 0Z"
|
||||
}
|
||||
}
|
||||
}
|
||||
property alias path: path_0_figma_94_94.path
|
||||
}
|
||||
Text {
|
||||
// component (Instance) level: 0 Преобразовать
|
||||
id: figma_94_95
|
||||
// # "Преобразовать"
|
||||
objectName:"Преобразовать"
|
||||
x: (figma_94_93.width - width) / 2 + 0.5
|
||||
y:123
|
||||
width:242
|
||||
height:39
|
||||
color:"#ff000000"
|
||||
wrapMode: TextEdit.WordWrap
|
||||
text:"Преобразовать"
|
||||
font.family: "Tahoma"
|
||||
font.italic: false
|
||||
font.letterSpacing: 0
|
||||
font.pixelSize: 32
|
||||
font.weight: Font.Normal
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
verticalAlignment: Text.AlignTop
|
||||
}
|
||||
}
|
||||
InputComponent33_figma {
|
||||
// component (Instance) level: 0 InputComponent
|
||||
id: figma_219_169
|
||||
// # "InputComponent"
|
||||
objectName:"InputComponent"
|
||||
x: (figma_219_154.width - width) / 2
|
||||
y:-40
|
||||
delegate_219_73: Text {
|
||||
// component (Instance) level: 1 ProjectLabel
|
||||
id: figma_i219_169_219_73
|
||||
// # "ProjectLabel"
|
||||
objectName:"ProjectLabel"
|
||||
x:0
|
||||
y:0
|
||||
width:231
|
||||
height:13
|
||||
color:"#ff302f38"
|
||||
wrapMode: TextEdit.WordWrap
|
||||
text:"Имя проекта"
|
||||
font.family: "Tahoma"
|
||||
font.italic: false
|
||||
font.letterSpacing: 0
|
||||
font.pixelSize: 11
|
||||
font.weight: Font.Normal
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
verticalAlignment: Text.AlignTop
|
||||
}
|
||||
delegate_219_155: Rectangle {
|
||||
// component (Instance) level: 1 StrokeElement
|
||||
id: figma_i219_169_219_155
|
||||
// # "StrokeElement"
|
||||
objectName:"StrokeElement"
|
||||
x:0
|
||||
y:17
|
||||
width:231
|
||||
height:23
|
||||
color: "transparent"
|
||||
radius:5
|
||||
clip: false
|
||||
Shape {
|
||||
anchors.fill: parent
|
||||
ShapePath {
|
||||
strokeColor: Qt.rgba(0, 0, 0, 1)
|
||||
strokeWidth: 1
|
||||
fillColor: "transparent"
|
||||
PathMove { x: 5; y: 0 }
|
||||
PathLine { x: 5; y: 0.5 }
|
||||
PathLine { x: 226; y: 0.5 }
|
||||
PathLine { x: 226; y: 0 }
|
||||
PathLine { x: 226; y: -0.5 }
|
||||
PathLine { x: 5; y: -0.5 }
|
||||
PathLine { x: 5; y: 0 }
|
||||
PathLine { x: 5; y: 0 }
|
||||
PathMove { x: 231; y: 5 }
|
||||
PathLine { x: 230.5; y: 5 }
|
||||
PathLine { x: 230.5; y: 18 }
|
||||
PathLine { x: 231; y: 18 }
|
||||
PathLine { x: 231.5; y: 18 }
|
||||
PathLine { x: 231.5; y: 5 }
|
||||
PathLine { x: 231; y: 5 }
|
||||
PathLine { x: 231; y: 5 }
|
||||
PathMove { x: 226; y: 23 }
|
||||
PathLine { x: 226; y: 22.5 }
|
||||
PathLine { x: 5; y: 22.5 }
|
||||
PathLine { x: 5; y: 23 }
|
||||
PathLine { x: 5; y: 23.5 }
|
||||
PathLine { x: 226; y: 23.5 }
|
||||
PathLine { x: 226; y: 23 }
|
||||
PathLine { x: 226; y: 23 }
|
||||
PathMove { x: 0; y: 18 }
|
||||
PathLine { x: 0.5; y: 18 }
|
||||
PathLine { x: 0.5; y: 5 }
|
||||
PathLine { x: 0; y: 5 }
|
||||
PathLine { x: -0.5; y: 5 }
|
||||
PathLine { x: -0.5; y: 18 }
|
||||
PathLine { x: 0; y: 18 }
|
||||
PathLine { x: 0; y: 18 }
|
||||
PathMove { x: 5; y: 23 }
|
||||
PathLine { x: 5; y: 22.5 }
|
||||
PathCubic { control1X: 2.51472; control1Y: 22.5; control2X: 0.5; control2Y: 20.4853; x: 0.5; y: 18 }
|
||||
PathLine { x: 0; y: 18 }
|
||||
PathLine { x: -0.5; y: 18 }
|
||||
PathCubic { control1X: -0.5; control1Y: 21.0376; control2X: 1.96243; control2Y: 23.5; x: 5; y: 23.5 }
|
||||
PathLine { x: 5; y: 23 }
|
||||
PathLine { x: 5; y: 23 }
|
||||
PathMove { x: 231; y: 18 }
|
||||
PathLine { x: 230.5; y: 18 }
|
||||
PathCubic { control1X: 230.5; control1Y: 20.4853; control2X: 228.485; control2Y: 22.5; x: 226; y: 22.5 }
|
||||
PathLine { x: 226; y: 23 }
|
||||
PathLine { x: 226; y: 23.5 }
|
||||
PathCubic { control1X: 229.038; control1Y: 23.5; control2X: 231.5; control2Y: 21.0376; x: 231.5; y: 18 }
|
||||
PathLine { x: 231; y: 18 }
|
||||
PathLine { x: 231; y: 18 }
|
||||
PathMove { x: 226; y: 0 }
|
||||
PathLine { x: 226; y: 0.5 }
|
||||
PathCubic { control1X: 228.485; control1Y: 0.5; control2X: 230.5; control2Y: 2.51472; x: 230.5; y: 5 }
|
||||
PathLine { x: 231; y: 5 }
|
||||
PathLine { x: 231.5; y: 5 }
|
||||
PathCubic { control1X: 231.5; control1Y: 1.96243; control2X: 229.038; control2Y: -0.5; x: 226; y: -0.5 }
|
||||
PathLine { x: 226; y: 0 }
|
||||
PathLine { x: 226; y: 0 }
|
||||
PathMove { x: 5; y: 0 }
|
||||
PathLine { x: 5; y: -0.5 }
|
||||
PathCubic { control1X: 1.96243; control1Y: -0.5; control2X: -0.5; control2Y: 1.96243; x: -0.5; y: 5 }
|
||||
PathLine { x: 0; y: 5 }
|
||||
PathLine { x: 0.5; y: 5 }
|
||||
PathCubic { control1X: 0.5; control1Y: 2.51472; control2X: 2.51472; control2Y: 0.5; x: 5; y: 0.5 }
|
||||
PathLine { x: 5; y: 0 }
|
||||
PathLine { x: 5; y: 0 }
|
||||
}}
|
||||
TextField {
|
||||
// component (Instance) level: 1 ProjectTextField
|
||||
id: figma_i219_169_219_74
|
||||
// # "ProjectTextField"
|
||||
objectName:"ProjectTextField"
|
||||
x:3
|
||||
y:0
|
||||
width:225
|
||||
height:23
|
||||
color:"#ff7d7e82"
|
||||
wrapMode: TextEdit.WordWrap
|
||||
text:"1"
|
||||
background: Rectangle {color: "transparent"} font.family: "Tahoma"
|
||||
font.italic: false
|
||||
font.letterSpacing: 0
|
||||
font.pixelSize: 16
|
||||
font.weight: Font.Normal
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,171 @@
|
||||
//Generated by FigmaQML 3.2.1
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Effects
|
||||
import QtQuick.Shapes
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Shapes
|
||||
import FigmaQmlInterface
|
||||
Rectangle {
|
||||
// component (Instance) level: 0 ColumnCenter-translating
|
||||
id: figma_94_97
|
||||
// # "ColumnCenter-translating"
|
||||
objectName:"ColumnCenter-translating"
|
||||
x:0
|
||||
y:0
|
||||
width:344
|
||||
height:607
|
||||
color: "transparent"
|
||||
clip: true
|
||||
|
||||
LabelComponent22_figma {
|
||||
// component (Instance) level: 0 ProgressTransformLabelItem
|
||||
id: figma_94_98
|
||||
// # "ProgressTransformLabelItem"
|
||||
objectName:"ProgressTransformLabelItem"
|
||||
x:48
|
||||
y:258
|
||||
Text {
|
||||
// component (Instance) level: 1 ProgressTransformLabel
|
||||
id: figma_i94_98_613_450
|
||||
// # "ProgressTransformLabel"
|
||||
objectName:"ProgressTransformLabel"
|
||||
x:0
|
||||
y:0
|
||||
width:146
|
||||
height:19
|
||||
color:"#ff000000"
|
||||
wrapMode: TextEdit.WordWrap
|
||||
text:"Преобразование..."
|
||||
font.family: "Tahoma"
|
||||
font.italic: false
|
||||
font.letterSpacing: 0
|
||||
font.pixelSize: 16
|
||||
font.weight: Font.Normal
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
verticalAlignment: Text.AlignTop
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
// component (Instance) level: 0 ProgressBar
|
||||
id: figma_94_99
|
||||
// # "ProgressBar"
|
||||
objectName:"ProgressBar"
|
||||
x:49
|
||||
y:285
|
||||
width:249
|
||||
height:22
|
||||
color: "transparent"
|
||||
clip: true
|
||||
Shape {
|
||||
anchors.fill: parent
|
||||
ShapePath {
|
||||
strokeColor: Qt.rgba(0.545103, 0.429919, 0.961538, 1)
|
||||
strokeWidth: 2
|
||||
fillColor: "transparent"
|
||||
PathMove { x: 0; y: 0 }
|
||||
PathLine { x: 0; y: -2 }
|
||||
PathLine { x: -2; y: -2 }
|
||||
PathLine { x: -2; y: 0 }
|
||||
PathLine { x: 0; y: 0 }
|
||||
PathLine { x: 0; y: 0 }
|
||||
PathMove { x: 249; y: 0 }
|
||||
PathLine { x: 251; y: 0 }
|
||||
PathLine { x: 251; y: -2 }
|
||||
PathLine { x: 249; y: -2 }
|
||||
PathLine { x: 249; y: 0 }
|
||||
PathLine { x: 249; y: 0 }
|
||||
PathMove { x: 249; y: 22 }
|
||||
PathLine { x: 249; y: 24 }
|
||||
PathLine { x: 251; y: 24 }
|
||||
PathLine { x: 251; y: 22 }
|
||||
PathLine { x: 249; y: 22 }
|
||||
PathLine { x: 249; y: 22 }
|
||||
PathMove { x: 0; y: 22 }
|
||||
PathLine { x: -2; y: 22 }
|
||||
PathLine { x: -2; y: 24 }
|
||||
PathLine { x: 0; y: 24 }
|
||||
PathLine { x: 0; y: 22 }
|
||||
PathLine { x: 0; y: 22 }
|
||||
PathMove { x: 0; y: 0 }
|
||||
PathLine { x: 0; y: 2 }
|
||||
PathLine { x: 249; y: 2 }
|
||||
PathLine { x: 249; y: 0 }
|
||||
PathLine { x: 249; y: -2 }
|
||||
PathLine { x: 0; y: -2 }
|
||||
PathLine { x: 0; y: 0 }
|
||||
PathLine { x: 0; y: 0 }
|
||||
PathMove { x: 249; y: 0 }
|
||||
PathLine { x: 247; y: 0 }
|
||||
PathLine { x: 247; y: 22 }
|
||||
PathLine { x: 249; y: 22 }
|
||||
PathLine { x: 251; y: 22 }
|
||||
PathLine { x: 251; y: 0 }
|
||||
PathLine { x: 249; y: 0 }
|
||||
PathLine { x: 249; y: 0 }
|
||||
PathMove { x: 249; y: 22 }
|
||||
PathLine { x: 249; y: 20 }
|
||||
PathLine { x: 0; y: 20 }
|
||||
PathLine { x: 0; y: 22 }
|
||||
PathLine { x: 0; y: 24 }
|
||||
PathLine { x: 249; y: 24 }
|
||||
PathLine { x: 249; y: 22 }
|
||||
PathLine { x: 249; y: 22 }
|
||||
PathMove { x: 0; y: 22 }
|
||||
PathLine { x: 2; y: 22 }
|
||||
PathLine { x: 2; y: 0 }
|
||||
PathLine { x: 0; y: 0 }
|
||||
PathLine { x: -2; y: 0 }
|
||||
PathLine { x: -2; y: 22 }
|
||||
PathLine { x: 0; y: 22 }
|
||||
PathLine { x: 0; y: 22 }
|
||||
}}
|
||||
Rectangle {
|
||||
// component (Instance) level: 0 ProgressBarFilled
|
||||
id: figma_94_100
|
||||
// # "ProgressBarFilled"
|
||||
objectName:"ProgressBarFilled"
|
||||
x:0
|
||||
y:0
|
||||
width:40
|
||||
height:22
|
||||
color:"#ff8b6ef5"
|
||||
clip: true
|
||||
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
// component (Instance) level: 0 ProgressTranslateCancelButton
|
||||
id: figma_94_101
|
||||
// # "ProgressTranslateCancelButton"
|
||||
objectName:"ProgressTranslateCancelButton"
|
||||
x:52
|
||||
y:319
|
||||
width:244
|
||||
height:31
|
||||
color:"#ff8b6ef5"
|
||||
radius:30
|
||||
clip: true
|
||||
|
||||
Text {
|
||||
// component (Instance) level: 0 Отменить
|
||||
id: figma_94_102
|
||||
// # "Отменить"
|
||||
objectName:"Отменить"
|
||||
x: (figma_94_101.width - width) / 2
|
||||
y: (figma_94_101.height - height) / 2
|
||||
width:78
|
||||
height:19
|
||||
color:"#ffffffff"
|
||||
wrapMode: TextEdit.WordWrap
|
||||
text:"Отменить"
|
||||
font.family: "Tahoma"
|
||||
font.italic: false
|
||||
font.letterSpacing: 0
|
||||
font.pixelSize: 16
|
||||
font.weight: Font.Normal
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
verticalAlignment: Text.AlignTop
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
//Generated by FigmaQML 3.2.1
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Effects
|
||||
import QtQuick.Shapes
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Shapes
|
||||
import FigmaQmlInterface
|
||||
FileComponent20_figma {
|
||||
// component (Instance) level: 0 FileComponent
|
||||
id: figma_98_57
|
||||
// # "FileComponent"
|
||||
objectName:"FileComponent"
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
//Generated by FigmaQML 3.2.1
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Effects
|
||||
import QtQuick.Shapes
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Shapes
|
||||
import FigmaQmlInterface
|
||||
FolderComponent19_figma {
|
||||
// component (Instance) level: 0 FolderComponent
|
||||
id: figma_98_54
|
||||
// # "FolderComponent"
|
||||
objectName:"FolderComponent"
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
//Generated by FigmaQML 3.2.1
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Effects
|
||||
import QtQuick.Shapes
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Shapes
|
||||
import FigmaQmlInterface
|
||||
InputComponent33_figma {
|
||||
// component (Instance) level: 0 InputComponent
|
||||
id: figma_219_72
|
||||
// # "InputComponent"
|
||||
objectName:"InputComponent"
|
||||
}
|
||||
165
pages/FigmaQmlInterface/qml/TestPage_MainPage2_figma.qml
Normal file
@ -0,0 +1,165 @@
|
||||
//Generated by FigmaQML 3.2.1
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Effects
|
||||
import QtQuick.Shapes
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Shapes
|
||||
import FigmaQmlInterface
|
||||
Rectangle {
|
||||
// component (Instance) level: 0 MainPage
|
||||
id: figma_94_72
|
||||
// # "MainPage"
|
||||
objectName:"MainPage"
|
||||
x:0
|
||||
y:0
|
||||
width:1096
|
||||
height:900
|
||||
color: "transparent"
|
||||
clip: true
|
||||
|
||||
LabelHeaderComponentH123_figma {
|
||||
// component (Instance) level: 0 MainPageHeader
|
||||
id: figma_94_73
|
||||
// # "MainPageHeader"
|
||||
objectName:"MainPageHeader"
|
||||
x:31
|
||||
y:20
|
||||
Text {
|
||||
// component (Instance) level: 1 LabelHeader
|
||||
id: figma_i94_73_613_438
|
||||
// # "LabelHeader"
|
||||
objectName:"LabelHeader"
|
||||
x:0
|
||||
y:0
|
||||
width:128
|
||||
height:39
|
||||
color:"#ff000000"
|
||||
wrapMode: TextEdit.WordWrap
|
||||
text:"Главная"
|
||||
font.family: "Tahoma"
|
||||
font.italic: false
|
||||
font.letterSpacing: 0
|
||||
font.pixelSize: 32
|
||||
font.weight: Font.Normal
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
verticalAlignment: Text.AlignTop
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
// component (Instance) level: 0 ButtonChooseFiles
|
||||
id: figma_94_74
|
||||
// # "ButtonChooseFiles"
|
||||
objectName:"ButtonChooseFiles"
|
||||
x:288
|
||||
y:97
|
||||
width:606
|
||||
height:107
|
||||
color:"#ff8b6ef5"
|
||||
radius:30
|
||||
clip: true
|
||||
|
||||
Text {
|
||||
// component (Instance) level: 0 ButtomChooseFilesLabel
|
||||
id: figma_94_75
|
||||
// # "ButtomChooseFilesLabel"
|
||||
objectName:"ButtomChooseFilesLabel"
|
||||
x: (figma_94_74.width - width) / 2
|
||||
y: (figma_94_74.height - height) / 2
|
||||
width:246
|
||||
height:39
|
||||
color:"#ffffffff"
|
||||
wrapMode: TextEdit.WordWrap
|
||||
text:"Выбрать файлы"
|
||||
font.family: "Tahoma"
|
||||
font.italic: false
|
||||
font.letterSpacing: 0
|
||||
font.pixelSize: 32
|
||||
font.weight: Font.Normal
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
verticalAlignment: Text.AlignTop
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
// component (Instance) level: 0 ContentMainPageTransform
|
||||
id: figma_155_49
|
||||
// # "ContentMainPageTransform"
|
||||
objectName:"ContentMainPageTransform"
|
||||
x:52
|
||||
y:249
|
||||
width:995
|
||||
height:636
|
||||
color: "transparent"
|
||||
clip: false
|
||||
|
||||
Rectangle {
|
||||
// component (Instance) level: 0 ColumnLeft
|
||||
id: figma_94_76
|
||||
// # "ColumnLeft"
|
||||
objectName:"ColumnLeft"
|
||||
x:0
|
||||
y:29
|
||||
width:316
|
||||
height:607
|
||||
color:"#ffffffff"
|
||||
clip: true
|
||||
|
||||
}
|
||||
Rectangle {
|
||||
// component (Instance) level: 0 ColumnRight
|
||||
id: figma_94_77
|
||||
// # "ColumnRight"
|
||||
objectName:"ColumnRight"
|
||||
x:679
|
||||
y:29
|
||||
width:316
|
||||
height:607
|
||||
color:"#ffffffff"
|
||||
clip: true
|
||||
|
||||
}
|
||||
Rectangle {
|
||||
// component (Instance) level: 0 ColumnCenter
|
||||
id: figma_94_78
|
||||
// # "ColumnCenter"
|
||||
objectName:"ColumnCenter"
|
||||
x:325
|
||||
y:29
|
||||
width:344
|
||||
height:607
|
||||
color:"#ffffffff"
|
||||
clip: true
|
||||
|
||||
}
|
||||
LabelComponent22_figma {
|
||||
// component (Instance) level: 0 16
|
||||
id: figma_94_79
|
||||
// # "16"
|
||||
objectName:"16"
|
||||
x:0
|
||||
y:0
|
||||
width:158
|
||||
height:19
|
||||
Text {
|
||||
// component (Instance) level: 1 ChosenFileCountLabel
|
||||
id: figma_i94_79_613_450
|
||||
// # "ChosenFileCountLabel"
|
||||
objectName:"ChosenFileCountLabel"
|
||||
x:0
|
||||
y:0
|
||||
width:158
|
||||
height:19
|
||||
color:"#ff000000"
|
||||
wrapMode: TextEdit.WordWrap
|
||||
text:"Выбрано файлов: 10"
|
||||
font.family: "Tahoma"
|
||||
font.italic: false
|
||||
font.letterSpacing: 0
|
||||
font.pixelSize: 16
|
||||
font.weight: Font.Normal
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
verticalAlignment: Text.AlignTop
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
1598
pages/FigmaQmlInterface/qml/TestPage_MainWindow2_figma.qml
Normal file
95
pages/FigmaQmlInterface/qml/TestPage_ProjectPage2_figma.qml
Normal file
@ -0,0 +1,95 @@
|
||||
//Generated by FigmaQML 3.2.1
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Effects
|
||||
import QtQuick.Shapes
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Shapes
|
||||
import FigmaQmlInterface
|
||||
Rectangle {
|
||||
// component (Instance) level: 0 ProjectPage
|
||||
id: figma_94_80
|
||||
// # "ProjectPage"
|
||||
objectName:"ProjectPage"
|
||||
x:0
|
||||
y:0
|
||||
width:1096
|
||||
height:900
|
||||
color: "transparent"
|
||||
clip: true
|
||||
|
||||
LabelHeaderComponentH123_figma {
|
||||
// component (Instance) level: 0 ProjectPageHeader
|
||||
id: figma_94_81
|
||||
// # "ProjectPageHeader"
|
||||
objectName:"ProjectPageHeader"
|
||||
x:31
|
||||
y:20
|
||||
width:139
|
||||
height:39
|
||||
Text {
|
||||
// component (Instance) level: 1 LabelHeader
|
||||
id: figma_i94_81_613_438
|
||||
// # "LabelHeader"
|
||||
objectName:"LabelHeader"
|
||||
x:0
|
||||
y:0
|
||||
width:139
|
||||
height:39
|
||||
color:"#ff000000"
|
||||
wrapMode: TextEdit.WordWrap
|
||||
text:"Проекты"
|
||||
font.family: "Tahoma"
|
||||
font.italic: false
|
||||
font.letterSpacing: 0
|
||||
font.pixelSize: 32
|
||||
font.weight: Font.Normal
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
verticalAlignment: Text.AlignTop
|
||||
}
|
||||
}
|
||||
LabelComponent22_figma {
|
||||
// component (Instance) level: 0 SubDirectoryLabelComponent
|
||||
id: figma_94_82
|
||||
// # "SubDirectoryLabelComponent"
|
||||
objectName:"SubDirectoryLabelComponent"
|
||||
x:197
|
||||
y:32
|
||||
width:125
|
||||
height:19
|
||||
Text {
|
||||
// component (Instance) level: 1 SubdirectorName
|
||||
id: figma_i94_82_613_450
|
||||
// # "SubdirectorName"
|
||||
objectName:"SubdirectorName"
|
||||
x:0
|
||||
y:0
|
||||
width:125
|
||||
height:19
|
||||
color:"#ff000000"
|
||||
wrapMode: TextEdit.WordWrap
|
||||
text:"Поддиректория"
|
||||
font.family: "Tahoma"
|
||||
font.italic: false
|
||||
font.letterSpacing: 0
|
||||
font.pixelSize: 16
|
||||
font.weight: Font.Normal
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
verticalAlignment: Text.AlignTop
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
// component (Instance) level: 0 FolderObserver
|
||||
id: figma_94_83
|
||||
// # "FolderObserver"
|
||||
objectName:"FolderObserver"
|
||||
x: (figma_94_80.width - width) / 2 + 1.5
|
||||
y:86
|
||||
width:1037
|
||||
height:790
|
||||
color: "transparent"
|
||||
radius:30
|
||||
clip: true
|
||||
|
||||
}
|
||||
}
|
||||
361
pages/FigmaQmlInterface/qml/TestPage_SettingsPage2_figma.qml
Normal file
@ -0,0 +1,361 @@
|
||||
//Generated by FigmaQML 3.2.1
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Effects
|
||||
import QtQuick.Shapes
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Shapes
|
||||
import FigmaQmlInterface
|
||||
Rectangle {
|
||||
// component (Instance) level: 0 SettingsPage
|
||||
id: figma_94_86
|
||||
// # "SettingsPage"
|
||||
objectName:"SettingsPage"
|
||||
x:0
|
||||
y:0
|
||||
width:1096
|
||||
height:900
|
||||
color: "transparent"
|
||||
clip: true
|
||||
|
||||
LabelHeaderComponentH123_figma {
|
||||
// component (Instance) level: 0 MainPageHeader
|
||||
id: figma_94_87
|
||||
// # "MainPageHeader"
|
||||
objectName:"MainPageHeader"
|
||||
x:31
|
||||
y:20
|
||||
width:171
|
||||
height:39
|
||||
Text {
|
||||
// component (Instance) level: 1 LabelHeader
|
||||
id: figma_i94_87_613_438
|
||||
// # "LabelHeader"
|
||||
objectName:"LabelHeader"
|
||||
x:0
|
||||
y:0
|
||||
width:171
|
||||
height:39
|
||||
color:"#ff000000"
|
||||
wrapMode: TextEdit.WordWrap
|
||||
text:"Настройки"
|
||||
font.family: "Tahoma"
|
||||
font.italic: false
|
||||
font.letterSpacing: 0
|
||||
font.pixelSize: 32
|
||||
font.weight: Font.Normal
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
verticalAlignment: Text.AlignTop
|
||||
}
|
||||
}
|
||||
LabelComponent22_figma {
|
||||
// component (Instance) level: 0 LabelComponent
|
||||
id: figma_94_88
|
||||
// # "LabelComponent"
|
||||
objectName:"LabelComponent"
|
||||
x:197
|
||||
y:32
|
||||
Text {
|
||||
// component (Instance) level: 1 SubdirectorName
|
||||
id: figma_i94_88_613_450
|
||||
// # "SubdirectorName"
|
||||
objectName:"SubdirectorName"
|
||||
visible: false
|
||||
x:0
|
||||
y:0
|
||||
width:146
|
||||
height:19
|
||||
color:"#ff000000"
|
||||
wrapMode: TextEdit.WordWrap
|
||||
text:"Преобразование..."
|
||||
font.family: "Tahoma"
|
||||
font.italic: false
|
||||
font.letterSpacing: 0
|
||||
font.pixelSize: 16
|
||||
font.weight: Font.Normal
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
verticalAlignment: Text.AlignTop
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
// component (Instance) level: 0 Frame 795
|
||||
id: figma_94_89
|
||||
// # "Frame 795"
|
||||
objectName:"Frame 795"
|
||||
x:0
|
||||
y:65
|
||||
width:1096
|
||||
height:835
|
||||
color:"#ffffffff"
|
||||
clip: true
|
||||
|
||||
InputComponent33_figma {
|
||||
// component (Instance) level: 0 InputComponent
|
||||
id: figma_249_53
|
||||
// # "InputComponent"
|
||||
objectName:"InputComponent"
|
||||
x: (figma_94_89.width - width) / 2 - 272
|
||||
y:33
|
||||
width:470
|
||||
height:40
|
||||
delegate_219_73: Text {
|
||||
// component (Instance) level: 1 ProjectLabel
|
||||
id: figma_i249_53_219_73
|
||||
// # "ProjectLabel"
|
||||
objectName:"ProjectLabel"
|
||||
x:0
|
||||
y:0
|
||||
width:470
|
||||
height:13
|
||||
color:"#ff302f38"
|
||||
wrapMode: TextEdit.WordWrap
|
||||
text:"Путь по умолчанию"
|
||||
font.family: "Tahoma"
|
||||
font.italic: false
|
||||
font.letterSpacing: 0
|
||||
font.pixelSize: 11
|
||||
font.weight: Font.Normal
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
verticalAlignment: Text.AlignTop
|
||||
}
|
||||
delegate_219_155: Rectangle {
|
||||
// component (Instance) level: 1 StrokeElement
|
||||
id: figma_i249_53_219_155
|
||||
// # "StrokeElement"
|
||||
objectName:"StrokeElement"
|
||||
x:0
|
||||
y:17
|
||||
width:470
|
||||
height:23
|
||||
color: "transparent"
|
||||
radius:5
|
||||
clip: false
|
||||
Shape {
|
||||
anchors.fill: parent
|
||||
ShapePath {
|
||||
strokeColor: Qt.rgba(0, 0, 0, 1)
|
||||
strokeWidth: 1
|
||||
fillColor: "transparent"
|
||||
PathMove { x: 5; y: 0 }
|
||||
PathLine { x: 5; y: 0.5 }
|
||||
PathLine { x: 465; y: 0.5 }
|
||||
PathLine { x: 465; y: 0 }
|
||||
PathLine { x: 465; y: -0.5 }
|
||||
PathLine { x: 5; y: -0.5 }
|
||||
PathLine { x: 5; y: 0 }
|
||||
PathLine { x: 5; y: 0 }
|
||||
PathMove { x: 470; y: 5 }
|
||||
PathLine { x: 469.5; y: 5 }
|
||||
PathLine { x: 469.5; y: 18 }
|
||||
PathLine { x: 470; y: 18 }
|
||||
PathLine { x: 470.5; y: 18 }
|
||||
PathLine { x: 470.5; y: 5 }
|
||||
PathLine { x: 470; y: 5 }
|
||||
PathLine { x: 470; y: 5 }
|
||||
PathMove { x: 465; y: 23 }
|
||||
PathLine { x: 465; y: 22.5 }
|
||||
PathLine { x: 5; y: 22.5 }
|
||||
PathLine { x: 5; y: 23 }
|
||||
PathLine { x: 5; y: 23.5 }
|
||||
PathLine { x: 465; y: 23.5 }
|
||||
PathLine { x: 465; y: 23 }
|
||||
PathLine { x: 465; y: 23 }
|
||||
PathMove { x: 0; y: 18 }
|
||||
PathLine { x: 0.5; y: 18 }
|
||||
PathLine { x: 0.5; y: 5 }
|
||||
PathLine { x: 0; y: 5 }
|
||||
PathLine { x: -0.5; y: 5 }
|
||||
PathLine { x: -0.5; y: 18 }
|
||||
PathLine { x: 0; y: 18 }
|
||||
PathLine { x: 0; y: 18 }
|
||||
PathMove { x: 5; y: 23 }
|
||||
PathLine { x: 5; y: 22.5 }
|
||||
PathCubic { control1X: 2.51472; control1Y: 22.5; control2X: 0.5; control2Y: 20.4853; x: 0.5; y: 18 }
|
||||
PathLine { x: 0; y: 18 }
|
||||
PathLine { x: -0.5; y: 18 }
|
||||
PathCubic { control1X: -0.5; control1Y: 21.0376; control2X: 1.96243; control2Y: 23.5; x: 5; y: 23.5 }
|
||||
PathLine { x: 5; y: 23 }
|
||||
PathLine { x: 5; y: 23 }
|
||||
PathMove { x: 470; y: 18 }
|
||||
PathLine { x: 469.5; y: 18 }
|
||||
PathCubic { control1X: 469.5; control1Y: 20.4853; control2X: 467.485; control2Y: 22.5; x: 465; y: 22.5 }
|
||||
PathLine { x: 465; y: 23 }
|
||||
PathLine { x: 465; y: 23.5 }
|
||||
PathCubic { control1X: 468.038; control1Y: 23.5; control2X: 470.5; control2Y: 21.0376; x: 470.5; y: 18 }
|
||||
PathLine { x: 470; y: 18 }
|
||||
PathLine { x: 470; y: 18 }
|
||||
PathMove { x: 465; y: 0 }
|
||||
PathLine { x: 465; y: 0.5 }
|
||||
PathCubic { control1X: 467.485; control1Y: 0.5; control2X: 469.5; control2Y: 2.51472; x: 469.5; y: 5 }
|
||||
PathLine { x: 470; y: 5 }
|
||||
PathLine { x: 470.5; y: 5 }
|
||||
PathCubic { control1X: 470.5; control1Y: 1.96243; control2X: 468.038; control2Y: -0.5; x: 465; y: -0.5 }
|
||||
PathLine { x: 465; y: 0 }
|
||||
PathLine { x: 465; y: 0 }
|
||||
PathMove { x: 5; y: 0 }
|
||||
PathLine { x: 5; y: -0.5 }
|
||||
PathCubic { control1X: 1.96243; control1Y: -0.5; control2X: -0.5; control2Y: 1.96243; x: -0.5; y: 5 }
|
||||
PathLine { x: 0; y: 5 }
|
||||
PathLine { x: 0.5; y: 5 }
|
||||
PathCubic { control1X: 0.5; control1Y: 2.51472; control2X: 2.51472; control2Y: 0.5; x: 5; y: 0.5 }
|
||||
PathLine { x: 5; y: 0 }
|
||||
PathLine { x: 5; y: 0 }
|
||||
}}
|
||||
TextField {
|
||||
// component (Instance) level: 1 ProjectsPathLabelField
|
||||
id: figma_i249_53_219_74
|
||||
// # "ProjectsPathLabelField"
|
||||
objectName:"ProjectsPathLabelField"
|
||||
x:3
|
||||
y:0
|
||||
width:464
|
||||
height:23
|
||||
color:"#ff7d7e82"
|
||||
wrapMode: TextEdit.WordWrap
|
||||
text:"1"
|
||||
background: Rectangle {color: "transparent"} font.family: "Tahoma"
|
||||
font.italic: false
|
||||
font.letterSpacing: 0
|
||||
font.pixelSize: 16
|
||||
font.weight: Font.Normal
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
}
|
||||
}
|
||||
InputComponent33_figma {
|
||||
// component (Instance) level: 0 InputComponent
|
||||
id: figma_249_58
|
||||
// # "InputComponent"
|
||||
objectName:"InputComponent"
|
||||
x: (figma_94_89.width - width) / 2 - 272
|
||||
y:86
|
||||
width:470
|
||||
height:40
|
||||
delegate_219_73: Text {
|
||||
// component (Instance) level: 1 ProjectLabel
|
||||
id: figma_i249_58_219_73
|
||||
// # "ProjectLabel"
|
||||
objectName:"ProjectLabel"
|
||||
x:0
|
||||
y:0
|
||||
width:470
|
||||
height:13
|
||||
color:"#ff302f38"
|
||||
wrapMode: TextEdit.WordWrap
|
||||
text:"Адрес сервера"
|
||||
font.family: "Tahoma"
|
||||
font.italic: false
|
||||
font.letterSpacing: 0
|
||||
font.pixelSize: 11
|
||||
font.weight: Font.Normal
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
verticalAlignment: Text.AlignTop
|
||||
}
|
||||
delegate_219_155: Rectangle {
|
||||
// component (Instance) level: 1 StrokeElement
|
||||
id: figma_i249_58_219_155
|
||||
// # "StrokeElement"
|
||||
objectName:"StrokeElement"
|
||||
x:0
|
||||
y:17
|
||||
width:470
|
||||
height:23
|
||||
color: "transparent"
|
||||
radius:5
|
||||
clip: false
|
||||
Shape {
|
||||
anchors.fill: parent
|
||||
ShapePath {
|
||||
strokeColor: Qt.rgba(0, 0, 0, 1)
|
||||
strokeWidth: 1
|
||||
fillColor: "transparent"
|
||||
PathMove { x: 5; y: 0 }
|
||||
PathLine { x: 5; y: 0.5 }
|
||||
PathLine { x: 465; y: 0.5 }
|
||||
PathLine { x: 465; y: 0 }
|
||||
PathLine { x: 465; y: -0.5 }
|
||||
PathLine { x: 5; y: -0.5 }
|
||||
PathLine { x: 5; y: 0 }
|
||||
PathLine { x: 5; y: 0 }
|
||||
PathMove { x: 470; y: 5 }
|
||||
PathLine { x: 469.5; y: 5 }
|
||||
PathLine { x: 469.5; y: 18 }
|
||||
PathLine { x: 470; y: 18 }
|
||||
PathLine { x: 470.5; y: 18 }
|
||||
PathLine { x: 470.5; y: 5 }
|
||||
PathLine { x: 470; y: 5 }
|
||||
PathLine { x: 470; y: 5 }
|
||||
PathMove { x: 465; y: 23 }
|
||||
PathLine { x: 465; y: 22.5 }
|
||||
PathLine { x: 5; y: 22.5 }
|
||||
PathLine { x: 5; y: 23 }
|
||||
PathLine { x: 5; y: 23.5 }
|
||||
PathLine { x: 465; y: 23.5 }
|
||||
PathLine { x: 465; y: 23 }
|
||||
PathLine { x: 465; y: 23 }
|
||||
PathMove { x: 0; y: 18 }
|
||||
PathLine { x: 0.5; y: 18 }
|
||||
PathLine { x: 0.5; y: 5 }
|
||||
PathLine { x: 0; y: 5 }
|
||||
PathLine { x: -0.5; y: 5 }
|
||||
PathLine { x: -0.5; y: 18 }
|
||||
PathLine { x: 0; y: 18 }
|
||||
PathLine { x: 0; y: 18 }
|
||||
PathMove { x: 5; y: 23 }
|
||||
PathLine { x: 5; y: 22.5 }
|
||||
PathCubic { control1X: 2.51472; control1Y: 22.5; control2X: 0.5; control2Y: 20.4853; x: 0.5; y: 18 }
|
||||
PathLine { x: 0; y: 18 }
|
||||
PathLine { x: -0.5; y: 18 }
|
||||
PathCubic { control1X: -0.5; control1Y: 21.0376; control2X: 1.96243; control2Y: 23.5; x: 5; y: 23.5 }
|
||||
PathLine { x: 5; y: 23 }
|
||||
PathLine { x: 5; y: 23 }
|
||||
PathMove { x: 470; y: 18 }
|
||||
PathLine { x: 469.5; y: 18 }
|
||||
PathCubic { control1X: 469.5; control1Y: 20.4853; control2X: 467.485; control2Y: 22.5; x: 465; y: 22.5 }
|
||||
PathLine { x: 465; y: 23 }
|
||||
PathLine { x: 465; y: 23.5 }
|
||||
PathCubic { control1X: 468.038; control1Y: 23.5; control2X: 470.5; control2Y: 21.0376; x: 470.5; y: 18 }
|
||||
PathLine { x: 470; y: 18 }
|
||||
PathLine { x: 470; y: 18 }
|
||||
PathMove { x: 465; y: 0 }
|
||||
PathLine { x: 465; y: 0.5 }
|
||||
PathCubic { control1X: 467.485; control1Y: 0.5; control2X: 469.5; control2Y: 2.51472; x: 469.5; y: 5 }
|
||||
PathLine { x: 470; y: 5 }
|
||||
PathLine { x: 470.5; y: 5 }
|
||||
PathCubic { control1X: 470.5; control1Y: 1.96243; control2X: 468.038; control2Y: -0.5; x: 465; y: -0.5 }
|
||||
PathLine { x: 465; y: 0 }
|
||||
PathLine { x: 465; y: 0 }
|
||||
PathMove { x: 5; y: 0 }
|
||||
PathLine { x: 5; y: -0.5 }
|
||||
PathCubic { control1X: 1.96243; control1Y: -0.5; control2X: -0.5; control2Y: 1.96243; x: -0.5; y: 5 }
|
||||
PathLine { x: 0; y: 5 }
|
||||
PathLine { x: 0.5; y: 5 }
|
||||
PathCubic { control1X: 0.5; control1Y: 2.51472; control2X: 2.51472; control2Y: 0.5; x: 5; y: 0.5 }
|
||||
PathLine { x: 5; y: 0 }
|
||||
PathLine { x: 5; y: 0 }
|
||||
}}
|
||||
TextField {
|
||||
// component (Instance) level: 1 RemoteAddressLabelField
|
||||
id: figma_i249_58_219_74
|
||||
// # "RemoteAddressLabelField"
|
||||
objectName:"RemoteAddressLabelField"
|
||||
x:3
|
||||
y:0
|
||||
width:464
|
||||
height:23
|
||||
color:"#ff7d7e82"
|
||||
wrapMode: TextEdit.WordWrap
|
||||
text:"http://localhost:1234"
|
||||
background: Rectangle {color: "transparent"} font.family: "Tahoma"
|
||||
font.italic: false
|
||||
font.letterSpacing: 0
|
||||
font.pixelSize: 16
|
||||
font.weight: Font.Normal
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 110 KiB |
|
After Width: | Height: | Size: 95 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 994 B |
|
After Width: | Height: | Size: 916 B |
|
After Width: | Height: | Size: 7.3 KiB |
|
After Width: | Height: | Size: 50 KiB |
3
qmakehelper.cpp
Normal file
@ -0,0 +1,3 @@
|
||||
#include "qmakehelper.h"
|
||||
|
||||
QMakeHelper::QMakeHelper() {}
|
||||
10
qmakehelper.h
Normal file
@ -0,0 +1,10 @@
|
||||
#ifndef QMAKEHELPER_H
|
||||
#define QMAKEHELPER_H
|
||||
|
||||
class QMakeHelper
|
||||
{
|
||||
public:
|
||||
QMakeHelper();
|
||||
};
|
||||
|
||||
#endif // QMAKEHELPER_H
|
||||
25
qml/ListItem.qml
Normal file
@ -0,0 +1,25 @@
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
|
||||
Rectangle {
|
||||
property alias text: itemText.text
|
||||
|
||||
height: 32
|
||||
color: "transparent"
|
||||
|
||||
Text {
|
||||
id: itemText
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: 5
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
font.pixelSize: 16
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
// Обработка клика
|
||||
}
|
||||
}
|
||||
}
|
||||
110
qml/ScrollableTextList.qml
Normal file
@ -0,0 +1,110 @@
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import Qt.labs.platform
|
||||
|
||||
Item {
|
||||
id: root
|
||||
anchors.fill: parent
|
||||
|
||||
// Свойство для хранения текущей модели
|
||||
property var currentModel: null
|
||||
|
||||
function openFileDialog() {
|
||||
fileDialog.open()
|
||||
}
|
||||
|
||||
FileDialog {
|
||||
id: fileDialog
|
||||
title: "Выберите файлы"
|
||||
fileMode: FileDialog.OpenFiles
|
||||
|
||||
nameFilters: [
|
||||
"Изображения (*.png *.jpg *.bmp)"
|
||||
]
|
||||
|
||||
onAccepted: {
|
||||
mainViewPresentor.listFilePath = fileDialog.currentFiles.map(url => url.toString())
|
||||
var fileNames = fileDialog.currentFiles.map(url => url.toString().split('/').pop());
|
||||
createAndSetNewModel(fileNames); // Используем новую функцию для создания модели
|
||||
console.log("Выбрано файлов:", fileNames.length);
|
||||
fileNames.forEach(file => console.log("Файл:", file));
|
||||
|
||||
|
||||
mainViewPresentor.transform()
|
||||
}
|
||||
onRejected: console.log("Выбор файлов отменен");
|
||||
}
|
||||
|
||||
ScrollView {
|
||||
id: scrollView
|
||||
anchors.fill: parent
|
||||
clip: true
|
||||
|
||||
ListView {
|
||||
id: listView
|
||||
model: root.currentModel // Используем текущую модель
|
||||
width: scrollView.width
|
||||
spacing: 2
|
||||
|
||||
delegate: Rectangle {
|
||||
width: ListView.view.width
|
||||
height: 30
|
||||
color: index % 2 ? "#ffffff" : "#f0f0f0"
|
||||
|
||||
Flickable {
|
||||
anchors.fill: parent
|
||||
contentWidth: textItem.width
|
||||
contentHeight: textItem.height
|
||||
|
||||
Text {
|
||||
anchors {
|
||||
verticalCenter: parent.verticalCenter
|
||||
left: parent.left
|
||||
leftMargin: 10
|
||||
right: parent.right
|
||||
}
|
||||
text: model.fileName
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Функция создания новой модели и установки её в currentModel
|
||||
function createAndSetNewModel(fileNames) {
|
||||
var newModel = Qt.createQmlObject('import QtQuick 2.15; ListModel {}', root);
|
||||
|
||||
for (var i = 0; i < fileNames.length; i++) {
|
||||
newModel.append({"fileName": fileNames[i]});
|
||||
}
|
||||
|
||||
if (root.currentModel) {
|
||||
if (typeof root.currentModel.deleteLater === "function") {
|
||||
root.currentModel.deleteLater();
|
||||
} else {
|
||||
root.currentModel.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
root.currentModel = newModel;
|
||||
}
|
||||
|
||||
function clear() {
|
||||
if (root.currentModel) {
|
||||
root.currentModel.clear();
|
||||
}
|
||||
}
|
||||
|
||||
// MouseArea {
|
||||
// anchors.fill: parent
|
||||
// onClicked: {
|
||||
// console.log("Clicked clear")
|
||||
// clear();
|
||||
// }
|
||||
// hoverEnabled: true
|
||||
// cursorShape: Qt.PointingHandCursor
|
||||
// }
|
||||
}
|
||||
233
quickhelper.cpp
Normal file
@ -0,0 +1,233 @@
|
||||
#include "quickhelper.h"
|
||||
#include "QDebug"
|
||||
#include <QJSEngine>
|
||||
#include <QQmlContext>
|
||||
#include <QQmlEngine>
|
||||
#include "QQuickItem"
|
||||
#include "callbackwrapper.h"
|
||||
#include "qrgb.h"
|
||||
QuickHelper::QuickHelper() {}
|
||||
|
||||
void QuickHelper::updateElement(QObject *rootObject, const QString &elementName, std::function<void (QObject *, std::function<void ()>)> updateItemFunction, std::function<void ()> onClick)
|
||||
{
|
||||
QObject *item = rootObject->findChild<QObject*>(elementName);
|
||||
if (item) {
|
||||
updateItemFunction(item,onClick);
|
||||
} else {
|
||||
qWarning() << "Элемент с objectName "<< elementName << " не найден";
|
||||
}
|
||||
}
|
||||
|
||||
void QuickHelper::clearChildren(QQuickItem *parentItem)
|
||||
{
|
||||
const auto children = parentItem->children();
|
||||
|
||||
if (children.size()) {
|
||||
|
||||
for (QObject* child : children) {
|
||||
if (QQuickItem* item = qobject_cast<QQuickItem*>(child)) {
|
||||
item->setParent(nullptr);
|
||||
item->setParentItem(nullptr);
|
||||
item->deleteLater();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void QuickHelper::moveTextFiledX(QQuickItem *item)
|
||||
{
|
||||
item->setX(item->x()-5);
|
||||
item->setWidth(item->width()+5);
|
||||
}
|
||||
|
||||
QQuickItem *QuickHelper::getQuickItem(QObject *rootObject, const QString &elementName)
|
||||
{
|
||||
QObject *item = rootObject->findChild<QObject*>(elementName);
|
||||
|
||||
if (!item) {
|
||||
qWarning() << "Элемент с objectName "<< elementName << " не найден";
|
||||
return 0;
|
||||
}
|
||||
|
||||
QQuickItem* quickItem = qobject_cast<QQuickItem*>(item);
|
||||
if (!quickItem) {
|
||||
qWarning() << "[C++] Root object is not a QQuickItem";
|
||||
return 0;
|
||||
}
|
||||
|
||||
return quickItem;
|
||||
}
|
||||
|
||||
void QuickHelper::addMouseArea(QObject* rootObject, std::function<void()> onClickAction) {
|
||||
qDebug() << "[C++] Starting to create MouseArea";
|
||||
|
||||
if (!rootObject) {
|
||||
qWarning() << "[C++] Root object is null";
|
||||
return;
|
||||
}
|
||||
|
||||
QQuickItem* parentItem = qobject_cast<QQuickItem*>(rootObject);
|
||||
if (!parentItem) {
|
||||
qWarning() << "[C++] Root object is not a QQuickItem";
|
||||
return;
|
||||
}
|
||||
|
||||
QQmlEngine* engine = qmlEngine(rootObject);
|
||||
if (!engine) {
|
||||
qWarning() << "[C++] Failed to get QQmlEngine";
|
||||
return;
|
||||
}
|
||||
// 1. Создаем CallbackWrapper и добавляем в контекст QML
|
||||
CallbackWrapper* wrapper = new CallbackWrapper(onClickAction, parentItem);
|
||||
QQmlContext* context = new QQmlContext(engine->rootContext(), parentItem);
|
||||
context->setContextProperty("callbackWrapper", wrapper); // Делаем доступным в QML
|
||||
|
||||
// 2. Создаем MouseArea (уже будет видеть callbackWrapper)
|
||||
QQmlComponent component(engine);
|
||||
component.setData(R"(
|
||||
import QtQuick 2.15
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: callbackWrapper.invoke()
|
||||
}
|
||||
)", QUrl());
|
||||
|
||||
// 3. Создаем MouseArea в этом контексте
|
||||
QObject* mouseAreaObj = component.create(context);
|
||||
if (!mouseAreaObj) {
|
||||
qWarning() << "Error creating MouseArea:" << component.errors();
|
||||
delete context;
|
||||
return;
|
||||
}
|
||||
|
||||
// 4. Настраиваем родительские связи
|
||||
mouseAreaObj->setParent(parentItem);
|
||||
QQuickItem* mouseAreaItem = qobject_cast<QQuickItem*>(mouseAreaObj);
|
||||
mouseAreaItem->setParentItem(parentItem);
|
||||
|
||||
// 5. Удаление контекста при удалении MouseArea
|
||||
context->setParent(mouseAreaObj);
|
||||
};
|
||||
|
||||
#include "quickupdater.h"
|
||||
|
||||
void QuickHelper::doFunction(
|
||||
QObject* rootObject,
|
||||
const QList<QVariant>& listItems,
|
||||
const QString& textComponent,
|
||||
const QString& functionName
|
||||
) {
|
||||
qDebug() << "[C++] Starting to create function";
|
||||
|
||||
if (!rootObject) {
|
||||
qWarning() << "[C++] Root object is null";
|
||||
return;
|
||||
}
|
||||
|
||||
QQuickItem* parentItem = qobject_cast<QQuickItem*>(rootObject);
|
||||
if (!parentItem) {
|
||||
qWarning() << "[C++] Root object is not a QQuickItem";
|
||||
return;
|
||||
}
|
||||
|
||||
QQmlEngine* engine = qmlEngine(rootObject);
|
||||
if (!engine) {
|
||||
qWarning() << "[C++] Failed to get QQmlEngine";
|
||||
return;
|
||||
}
|
||||
|
||||
// 1. Создаем ArrDifferentTypes и добавляем в контекст QML
|
||||
ArrDifferentTypes* arrDifferentTypes = new ArrDifferentTypes(parentItem);
|
||||
arrDifferentTypes->setArrDifferentTypes(listItems);
|
||||
|
||||
QQmlContext* context = new QQmlContext(engine->rootContext(), parentItem);
|
||||
context->setContextProperty("quickUpdaterData", arrDifferentTypes);
|
||||
|
||||
QQmlComponent component(engine);
|
||||
component.setData(textComponent.toLocal8Bit(), QUrl());
|
||||
|
||||
if (component.isError()) {
|
||||
qWarning() << "QML Component errors:" << component.errors() << "\n" << textComponent;
|
||||
delete context;
|
||||
return;
|
||||
}
|
||||
|
||||
QObject* updaterObject = component.create(context);
|
||||
if (!updaterObject) {
|
||||
qWarning() << "Error creating updaterObject:" << component.errors();
|
||||
delete context;
|
||||
return;
|
||||
}
|
||||
|
||||
// 4. Настраиваем родительские связи (управление памятью через Qt-родителя)
|
||||
updaterObject->setParent(parentItem);
|
||||
|
||||
// 5. Контекст удалится автоматически при удалении updaterObject
|
||||
context->setParent(updaterObject);
|
||||
|
||||
// 6. Вызываем функцию в QML
|
||||
bool success = QMetaObject::invokeMethod(
|
||||
updaterObject,
|
||||
functionName.toUtf8().constData(),
|
||||
Q_ARG(QVariant, QVariant::fromValue(rootObject))
|
||||
);
|
||||
|
||||
if (!success) {
|
||||
qWarning() << "Failed to invoke QML function:" << functionName;
|
||||
}
|
||||
|
||||
updaterObject->deleteLater();
|
||||
arrDifferentTypes->deleteLater();
|
||||
}
|
||||
|
||||
void QuickHelper::updateColor(QObject* rootObject, QColor disabledColor, QColor enabledColor){
|
||||
// Присваивает значение
|
||||
/*QString textComponent = R"(
|
||||
import QtQuick 2.0
|
||||
|
||||
QtObject {
|
||||
function updateColor(smthItem) {
|
||||
if (!quickUpdaterData || quickUpdaterData.arrDifferentTypes.length < 2) {
|
||||
console.log("quickUpdaterData not set or length < 2");
|
||||
return;
|
||||
}
|
||||
|
||||
var colorDisabled = quickUpdaterData.arrDifferentTypes[0];
|
||||
var colorEnabled = quickUpdaterData.arrDifferentTypes[1];
|
||||
|
||||
if (smthItem && smthItem.hasOwnProperty("color") && smthItem.hasOwnProperty("enabled")) {
|
||||
smthItem.color = smthItem.enabled ? colorEnabled : colorDisabled;
|
||||
} else {
|
||||
console.log("item does not have color or enabled property");
|
||||
}
|
||||
}
|
||||
}
|
||||
)";*/
|
||||
QString textComponent = R"(
|
||||
import QtQuick 2.15
|
||||
|
||||
QtObject {
|
||||
function updateColor(smthItem) {
|
||||
if (!quickUpdaterData || quickUpdaterData.arrDifferentTypes.length < 2) {
|
||||
console.log("quickUpdaterData not set or length < 2")
|
||||
return
|
||||
}
|
||||
|
||||
var colorDisabled = quickUpdaterData.arrDifferentTypes[0]
|
||||
var colorEnabled = quickUpdaterData.arrDifferentTypes[1]
|
||||
|
||||
// Просто устанавливаем binding напрямую
|
||||
smthItem.color = Qt.binding(function() {
|
||||
return smthItem.enabled ? colorEnabled : colorDisabled
|
||||
})
|
||||
}
|
||||
}
|
||||
)";
|
||||
QString function = "updateColor";
|
||||
QVariantList list;
|
||||
// list.append(QColor(qRgb(255,255,0)));
|
||||
// list.append(QColor(qRgb(0,255,0)));
|
||||
list.append(disabledColor);
|
||||
list.append(enabledColor);
|
||||
QuickHelper::doFunction(rootObject, list,textComponent,function);
|
||||
}
|
||||
25
quickhelper.h
Normal file
@ -0,0 +1,25 @@
|
||||
#ifndef QUICKHELPER_H
|
||||
#define QUICKHELPER_H
|
||||
|
||||
#include "QObject"
|
||||
|
||||
class QQuickItem;
|
||||
class QuickHelper
|
||||
{
|
||||
public:
|
||||
QuickHelper();
|
||||
|
||||
static void updateElement(QObject *rootObject, const QString &elementName,
|
||||
std::function<void(QObject*, std::function<void()>)> updateItemFunction,
|
||||
std::function<void()> onClick);
|
||||
|
||||
static void clearChildren(QQuickItem *parentItem);
|
||||
static void moveTextFiledX(QQuickItem *parentItem);
|
||||
static QQuickItem * getQuickItem(QObject *rootObject, const QString &elementName);
|
||||
static void addMouseArea(QObject *rootObject, std::function<void ()> onClickAction);
|
||||
|
||||
static void doFunction(QObject *rootObject, const QList<QVariant> &listItems, const QString &textFunction, const QString &functionName);
|
||||
static void updateColor(QObject *rootObject, QColor disabledColor, QColor enabledColor);
|
||||
};
|
||||
|
||||
#endif // QUICKHELPER_H
|
||||
1
quickupdater.cpp
Normal file
@ -0,0 +1 @@
|
||||
#include "quickupdater.h"
|
||||
41
quickupdater.h
Normal file
@ -0,0 +1,41 @@
|
||||
#ifndef QUICKUPDATER_H
|
||||
#define QUICKUPDATER_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QQmlEngine>
|
||||
#include <QList>
|
||||
#include <QObject>
|
||||
#include <QList>
|
||||
#include <QVariant>
|
||||
|
||||
class ArrDifferentTypes : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(QList<QVariant> arrDifferentTypes READ getArrDifferentTypes WRITE setArrDifferentTypes NOTIFY arrDifferentTypesChanged)
|
||||
QML_ELEMENT
|
||||
|
||||
public:
|
||||
explicit ArrDifferentTypes(QObject *parent = nullptr) : QObject(parent) {}
|
||||
|
||||
QList<QVariant> getArrDifferentTypes() const { return arrDifferentTypes; }
|
||||
void setArrDifferentTypes(const QList<QVariant> &arr) {
|
||||
if (arrDifferentTypes != arr) {
|
||||
arrDifferentTypes = arr;
|
||||
emit arrDifferentTypesChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public slots:
|
||||
void addVarToData(const QVariant& value) {
|
||||
arrDifferentTypes.append(value);
|
||||
emit arrDifferentTypesChanged();
|
||||
}
|
||||
|
||||
signals:
|
||||
void arrDifferentTypesChanged();
|
||||
|
||||
private:
|
||||
QList<QVariant> arrDifferentTypes;
|
||||
};
|
||||
|
||||
#endif // QUICKUPDATER_H
|
||||
70
settingspageactivity.cpp
Normal file
@ -0,0 +1,70 @@
|
||||
#include "settingspageactivity.h"
|
||||
#include "mainpageactivity.h"
|
||||
#include <QJSEngine>
|
||||
#include <QQmlContext>
|
||||
#include <QQmlEngine>
|
||||
#include "QQuickItem"
|
||||
#include "quickhelper.h"
|
||||
#include <QDebug>
|
||||
#include "dynamicloader.h"
|
||||
#include <QGuiApplication>
|
||||
#include <QQmlApplicationEngine>
|
||||
#include "settingsrepository.h"
|
||||
|
||||
SettingsPageActivity::SettingsPageActivity(QQuickItem *item, QObject *parent)
|
||||
: root(item)
|
||||
{
|
||||
if (!item) {
|
||||
qWarning() << "[C++] Root object is null";
|
||||
return;
|
||||
}
|
||||
|
||||
engine = qmlEngine(item);
|
||||
|
||||
if (!engine) {
|
||||
qWarning() << "[C++] Failed to get QQmlEngine";
|
||||
return;
|
||||
}
|
||||
|
||||
loader = new DynamicLoader(engine,this);
|
||||
connect(loader, &DynamicLoader::errorOccurred, this, &SettingsPageActivity::errorOccurredDynamycLoaderHandler);
|
||||
SettingsPageActivity::init();
|
||||
}
|
||||
|
||||
bool SettingsPageActivity::isAllElementsFound(){
|
||||
bool retCode = true; // Флаг ошибки
|
||||
|
||||
fieldProjectPath = QuickHelper::getQuickItem(root, FIELD_PROJECT_PATH);
|
||||
if (!fieldProjectPath) {
|
||||
qWarning() << "Failed to get fieldProjectPath:" << FIELD_PROJECT_PATH;
|
||||
retCode = false;
|
||||
}
|
||||
|
||||
fieldRemoteAdress = QuickHelper::getQuickItem(root, FIELD_REMOTE_ADDRESS);
|
||||
|
||||
if (!fieldRemoteAdress) {
|
||||
qWarning() << "Failed to get fieldRemoteAdress:" << FIELD_REMOTE_ADDRESS;
|
||||
retCode = false;
|
||||
}
|
||||
|
||||
return retCode;
|
||||
}
|
||||
|
||||
void SettingsPageActivity::init()
|
||||
{
|
||||
if(!isAllElementsFound()) return;
|
||||
|
||||
QString projectDir = SettingsRepository::instance().defaultProjectDirectory();
|
||||
QUrl remoteAddress = SettingsRepository::instance().remoteAddressUrl();
|
||||
|
||||
fieldRemoteAdress->setProperty("text", remoteAddress.toString());
|
||||
fieldProjectPath->setProperty("text", projectDir);
|
||||
|
||||
QuickHelper::moveTextFiledX(fieldRemoteAdress);
|
||||
QuickHelper::moveTextFiledX(fieldProjectPath);
|
||||
}
|
||||
|
||||
void SettingsPageActivity::errorOccurredDynamycLoaderHandler(const QString &message)
|
||||
{
|
||||
qDebug()<<message;
|
||||
}
|
||||
37
settingspageactivity.h
Normal file
@ -0,0 +1,37 @@
|
||||
#ifndef SETTINGSPAGEACTIVITY_H
|
||||
#define SETTINGSPAGEACTIVITY_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class QQuickItem;
|
||||
class DynamicLoader;
|
||||
class QQmlEngine;
|
||||
|
||||
class SettingsPageActivity : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit SettingsPageActivity(QQuickItem * item, QObject *parent = nullptr);
|
||||
|
||||
private:
|
||||
QQuickItem * root;
|
||||
DynamicLoader* loader = 0;
|
||||
QQmlEngine * engine;
|
||||
|
||||
const QString FIELD_PROJECT_PATH = "ProjectsPathLabelField";
|
||||
QQuickItem * fieldProjectPath = 0;
|
||||
|
||||
const QString FIELD_REMOTE_ADDRESS = "RemoteAddressLabelField";
|
||||
QQuickItem * fieldRemoteAdress = 0;
|
||||
|
||||
bool isAllElementsFound();
|
||||
void init();
|
||||
|
||||
public:
|
||||
private slots:
|
||||
void errorOccurredDynamycLoaderHandler(const QString& message);
|
||||
signals:
|
||||
};
|
||||
|
||||
#endif // SETTINGSPAGEACTIVITY_H
|
||||
1
settingsrepository.cpp
Normal file
@ -0,0 +1 @@
|
||||
#include "settingsrepository.h"
|
||||
60
settingsrepository.h
Normal file
@ -0,0 +1,60 @@
|
||||
// settingsrepository.h
|
||||
|
||||
#ifndef SETTINGSREPOSITORY_H
|
||||
#define SETTINGSREPOSITORY_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QSettings>
|
||||
#include <QUrl>
|
||||
|
||||
class SettingsRepository : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
static SettingsRepository& instance()
|
||||
{
|
||||
static SettingsRepository _instance;
|
||||
return _instance;
|
||||
}
|
||||
|
||||
// Получить каталог проекта по умолчанию
|
||||
QString defaultProjectDirectory() const
|
||||
{
|
||||
return m_settings.value("General/defaultProjectDirectory", "").toString();
|
||||
}
|
||||
|
||||
// Установить каталог проекта по умолчанию
|
||||
void setDefaultProjectDirectory(const QString& dir)
|
||||
{
|
||||
m_settings.setValue("General/defaultProjectDirectory", dir);
|
||||
m_settings.sync();
|
||||
}
|
||||
|
||||
// Получить URL удалённого адреса
|
||||
QUrl remoteAddressUrl() const
|
||||
{
|
||||
return m_settings.value("Network/remoteAddressUrl", QUrl()).toUrl();
|
||||
}
|
||||
|
||||
// Установить URL удалённого адреса
|
||||
void setRemoteAddressUrl(const QUrl& url)
|
||||
{
|
||||
m_settings.setValue("Network/remoteAddressUrl", url);
|
||||
m_settings.sync();
|
||||
}
|
||||
|
||||
private:
|
||||
explicit SettingsRepository(QObject* parent = nullptr)
|
||||
: QObject(parent)
|
||||
, m_settings(QSettings::IniFormat, QSettings::UserScope, "CyberCode", "Pretvorenit")
|
||||
{
|
||||
}
|
||||
|
||||
// Запрет копирования
|
||||
SettingsRepository(const SettingsRepository&) = delete;
|
||||
SettingsRepository& operator=(const SettingsRepository&) = delete;
|
||||
|
||||
QSettings m_settings;
|
||||
};
|
||||
|
||||
#endif // SETTINGSREPOSITORY_H
|
||||