Meeting 12: Event Driven Programming

Today we will learn how to design systems that respond to internal and external events in an application.

Links:

Exercise 12: Qt Event System

GitHub Invitation URL: exercise12

Steps:

  1. Clone the assignment for today after accepting the GitHub invitation at the link above.

  2. Define and implement a class WidgetEvent that publicly inherits from QWidget. Override the event member function, printing the event type and returning true.

  3. Write a main function in main.cpp that uses QApplication to instantiate the WidgetEvent class, show it, then enter the event loop.

  4. Build and run your application using the provided CMakeLists.txt and your compiler. Examine all the different events the widget recieves by default.

  5. Now, insert a blocking call to standard input in the event member function. Rebuild and run the application. What happens?

  6. Now, use git to commit the source files to the local repository.

  7. Finally, use git push to synchronize the repository with that on GitHub.

You have completed the Exercise.