Widgets

Widgets are the graphical components with which we construct user interfaces. A familiar example of such a component is a textbox. This is the component that is used to capture our email address or last and first names on forms in a GUI application.

There are a few critical points to note regarding widgets in Qt:

  • Information is passed to widgets by way of events. For a textbox, an example of an event could be when a user clicks within the textbox or when the return key has been pressed while a textbox cursor is blinking.
  • Every widget can have a parent widget or children widgets.
  • Widgets that do not have a parent widget become a window when the show() function is called on them. Such a widget will be enclosed in a window with buttons ...

Get Getting Started with Qt 5 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.