From 6a2094614ce9cad0130b3c4165b1e31fe7b66c1a Mon Sep 17 00:00:00 2001 From: Josh Klontz Date: Tue, 13 Jan 2015 13:53:37 -0500 Subject: [PATCH] make sure ImageViewer redraws after a resize event --- openbr/gui/imageviewer.cpp | 5 +++++ openbr/gui/imageviewer.h | 1 + 2 files changed, 6 insertions(+), 0 deletions(-) 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 -- libgit2 0.21.4