A quick question:
QWidget::setLayout takes ownership of the layout and QLayout::addWidget takes ownership of the passed widgets. How does it know when to delete an object and when not? Or: why does this work:
Qt Code:
{ public: test() { l->addWidget(&bar); setLayout(l); } QScrollBar bar; };To copy to clipboard, switch view to plain text mode
Why doesn't a double free occur, once when the layout discards the scrollbar and once when the test dtor?
Bookmarks