forked from qt-creator/qt-creator
EffectMaker: Add clear all nodes button
Fixes: QDS-11335 Change-Id: I5d0e0e11baabe780c19234410814a9f6eb45130d Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
@@ -129,8 +129,7 @@ void EffectMakerModel::moveNode(int fromIdx, int toIdx)
|
||||
void EffectMakerModel::removeNode(int idx)
|
||||
{
|
||||
beginRemoveRows({}, idx, idx);
|
||||
CompositionNode *node = m_nodes.at(idx);
|
||||
m_nodes.removeAt(idx);
|
||||
CompositionNode *node = m_nodes.takeAt(idx);
|
||||
delete node;
|
||||
endRemoveRows();
|
||||
|
||||
@@ -140,6 +139,16 @@ void EffectMakerModel::removeNode(int idx)
|
||||
bakeShaders();
|
||||
}
|
||||
|
||||
void EffectMakerModel::removeAllNodes()
|
||||
{
|
||||
beginResetModel();
|
||||
qDeleteAll(m_nodes);
|
||||
m_nodes.clear();
|
||||
endResetModel();
|
||||
|
||||
setIsEmpty(true);
|
||||
}
|
||||
|
||||
QString EffectMakerModel::fragmentShader() const
|
||||
{
|
||||
return m_fragmentShader;
|
||||
|
||||
Reference in New Issue
Block a user