How to make our own event?
-
Hi...
Is there example or tutorial how to make our own event? May be using sendEvent() or other? Is it true?Thanks in advance
-
Hi,
look at this paper: http://doc.qt.digia.com/qq/qq11-events.html#customeventtypesalso next articles should be usefull:
http://qt-project.org/wiki/Threads_Events_QObjects#e3189e3dc40b94d64bb90318c4c401cb
http://qt-project.org/doc/qt-4.8/eventsandfilters.html -
Thanks for reply. The document said that
Here's a code snippet that shows how to post a custom event:
@
const QEvent::Type MyEvent = (QEvent::Type)1234;... QApplication::postEvent(obj, new QCustomEvent(MyEvent));
@
Actually, what is in "... ", and other help said that QCustomEvent is obsolete, is there any other alternatives?
The application that I make is detected a click like QMouseClickEvent, but the movement of coordinate and clicked comes from (x,y) coordinates from other function not from a real mouse. Thank you in advance. -
What are you trying to do?
I have the suspicion that you might be heading into the wrong direction. Custom events are rather common in other environments, but hardly ever used in Qt.
-
I am trying to make an event. My event want to imitate a mouse click using a point that was detected or not (ON-OFF-ON) using a laser pointer. When a user pointing laser pointer spotlight and the spotlight entering an item then a user give ON-OFF-ON sequence, it means that "item-clicked".
Is there any suggestion?Thanks in advance