How to do it...

To learn how to use signals and slots with UI events, follow these steps:

  1. Let's create a new Qt Widgets Application project.
  2. Drag and drop a Push Button, Combo Box, Line Edit, Spin Box, and Slider from the Widget Box into your UI canvas:
  1. Then, right-click on the push button and select clicked() and press the OK button to proceed. A slot function will be created for you by Qt Creator:
  1. Repeat the previous step, but this time, select the next selection until every function in QAbstractButton has been added to the source code: ...

Get Qt5 C++ GUI Programming Cookbook - 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.