summaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/profilewidget2.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-06-08 11:56:35 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-06-08 12:42:51 -0700
commitf037f03268f2676bf906f19353871186af297d12 (patch)
tree833929589a9646e00660ef4251b82eb96d1da987 /qt-ui/profile/profilewidget2.cpp
parent543f3ac5844c433c481f42380c4ac344fdadd3bc (diff)
downloadsubsurface-f037f03268f2676bf906f19353871186af297d12.tar.gz
Picture handling: put the picture near its correct time during the dive
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/profilewidget2.cpp')
-rw-r--r--qt-ui/profile/profilewidget2.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp
index b2021fd8c..05ddeedbd 100644
--- a/qt-ui/profile/profilewidget2.cpp
+++ b/qt-ui/profile/profilewidget2.cpp
@@ -1311,8 +1311,11 @@ void ProfileWidget2::plotPictures()
continue;
DivePictureItem *item = new DivePictureItem();
item->setPixmap(m->index(i,0).data(Qt::DecorationRole).value<QPixmap>());
- // TODO: put the item in the correct place. use the pic.timestamp to find where it belongs on the dive.
- item->setPos(10 ,10);
+ // let's put the picture at the correct time, but at a fixed "depth" on the profile
+ // not sure this is ideal, but it seems to look right.
+ qreal x = timeAxis->posAtValue(pic->timestamp - current_dive->when);
+ qreal y = 10;
+ item->setPos(x, y);
item->setFlag(QGraphicsItem::ItemIgnoresTransformations);
scene()->addItem(item);
pictures.push_back(item);