From 4098922b553c8a412b457a3b6fabbbd936317a65 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Fri, 17 May 2013 08:14:10 -0300 Subject: Adds preliminary support for Marble Widget Adds preliminary support for marble widget, alongside with the dive list. my idea is to let the view stay there at the left of the dive list since we got a lot of unused space and a globe is something nice to have - so you can look around where did you dived, the dives near the one that's currectly selected, and so on. I'm not using OpenStreetMaps right now, but a good thing about marble is that it is skinnable - so for instance, a dive school could present a dive lesson using subsurface with a globe from the 1600, to make it feel like 'history'. This version will only compile to Qt4. Signed-off-by: Tomaz Canabrava --- qt-ui/globe.cpp | 25 +++++++++++++++++++++ qt-ui/globe.h | 13 +++++++++++ qt-ui/mainwindow.ui | 62 ++++++++++++++++++++++++++++++++--------------------- 3 files changed, 75 insertions(+), 25 deletions(-) create mode 100644 qt-ui/globe.cpp create mode 100644 qt-ui/globe.h (limited to 'qt-ui') diff --git a/qt-ui/globe.cpp b/qt-ui/globe.cpp new file mode 100644 index 000000000..770e51b02 --- /dev/null +++ b/qt-ui/globe.cpp @@ -0,0 +1,25 @@ +#include "globe.h" +#include + +using namespace Marble; + +GlobeGPS::GlobeGPS(QWidget* parent) : MarbleWidget(parent) +{ + setMapThemeId("earth/bluemarble/bluemarble.dgml"); + setProjection( Marble::Spherical ); + + // Enable the cloud cover and enable the country borders + setShowClouds( true ); + setShowBorders( true ); + + // Hide the FloatItems: Compass and StatusBar + setShowOverviewMap(false); + setShowScaleBar(false); + + Q_FOREACH( AbstractFloatItem * floatItem, floatItems() ){ + if ( floatItem && floatItem->nameId() == "compass" ) { + floatItem->setPosition( QPoint( 10, 10 ) ); + floatItem->setContentSize( QSize( 50, 50 ) ); + } + } +} diff --git a/qt-ui/globe.h b/qt-ui/globe.h new file mode 100644 index 000000000..bdf40fb1a --- /dev/null +++ b/qt-ui/globe.h @@ -0,0 +1,13 @@ +#ifndef GLOBE_H +#define GLOBE_H + +#include + +class GlobeGPS : public Marble::MarbleWidget{ + Q_OBJECT +public: + GlobeGPS(QWidget *parent); + +}; + +#endif diff --git a/qt-ui/mainwindow.ui b/qt-ui/mainwindow.ui index b2969ac61..ab0cd5f49 100644 --- a/qt-ui/mainwindow.ui +++ b/qt-ui/mainwindow.ui @@ -14,8 +14,8 @@ MainWindow - - + + Qt::Vertical @@ -27,9 +27,13 @@ - - - QTreeView { + + + Qt::Horizontal + + + + QTreeView { show-decoration-selected: 1; } @@ -58,25 +62,27 @@ } - - - true - - - QAbstractItemView::ExtendedSelection - - - true - - - true - - - true - - - true - + + + true + + + QAbstractItemView::ExtendedSelection + + + true + + + true + + + true + + + true + + + @@ -88,7 +94,7 @@ 0 0 763 - 20 + 25 @@ -365,6 +371,12 @@ QGraphicsView
profilegraphics.h
+ + GlobeGPS + QWidget +
globe.h
+ 1 +
-- cgit v1.2.3-70-g09d2