Changeset View
Changeset View
Standalone View
Standalone View
src/lib/marble/declarative/MarbleQuickItem.cpp
Show First 20 Lines • Show All 197 Lines • ▼ Show 20 Line(s) | 188 | { | |||
---|---|---|---|---|---|
198 | 198 | | |||
199 | d->m_model.positionTracking()->setTrackVisible(false); | 199 | d->m_model.positionTracking()->setTrackVisible(false); | ||
200 | 200 | | |||
201 | connect(&d->m_map, SIGNAL(repaintNeeded(QRegion)), this, SLOT(update())); | 201 | connect(&d->m_map, SIGNAL(repaintNeeded(QRegion)), this, SLOT(update())); | ||
202 | connect(this, SIGNAL(widthChanged()), this, SLOT(resizeMap())); | 202 | connect(this, SIGNAL(widthChanged()), this, SLOT(resizeMap())); | ||
203 | connect(this, SIGNAL(heightChanged()), this, SLOT(resizeMap())); | 203 | connect(this, SIGNAL(heightChanged()), this, SLOT(resizeMap())); | ||
204 | connect(&d->m_map, SIGNAL(visibleLatLonAltBoxChanged(GeoDataLatLonAltBox)), this, SLOT(updatePositionVisibility())); | 204 | connect(&d->m_map, SIGNAL(visibleLatLonAltBoxChanged(GeoDataLatLonAltBox)), this, SLOT(updatePositionVisibility())); | ||
205 | connect(&d->m_map, SIGNAL(visibleLatLonAltBoxChanged(GeoDataLatLonAltBox)), this, SIGNAL(visibleLatLonAltBoxChanged())); | 205 | connect(&d->m_map, SIGNAL(visibleLatLonAltBoxChanged(GeoDataLatLonAltBox)), this, SIGNAL(visibleLatLonAltBoxChanged())); | ||
206 | connect(&d->m_map, SIGNAL(radiusChanged(int)), this, SIGNAL(radiusChanged(int))); | ||||
206 | connect(&d->m_map, SIGNAL(radiusChanged(int)), this, SIGNAL(zoomChanged())); | 207 | connect(&d->m_map, SIGNAL(radiusChanged(int)), this, SIGNAL(zoomChanged())); | ||
207 | connect(&d->m_reverseGeocoding, SIGNAL(reverseGeocodingFinished(GeoDataCoordinates,GeoDataPlacemark)), | 208 | connect(&d->m_reverseGeocoding, SIGNAL(reverseGeocodingFinished(GeoDataCoordinates,GeoDataPlacemark)), | ||
208 | this, SLOT(handleReverseGeocoding(GeoDataCoordinates,GeoDataPlacemark))); | 209 | this, SLOT(handleReverseGeocoding(GeoDataCoordinates,GeoDataPlacemark))); | ||
209 | 210 | | |||
210 | setAcceptedMouseButtons(Qt::AllButtons); | 211 | setAcceptedMouseButtons(Qt::AllButtons); | ||
211 | installEventFilter(&d->m_inputHandler); | 212 | installEventFilter(&d->m_inputHandler); | ||
212 | } | 213 | } | ||
213 | 214 | | |||
▲ Show 20 Lines • Show All 299 Lines • ▼ Show 20 Line(s) | |||||
513 | QPointF MarbleQuickItem::screenCoordinatesFromCoordinate(Coordinate * coordinate) const | 514 | QPointF MarbleQuickItem::screenCoordinatesFromCoordinate(Coordinate * coordinate) const | ||
514 | { | 515 | { | ||
515 | qreal x; | 516 | qreal x; | ||
516 | qreal y; | 517 | qreal y; | ||
517 | d->m_map.viewport()->screenCoordinates(coordinate->coordinates(), x, y); | 518 | d->m_map.viewport()->screenCoordinates(coordinate->coordinates(), x, y); | ||
518 | return QPointF(x, y); | 519 | return QPointF(x, y); | ||
519 | } | 520 | } | ||
520 | 521 | | |||
522 | void MarbleQuickItem::setRadius(int radius) | ||||
523 | { | ||||
524 | d->m_map.setRadius(radius); | ||||
525 | } | ||||
526 | | ||||
521 | void MarbleQuickItem::setZoom(int newZoom, FlyToMode mode) | 527 | void MarbleQuickItem::setZoom(int newZoom, FlyToMode mode) | ||
522 | { | 528 | { | ||
523 | d->m_presenter.setZoom(newZoom, mode); | 529 | d->m_presenter.setZoom(newZoom, mode); | ||
524 | } | 530 | } | ||
525 | 531 | | |||
526 | void MarbleQuickItem::setZoomToMaximumLevel() | 532 | void MarbleQuickItem::setZoomToMaximumLevel() | ||
527 | { | 533 | { | ||
528 | d->m_presenter.setZoom(d->m_map.maximumZoom()); | 534 | d->m_presenter.setZoom(d->m_map.maximumZoom()); | ||
▲ Show 20 Lines • Show All 406 Lines • ▼ Show 20 Line(s) | 940 | { | |||
935 | d->m_inputHandler.pinch(center, scale, state); | 941 | d->m_inputHandler.pinch(center, scale, state); | ||
936 | } | 942 | } | ||
937 | 943 | | |||
938 | MarbleInputHandler *MarbleQuickItem::inputHandler() | 944 | MarbleInputHandler *MarbleQuickItem::inputHandler() | ||
939 | { | 945 | { | ||
940 | return &d->m_inputHandler; | 946 | return &d->m_inputHandler; | ||
941 | } | 947 | } | ||
942 | 948 | | |||
949 | int MarbleQuickItem::radius() const | ||||
950 | { | ||||
951 | return d->m_map.radius(); | ||||
952 | } | ||||
953 | | ||||
943 | int MarbleQuickItem::zoom() const | 954 | int MarbleQuickItem::zoom() const | ||
944 | { | 955 | { | ||
945 | return d->m_presenter.logzoom(); | 956 | return d->m_presenter.logzoom(); | ||
946 | } | 957 | } | ||
947 | 958 | | |||
948 | bool MarbleQuickItem::layersEventFilter(QObject *, QEvent *) | 959 | bool MarbleQuickItem::layersEventFilter(QObject *, QEvent *) | ||
949 | { //Does nothing, but can be reimplemented in a subclass | 960 | { //Does nothing, but can be reimplemented in a subclass | ||
950 | return false; | 961 | return false; | ||
951 | } | 962 | } | ||
952 | } | 963 | } |