From cf1eeaab19da2d2a6eaaba3ae6bd1fc8ad620552 Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 17 Apr 2024 10:00:14 +0200 Subject: [PATCH] Gui: In property editor disable widget of Placement property is not part of a DocumentObject --- src/Gui/propertyeditor/PropertyItem.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Gui/propertyeditor/PropertyItem.cpp b/src/Gui/propertyeditor/PropertyItem.cpp index f1cfcb42ce..68f47ab629 100644 --- a/src/Gui/propertyeditor/PropertyItem.cpp +++ b/src/Gui/propertyeditor/PropertyItem.cpp @@ -2713,7 +2713,13 @@ QWidget* PropertyPlacementItem::createEditor(QWidget* parent, const QObject* rec { auto pe = new PlacementEditor(this->propertyName(), parent); QObject::connect(pe, SIGNAL(valueChanged(const QVariant &)), receiver, method); - pe->setDisabled(isReadOnly()); + + // The Placement dialog only works if property is part of a DocumentObject + bool readonly = isReadOnly(); + if (auto prop = getFirstProperty()) { + readonly |= (!prop->getContainer()->isDerivedFrom()); + } + pe->setDisabled(readonly); return pe; }