Re: QTreeWidget child index
Re: QTreeWidget child index
Well atleast I asked the obvious question in the newbie section :D
The sad part is I went over those sections in the docs many times before I came and asked a stupid question and still missed it. Starting to think this ability to miss the openly obvious might be a medical condition.
Thank you for the help.
Re: QTreeWidget child index
Code:
QList<QTreeWidgetItem *> selected = ui->twg->selectedItems();
if(parent) {
tmp->setText(0, "Dude");
parent->addChild(tmp);
}
Code:
QList<QTreeWidgetItem *> selected = ui->twg->selectedItems();
if(parent) {
int index = parent->indexOfChild(item);
delete parent->takeChild(index);
}