Nominate our 2022 Qt Champions!

Corresponding Qt function

  • Hello forum.

    I am trying to port an wxwidget application to qt and i am stuck with the following function.

    wxTreeItemId AppendItem(const wxTreeItemId& parent, const wxString& text, int image = -1, int selImage = -1, wxTreeItemData* data = NULL)

    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?


  • 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":

    and then you can use "indexOfChild": to get the inserted item's index.

Log in to reply