diff --git a/src/motionmanagewidget.cpp b/src/motionmanagewidget.cpp index f38e1e82..1b337976 100644 --- a/src/motionmanagewidget.cpp +++ b/src/motionmanagewidget.cpp @@ -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); diff --git a/src/posemanagewidget.cpp b/src/posemanagewidget.cpp index 8388429f..70f9c801 100644 --- a/src/posemanagewidget.cpp +++ b/src/posemanagewidget.cpp @@ -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); diff --git a/src/skeletondocument.cpp b/src/skeletondocument.cpp index 20db327d..a79dbd06 100644 --- a/src/skeletondocument.cpp +++ b/src/skeletondocument.cpp @@ -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(); }