Pop quiz

Q1. Which classes can have signals?

  1. All classes derived from QWidget.
  2. All classes derived from QObject.
  3. All classes.

Q2. For which of the following do you have to provide your own implementation?

  1. A signal.
  2. A slot.
  3. Both.

Q3. A method that returns the preferred size of a widget is called which of these?

  1. preferredSize.
  2. sizeHint.
  3. defaultSize.

Q4. What is the purpose of the QAction object?

  1. It represents a functionality that a user can invoke in the program.
  2. It holds a key sequence to move the focus on a widget.
  3. It is a base class for all forms generated using the form editor.

Get Game Programming using Qt 5 Beginner's Guide - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.