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 is proper way to catch mouse release outside app?
Forum Updated to NodeBB v4.3 + New Features

How is proper way to catch mouse release outside app?

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 2 Posters 226 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.
  • Q Offline
    Q Offline
    qwe3
    wrote on last edited by
    #1

    Hi,

    I have myScrollBar ( inherits QScrollBar ). I would like to know when scrollBar is kept by user, so I would like to know when user click on sroll bar, keep it and release it. I have it using mousePressEvent and mouseReleaseEvent, but I have problem, when user kept scrollBar, move mouse outside app and release it. I don't see it.

    kshegunovK 1 Reply Last reply
    0
    • Q qwe3

      Hi,

      I have myScrollBar ( inherits QScrollBar ). I would like to know when scrollBar is kept by user, so I would like to know when user click on sroll bar, keep it and release it. I have it using mousePressEvent and mouseReleaseEvent, but I have problem, when user kept scrollBar, move mouse outside app and release it. I don't see it.

      kshegunovK Offline
      kshegunovK Offline
      kshegunov
      Moderators
      wrote on last edited by kshegunov
      #2

      That's because your application doesn't get the events due to the release being outside of its supposed scope. Now, it's possible to capture them exclusively with QWidget::grabMouse, but the usual warnings apply. Make sure you don't have bugs in that code, as it's rather easy to kill the usability of the system by not releasing the mouse ...

      Note: Also there are platform differences, so check the documentation out.

      Note 2: You could try to respond sensibly to the mouse leave event as an alternative.

      Read and abide by the Qt Code of Conduct

      1 Reply Last reply
      1

      • Login

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