Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. I have an event filter setup - while in it, where might I find the absolute touch screen coordinates?
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved Mobile and Embedded
3 Posts 1 Posters 1.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    st2000
    wrote on last edited by
    #1

    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.

    -thanks

    1 Reply Last reply
    0
    • S Offline
      S Offline
      st2000
      wrote on last edited by
      #2

      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:
      globalPos()
      QCursor::pos()
      QWidget::mapToGlobal(pos())
      globalX()
      globalY()

      -thanks

      1 Reply Last reply
      0
      • S Offline
        S Offline
        st2000
        wrote on last edited by
        #3

        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.

        -thanks

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved