fix: wrong scene rect will be set for :gif:

This commit is contained in:
Gary Wang 2019-10-02 22:53:13 +08:00
parent 31add38e48
commit 096ff5170b

View File

@ -54,6 +54,7 @@ void GraphicsScene::showGif(const QString &filepath)
label->setMovie(movie); label->setMovie(movie);
this->addWidget(label); this->addWidget(label);
movie->start(); movie->start();
m_theThing = this->addRect(QRect(QPoint(0, 0), movie->scaledSize())); m_theThing = this->addRect(QRect(QPoint(0, 0), label->sizeHint()),
QPen(Qt::transparent));
this->setSceneRect(m_theThing->boundingRect()); this->setSceneRect(m_theThing->boundingRect());
} }