mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-05 18:54:14 +02:00
Conductor dock: apply edits live, edit via label, fill height (#500)
Addresses the testing feedback on the conductor selection-properties prototype: 1. Edits were never applied. The dock drives every editor through setLiveEdit(true), which each editor overrides to connect its field changes to apply(); ConductorPropertiesEditorWidget didn't override it, so the call was a no-op. Implement setLiveEdit() to connect the hosted ConductorPropertiesWidget's controls (commit-style signals) to apply(). A m_updating guard suppresses the signals emitted while the widget is loaded programmatically, so a partial mid-load state is never committed. 2. Clicking a conductor's text label showed nothing, because the label is a ConductorTextItem, not a Conductor. Map it to its parentConductor() in the editor factory, mirroring the double-click-the-label dialog behaviour. 3. The panel sat at a small size hint with empty space below it. Give the editor an Expanding vertical size policy (and a minimum height) so it fills the dock like the other editors. Refs #500 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
#include "../qetgraphicsitem/ViewItem/ui/graphicstablepropertieseditor.h"
|
||||
#include "../qetgraphicsitem/ViewItem/ui/projectdbmodelpropertieswidget.h"
|
||||
#include "../qetgraphicsitem/conductor.h"
|
||||
#include "../qetgraphicsitem/conductortextitem.h"
|
||||
#include "../qetgraphicsitem/diagramimageitem.h"
|
||||
#include "../qetgraphicsitem/dynamicelementtextitem.h"
|
||||
#include "../qetgraphicsitem/element.h"
|
||||
@@ -86,6 +87,17 @@ PropertiesEditorWidget *PropertiesEditorFactory::propertiesEditor(
|
||||
return nullptr;
|
||||
}
|
||||
QGraphicsItem *item = items.first();
|
||||
|
||||
//Selecting a conductor's text label edits its parent conductor (#500),
|
||||
//mirroring how double-clicking the label opens the conductor dialog.
|
||||
if (count_ == 1) {
|
||||
if (auto *cti = qgraphicsitem_cast<ConductorTextItem *>(item)) {
|
||||
if (Conductor *parent_cond = cti->parentConductor()) {
|
||||
items = {parent_cond};
|
||||
item = parent_cond;
|
||||
}
|
||||
}
|
||||
}
|
||||
const int type_ = item->type();
|
||||
|
||||
//The editor widget can only edit one item
|
||||
|
||||
Reference in New Issue
Block a user