diff --git a/openbr/gui/imageviewer.cpp b/openbr/gui/imageviewer.cpp index 807aa37..ea2d6e9 100644 --- a/openbr/gui/imageviewer.cpp +++ b/openbr/gui/imageviewer.cpp @@ -78,6 +78,11 @@ void br::ImageViewer::updatePixmap(QImage image, bool async) } } +QSize br::ImageViewer::sizeHint() const +{ + return QSize(width(), (src.height() * width() + /* round up */ src.width() - 1) / src.width()); +} + /*** PROTECTED SLOTS ***/ void br::ImageViewer::keyPressEvent(QKeyEvent *event) { diff --git a/openbr/gui/imageviewer.h b/openbr/gui/imageviewer.h index 072f33c..3e9612f 100644 --- a/openbr/gui/imageviewer.h +++ b/openbr/gui/imageviewer.h @@ -57,6 +57,7 @@ protected slots: private slots: void updatePixmap(QImage image, bool async = false); + QSize sizeHint() const; }; } // namespace br