Hey everyone!
I have a very basic question.
Usually, I save the pointer to dynamically created objects as members of the class that created it.
However, in Qt there is this automatic dealing with pointers by parent objects.
Can I create a simple label dynamically within the constructor of a selfmade dialog, add it to a layout and this is it?
Some thing like
Qt Code:
// constructor of MyDialog class /////////////////////////////////// { newLay.add(newLbl); }To copy to clipboard, switch view to plain text mode
The QDialog is just an example. It could be also any ordinary class that inherits QWidget.
I was doing it like this for a while and it seemed to work out fine. However, when I used such a selfmade widget within a QTabWidget. All the labels are gone.
Any answer would be appreciated.
David
Bookmarks