QTreeWidget



  • Hello forum,

    I am pulling out the invisible root item from an qtreewidget with the following command:

    [code]
    QTreeWidgetItem *rootItem = treewidget->invisibleRootItem();
    [/code]

    Then i initilialize another tree widget item where we have the rootitem as the parent

    [code]
    QTreeWidgetItem *new_widget_item = new QTreeWidgetItem(rootItem);
    new_widget_item->setText(0,QString(tree_string.c_str()));
    [/code]

    Now i want to insert the new_widget_item into the qtreewidget object and i do not find any relevant function to it.

    Any hint?

    Regards
    Sajjad



  • You create a toplevel item. Insert this with "QTreeWidget::addTopLevelItem() ":/doc/qt-4.8/qtreewidget.html#addTopLevelItem or "QTreeWidget::insertTopLevelItem() ":/doc/qt-4.8/qtreewidget.html#insertTopLevelItem.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.