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. Any easy way for mouse events to continue past the edge?

Any easy way for mouse events to continue past the edge?

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 1.2k 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.
  • E Offline
    E Offline
    earthbanana
    wrote on last edited by
    #1

    I have a qglWidget with a lot of stuff rendering inside and it gets a bit annoying dragging some of my 3d models around only to have the mouse stop at the edge of the screen - I was just wondering if anybody knows a way to keep the mouse coordinates in QMouseEvens increasing after you get to the edge of the screen.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      What I do is that I install an event filter on the application, and enable mouse tracking. That gives a continuous flow of mouse events as long as the mouse is within your applications borders. If you also need the events when the mouse is outside your application, you'll need another approach, such as a transparent widget overlaying your entire screen, polling the mouse position or use platform specific mouse tracking methods.

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Asperamanca
        wrote on last edited by
        #3

        Just to clarify things: "Edge of the screen" vs. "edge of my widget" vs. "edge of my application window".

        If you really meant "edge of the screen" (aka display monitor, desktop), I believe you are out of luck.

        If you mean "edge of my widget" or "edge of my application window", it should be enough to make yourself the mouse grabber.

        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