How To Delete an Item by knowing its WidgetItem? and Is it Safe to Delete a WidgetItem without Deleting the Item itself?
Unsolved
General and Desktop
-
wrote on 15 Oct 2024, 20:53 last edited by
Hello Everyone! I am a Beginner Qt Developer who started learning it 1 month ago.
As you Can See at the line 106 in the Image Below:
at that line, I Deleted the tempyitemwidget Which is a widget item for an item in a qlistwidget.So Basically The Questions:
- Is it Safe and Fast to Delete the WidgetItem inside the item, instead of Deleting the Item itself?
- will The item be Deleted if its itemwidget is deleted?
- Is There any way to Find By Knowing its itemwidget only? And then at the End Delete it?
Thanks for everyone!
-
wrote on 15 Oct 2024, 21:50 last edited by ankou29666
Hi
please prefer posting your code as text rather than screenshot.
Your questions are a little unclear to me, but if I understand it right, at least for the two first
- yes you can safely delete an object from within it's parent or from any other object, however, if you ever want an object to delete itself, I would rather suggest doing this->deletelater() ;
- no the deleter is not deleted
- please reformulate correctly
1/2