mirror of
https://github.com/subsurface/subsurface.git
synced 2024-12-01 06:30:26 +00:00
abc81fbd01
Marble is a weird piece of Qt software, it seems that it wasn't thought of being a library when first written. Most of its features are not achieved by subclassing && overriding one of Qt default methods, instead we need to eventFilter for almost everything ( which is a pain, and a bit error prone - see our combo box delegate *puke*. ) This one's ready, only one thing though - if we want to implement our own context menu, we will need to use the eventFilter, and not the contextMenuEvent. Fixes #291 [Dirk Hohndel: this does not disable the context menu for me...] Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
41 lines
982 B
C++
41 lines
982 B
C++
#ifndef GLOBE_H
|
|
#define GLOBE_H
|
|
|
|
#include <marble/MarbleWidget.h>
|
|
#include <marble/GeoDataCoordinates.h>
|
|
#include <marble/GeoDataDocument.h>
|
|
|
|
#include <QHash>
|
|
|
|
class KMessageWidget;
|
|
using namespace Marble;
|
|
struct dive;
|
|
|
|
class GlobeGPS : public MarbleWidget{
|
|
Q_OBJECT
|
|
public:
|
|
using MarbleWidget::centerOn;
|
|
GlobeGPS(QWidget *parent);
|
|
void reload();
|
|
void repopulateLabels();
|
|
void centerOn(struct dive* dive);
|
|
void diveEditMode();
|
|
bool eventFilter(QObject*, QEvent*);
|
|
protected:
|
|
/* reimp */ void resizeEvent(QResizeEvent *event);
|
|
/* reimp */ void mousePressEvent(QMouseEvent* event);
|
|
private:
|
|
void prepareForGetDiveCoordinates(struct dive* dive);
|
|
GeoDataDocument *loadedDives;
|
|
struct dive* editingDiveCoords;
|
|
KMessageWidget* messageWidget;
|
|
QTimer *fixZoomTimer;
|
|
int currentZoomLevel;
|
|
|
|
public slots:
|
|
void changeDiveGeoPosition(qreal lon,qreal lat,GeoDataCoordinates::Unit);
|
|
void mouseClicked(qreal lon, qreal lat, GeoDataCoordinates::Unit);
|
|
void fixZoom();
|
|
};
|
|
|
|
#endif
|