forked from qt-creator/qt-creator
EffectMaker: Clear composition nodes on view attach
Fixes: QDS-10513 Change-Id: I3d2b1369c4e33fb6e21311c59a92625437382602 Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
This commit is contained in:
@@ -168,6 +168,19 @@ const QString &EffectMakerModel::qmlComponentString() const
|
|||||||
return m_qmlComponentString;
|
return m_qmlComponentString;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EffectMakerModel::clear()
|
||||||
|
{
|
||||||
|
if (m_nodes.isEmpty())
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (CompositionNode *node : std::as_const(m_nodes))
|
||||||
|
delete node;
|
||||||
|
|
||||||
|
m_nodes.clear();
|
||||||
|
|
||||||
|
setIsEmpty(true);
|
||||||
|
}
|
||||||
|
|
||||||
const QList<Uniform *> EffectMakerModel::allUniforms()
|
const QList<Uniform *> EffectMakerModel::allUniforms()
|
||||||
{
|
{
|
||||||
QList<Uniform *> uniforms = {};
|
QList<Uniform *> uniforms = {};
|
||||||
|
|||||||
@@ -70,6 +70,8 @@ public:
|
|||||||
|
|
||||||
const QString &qmlComponentString() const;
|
const QString &qmlComponentString() const;
|
||||||
|
|
||||||
|
void clear();
|
||||||
|
|
||||||
Q_INVOKABLE void updateQmlComponent();
|
Q_INVOKABLE void updateQmlComponent();
|
||||||
|
|
||||||
Q_INVOKABLE void resetEffectError(int type);
|
Q_INVOKABLE void resetEffectError(int type);
|
||||||
|
|||||||
@@ -3,8 +3,9 @@
|
|||||||
|
|
||||||
#include "effectmakerview.h"
|
#include "effectmakerview.h"
|
||||||
|
|
||||||
#include "effectmakerwidget.h"
|
#include "effectmakermodel.h"
|
||||||
#include "effectmakernodesmodel.h"
|
#include "effectmakernodesmodel.h"
|
||||||
|
#include "effectmakerwidget.h"
|
||||||
|
|
||||||
#include "nodeinstanceview.h"
|
#include "nodeinstanceview.h"
|
||||||
#include "qmldesignerconstants.h"
|
#include "qmldesignerconstants.h"
|
||||||
@@ -71,6 +72,7 @@ void EffectMakerView::modelAttached(QmlDesigner::Model *model)
|
|||||||
AbstractView::modelAttached(model);
|
AbstractView::modelAttached(model);
|
||||||
|
|
||||||
m_widget->effectMakerNodesModel()->loadModel();
|
m_widget->effectMakerNodesModel()->loadModel();
|
||||||
|
m_widget->effectMakerModel()->clear();
|
||||||
m_widget->initView();
|
m_widget->initView();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user