Hi everyone,
I am developing a program which creates dynamically labels and saves their handles in a QList.
The labels are created OnMouse click and are destroyed OnMouse double click.
Actually the program runs without problems, but I wonder if I am doing a correct usage of pointers in order to prevent runtime errors: I would like to know if the memory correspondent to the created label pointers will exists till mouseDoubleClick_slot is called.
Here below an extract of my code.
Qt Code:
QList<QLabel*> *tipList; // declared in the .h file { tipList->append(tip); // ... } { if (tipList->size()) { for(int i=0; i<(tipList->size()); i++) { delete tipTmp; } tipList->clear(); } }To copy to clipboard, switch view to plain text mode
Bookmarks