Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to get the coordinates of mouse, when i push out a key at mouse
Forum Update on Monday, May 27th 2025

How to get the coordinates of mouse, when i push out a key at mouse

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 508 Views
  • 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.
  • JulilaJ Offline
    JulilaJ Offline
    Julila
    wrote on last edited by
    #1

    How to get the coordinates of mouse, when i push out a key at mouse

    1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by Chris Kawa
      #2

      Depending on where you capture that event there are couple of ways. If, for example, you're overriding mousePressEvent its event parameter has many methods like pos(), localPos(), screenPos() and others. See QMouseEvent for complete list.

      Outside of mouse events you can always get current cursor position with QCursor::pos().

      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