From b3feaa80e26510928c73e92049ec346841f6093a Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sun, 15 Jul 2018 17:56:18 +0200 Subject: Dive video: paint duration-bar above thumbnail in profile plot Paint a rectangle on top of thumbnails indicating the run-time of the video. Use the z=100.0-101.0 range for painting the thumbnails, whereby the z-value increases uniformly from first to last thumbnail (sorted by timestamp). The duration-bars are placed at z-values midway between those of the thumbnails. Signed-off-by: Berthold Stoeger --- qt-models/divepicturemodel.cpp | 2 +- qt-models/divepicturemodel.h | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'qt-models') diff --git a/qt-models/divepicturemodel.cpp b/qt-models/divepicturemodel.cpp index c881ce5bf..f0b5eff47 100644 --- a/qt-models/divepicturemodel.cpp +++ b/qt-models/divepicturemodel.cpp @@ -165,7 +165,7 @@ int DivePictureModel::findPictureId(const QString &filename) return -1; } -void DivePictureModel::updateThumbnail(QString filename, QImage thumbnail) +void DivePictureModel::updateThumbnail(QString filename, QImage thumbnail, duration_t) { int i = findPictureId(filename); if (i >= 0) { diff --git a/qt-models/divepicturemodel.h b/qt-models/divepicturemodel.h index 6dc633fb2..3bd872d6a 100644 --- a/qt-models/divepicturemodel.h +++ b/qt-models/divepicturemodel.h @@ -2,6 +2,8 @@ #ifndef DIVEPICTUREMODEL_H #define DIVEPICTUREMODEL_H +#include "core/units.h" + #include #include #include @@ -28,7 +30,7 @@ signals: void picturesRemoved(const QVector &fileUrls); public slots: void setZoomLevel(int level); - void updateThumbnail(QString filename, QImage thumbnail); + void updateThumbnail(QString filename, QImage thumbnail, duration_t duration); private: DivePictureModel(); QVector pictures; -- cgit v1.2.3-70-g09d2