Alright, we completed AlbumListWidget
, AlbumWidget,
and PictureWidget
. If you remember correctly, AlbumListWidget
and AlbumWidget
are contained in a widget called GalleryWidget
.
Let's take a look at the GalleryWidget.ui
file:
This widget does not contain any standard Qt widgets but only our created widgets. Qt provides two ways to use your own widgets in the Qt designer:
Promoting widgets: This is the fastest and easiest way
Creating widget plugin for Qt designer: This is more powerful but more complex
In this chapter, we will use the first way, which consists of placing a generic QWidget
as a placeholder and then promoting it to our custom widget class. You can follow these steps to add the albumListWidget
and the albumWidget
objects to the GalleryWidget.ui
file from the Qt designer:
Drag and drop a Widget from Containers to your form.
Set the objectName (for example,
albumListWidget
) from the Property Editor.Select Promote to... from the widget contextual menu.
Set the...