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. register mouse movement inside a particular window?
Forum Update on Monday, May 27th 2025

register mouse movement inside a particular window?

Scheduled Pinned Locked Moved Solved General and Desktop
mousemouseeventwindowsignalmovement
2 Posts 1 Posters 704 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.
  • 4 Offline
    4 Offline
    4oh4
    wrote on 7 Apr 2019, 03:31 last edited by 4oh4 4 Jul 2019, 03:38
    #1

    I have multiple windows and need to register mouse movements within one of those windows and call a function. It is a standard ui class with setcentralwidget() for a qvideowidget.

    Is there a simple way to capture mousemovements just within one of those elements? (the window itself, the centralwidget or on a qvideowidget)?

    Ive found I can get a mouse event on that window with mouseMoveEvent(QMouseEvent *event) function override, but it only seems to trigger the function if i move the mouse when holding down leftclick, which isn't great, can i change that to be any movement, clicked or not?

    1 Reply Last reply
    0
    • 4 Offline
      4 Offline
      4oh4
      wrote on 7 Apr 2019, 04:34 last edited by
      #2

      Solved, overrode the standard event() and just used event.type() == QEvent::hovermove to get what I needed.

      1 Reply Last reply
      0

      2/2

      7 Apr 2019, 04:34

      • Login

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