Thanks for your answer anda_skoa, but I'm not sure I fully understand.
Right now, I create a context menu (QMenu) with the QTreeWidget as parent, then add an action to that menu that will delete the selected item(s):
...
menu->addAction
("Delete",
this,
SLOT(slot_delete
()),
QKeySequence(Qt
::Key_Delete));
...
menu->exec(treeWidget()->mapToGlobal(point));
QMenu* menu = new QMenu(treeWidget());
...
menu->addAction("Delete", this, SLOT(slot_delete()), QKeySequence(Qt::Key_Delete));
...
menu->exec(treeWidget()->mapToGlobal(point));
To copy to clipboard, switch view to plain text mode
And here is a slot_delete():
void MyItem::slot_delete()
{
// Do a bunch of stuff here, might take some time.
delete this;
}
void MyItem::slot_delete()
{
// Do a bunch of stuff here, might take some time.
delete this;
}
To copy to clipboard, switch view to plain text mode
How would I change this?
I'm not sure how first hiding or taking out the item in slot_delete() would fix the problem.
Bookmarks