From ade4e4d96a2b026807019efdc717ed28793b09ad Mon Sep 17 00:00:00 2001 From: Pieter Hijma Date: Mon, 15 Sep 2025 15:07:32 +0200 Subject: [PATCH] Gui: Enable single click expand property editor --- src/Gui/propertyeditor/PropertyEditor.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Gui/propertyeditor/PropertyEditor.cpp b/src/Gui/propertyeditor/PropertyEditor.cpp index d601842b92..2ee9d7428b 100644 --- a/src/Gui/propertyeditor/PropertyEditor.cpp +++ b/src/Gui/propertyeditor/PropertyEditor.cpp @@ -76,7 +76,7 @@ PropertyEditor::PropertyEditor(QWidget* parent) setAlternatingRowColors(true); setRootIsDecorated(false); - setExpandsOnDoubleClick(true); + setExpandsOnDoubleClick(false); #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) QStyleOptionViewItem opt = PropertyEditor::viewOptions(); @@ -411,6 +411,18 @@ void PropertyEditor::openEditor(const QModelIndex& index) void PropertyEditor::onItemActivated(const QModelIndex& index) { + if (!index.isValid()) { + return; + } + if (auto* prop = static_cast(index.internalPointer()); + prop && prop->isSeparator()) { + + // setExpanded() only works on column 0 + QModelIndex idxFirstColum = propertyModel->index(index.row(), 0, index.parent()); + setExpanded(idxFirstColum, !isExpanded(idxFirstColum)); + return; + } + if (index.column() != 1) { return; }