Fix rig result doesn't reset after document changed

master
Jeremy Hu 2018-10-22 07:56:56 +08:00
parent 34e2ac1fef
commit 09200c920d
3 changed files with 13 additions and 4 deletions

View File

@ -25,7 +25,7 @@ MotionManageWidget::MotionManageWidget(const SkeletonDocument *document, QWidget
infoLabel->setText(tr("Missing Rig"));
infoLabel->show();
connect(m_document, &SkeletonDocument::resultRigChanged, this, [=]() {
auto refreshInfoLabel = [=]() {
if (m_document->currentRigSucceed()) {
infoLabel->hide();
addMotionButton->show();
@ -33,7 +33,10 @@ MotionManageWidget::MotionManageWidget(const SkeletonDocument *document, QWidget
infoLabel->show();
addMotionButton->hide();
}
});
};
connect(m_document, &SkeletonDocument::resultRigChanged, this, refreshInfoLabel);
connect(m_document, &SkeletonDocument::cleanup, this, refreshInfoLabel);
QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addWidget(infoLabel);

View File

@ -25,7 +25,7 @@ PoseManageWidget::PoseManageWidget(const SkeletonDocument *document, QWidget *pa
infoLabel->setText(tr("Missing Rig"));
infoLabel->show();
connect(m_document, &SkeletonDocument::resultRigChanged, this, [=]() {
auto refreshInfoLabel = [=]() {
if (m_document->currentRigSucceed()) {
infoLabel->hide();
addPoseButton->show();
@ -33,7 +33,10 @@ PoseManageWidget::PoseManageWidget(const SkeletonDocument *document, QWidget *pa
infoLabel->show();
addPoseButton->hide();
}
});
};
connect(m_document, &SkeletonDocument::resultRigChanged, this, refreshInfoLabel);
connect(m_document, &SkeletonDocument::cleanup, this, refreshInfoLabel);
QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addWidget(infoLabel);

View File

@ -1375,6 +1375,7 @@ void SkeletonDocument::reset()
motionMap.clear();
motionIdList.clear();
rootComponent = SkeletonComponent();
removeRigResults();
emit cleanup();
emit skeletonChanged();
}
@ -2742,6 +2743,8 @@ void SkeletonDocument::removeRigResults()
m_resultRigErrorMarkNames.clear();
m_resultRigMissingMarkNames.clear();
m_currentRigSucceed = false;
emit resultRigChanged();
}