Fix qt warning

Try to call deleteLater on a nullptr would cause qt print warning message: "QCoreApplication::notify: Unexpected null receiver"
master
Jeremy Hu 2018-10-24 06:51:33 +08:00
parent d663876c5c
commit f2849a020f
1 changed files with 2 additions and 1 deletions

View File

@ -47,7 +47,8 @@ void MotionClipWidget::setClip(SkeletonMotionClip clip)
void MotionClipWidget::reload() void MotionClipWidget::reload()
{ {
m_reloadToWidget->deleteLater(); if (nullptr != m_reloadToWidget)
m_reloadToWidget->deleteLater();
m_reloadToWidget = new QWidget(this); m_reloadToWidget = new QWidget(this);
m_reloadToWidget->setContentsMargins(1, 0, 0, 0); m_reloadToWidget->setContentsMargins(1, 0, 0, 0);
m_reloadToWidget->setFixedSize(preferredSize()); m_reloadToWidget->setFixedSize(preferredSize());