PDA

View Full Version : QWidget post event



bunjee
14th November 2008, 17:48
I have QWidget containing several child widget.

I only have track of the parent widget and not its childs.
I'd like to emulate a mouse click to a specific position.
So that one of the child widget gets the mouseClick event depending on cursor's position.

Is it possible to emulate that behaviour using postEvent or sendEvent ?

Thanks.

h123
14th November 2008, 18:07
Hi,
> I only have track of the parent widget and not its childs.
QWidget has children() method via which you can get list of child widgets...

> I'd like to emulate a mouse click to a specific position.
>So that one of the child widget gets the mouseClick event
>depending on cursor's position.
If QWidget is the parent and QPushbutton is the child then when you click on QPushbutton then you will get the QPushbutton::mouseClick/Press event...