summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/user-manual.txt1
-rw-r--r--desktop-widgets/divepicturewidget.cpp31
2 files changed, 20 insertions, 12 deletions
diff --git a/Documentation/user-manual.txt b/Documentation/user-manual.txt
index b13fe90a2..512b65d9d 100644
--- a/Documentation/user-manual.txt
+++ b/Documentation/user-manual.txt
@@ -319,6 +319,7 @@ xref:_appendix_b_dive_computer_specific_information_for_importing_dive_informati
has dive computer specific information.
After this, the dive computer can be hooked up to the user's PC using these steps:
+
1. The interface cable should be connected to a free USB port (or the Infra-red
or Bluetooth connection set up as described later in this manual)
diff --git a/desktop-widgets/divepicturewidget.cpp b/desktop-widgets/divepicturewidget.cpp
index c612ab6d4..d52fbb9d7 100644
--- a/desktop-widgets/divepicturewidget.cpp
+++ b/desktop-widgets/divepicturewidget.cpp
@@ -30,22 +30,29 @@ void DivePictureWidget::doubleClicked(const QModelIndex &index)
void DivePictureWidget::mousePressEvent(QMouseEvent *event)
{
+ ulong doubleClickInterval = static_cast<ulong>(qApp->styleHints()->mouseDoubleClickInterval());
+ static ulong lasttime = 0L;
- QPixmap pixmap = model()->data(indexAt(event->pos()), Qt::DecorationRole).value<QPixmap>();
+ if (event->timestamp() - lasttime <= doubleClickInterval) {
+ doubleClicked(indexAt(event->pos()));
+ } else {
+ lasttime = event->timestamp();
+ QPixmap pixmap = model()->data(indexAt(event->pos()), Qt::DecorationRole).value<QPixmap>();
- QString filename = model()->data(indexAt(event->pos()), Qt::DisplayPropertyRole).toString();
+ QString filename = model()->data(indexAt(event->pos()), Qt::DisplayPropertyRole).toString();
- QByteArray itemData;
- QDataStream dataStream(&itemData, QIODevice::WriteOnly);
- dataStream << filename << event->pos();
+ QByteArray itemData;
+ QDataStream dataStream(&itemData, QIODevice::WriteOnly);
+ dataStream << filename << event->pos();
- QMimeData *mimeData = new QMimeData;
- mimeData->setData("application/x-subsurfaceimagedrop", itemData);
+ QMimeData *mimeData = new QMimeData;
+ mimeData->setData("application/x-subsurfaceimagedrop", itemData);
- QDrag *drag = new QDrag(this);
- drag->setMimeData(mimeData);
- drag->setPixmap(pixmap);
- drag->setHotSpot(event->pos() - rectForIndex(indexAt(event->pos())).topLeft());
+ QDrag *drag = new QDrag(this);
+ drag->setMimeData(mimeData);
+ drag->setPixmap(pixmap);
+ drag->setHotSpot(event->pos() - rectForIndex(indexAt(event->pos())).topLeft());
- drag->exec(Qt::CopyAction | Qt::MoveAction, Qt::CopyAction);
+ drag->exec(Qt::CopyAction | Qt::MoveAction, Qt::CopyAction);
+ }
}