When we started working on Hello From Qt! in Chapter 2, Writing Your First Qt Application, we created our first widget, MainWindow:
MainWindow inherited from QMainWindow, which traces its ancestry back to QWidget. The Designer screen allowed us to populate MainWindow with different predefined widgets.
There are actually three files associated with MainWindow:
- MainWindow.h defines the MainWindow C++ class
- MainWindow.cc (or .cpp) provides the implementation of MainWindow
- MainWindow.ui defines the graphic elements (widgets) that make up the display of MainWindow
What if we want to add a custom widget ...