18 #include <QStringList>
26 qDeleteAll(m_Children);
35 if (!child->
GetData(0).toString().contains(
'.'))
38 bool nodeAlreadyExists =
false;
40 for (
int i = 0; i < m_Children.count(); ++i)
42 if (m_Children[i]->
GetData(0).toString() == child->
GetData(0).toString())
44 if (m_Children[i]->
GetData(1).isNull() && child->
GetData(1).isValid())
45 m_Children[i]->m_Data[1] = child->m_Data[1];
47 nodeAlreadyExists =
true;
52 if (!nodeAlreadyExists)
54 m_Children.append(child);
55 child->m_Parent =
this;
61 QStringList names = child->
GetData(0).toString().split(
'.');
66 for (
int i = 0; i < names.count(); ++i)
68 if (i != names.count() - 1)
73 for (
int j = 0; j < currentParent->m_Children.count(); ++j)
75 if (currentParent->m_Children[j]->GetData(0).toString() == names[i])
77 currentChild = currentParent->m_Children[j];
83 if (currentChild ==
nullptr)
86 data << names[i] << QVariant();
92 currentParent = currentChild;
98 data << names[i] << child->m_Data[1];
111 return m_Children.value(row);
116 return m_Children.count();
121 return m_Data.count();
126 return m_Data.value(column);
136 if (m_Parent !=
nullptr)
137 return m_Parent->m_Children.indexOf(
this);
int GetColumnCount() const
void AppendChild(QmitkPropertyItem *child)
int GetChildCount() const
QmitkPropertyItem(const QList< QVariant > &data)
QVariant GetData(int column) const
QmitkPropertyItem * GetChild(int row) const
QmitkPropertyItem * GetParent() const