Unsolved How to make a widget recieve mouseevent?
-
Hello everyone! I am facing a confused issue, I use 3 widget3, one is the under other widgets, the other widgets (widget A and widgetB) are used without parent. The issue is when I use A->show() to show A, I use A->close(),then I use B->show(), A->show(), the A widget is on the top, but QApplication::notify shows that when I click the screen, B widget recieved the event. Do you know why? My Qt is 5.11.x . And I have used activateWindow() and setFocus() , they don't make sense.
-
I have used qDebug()<<A->isActiveWindow(), and qDebug()<<A->hasFocus. Both were true. But B still recieved all click events.
-
Hi and welcome to devnet,
Does one of these widgets have their focus handling changed ?
Can you provide a minimal compilable example that shows that behaviour ?
-
@SGaist Hi , do you need the code?
By the way, I face this issue on embeded system, when I use this code on PC, seems everything works well. -
@SGaist Oh, I use qDebug<<B->hasFoucus(). When A's hasFocus is true, B's is false.
-
@wohehe said in How to make a widget recieve mouseevent?:
@SGaist Hi , do you need the code?
By the way, I face this issue on embeded system, when I use this code on PC, seems everything works well.A minimal compilable example would be good.
Embedded device ?
Which device ?
Which OS ?
Which QPA backend ?