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. A problem about parent widget and mouse event capture
Forum Updated to NodeBB v4.3 + New Features

A problem about parent widget and mouse event capture

Scheduled Pinned Locked Moved Unsolved General and Desktop
helpqt5.12.x
1 Posts 1 Posters 149 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.
  • H Offline
    H Offline
    hymnly
    wrote on 19 Jun 2024, 13:13 last edited by
    #1

    I am a qt beginner and when I am working with qt, I am trying to put a custom widget into another widget \ drag it out of another widget, this works fine without nesting, but when I click on a sub Widget2 in a sub Widget1 in a MainWindow, the sub Widget2 I click on responds to the MousePressEvent and responds normally to a MouseMoveEvent.But if I set Widget2 to be a child Widget of MainWindow in the MousePressEvent function, it doesn't respond to a MouseMoveEvent and a MousePressEvent(Widget2 or MainWindow either).When I release the mouse or click once elsewhere and move the mouse back into its range, it can respond to MouseMoveEvent again (setMouseTracking to true)
    more imformation in gif(normal setMouseTrackingFalse setMouseTrackingTrue1 setMouseTrackingTrue2)
    Normal.gif
    setMouseTrackingFalse.gif
    setMouseTrackingTrue1.gif
    setMouseTrackingTrue2.gif

    1 Reply Last reply
    0

    1/1

    19 Jun 2024, 13:13

    • Login

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