0

I've enabled HDPI by setting QT_SCALE_FACTOR environment variable.
Then I've found that my main window appears somewhere behind the screen.
After some debugging I've found that frameGeometry() returns less than zero.
P.s. : There are 2 monitors in the system also. One has 96 dpi, other is in 144 dpi mode.
For example:
left top = {-1920, -30}
width, height = {968, 820}

Has anyone faced any similar problem?

Vladimir Tsyshnatiy
  • 989
  • 1
  • 10
  • 20
  • Lefft/top can be negative. But width/height cannot be negative (at least that is wrong). If the position is negative it usually means that your main monitor is on the right / positioned lower than the other monitor. – Alexander V Dec 22 '16 at 19:37
  • Thanks for your answer, Alexander! I have 2 monitors - left and right. left is at 100% dpi mode, right is at 150% dpi mode. My app starts at the right monitor. I have negative left top, yes, width and height are correct (sorry, fixed at the question also). Is there a correct way to handle such situation? Should I take abs on rect from frameGeometry? – Vladimir Tsyshnatiy Dec 24 '16 at 11:48
  • There bugs with monitor hardware data and Qt can be doing wrong calculation based on that data. I only use qt.conf setting to make it usable across different monitors: http://stackoverflow.com/questions/24367355/automatic-rescaling-of-an-application-on-high-dpi-windows-platform – Alexander V Dec 24 '16 at 16:37

0 Answers0