25{
26 Q_UNUSED(option);
27 const dbe::models::tableselection* Model =
dynamic_cast<const dbe::models::tableselection*
>(
index.model());
28
29 const dbe::models::table* SourceModel = dynamic_cast<const dbe::models::table*>(Model->sourceModel());
30
31 TableNode* Item = Model->
getnode(index);
32
34
35 if (Model == nullptr) {
36 return nullptr;
37 }
38
39 if (
index.column() == 0) {
41 return nullptr;
42 }
43
44 if (dynamic_cast<TableRelationshipNode*>(Item)) {
45 TableRelationshipNode* RelationshipItem = dynamic_cast<TableRelationshipNode*>(Item);
46 dunedaq::conffwk::relationship_t RelationshipData = RelationshipItem->GetRelationship();
47 widgets::editors::relation* Editor = new widgets::editors::relation(RelationshipData);
48 connect(Editor, SIGNAL(signal_edit_end()),
this, SLOT(
CommitAndClose()));
49 connect(Editor, SIGNAL(signal_force_close()),
this, SLOT(
Close()));
50 return Editor;
51 } else if (dynamic_cast<TableAttributeNode*>(Item)) {
52 TableAttributeNode* AttributeItem = dynamic_cast<TableAttributeNode*>(Item);
53 dunedaq::conffwk::attribute_t AttributeData = AttributeItem->GetAttribute();
54
56 widgets::editors::multiattr* widget = new widgets::editors::multiattr(AttributeData);
57 connect(widget, SIGNAL(signal_edit_end()),
this, SLOT(
CommitAndClose()));
58 connect(widget, SIGNAL(signal_force_close()),
this, SLOT(
Close()));
59 return widget;
60 } else {
61 switch (AttributeData.
p_type) {
62
64
66
68 widgets::editors::stringattr* Editor = new widgets::editors::stringattr(AttributeData, parent);
69 connect(Editor, SIGNAL(signal_edit_end()),
this, SLOT(
CommitAndClose()));
70 connect(Editor, SIGNAL(signal_force_close()),
this, SLOT(
Close()));
71 return Editor;
72 }
73
75
77
79
81
83
85
87
89
91
93 widgets::editors::numericattr* Editor = new widgets::editors::numericattr(AttributeData, parent);
94 connect(Editor, SIGNAL(signal_edit_end()),
this, SLOT(
CommitAndClose()));
95 connect(Editor, SIGNAL(signal_force_close()),
this, SLOT(
Close()));
96 return Editor;
97 }
98
100
102 widgets::editors::combo* Editor = new widgets::editors::combo(AttributeData, parent);
103 connect(Editor, SIGNAL(signal_value_change()),
this, SLOT(
CommitAndClose()));
104 connect(Editor, SIGNAL(signal_force_close()),
this, SLOT(
Close()));
105 return Editor;
106 }
107
109 widgets::editors::combo* Editor = new widgets::editors::combo(AttributeData, parent);
110 connect(Editor, SIGNAL(signal_edit_end()),
this, SLOT(
CommitAndClose()));
111 connect(Editor, SIGNAL(signal_force_close()),
this, SLOT(
Close()));
112 return Editor;
113 }
114
115 default:
116 break;
117 }
118 }
119 }
120
121 return nullptr;
122}
void CreateObjectEditorSignal(tref Object) const
tref GetTableObject(int ObjectIndex) const
TableNode * getnode(const QModelIndex &index) const
inner::configobject::tref tref