From 3595ad029408cae855dcf3d7fdbb03c1a02a6714 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Mon, 2 Jun 2014 19:50:42 -0300 Subject: Make the new picture widget display the pictures. Small changes in the model to display the pictures of the dives. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/divepicturewidget.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'qt-ui/divepicturewidget.cpp') diff --git a/qt-ui/divepicturewidget.cpp b/qt-ui/divepicturewidget.cpp index 01e52d6e8..916345346 100644 --- a/qt-ui/divepicturewidget.cpp +++ b/qt-ui/divepicturewidget.cpp @@ -9,7 +9,6 @@ void DivePictureDelegate::paint(QPainter *painter, const QStyleOptionViewItem &o DivePictureModel::DivePictureModel(QObject *parent): QAbstractTableModel(parent) { - } typedef QPair SPixmap; @@ -53,7 +52,7 @@ void DivePictureModel::updateDivePictures(int divenr) int DivePictureModel::columnCount(const QModelIndex &parent) const { - + return 1; } QVariant DivePictureModel::data(const QModelIndex &index, int role) const @@ -64,9 +63,10 @@ QVariant DivePictureModel::data(const QModelIndex &index, int role) const QString key = stringPixmapCache.keys().at(index.row()); switch(role){ - case Qt::DisplayRole : return key; - case Qt::DecorationRole : return stringPixmapCache[key]; + case Qt::DisplayRole : ret = key; break; + case Qt::DecorationRole : ret = stringPixmapCache[key]; break; } + return ret; } int DivePictureModel::rowCount(const QModelIndex &parent) const @@ -76,5 +76,4 @@ int DivePictureModel::rowCount(const QModelIndex &parent) const DivePictureWidget::DivePictureWidget(QWidget *parent): QListView(parent) { - } -- cgit v1.2.3-70-g09d2