now i use the struct of exemple tree view ok ... but i don't do the this function
class TreeNode
{
public:
~TreeNode()
{
qDeleteAll(m_children);
}
void appendChild(TreeNode *c)
{
m_children.append(c);
}
void removeChild(int row)
{
m_children.removeAt(row);
}
void deleteChildRecursively(int row)
{
TreeNode *c = m_children.takeAt(row);
delete c;
}
private:
TreeNode *m_parent;
QList<TreeNode*> m_children;
};
class TreeNode
{
public:
~TreeNode()
{
qDeleteAll(m_children);
}
void appendChild(TreeNode *c)
{
m_children.append(c);
}
void removeChild(int row)
{
m_children.removeAt(row);
}
void deleteChildRecursively(int row)
{
TreeNode *c = m_children.takeAt(row);
delete c;
}
private:
TreeNode *m_parent;
QList<TreeNode*> m_children;
};
To copy to clipboard, switch view to plain text mode
how can access item of model ???
example
insert a child in the parent specify
parent_z
child1
child2
......
insert(child3) into parent_z
......
parent_z
child1
child2
child3
parent_z
child1
child2
......
insert(child3) into parent_z
......
parent_z
child1
child2
child3
To copy to clipboard, switch view to plain text mode
Bookmarks