Displaying the selected album with AlbumWidget
This widget will display the data of the selected album from AlbumListWidget
. Some buttons will allow us to interact with this album.
Here is the layout of the AlbumWidget.ui
file:
The top frame, albumInfoFrame
, with a horizontal layout, contains:
albumName
: This object displays the album's name (Lorem ipsum in the designer)addPicturesButton
: This object allows the user to add pictures selecting fileseditButton
: This object is used to rename the albumdeleteButton
: This object is used to delete the album
The bottom element, thumbnailListView,
is a QListView
. This list view represents items from PictureModel
. By default, QListView
is able to display a picture next to text requesting Qt::DisplayRole
and Qt::DecorationRole
from the model.
Take a look at the header AlbumWidget.h
file:
#include <QWidget> #include <QModelIndex> namespace Ui { class AlbumWidget; } class AlbumModel; class PictureModel; class QItemSelectionModel; class...