summaryrefslogtreecommitdiffstats
path: root/qt-ui/globe.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2015-07-16 18:47:57 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-07-16 18:34:22 -0700
commit0a473b3a2af6cab57f1fc0f360aff7e2dfeca133 (patch)
treefd9fa236a8d5d7c493311bbfa0efdac17788f60b /qt-ui/globe.cpp
parent56240cff5ba2e8b762d3ba85cf62aafdc874d693 (diff)
downloadsubsurface-0a473b3a2af6cab57f1fc0f360aff7e2dfeca133.tar.gz
Fix mouse interaction with the Location List
paint methods should be used only to paint, not to trigger other widget behaviours ( we could got ourselves into a bad recursion bug from that ). Also, enabled mouse tracking to correctly track the mouse movement inside the widget. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/globe.cpp')
-rw-r--r--qt-ui/globe.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/qt-ui/globe.cpp b/qt-ui/globe.cpp
index e74e4d107..066fdc217 100644
--- a/qt-ui/globe.cpp
+++ b/qt-ui/globe.cpp
@@ -373,6 +373,15 @@ void GlobeGPS::resizeEvent(QResizeEvent *event)
messageWidget->setGeometry(5, 5, size - 10, 0);
messageWidget->setMaximumHeight(500);
}
+
+void GlobeGPS::centerOnIndex(const QModelIndex& idx)
+{
+ struct dive_site *ds = get_dive_site_by_uuid(idx.model()->index(idx.row(), 0).data().toInt());
+ if (!ds || !dive_site_has_gps_location(ds))
+ MainWindow::instance()->globe()->centerOnDiveSite(&displayed_dive_site);
+ else
+ MainWindow::instance()->globe()->centerOnDiveSite(ds);
+}
#else
GlobeGPS::GlobeGPS(QWidget *parent)
@@ -398,4 +407,7 @@ void GlobeGPS::endGetDiveCoordinates()
void GlobeGPS::reload()
{
}
+void GlobeGPS::centerOnIndex(const QModelIndex& idx)
+{
+}
#endif