title: How do events work in Qt?
body: <p>I have some questions about the general usage of Qt events. I'm new to Qt, and I am going to try out making a custom event. The questions I ask are related to this article: <a href="http://doc.qt.digia.com/4.8-snapshot/eventsandfilters.html" rel="nofollow">Qt 4.8: The Event System</a></p>
  
  <ul>
  <li><p><strong>When does an event “occur”?</strong> <br/>In Qt's built in events, mouse clicks and key presses are put into a queue and then the functions are executed at the next frame. I’m especially wondering about this for custom events, because I’m not sure if it always occurs when a mouse is clicked. For custom events, is it when you send the event into the queue and then waits to be processed by the event() function at the next frame?</p></li>
  <li><p><strong>To create a custom event, must you make a class that inherits from QEvent and register an event with registerEventType() function?</strong> <br/>Is this the standard process, or can an event simply be a class? How does this function, registerEventType(), work?</p></li>
  <li><p><strong>Do custom events have a QEvent::Type?</strong> <br/> Is this the number between 1000 and 6563 that is given when using the registerEventType() function?</p></li>
  <li><p><strong>What is the recipient of an event?</strong> <br/> It seems to be in functions' parameters like postEvent(), sendEvent(), etc. However, I am not sure what this object is for.</p></li>
  <li><p><strong>Where is the actual code that is executed when an event is fired?</strong> <br/>
  Is it a function, or is it in the event() function of QObjects.</p></li>
  </ul>
  
  <p><br/>
  Also any working examples of Qt events (both built-in or custom) in action would be helpful.</p>