Animation Editor: Morph targets window shows duplicated morph targets (#5831)

Dialog stack wasn't deleting the morph target widgets after reinitializing the window which ended up in duplicated morph targets

Signed-off-by: Benjamin Jillich <jillich@amazon.com>
This commit is contained in:
Benjamin Jillich
2021-11-23 08:55:53 +01:00
committed by GitHub
parent ebd679d8cf
commit 2fbb2a73c6
2 changed files with 11 additions and 15 deletions
@@ -71,8 +71,6 @@ namespace MysticQt
setWidget(m_rootSplitter);
}
// destructor
DialogStack::~DialogStack()
{
}
@@ -81,6 +79,14 @@ namespace MysticQt
// get rid of all dialogs and their allocated memory
void DialogStack::Clear()
{
for (Dialog& dialog : m_dialogs)
{
if (dialog.m_dialogWidget)
{
dialog.m_dialogWidget->deleteLater();
}
}
// destroy the dialogs
m_dialogs.clear();
@@ -679,6 +685,4 @@ namespace MysticQt
return;
}
}
} // namespace MysticQt
#include <MysticQt/Source/moc_DialogStack.cpp>
} // namespace MysticQt
@@ -6,10 +6,8 @@
*
*/
#ifndef __MYSTICQT_DIALOGSTACK_H
#define __MYSTICQT_DIALOGSTACK_H
#pragma once
//
#if !defined(Q_MOC_RUN)
#include "MysticQtConfig.h"
#include <QtWidgets/QWidget>
@@ -30,14 +28,10 @@ namespace MysticQt
{
class DialogStackSplitter;
/**
*
*
*/
class MYSTICQT_API DialogStack
: public QScrollArea
{
Q_OBJECT
Q_OBJECT // AUTOMOC
public:
DialogStack(QWidget* parent = nullptr);
@@ -89,5 +83,3 @@ namespace MysticQt
int32 m_prevMouseY;
};
} // namespace MysticQt
#endif