Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

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

    General and Desktop
    3
    3
    1060
    Loading More Posts
    • 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
      earthbanana last edited by

      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 Reply Quote 0
      • A
        andre last edited by

        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 Reply Quote 0
        • A
          Asperamanca last edited by

          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 Reply Quote 0
          • First post
            Last post