From f363670934483919550a0379f0c952a6a8e89610 Mon Sep 17 00:00:00 2001 From: Dominik Kleiser Date: Fri, 17 Jul 2015 20:02:01 +0200 Subject: [PATCH] Bug #3800 - Resize viewport when CV_WINDOW_KEEPRATIO was set (Qt) --- modules/highgui/src/window_QT.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/highgui/src/window_QT.cpp b/modules/highgui/src/window_QT.cpp index d0aad919ee..a01dcd3429 100644 --- a/modules/highgui/src/window_QT.cpp +++ b/modules/highgui/src/window_QT.cpp @@ -2591,6 +2591,7 @@ void DefaultViewPort::resizeEvent(QResizeEvent* evnt) if (fabs(ratioX - ratioY) * 100 > ratioX) //avoid infinity loop / epsilon = 1% of ratioX { resize(newSize); + viewport()->resize(newSize); //move to the middle //newSize get the delta offset to place the picture in the middle of its parent