mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Picture handling: put the picture near its correct time during the dive
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
543f3ac584
commit
f037f03268
1 changed files with 5 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue