abstract spec mode
This commit is contained in:
parent
7e59150831
commit
3a251b5adf
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorProject>
|
||||
<!-- Written by QtCreator 4.14.1, 2021-04-01T16:59:16. -->
|
||||
<!-- Written by QtCreator 4.14.2, 2021-04-06T10:55:52. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>EnvironmentId</variable>
|
||||
@ -88,16 +88,16 @@
|
||||
<variable>ProjectExplorer.Project.Target.0</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<value type="QString" key="DeviceType">Desktop</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 6.0.2 MSVC2019 64bit</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 6.0.2 MSVC2019 64bit</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt6.602.win64_msvc2019_64_kit</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 6.0.3 MSVC2019 64bit</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 6.0.3 MSVC2019 64bit</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt6.603.win64_msvc2019_64_kit</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
|
||||
<value type="int" key="EnableQmlDebugging">0</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:\Users\maverick\Workspace\Doric\doric-Qt\build-doric-Desktop_Qt_6_0_2_MSVC2019_64bit-Debug</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">C:/Users/maverick/Workspace/Doric/doric-Qt/build-doric-Desktop_Qt_6_0_2_MSVC2019_64bit-Debug</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:\Users\maverick\Workspace\Doric\doric-Qt\build-doric-Desktop_Qt_6_0_3_MSVC2019_64bit-Debug</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">C:/Users/maverick/Workspace/Doric/doric-Qt/build-doric-Desktop_Qt_6_0_3_MSVC2019_64bit-Debug</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
@ -136,8 +136,8 @@
|
||||
<value type="int" key="RunSystemFunction">0</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:\Users\maverick\Workspace\Doric\doric-Qt\build-doric-Desktop_Qt_6_0_2_MSVC2019_64bit-Release</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">C:/Users/maverick/Workspace/Doric/doric-Qt/build-doric-Desktop_Qt_6_0_2_MSVC2019_64bit-Release</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:\Users\maverick\Workspace\Doric\doric-Qt\build-doric-Desktop_Qt_6_0_3_MSVC2019_64bit-Release</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">C:/Users/maverick/Workspace/Doric/doric-Qt/build-doric-Desktop_Qt_6_0_3_MSVC2019_64bit-Release</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
@ -178,8 +178,8 @@
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
|
||||
<value type="int" key="EnableQmlDebugging">0</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:\Users\maverick\Workspace\Doric\doric-Qt\build-doric-Desktop_Qt_6_0_2_MSVC2019_64bit-Profile</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">C:/Users/maverick/Workspace/Doric/doric-Qt/build-doric-Desktop_Qt_6_0_2_MSVC2019_64bit-Profile</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:\Users\maverick\Workspace\Doric\doric-Qt\build-doric-Desktop_Qt_6_0_3_MSVC2019_64bit-Profile</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">C:/Users/maverick/Workspace/Doric/doric-Qt/build-doric-Desktop_Qt_6_0_3_MSVC2019_64bit-Profile</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
@ -301,7 +301,7 @@
|
||||
<value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
|
||||
<value type="QString" key="RunConfiguration.WorkingDirectory.default">C:/Users/maverick/Workspace/Doric/doric-Qt/build-doric-Desktop_Qt_6_0_2_MSVC2019_64bit-Debug</value>
|
||||
<value type="QString" key="RunConfiguration.WorkingDirectory.default">C:/Users/maverick/Workspace/Doric/doric-Qt/build-doric-Desktop_Qt_6_0_3_MSVC2019_64bit-Debug</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
|
||||
</valuemap>
|
||||
@ -310,16 +310,16 @@
|
||||
<variable>ProjectExplorer.Project.Target.1</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<value type="QString" key="DeviceType">Desktop</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 6.0.1 MinGW 64-bit</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 6.0.1 MinGW 64-bit</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt6.601.win64_mingw81_kit</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 6.0.3 MinGW 64-bit</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 6.0.3 MinGW 64-bit</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt6.603.win64_mingw81_kit</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
|
||||
<value type="int" key="EnableQmlDebugging">0</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:\Users\maverick\Workspace\Doric\doric-Qt\build-doric-Desktop_Qt_6_0_1_MinGW_64_bit-Debug</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">C:/Users/maverick/Workspace/Doric/doric-Qt/build-doric-Desktop_Qt_6_0_1_MinGW_64_bit-Debug</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:\Users\maverick\Workspace\Doric\doric-Qt\build-doric-Desktop_Qt_6_0_3_MinGW_64_bit-Debug</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">C:/Users/maverick/Workspace/Doric/doric-Qt/build-doric-Desktop_Qt_6_0_3_MinGW_64_bit-Debug</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
@ -358,8 +358,8 @@
|
||||
<value type="int" key="RunSystemFunction">0</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:\Users\maverick\Workspace\Doric\doric-Qt\build-doric-Desktop_Qt_6_0_1_MinGW_64_bit-Release</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">C:/Users/maverick/Workspace/Doric/doric-Qt/build-doric-Desktop_Qt_6_0_1_MinGW_64_bit-Release</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:\Users\maverick\Workspace\Doric\doric-Qt\build-doric-Desktop_Qt_6_0_3_MinGW_64_bit-Release</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">C:/Users/maverick/Workspace/Doric/doric-Qt/build-doric-Desktop_Qt_6_0_3_MinGW_64_bit-Release</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
@ -400,8 +400,8 @@
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
|
||||
<value type="int" key="EnableQmlDebugging">0</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:\Users\maverick\Workspace\Doric\doric-Qt\build-doric-Desktop_Qt_6_0_1_MinGW_64_bit-Profile</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">C:/Users/maverick/Workspace/Doric/doric-Qt/build-doric-Desktop_Qt_6_0_1_MinGW_64_bit-Profile</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:\Users\maverick\Workspace\Doric\doric-Qt\build-doric-Desktop_Qt_6_0_3_MinGW_64_bit-Profile</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">C:/Users/maverick/Workspace/Doric/doric-Qt/build-doric-Desktop_Qt_6_0_3_MinGW_64_bit-Profile</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
@ -516,11 +516,10 @@
|
||||
<valuelist type="QVariantList" key="CustomOutputParsers"/>
|
||||
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
|
||||
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:C:/Users/maverick/Workspace/Doric/doric-Qt/doric/doric.pro</value>
|
||||
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">C:/Users/maverick/Workspace/Doric/doric-Qt/doric/doric.pro</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
|
||||
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey"></value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
|
||||
<value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
|
||||
</valuemap>
|
||||
|
@ -57,7 +57,7 @@ void DoricSuperNode::blendSubLayoutConfig(DoricViewNode *viewNode,
|
||||
|
||||
QJsonValue DoricSuperNode::generateDefaultLayoutConfig() {
|
||||
QJsonObject layoutConfig;
|
||||
layoutConfig.insert("widthSpec", 0);
|
||||
layoutConfig.insert("heightSpec", 0);
|
||||
layoutConfig.insert("widthSpec", SpecMode::JUST);
|
||||
layoutConfig.insert("heightSpec", SpecMode::JUST);
|
||||
return layoutConfig;
|
||||
}
|
||||
|
@ -12,28 +12,28 @@ void DoricViewNode::blendLayoutConfig(QJsonValue jsObject) {
|
||||
|
||||
if (widthSpec.isDouble()) {
|
||||
switch (widthSpec.toInt()) {
|
||||
case 0:
|
||||
mView->setProperty("widthSpec", 0);
|
||||
case SpecMode::JUST:
|
||||
mView->setProperty("widthSpec", SpecMode::JUST);
|
||||
break;
|
||||
case 1:
|
||||
mView->setProperty("widthSpec", 1);
|
||||
case SpecMode::FIT:
|
||||
mView->setProperty("widthSpec", SpecMode::FIT);
|
||||
break;
|
||||
case 2:
|
||||
mView->setProperty("widthSpec", 2);
|
||||
case SpecMode::MOST:
|
||||
mView->setProperty("widthSpec", SpecMode::MOST);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (heightSpec.isDouble()) {
|
||||
switch (heightSpec.toInt()) {
|
||||
case 0:
|
||||
mView->setProperty("heightSpec", 0);
|
||||
case SpecMode::JUST:
|
||||
mView->setProperty("heightSpec", SpecMode::JUST);
|
||||
break;
|
||||
case 1:
|
||||
mView->setProperty("heightSpec", 1);
|
||||
case SpecMode::FIT:
|
||||
mView->setProperty("heightSpec", SpecMode::FIT);
|
||||
break;
|
||||
case 2:
|
||||
mView->setProperty("heightSpec", 2);
|
||||
case SpecMode::MOST:
|
||||
mView->setProperty("heightSpec", SpecMode::MOST);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -87,7 +87,7 @@ void DoricViewNode::blend(QQuickItem *view, QString name, QJsonValue prop) {
|
||||
} else {
|
||||
QJsonValue widthSpec = this->mLayoutConfig["widthSpec"];
|
||||
if (widthSpec.isDouble()) {
|
||||
if (widthSpec.toInt() == 0) {
|
||||
if (widthSpec.toInt() == SpecMode::JUST) {
|
||||
view->setWidth(prop.toInt());
|
||||
}
|
||||
}
|
||||
@ -101,7 +101,7 @@ void DoricViewNode::blend(QQuickItem *view, QString name, QJsonValue prop) {
|
||||
} else {
|
||||
QJsonValue heightSpec = this->mLayoutConfig["heightSpec"];
|
||||
if (heightSpec.isDouble()) {
|
||||
if (heightSpec.toInt() == 0) {
|
||||
if (heightSpec.toInt() == SpecMode::JUST) {
|
||||
view->setHeight(prop.toInt());
|
||||
}
|
||||
}
|
||||
|
@ -1,12 +1,19 @@
|
||||
#ifndef DORICVIEWNODE_H
|
||||
#define DORICVIEWNODE_H
|
||||
|
||||
#include <QQuickItem>
|
||||
#include <QJsonValue>
|
||||
#include <QJsonObject>
|
||||
#include <QJsonValue>
|
||||
#include <QQuickItem>
|
||||
|
||||
#include "../utils/DoricContextHolder.h"
|
||||
|
||||
class SpecMode {
|
||||
public:
|
||||
const static int JUST = 0;
|
||||
const static int FIT = 1;
|
||||
const static int MOST = 2;
|
||||
};
|
||||
|
||||
class DoricSuperNode;
|
||||
|
||||
class DoricViewNode : public DoricContextHolder {
|
||||
|
Reference in New Issue
Block a user