samedi 23 juillet 2016
How to remove widget from QAbstractItemView
QAbstractItemView has `setIndexWidget but doesn't have "remove" function.
I tried to work it around by storing widgets that are passed to QAbstractItemView and hide / delete them when I want to remove them from the view, which ends up with RuntimeError: wrapped C/C++ object of %S has been deleted error. I assume that is due to the ownership of the widgets are passed to viewport, as the doc says:
Sets the given widget on the item at the given index, passing the ownership of the widget to the viewport.
How can I remove widgets?
I'm using PyQt but I assume it's valid question for C++ and PySide too.
Inscription à :
Publier les commentaires (Atom)
Aucun commentaire:
Enregistrer un commentaire