26{
27 Q_UNUSED ( option );
28 const dbe::models::tableselection * Model =
29 dynamic_cast<const dbe::models::tableselection *
> (
index.model() );
30
31 const dbe::models::table * SourceModel = dynamic_cast<const dbe::models::table *> ( Model
32 ->sourceModel() );
33
34 TableNode * Item = Model->
getnode ( index );
35
37
38 if ( Model == nullptr )
39 {
40 return nullptr;
41 }
42
43 if (
index.column() == 0 )
44 {
46 return nullptr;
47 }
48
49 if ( dynamic_cast<TableRelationshipNode *> ( Item ) )
50 {
51 TableRelationshipNode * RelationshipItem = dynamic_cast<TableRelationshipNode *> ( Item );
52 dunedaq::conffwk::relationship_t RelationshipData = RelationshipItem->GetRelationship();
53 widgets::editors::relation * Editor = new widgets::editors::relation ( RelationshipData );
54 connect ( Editor, SIGNAL ( signal_edit_end() ),
this, SLOT (
CommitAndClose() ) );
55 connect ( Editor, SIGNAL ( signal_force_close() ),
this, SLOT (
Close() ) );
56 return Editor;
57 }
58 else if ( dynamic_cast<TableAttributeNode *> ( Item ) )
59 {
60 TableAttributeNode * AttributeItem = dynamic_cast<TableAttributeNode *> ( Item );
61 dunedaq::conffwk::attribute_t AttributeData = AttributeItem->GetAttribute();
62
64 {
65 widgets::editors::multiattr * widget = new widgets::editors::multiattr(AttributeData);
66 connect ( widget, SIGNAL ( signal_edit_end() ),
this, SLOT (
CommitAndClose() ) );
67 connect ( widget, SIGNAL ( signal_force_close() ),
this, SLOT (
Close() ) );
68 return widget;
69 }
70 else
71 {
72 switch ( AttributeData.
p_type )
73 {
74
76
78
80 {
81 widgets::editors::stringattr * Editor = new widgets::editors::stringattr ( AttributeData,
82 parent );
83 connect ( Editor, SIGNAL ( signal_edit_end() ),
this, SLOT (
CommitAndClose() ) );
84 connect ( Editor, SIGNAL ( signal_force_close() ),
this, SLOT (
Close() ) );
85 return Editor;
86 }
87
89
91
93
95
97
99
101
103
105
107 {
108 widgets::editors::numericattr * Editor = new widgets::editors::numericattr ( AttributeData,
109 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
116
118 {
119 widgets::editors::combo * Editor = new widgets::editors::combo ( AttributeData, parent );
120 connect ( Editor, SIGNAL ( signal_value_change() ),
this, SLOT (
CommitAndClose() ) );
121 connect ( Editor, SIGNAL ( signal_force_close() ),
this, SLOT (
Close() ) );
122 return Editor;
123 }
124
126 {
127 widgets::editors::combo * Editor = new widgets::editors::combo ( AttributeData, parent );
128 connect ( Editor, SIGNAL ( signal_edit_end() ),
this, SLOT (
CommitAndClose() ) );
129 connect ( Editor, SIGNAL ( signal_force_close() ),
this, SLOT (
Close() ) );
130 return Editor;
131 }
132
133 default:
134 break;
135 }
136 }
137 }
138
139 return nullptr;
140}
void CreateObjectEditorSignal(tref Object) const
tref GetTableObject(int ObjectIndex) const
TableNode * getnode(const QModelIndex &index) const
inner::configobject::tref tref