There is a function called by pressing a button. The function has a call to the clear () method to clear the QListWidget and then fill it. The problem is that when you call the function again, the program crashes, referring to the fact that the memory cannot be cleared. However, if you clear clear (), the previous items in the QListWidget will remain.
- Code show, so do not understand - Pavel Parshin
- It turns out QT is too independent. I stored the QListWidgetItem array in order not to lose memory, and each time I entered the function, I cleared it to re-create it. And the Clear () method clears the memory of the used item, and as a result it turned out that when calling clear () there was already almost nothing to clean (except for the headers, but it’s so meticulous, it needs to completely kill them). - Dark Dead Dragon
|