marble
Go to the documentation of this file.
11 #include <QApplication>
12 #include <QtQuick/QQuickView>
18 using namespace Marble;
27 map()->setSize(width(), height());
28 map()->setShowFrameRate(
false);
30 map()->setMapThemeId(
"earth/openstreetmap/openstreetmap.dgml");
31 map()->setShowAtmosphere(
false);
32 map()->setShowCompass(
false);
33 map()->setShowClouds(
false);
34 map()->setShowCrosshairs(
false);
35 map()->setShowGrid(
false);
36 map()->setShowOverviewMap(
false);
37 map()->setShowOtherPlaces(
false);
38 map()->setShowScaleBar(
false);
39 map()->setShowBackground(
false);
42 void componentComplete()
44 QQuickItem *pinch = findChild<QQuickItem*>(
"pinchArea");
53 void handlePinchStart(
QPointF center)
55 makePinch(center, Qt::GestureStarted);
58 void handlePinchUpdate(
QPointF center, qreal scale)
60 makePinch(center, Qt::GestureUpdated, scale);
63 void handlePinchEnd(
QPointF center,
bool canceled)
65 makePinch(center, canceled ? Qt::GestureCanceled : Qt::GestureFinished);
69 void makePinch(
QPointF center, Qt::GestureState state, qreal scale = 1)
71 scale = sqrt(sqrt(scale));
72 scale = qBound(0.5, scale, 2.0);
73 pinch(center, scale, state);
82 qmlRegisterType<MarbleDemoItem>(
"MarbleItem", 1, 0,
"MarbleItem");
83 setSource(
QUrl(
"qrc:/main.qml"));
85 if(status()!=QQuickView::Ready)
86 qDebug(
"can't initialise view");
88 QSurfaceFormat format;
89 format.setAlphaBufferSize(8);
91 setClearBeforeRendering(
true);
92 setColor(
QColor(Qt::transparent));
93 setTitle(
"Marble in QML 2.0 demo");
99 int main(
int argc,
char *argv[])
This file contains the headers for MarbleMap.
void installEventFilter(QObject *filterObj)
QFuture< void > map(Sequence &sequence, MapFunction function)
int main(int argc, char *argv[])
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:40 by
doxygen 1.8.7 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.