How to keep physical window size constant when working with multiple monitors?
-
I have a frameless window with a custom drop shadow applied to it, with a fixed sized widget in the window. The issue I'm having is that if I move the window between monitors with different DPIs the window resizes, which results in the drop shadow being drawn in the top left corner of the window, while the widget is drawn on the bottom right. The effect is that the drop shadow is 'split' from the widget when the window is resized.
Is there any way to prevent a window from being resized in this case? I tried setting the size policy of it but that didn't work.
-
Hi
Do you intercept resizeEvent and recalculate the drop shadow ?
also
if you do this->setFixedSize(500,500);
and qDebug () << this->width() << " - " << this->height();
once moved. What does it say ?
( "this" is most likely mainwindow) -
Hi
Do you intercept resizeEvent and recalculate the drop shadow ?
also
if you do this->setFixedSize(500,500);
and qDebug () << this->width() << " - " << this->height();
once moved. What does it say ?
( "this" is most likely mainwindow)@mrjj said in How to keep physical window size constant when working with multiple monitors?:
Do you intercept resizeEvent and recalculate the drop shadow ?
No, I was hoping to just be able to 'cancel' the window resize.
It looks like my mistake was in thinking that I wouldn't have to manually resize the drop shadow and the window.
-
what values did u get from the test ?
-
500 and 500. It wasn't a Qt problem, just my understanding of how to fix the issue.
-
Hi
Ok super. just wanted to be sure. i assumed the mere movement would call for
a recalc since its other monitor.