File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,6 +43,10 @@ void ImageViewer::setImage(const QImage &image) {
4343 this ->image ->setPixmap (pixmap);
4444}
4545
46+ void ImageViewer::fitToView () {
47+ this ->fitInView (this ->image , Qt::KeepAspectRatio);
48+ }
49+
4650void ImageViewer::clear () {
4751 this ->image ->setPixmap (QPixmap ());
4852}
Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ class ImageViewer : public QGraphicsView {
4040 ImageViewer (ImageViewer &&T) = delete ;
4141 ~ImageViewer () = default ;
4242 void setImage (const QImage &image);
43+ void fitToView ();
4344 void clear ();
4445 void setRectangle (const QRect &rect);
4546
Original file line number Diff line number Diff line change @@ -562,6 +562,7 @@ void Interactive::openFolder(QString path) {
562562 videoStatus = true ;
563563 }
564564 display (0 );
565+ ui->display ->fitToView ();
565566 crop ();
566567 }
567568 // If an error occurs during the opening, resets the information table and warns the user
Original file line number Diff line number Diff line change @@ -422,6 +422,7 @@ void Replay::loadReplay(const QString& dir) {
422422 ui->annotation ->blockSignals (true );
423423 ui->replaySlider ->setValue (1 ); // To force the change
424424 ui->replaySlider ->setValue (0 );
425+ ui->replayDisplay ->fitToView ();
425426 ui->annotation ->blockSignals (false );
426427 emit opened (isReplayable);
427428 }
You can’t perform that action at this time.
0 commit comments