summaryrefslogtreecommitdiffstats
path: root/qt-ui/divepicturewidget.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2014-06-02 19:50:42 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-06-03 00:05:24 -0700
commit3595ad029408cae855dcf3d7fdbb03c1a02a6714 (patch)
tree003ac4c63c74a500528c487b06794a41873310f5 /qt-ui/divepicturewidget.cpp
parent2cded299ace9dd5d312956dd3c65509971ded9b6 (diff)
downloadsubsurface-3595ad029408cae855dcf3d7fdbb03c1a02a6714.tar.gz
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 <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/divepicturewidget.cpp')
-rw-r--r--qt-ui/divepicturewidget.cpp9
1 files changed, 4 insertions, 5 deletions
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<QString, QPixmap> 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)
{
-
}