aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--desktop-widgets/divepicturewidget.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/desktop-widgets/divepicturewidget.cpp b/desktop-widgets/divepicturewidget.cpp
index 04ae76e23..ac3c03ea3 100644
--- a/desktop-widgets/divepicturewidget.cpp
+++ b/desktop-widgets/divepicturewidget.cpp
@@ -31,12 +31,13 @@ void DivePictureWidget::doubleClicked(const QModelIndex &index)
void DivePictureWidget::mousePressEvent(QMouseEvent *event)
{
ulong doubleClickInterval = static_cast<ulong>(qApp->styleHints()->mouseDoubleClickInterval());
- static ulong lasttime = 0L;
+ static qint64 lasttime = 0L;
+ qint64 timestamp = QDateTime::currentDateTime().toMSecsSinceEpoch();
- if (event->timestamp() - lasttime <= doubleClickInterval) {
+ if (timestamp - lasttime <= doubleClickInterval) {
doubleClicked(indexAt(event->pos()));
} else {
- lasttime = event->timestamp();
+ lasttime = timestamp;
QPixmap pixmap = model()->data(indexAt(event->pos()), Qt::DecorationRole).value<QPixmap>();
QString filename = model()->data(indexAt(event->pos()), Qt::DisplayPropertyRole).toString();