From 1796818640973ee44173f2d47534ccc8865ab1bd Mon Sep 17 00:00:00 2001 From: Pieter Hijma Date: Thu, 4 Jul 2024 00:34:04 +0200 Subject: [PATCH] Gui: Add font data to VarSet dialog --- src/Gui/DlgAddPropertyVarSet.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Gui/DlgAddPropertyVarSet.cpp b/src/Gui/DlgAddPropertyVarSet.cpp index d44e5a9747..f00b62c7a9 100644 --- a/src/Gui/DlgAddPropertyVarSet.cpp +++ b/src/Gui/DlgAddPropertyVarSet.cpp @@ -222,11 +222,14 @@ static PropertyEditor::PropertyItem *createPropertyItem(App::Property *prop) return item; } -void DlgAddPropertyVarSet::addEditor(PropertyEditor::PropertyItem* propertyItem, std::string& /*type*/) +void DlgAddPropertyVarSet::addEditor(PropertyEditor::PropertyItem* propertyItem, std::string& type) { editor.reset(propertyItem->createEditor(this, [this]() { this->valueChanged(); })); + if (type == "App::PropertyFont") { + propertyItem->setEditorData(editor.get(), QVariant()); + } editor->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); editor->setObjectName(QString::fromUtf8("editor")); auto formLayout = qobject_cast(layout()); @@ -274,7 +277,7 @@ void DlgAddPropertyVarSet::createProperty(std::string& name, std::string& group) if (propertyItem && isTypeWithEditor(type)) { propertyItem->setPropertyData({prop}); propertyItem->bind(*objectIdentifier); - addEditor(propertyItem.get(), type); + addEditor(propertyItem.get(), type); } setOkEnabled(true);