Corresponding Qt function
-
Hello forum.
I am trying to port an wxwidget application to qt and i am stuck with the following function.
[code]
wxTreeItemId AppendItem(const wxTreeItemId& parent, const wxString& text, int image = -1, int selImage = -1, wxTreeItemData* data = NULL)
[/code]The above code does the following:
Appends an item to the end of the branch identified by parent, return a new item id. So it mean that the new item id is the child of the parent.
I am looking for the corresponding function in qtreewidget, but did not find any ?
Could some one in the forum refer me to the right place to look for?
Regards
Sajjad -
If I understand what you require,
You got a parent item and you want to be able to add an item to its list of children?
If so maybe this "addChild":http://qt-project.org/doc/qt-4.8/qtreewidgetitem.html#addChild
and then you can use "indexOfChild":http://qt-project.org/doc/qt-4.8/qtreewidgetitem.html#indexOfChild to get the inserted item's index.