forked from qt-creator/qt-creator
Utils: Actually delete subwidgets on finish()
In the context of option pages, finish() means that the dialog is dismissed somehow. Keeping the widgets around for subsequent re-use is ok in principle, on the other hand it's a matter of hygiene and give a defined clean slate next time addToLayout() is used. This has not much practical impact yet as most option pages do not forward finish() to their aspects right now. Change-Id: Ifd591e3fa0d07c7943e86eb5474429efae2887f9 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -429,7 +429,8 @@ void BaseAspect::cancel()
|
||||
|
||||
void BaseAspect::finish()
|
||||
{
|
||||
// FIXME: Delete widgets?
|
||||
qDeleteAll(d->m_subWidgets);
|
||||
d->m_subWidgets.clear();
|
||||
}
|
||||
|
||||
bool BaseAspect::hasAction() const
|
||||
@@ -1448,6 +1449,12 @@ void SelectionAspect::setVolatileValue(const QVariant &val)
|
||||
}
|
||||
}
|
||||
|
||||
void SelectionAspect::finish()
|
||||
{
|
||||
BaseAspect::finish();
|
||||
delete d->m_buttonGroup;
|
||||
}
|
||||
|
||||
void SelectionAspect::setDisplayStyle(SelectionAspect::DisplayStyle style)
|
||||
{
|
||||
d->m_displayStyle = style;
|
||||
|
@@ -245,6 +245,7 @@ public:
|
||||
void addToLayout(LayoutBuilder &builder) override;
|
||||
QVariant volatileValue() const override;
|
||||
void setVolatileValue(const QVariant &val) override;
|
||||
void finish() override;
|
||||
|
||||
int value() const;
|
||||
void setValue(int val);
|
||||
|
Reference in New Issue
Block a user