Commit 6a2094614ce9cad0130b3c4165b1e31fe7b66c1a
1 parent
e226f069
make sure ImageViewer redraws after a resize event
Showing
2 changed files
with
6 additions
and
0 deletions
openbr/gui/imageviewer.cpp
| @@ -78,6 +78,11 @@ void br::ImageViewer::updatePixmap(QImage image, bool async) | @@ -78,6 +78,11 @@ void br::ImageViewer::updatePixmap(QImage image, bool async) | ||
| 78 | } | 78 | } |
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | +QSize br::ImageViewer::sizeHint() const | ||
| 82 | +{ | ||
| 83 | + return QSize(width(), (src.height() * width() + /* round up */ src.width() - 1) / src.width()); | ||
| 84 | +} | ||
| 85 | + | ||
| 81 | /*** PROTECTED SLOTS ***/ | 86 | /*** PROTECTED SLOTS ***/ |
| 82 | void br::ImageViewer::keyPressEvent(QKeyEvent *event) | 87 | void br::ImageViewer::keyPressEvent(QKeyEvent *event) |
| 83 | { | 88 | { |
openbr/gui/imageviewer.h
| @@ -57,6 +57,7 @@ protected slots: | @@ -57,6 +57,7 @@ protected slots: | ||
| 57 | 57 | ||
| 58 | private slots: | 58 | private slots: |
| 59 | void updatePixmap(QImage image, bool async = false); | 59 | void updatePixmap(QImage image, bool async = false); |
| 60 | + QSize sizeHint() const; | ||
| 60 | }; | 61 | }; |
| 61 | 62 | ||
| 62 | } // namespace br | 63 | } // namespace br |