Button Presses are detected in the Wrong Spot when I change screen resolutions



  • Hi There,

    I am coding an straight forward Qt Program that uses OpenGL. The main screen has a number of buttons and a big OpenGL widget. (The OpenGL widget gets mouse events to manipulate the 3d image). I am developing this on a laptop, but are really targeting a Microsoft Surface Pro 4. I am using Qt5.9

    Everything was going okay. However, management designed the GUI around a 1280 x 960 pixel screen. The Surface Pro 4 has a 2736 x 1824 pixel screen. My program runs fine using the native resolution screen. When I change the Surface Pro's screen to 1280 x 960 (which is an official setting) the display looks correct, but all the buttons don't respond to mouse clicks unless you click 'just above' the button. It seems the displayed position and the 'click' position of the button are not the same. If you rotate the Surface Pro 90 degrees, the error is the same. You must always be 'above' the button.

    The Windows buttons do not have this problem (on windows dialog boxes), only the Qt buttons.

    I'm not sure what is the best approach to this problem. Has anybody else seen this problem?
    Is there some 'setting' I am missing?

    Thanks.



  • @Bradzo

    Rebooting the Surface Pro solves this problem.....


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.