Important: Please read the Qt Code of Conduct -

I have an event filter setup - while in it, where might I find the absolute touch screen coordinates?

  • In our embedded application, I have to work inside and outside of Qt as our embedded platform is not a total port of Qt. That is, the video playback and volume have to be "manually" operated. So, no simple volume slider control for me :(. But one it needed! So, currently I stop the video when the screen is pressed. I do this in the event filter. No need to even consider the coordinates of the touch. But now I want to add buttons at the bottom to control volume. So now I need to only stop the video if the screen is touched above the buttons. To do this I need to know the coordinates of the touch. But, so far, I have not found where these values show up. There is a lot of discussion regarding events inside buttons and so fourth. But little talk about the raw values and where to find them. If someone could point this out to me that would be great.


  • I think one of my problems is that Qt is using "global" instead of "absolute" when talking about the position of the mouse (or in my case touch screen) event. So I'm thinking I need to use some combination of one or more of the following:


  • Actually, none of the above will work. Or at least I don't think they will work. That's because they are a part of QMouseEvent. But I am trying to find the coordinates of where the user pressed the screen (the entire screen) while in an eventFilter. In that method I am passed two pointers. A pointer to QObject and a pointer to QEvent. However I don't see where the absolute or "global" X Y coordinates are available with in the structures pointed to by these parameters.

    I assume I am having such a hard time with Qt as normally Qt would handle many decisions based on the X Y coordinate "under the hood". However, in this embedded case, Qt is not and probably will not be TOTALLY PORTED. That is, Qt is not aware of such hardware as volume control, video playback and other things. So we NEED access to such low level features as the X and Y press coordinates. Otherwise we can not, our selves, provide the interface in C to these necessary features.


Log in to reply