forked from qt-creator/qt-creator
Improve memory management in project window.
* Panel struct does no longer take ownership of its widget. * Panels consitently delete their widget in their destructor. Reviewed-By: dt
This commit is contained in:
@@ -68,21 +68,25 @@ public:
|
||||
// Adds a widget
|
||||
void addWidget(QWidget *widget);
|
||||
void addWidget(const QString &name, QWidget *widget);
|
||||
void removeWidget(QWidget *widget);
|
||||
|
||||
// Removes all widgets and deletes them
|
||||
void clear();
|
||||
private:
|
||||
|
||||
private:
|
||||
struct Panel
|
||||
{
|
||||
// This does not take ownership of widget!
|
||||
explicit Panel(QWidget * widget);
|
||||
~Panel();
|
||||
|
||||
QSpacerItem *spacer;
|
||||
QLabel *nameLabel;
|
||||
QWidget *panelWidget;
|
||||
QHBoxLayout *marginLayout;
|
||||
};
|
||||
QList<Panel *> m_panels;
|
||||
|
||||
QVBoxLayout *m_layout;
|
||||
QList<Panel> m_panels;
|
||||
};
|
||||
|
||||
class BuildConfigurationComboBox : public QStackedWidget
|
||||
|
||||
Reference in New Issue
Block a user