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. How to make our own event?

How to make our own event?

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 2.0k 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.
  • R Offline
    R Offline
    romeo.rbw
    wrote on last edited by
    #1

    Hi...
    Is there example or tutorial how to make our own event? May be using sendEvent() or other? Is it true?

    Thanks in advance

    1 Reply Last reply
    0
    • _ Offline
      _ Offline
      _rmn
      wrote on last edited by
      #2

      Hi,
      look at this paper: http://doc.qt.digia.com/qq/qq11-events.html#customeventtypes

      also next articles should be usefull:
      http://qt-project.org/wiki/Threads_Events_QObjects#e3189e3dc40b94d64bb90318c4c401cb
      http://qt-project.org/doc/qt-4.8/eventsandfilters.html

      1 Reply Last reply
      0
      • R Offline
        R Offline
        romeo.rbw
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        • T Offline
          T Offline
          tobias.hunger
          wrote on last edited by
          #4

          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.

          1 Reply Last reply
          0
          • R Offline
            R Offline
            romeo.rbw
            wrote on last edited by
            #5

            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

            1 Reply Last reply
            0

            • Login

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