aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp')
-rw-r--r--src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp69
1 files changed, 60 insertions, 9 deletions
diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp
index ddded6400b..bf2243d09f 100644
--- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp
+++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp
@@ -47,6 +47,8 @@
#include <QApplication>
#include <QDir>
#include <QFileInfo>
+#include <QVector3D>
+#include <QVector2D>
#include <QLoggingCategory>
@@ -166,10 +168,34 @@ QVariant properDefaultAuxiliaryProperties(const QmlObjectNode &qmlObjectNode,
return 0;
else if (propertyName == "breakPoint")
return 50;
+ else if (propertyName == "transitionType")
+ return 0;
+ else if (propertyName == "type")
+ return 0;
+ else if (propertyName == "transitionRadius")
+ return 8;
+ else if (propertyName == "radius")
+ return 8;
+ else if (propertyName == "transitionBezier")
+ return 50;
+ else if (propertyName == "bezier")
+ return 50;
+ else if (propertyName == "labelPosition")
+ return 50.0;
+ else if (propertyName == "labelFlipSide")
+ return false;
else if (propertyName == "customId")
return QString();
else if (propertyName == "joinConnection")
return false;
+ else if (propertyName == "blockSize")
+ return 200;
+ else if (propertyName == "blockRadius")
+ return 18;
+ else if (propertyName == "showDialogLabel")
+ return false;
+ else if (propertyName == "dialogLabelPosition")
+ return Qt::TopRightCorner;
return {};
}
@@ -235,17 +261,17 @@ void PropertyEditorQmlBackend::setupAuxiliaryProperties(const QmlObjectNode &qml
propertyNames.append("customId");
if (itemNode.isFlowTransition()) {
- propertyNames.append({"color", "width", "inOffset", "outOffset", "dash", "breakPoint"});
+ propertyNames.append({"color", "width", "inOffset", "outOffset", "dash", "breakPoint", "type", "radius", "bezier", "labelPosition", "labelFlipSide"});
} else if (itemNode.isFlowItem()) {
propertyNames.append({"color", "width", "inOffset", "outOffset", "joinConnection"});
} else if (itemNode.isFlowActionArea()) {
propertyNames.append({"color", "width", "fillColor", "outOffset", "dash"});
} else if (itemNode.isFlowDecision()) {
- propertyNames.append({"color", "width", "fillColor", "dash"});
+ propertyNames.append({"color", "width", "fillColor", "dash", "blockSize", "blockRadius", "showDialogLabel", "dialogLabelPosition"});
} else if (itemNode.isFlowWildcard()) {
- propertyNames.append({"color", "width", "fillColor", "dash"});
+ propertyNames.append({"color", "width", "fillColor", "dash", "blockSize", "blockRadius"});
} else if (itemNode.isFlowView()) {
- propertyNames.append({"transitionColor", "areaColor", "areaFillColor", "blockColor" });
+ propertyNames.append({"transitionColor", "areaColor", "areaFillColor", "blockColor", "transitionType", "transitionRadius", "transitionBezier"});
}
for (const PropertyName &propertyName : propertyNames) {
@@ -294,11 +320,36 @@ void PropertyEditorQmlBackend::createPropertyEditorValue(const QmlObjectNode &qm
void PropertyEditorQmlBackend::setValue(const QmlObjectNode & , const PropertyName &name, const QVariant &value)
{
- PropertyName propertyName = name;
- propertyName.replace('.', '_');
- auto propertyValue = qobject_cast<PropertyEditorValue*>(variantToQObject(m_backendValuesPropertyMap.value(QString::fromUtf8(propertyName))));
- if (propertyValue)
- propertyValue->setValue(value);
+ // Vector*D values need to be split into their subcomponents
+ if (value.type() == QVariant::Vector2D) {
+ const char *suffix[2] = {"_x", "_y"};
+ auto vecValue = value.value<QVector2D>();
+ for (int i = 0; i < 2; ++i) {
+ PropertyName subPropName(name.size() + 2, '\0');
+ subPropName.replace(0, name.size(), name);
+ subPropName.replace(name.size(), 2, suffix[i]);
+ auto propertyValue = qobject_cast<PropertyEditorValue *>(variantToQObject(m_backendValuesPropertyMap.value(QString::fromUtf8(subPropName))));
+ if (propertyValue)
+ propertyValue->setValue(QVariant(vecValue[i]));
+ }
+ } else if (value.type() == QVariant::Vector3D) {
+ const char *suffix[3] = {"_x", "_y", "_z"};
+ auto vecValue = value.value<QVector3D>();
+ for (int i = 0; i < 3; ++i) {
+ PropertyName subPropName(name.size() + 2, '\0');
+ subPropName.replace(0, name.size(), name);
+ subPropName.replace(name.size(), 2, suffix[i]);
+ auto propertyValue = qobject_cast<PropertyEditorValue *>(variantToQObject(m_backendValuesPropertyMap.value(QString::fromUtf8(subPropName))));
+ if (propertyValue)
+ propertyValue->setValue(QVariant(vecValue[i]));
+ }
+ } else {
+ PropertyName propertyName = name;
+ propertyName.replace('.', '_');
+ auto propertyValue = qobject_cast<PropertyEditorValue *>(variantToQObject(m_backendValuesPropertyMap.value(QString::fromUtf8(propertyName))));
+ if (propertyValue)
+ propertyValue->setValue(value);
+ }
}
QQmlContext *PropertyEditorQmlBackend::context() {