Re: [Interest] Simulating Mouse Click Event?
Am Wed, 21 Aug 2013 12:39:44 -0400 schrieb Mitchell Verter mitchell.ver...@gmail.com: QCoreApplication::postEvent(this, evt); i am doing nearly the same, but i use recorded events and replay them. then i use sendEvent and not postEvent, but this shouldn't be your problem. but: i think you must locate the correct receiver for your event. i am looping over QApplication::allWidgets() and searching for a widget with correct object name and correct class name. this values i have saved during recording, so i can use them on replay. effect: i can even move the window around and resize, the mouse press is delivered to my pushbutton nevertheless. alex -- /* * You will inherit millions of dollars. */ signature.asc Description: PGP signature ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
[Interest] Simulating Mouse Click Event?
How do i simulate a mouse click event from a device that is not the mouse? I can set the mouse position with a motion sensor. Then I would like to send a Left Button Press after one second hover in aspot. However, none of the GUI elements are reacting to the event. = MainWindow void mouseMotionController() { if (mouse is in same position for a second) { printf(mouse is hovering); QMouseEvent * evt = new QMouseEvent ( QEvent::MouseButtonPress, pressPoint, Qt::LeftButton, Qt::LeftButton, Qt::NoModifier); QCoreApplication::postEvent(this, evt); } I've tried a few permutations of this -- using qApp instead of QCoreApplication , using sendEvent instead of postEvent, using a QGraphicsSceneMouseEvent instead of a Mouse Event. But none of these seems to work. Any ideas? Thanks Mitchell ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest