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. QWidget.hide() interrupts mouseMoveEvent()
Forum Updated to NodeBB v4.3 + New Features

QWidget.hide() interrupts mouseMoveEvent()

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 1.5k 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.
  • J Offline
    J Offline
    jesuisbenjamin
    wrote on last edited by
    #1

    Hello,

    I would like to make my application so as to have a QRubberband for selecting a region on a QScrollArea's child widget (Document). Whenever a selection is made, a Mask (a semi-transparent QFrame) shows up on the Document. Whenever a new selection is made with the rubberband, i.e. on mousePressEvent(), the Mask should hide while the selection is being made, and turn visible only after the selection process has been completed.

    The rubberband on its own functions perfectly. As I introduced the Mask however, with a Mask.hide() in the mousePressEvent(), the hide() method call interrups the mouseMoveEvent(). i.e. subsequent method calls do not occur and there is not error message returned. I have tried to place the Mask.hide() in the mouseMoveEvent() to test out, and in the same way, all method calls following the Mask.hide() do not work.

    How is this possible? Is it a bug or am I doing the wrong thing?

    Thanks.
    Benjamin

    1 Reply Last reply
    0
    • J Offline
      J Offline
      jesuisbenjamin
      wrote on last edited by
      #2

      For now I have worked around this "bug" by creating a QWidget and reimplementing its paintEvent() with a forked option (either fillRect() or pass) and forcing an update() whenever changes are required. It might even be a better idea than using hide() / show(). Or isn't it?

      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