Displaying a picture with PictureWidget
This widget will be called to display a picture at its full size. We also add some buttons to go to the previous/next picture or delete the current one.
Let's start to analyze the PictureWidget.ui
form, here is the design view:
Here are the details:
backButton
: This object requests to display the gallerydeleteButton
: This object removes the picture from the albumnameLabel
: This object displays the picture namenextButton
: This object selects the next picture in the albumpreviousButton
: This object selects the previous picture in the albumpictureLabel
: This object displays the picture
We can now take a look at the header PictureWidget.h
:
#include <QWidget> #include <QItemSelection> namespace Ui { class PictureWidget; } class PictureModel; class QItemSelectionModel; class ThumbnailProxyModel; class PictureWidget : public QWidget { Q_OBJECT public: explicit PictureWidget(QWidget *parent = 0); ~PictureWidget(); ...