Hi,
I am sure there is a correct way to go about this. Unfortunately the code is not that well written. So, instead, I would simply like to change the numbers used by Qt for button presses.
What I would like to do is divide the X and the Y coordinates by, in this case, 1.33. Then I want to insert the new number back into Qt for use by Qt in identifying what buttons are pressed. I assume the eventHandler is run before any other code which deals with touch screen events. So I thought it would be a simple fix. But it is evident I don’t know how to “insert” the new coordinates back into Qt such that they are used later when Qt is figuring out which button I have pressed.
The longer explanation is that we switch screen resolutions as both the display and touch screen hardware has changed. I have already made a quick fix in the display driver code to “stretch” all images, buttons and videos across the new screen. But the touch screen driver has no equivalent quick fix method. So I want to do this in the Qt code. I want a touch reported in the bottom left corner to be scaled to a point about 1/1.33 the way down the screen and about 1/1.33 the way to the right side of the screen.
Currently I am getting and changing the coordinates like this:
mouse_x = cursor->pos().x();
mouse_y = cursor->pos().y();
mouse_x /= 1.33;
mouse_y /= 1.33;
But how do I get the values back into Qt such that they are used later when processing button presses?
Any help would be appreciated.
-thanks
↧