Marble

MarbleWidget.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2006-2007 Torsten Rahn <tackat@kde.org>
4// SPDX-FileCopyrightText: 2007 Inge Wallin <ingwa@kde.org>
5// SPDX-FileCopyrightText: 2010-2012 Bernhard Beschow <bbeschow@cs.tu-berlin.de>
6// SPDX-FileCopyrightText: 2012 Mohammed Nafees <nafees.technocool@gmail.com>
7//
8
9#include "MarbleWidget.h"
10
11#include <qmath.h>
12#include <QHash>
13#include <QSettings>
14#include <QElapsedTimer>
15#include <QPaintEvent>
16#include <QPaintEngine>
17#include <QRegion>
18#include <QNetworkProxy>
19#include <QMetaMethod>
20#include "DataMigration.h"
21#include "FpsLayer.h"
22#include "FileManager.h"
23#include "GeoDataLatLonAltBox.h"
24#include "GeoDataPlacemark.h"
25#include "GeoDataLookAt.h"
26#include "GeoPainter.h"
27#include "MarbleClock.h"
28#include "MarbleDebug.h"
29#include "MarbleDirs.h"
30#include "MarbleLocale.h"
31#include "MarbleMap.h"
32#include "MarbleModel.h"
33#include "MarbleWidgetInputHandler.h"
34#include "MarbleWidgetPopupMenu.h"
35#include "Planet.h"
36#include "PopupLayer.h"
37#include "RenderState.h"
38#include "RenderPlugin.h"
39#include "SunLocator.h"
40#include "TileCreatorDialog.h"
41#include "ViewportParams.h"
42#include "routing/RoutingLayer.h"
43#include "MarbleAbstractPresenter.h"
44#include "StyleBuilder.h"
45
46namespace Marble
47{
48
49class MarbleWidget::CustomPaintLayer : public LayerInterface
50{
51 public:
52 explicit CustomPaintLayer( MarbleWidget *widget )
53 : m_widget( widget )
54 {
55 }
56
57 QStringList renderPosition() const override { return QStringList() << "USER_TOOLS"; }
58
59 bool render( GeoPainter *painter, ViewportParams *viewport,
60 const QString &renderPos, GeoSceneLayer *layer ) override
61 {
62 Q_UNUSED( viewport );
64 Q_UNUSED( layer );
65
66 painter->setPen( Qt::black );
67 m_widget->customPaint( painter );
68
69 return true;
70 }
71
72 qreal zValue() const override { return 1.0e7; }
73
74 RenderState renderState() const override { return RenderState(QStringLiteral("Custom Widget Paint")); }
75
76 QString runtimeTrace() const override { return QStringLiteral("MarbleWidget::CustomPaintLayer"); }
77
78 private:
79 MarbleWidget *const m_widget;
80};
81
82
83class MarbleWidgetPrivate
84{
85 public:
86 explicit MarbleWidgetPrivate( MarbleWidget *parent ) :
87 m_widget( parent ),
88 m_model(),
89 m_map( &m_model ),
90 m_presenter( &m_map ),
91 m_inputhandler( nullptr ),
92 m_routingLayer( nullptr ),
93 m_mapInfoDialog( nullptr ),
94 m_customPaintLayer( parent ),
95 m_popupmenu( nullptr ),
96 m_showFrameRate( false )
97 {
98 }
99
100 ~MarbleWidgetPrivate()
101 {
102 m_map.removeLayer( &m_customPaintLayer );
103 m_map.removeLayer( m_mapInfoDialog );
104 delete m_mapInfoDialog;
105 delete m_popupmenu;
106 }
107
108 void construct();
109
110 void updateMapTheme();
111
112 void setInputHandler();
113 void setInputHandler( MarbleWidgetInputHandler *handler );
114
115 /**
116 * @brief Update widget flags and cause a full repaint
117 *
118 * The background of the widget only needs to be redrawn in certain cases. This
119 * method sets the widget flags accordingly and triggers a repaint.
120 */
121 void updateSystemBackgroundAttribute();
122
123 MarbleWidget *const m_widget;
124
125 MarbleModel m_model;
126 MarbleMap m_map;
127
128 MarbleAbstractPresenter m_presenter;
129
130 MarbleWidgetInputHandler *m_inputhandler;
131
132 RoutingLayer *m_routingLayer;
133 PopupLayer *m_mapInfoDialog;
134 MarbleWidget::CustomPaintLayer m_customPaintLayer;
135
136 MarbleWidgetPopupMenu *m_popupmenu;
137
138 bool m_showFrameRate;
139};
140
141
142
144 : QWidget( parent ),
145 d( new MarbleWidgetPrivate( this ) )
146{
147// setAttribute( Qt::WA_PaintOnScreen, true );
148 d->construct();
149}
150
151MarbleWidget::~MarbleWidget()
152{
153 // Remove and delete an existing InputHandler
154 // initialized in d->construct()
155 setInputHandler( nullptr );
156
157 delete d;
158}
159
160void MarbleWidgetPrivate::construct()
161{
162 QPointer<DataMigration> dataMigration = new DataMigration( m_widget );
163 dataMigration->exec();
164 delete dataMigration;
165
166 // Widget settings
167 m_widget->setMinimumSize( 200, 300 );
168 m_widget->setFocusPolicy( Qt::WheelFocus );
169 m_widget->setFocus( Qt::OtherFocusReason );
170
171 // Set background: black.
172 m_widget->setPalette( QPalette ( Qt::black ) );
173
174 // Set whether the black space gets displayed or the earth gets simply
175 // displayed on the widget background.
176 m_widget->setAutoFillBackground( true );
177
178 // Initialize the map and forward some signals.
179 m_map.setSize( m_widget->width(), m_widget->height() );
180 m_map.setShowFrameRate( false ); // never let the map draw the frame rate,
181 // we do this differently here in the widget
182
183 m_widget->connect( &m_presenter, SIGNAL(regionSelected(GeoDataLatLonBox)), m_widget, SIGNAL(regionSelected(GeoDataLatLonBox)) );
184
185 m_widget->connect( &m_presenter, SIGNAL(zoomChanged(int)), m_widget, SIGNAL(zoomChanged(int)) );
186 m_widget->connect( &m_presenter, SIGNAL(distanceChanged(QString)), m_widget, SIGNAL(distanceChanged(QString)) );
187
188 // forward some signals of m_map
189 m_widget->connect( &m_map, SIGNAL(visibleLatLonAltBoxChanged(GeoDataLatLonAltBox)),
190 m_widget, SIGNAL(visibleLatLonAltBoxChanged(GeoDataLatLonAltBox)) );
191 m_widget->connect( &m_map, SIGNAL(projectionChanged(Projection)),
192 m_widget, SIGNAL(projectionChanged(Projection)) );
193 m_widget->connect( &m_map, SIGNAL(tileLevelChanged(int)),
194 m_widget, SIGNAL(tileLevelChanged(int)) );
195 m_widget->connect( &m_map, SIGNAL(framesPerSecond(qreal)),
196 m_widget, SIGNAL(framesPerSecond(qreal)) );
197 m_widget->connect( &m_map, SIGNAL(viewContextChanged(ViewContext)),
198 m_widget, SLOT(setViewContext(ViewContext)) );
199
200 m_widget->connect( &m_map, SIGNAL(pluginSettingsChanged()),
201 m_widget, SIGNAL(pluginSettingsChanged()) );
202 m_widget->connect( &m_map, SIGNAL(renderPluginInitialized(RenderPlugin*)),
203 m_widget, SIGNAL(renderPluginInitialized(RenderPlugin*)) );
204
205 // react to some signals of m_map
206 m_widget->connect( &m_map, SIGNAL(themeChanged(QString)),
207 m_widget, SLOT(updateMapTheme()) );
208 m_widget->connect( &m_map, SIGNAL(viewContextChanged(ViewContext)),
209 m_widget, SIGNAL(viewContextChanged(ViewContext)) );
210 m_widget->connect( &m_map, SIGNAL(repaintNeeded(QRegion)),
211 m_widget, SLOT(update()) );
212 m_widget->connect( &m_map, SIGNAL(visibleLatLonAltBoxChanged(GeoDataLatLonAltBox)),
213 m_widget, SLOT(updateSystemBackgroundAttribute()) );
214 m_widget->connect( &m_map, SIGNAL(renderStatusChanged(RenderStatus)),
215 m_widget, SIGNAL(renderStatusChanged(RenderStatus)) );
216 m_widget->connect( &m_map, SIGNAL(renderStateChanged(RenderState)),
217 m_widget, SIGNAL(renderStateChanged(RenderState)) );
218
219 m_widget->connect( &m_map, SIGNAL(propertyValueChanged(QString,bool)),
220 m_widget, SIGNAL(propertyValueChanged(QString,bool)) );
221
222 m_widget->connect( m_model.fileManager(), SIGNAL(centeredDocument(GeoDataLatLonBox)),
223 m_widget, SLOT(centerOn(GeoDataLatLonBox)) );
224
225
226 // Show a progress dialog when the model calculates new map tiles.
227 m_widget->connect( &m_model, SIGNAL( creatingTilesStart( TileCreator*, const QString&,
228 const QString& ) ),
229 m_widget, SLOT( creatingTilesStart( TileCreator*, const QString&,
230 const QString& ) ) );
231
232 m_popupmenu = new MarbleWidgetPopupMenu( m_widget, &m_model );
233
234 m_routingLayer = new RoutingLayer( m_widget, m_widget );
235 m_routingLayer->setPlacemarkModel( nullptr );
236 QObject::connect( m_routingLayer, SIGNAL(repaintNeeded(QRect)),
237 m_widget, SLOT(update()) );
238
239 m_mapInfoDialog = new PopupLayer( m_widget, m_widget );
240 m_mapInfoDialog->setVisible( false );
241 m_widget->connect( m_mapInfoDialog, SIGNAL(repaintNeeded()), m_widget, SLOT(update()) );
242 m_map.addLayer( m_mapInfoDialog );
243
244 setInputHandler();
245 m_widget->setMouseTracking( true );
246
247 m_map.addLayer( &m_customPaintLayer );
248
249 m_widget->connect( m_inputhandler, SIGNAL(mouseClickGeoPosition(qreal,qreal,GeoDataCoordinates::Unit)),
250 m_widget, SIGNAL(highlightedPlacemarksChanged(qreal,qreal,GeoDataCoordinates::Unit)) );
251 m_widget->setHighlightEnabled( true );
252
253}
254
255void MarbleWidgetPrivate::setInputHandler()
256{
257 setInputHandler( new MarbleWidgetInputHandler( &m_presenter, m_widget ) );
258}
259
260void MarbleWidgetPrivate::setInputHandler( MarbleWidgetInputHandler *handler )
261{
262 delete m_inputhandler;
263 m_inputhandler = handler;
264
265 if ( m_inputhandler )
266 {
267 m_widget->installEventFilter( m_inputhandler );
268
269 QObject::connect( m_inputhandler, SIGNAL(mouseClickScreenPosition(int,int)),
270 m_widget, SLOT(notifyMouseClick(int,int)) );
271
272 QObject::connect( m_inputhandler, SIGNAL(mouseMoveGeoPosition(QString)),
273 m_widget, SIGNAL(mouseMoveGeoPosition(QString)) );
274 }
275}
276
277void MarbleWidgetPrivate::updateSystemBackgroundAttribute()
278{
279 // We only have to repaint the background every time if the earth
280 // doesn't cover the whole image.
281 const bool isOn = m_map.viewport()->mapCoversViewport() && !m_model.mapThemeId().isEmpty();
282 m_widget->setAttribute( Qt::WA_NoSystemBackground, isOn );
283}
284
285// ----------------------------------------------------------------
286
287
289{
290 return &d->m_model;
291}
292
293const MarbleModel *MarbleWidget::model() const
294{
295 return &d->m_model;
296}
297
298ViewportParams* MarbleWidget::viewport()
299{
300 return d->m_map.viewport();
301}
302
303const ViewportParams* MarbleWidget::viewport() const
304{
305 return d->m_map.viewport();
306}
307
308MarbleWidgetPopupMenu *MarbleWidget::popupMenu()
309{
310 return d->m_popupmenu;
311}
312
313
314void MarbleWidget::setInputHandler( MarbleWidgetInputHandler *handler )
315{
316 d->setInputHandler(handler);
317}
318
319MarbleWidgetInputHandler *MarbleWidget::inputHandler() const
320{
321 return d->m_inputhandler;
322}
323
325{
326 return d->m_map.radius();
327}
328
329void MarbleWidget::setRadius( int radius )
330{
331 d->m_map.setRadius( radius );
332}
333
335{
336 return d->m_presenter.moveStep();
337}
338
339int MarbleWidget::zoom() const
340{
341 return d->m_presenter.logzoom();
342}
343
344int MarbleWidget::tileZoomLevel() const
345{
346 return d->m_map.tileZoomLevel();
347}
348
350{
351 return d->m_map.minimumZoom();
352}
353
355{
356 return d->m_map.maximumZoom();
357}
358
359QVector<const GeoDataFeature*> MarbleWidget::whichFeatureAt( const QPoint &curpos ) const
360{
361 return d->m_map.whichFeatureAt( curpos );
362}
363
365{
366 return d->m_map.whichItemAt( curpos );
367}
368
369void MarbleWidget::addLayer( LayerInterface *layer )
370{
371 d->m_map.addLayer( layer );
372}
373
374void MarbleWidget::removeLayer( LayerInterface *layer )
375{
376 d->m_map.removeLayer( layer );
377}
378
379Marble::TextureLayer* MarbleWidget::textureLayer() const
380{
381 return d->m_map.textureLayer();
382}
383
384VectorTileLayer *MarbleWidget::vectorTileLayer() const
385{
386 return d->m_map.vectorTileLayer();
387}
388
390{
391 return grab();
392}
393
394RenderStatus MarbleWidget::renderStatus() const
395{
396 return d->m_map.renderStatus();
397}
398
399RenderState MarbleWidget::renderState() const
400{
401 return d->m_map.renderState();
402}
403
405{
406 if ( enabled ) {
407 connect( this, SIGNAL(highlightedPlacemarksChanged(qreal,qreal,GeoDataCoordinates::Unit)),
408 &d->m_map, SIGNAL(highlightedPlacemarksChanged(qreal,qreal,GeoDataCoordinates::Unit)),
410 }
411 else {
412 disconnect( this, SIGNAL(highlightedPlacemarksChanged(qreal,qreal,GeoDataCoordinates::Unit)),
413 &d->m_map, SIGNAL(highlightedPlacemarksChanged(qreal,qreal,GeoDataCoordinates::Unit)) );
414 }
415}
416
417bool MarbleWidget::showOverviewMap() const
418{
419 return d->m_map.showOverviewMap();
420}
421
422bool MarbleWidget::showScaleBar() const
423{
424 return d->m_map.showScaleBar();
425}
426
427bool MarbleWidget::showCompass() const
428{
429 return d->m_map.showCompass();
430}
431
432bool MarbleWidget::showClouds() const
433{
434 return d->m_map.showClouds();
435}
436
437bool MarbleWidget::showSunShading() const
438{
439 return d->m_map.showSunShading();
440}
441
442bool MarbleWidget::showCityLights() const
443{
444 return d->m_map.showCityLights();
445}
446
447bool MarbleWidget::isLockedToSubSolarPoint() const
448{
449 return d->m_map.isLockedToSubSolarPoint();
450}
451
452bool MarbleWidget::isSubSolarPointIconVisible() const
453{
454 return d->m_map.isSubSolarPointIconVisible();
455}
456
457bool MarbleWidget::showAtmosphere() const
458{
459 return d->m_map.showAtmosphere();
460}
461
462bool MarbleWidget::showCrosshairs() const
463{
464 return d->m_map.showCrosshairs();
465}
466
467bool MarbleWidget::showGrid() const
468{
469 return d->m_map.showGrid();
470}
471
472bool MarbleWidget::showPlaces() const
473{
474 return d->m_map.showPlaces();
475}
476
477bool MarbleWidget::showCities() const
478{
479 return d->m_map.showCities();
480}
481
482bool MarbleWidget::showTerrain() const
483{
484 return d->m_map.showTerrain();
485}
486
487bool MarbleWidget::showOtherPlaces() const
488{
489 return d->m_map.showOtherPlaces();
490}
491
492bool MarbleWidget::showRelief() const
493{
494 return d->m_map.showRelief();
495}
496
497bool MarbleWidget::showIceLayer() const
498{
499 return d->m_map.showIceLayer();
500}
501
502bool MarbleWidget::showBorders() const
503{
504 return d->m_map.showBorders();
505}
506
507bool MarbleWidget::showRivers() const
508{
509 return d->m_map.showRivers();
510}
511
512bool MarbleWidget::showLakes() const
513{
514 return d->m_map.showLakes();
515}
516
518{
519 return d->m_showFrameRate;
520}
521
522bool MarbleWidget::showBackground() const
523{
524 return d->m_map.showBackground();
525}
526
527quint64 MarbleWidget::volatileTileCacheLimit() const
528{
529 return d->m_map.volatileTileCacheLimit();
530}
531
532
533void MarbleWidget::setZoom( int newZoom, FlyToMode mode )
534{
535 d->m_inputhandler->stopInertialEarthRotation();
536 d->m_presenter.setZoom( newZoom, mode );
537}
538
539void MarbleWidget::zoomView( int zoom, FlyToMode mode )
540{
541 d->m_inputhandler->stopInertialEarthRotation();
542 d->m_presenter.zoomView( zoom, mode );
543}
544
545
546void MarbleWidget::zoomViewBy( int zoomStep, FlyToMode mode )
547{
548 d->m_inputhandler->stopInertialEarthRotation();
549 d->m_presenter.zoomViewBy( zoomStep, mode );
550}
551
552
554{
555 d->m_inputhandler->stopInertialEarthRotation();
556 d->m_presenter.zoomIn( mode );
557}
558
560{
561 d->m_inputhandler->stopInertialEarthRotation();
562 d->m_presenter.zoomOut( mode );
563}
564
565void MarbleWidget::rotateBy( const qreal deltaLon, const qreal deltaLat, FlyToMode mode )
566{
567 d->m_inputhandler->stopInertialEarthRotation();
568 d->m_presenter.rotateBy( deltaLon, deltaLat, mode );
569}
570
571
572void MarbleWidget::centerOn( const qreal lon, const qreal lat, bool animated )
573{
574 d->m_inputhandler->stopInertialEarthRotation();
575 d->m_presenter.centerOn( lon, lat, animated );
576}
577
578void MarbleWidget::centerOn( const GeoDataCoordinates &position, bool animated )
579{
580 d->m_inputhandler->stopInertialEarthRotation();
581 d->m_presenter.centerOn( position, animated );
582}
583
584void MarbleWidget::centerOn( const GeoDataLatLonBox &box, bool animated )
585{
586 d->m_inputhandler->stopInertialEarthRotation();
587 d->m_presenter.centerOn( box, animated );
588}
589
590void MarbleWidget::centerOn( const GeoDataPlacemark& placemark, bool animated )
591{
592 d->m_inputhandler->stopInertialEarthRotation();
593 d->m_presenter.centerOn( placemark, animated );
594}
595
597{
598 d->m_inputhandler->stopInertialEarthRotation();
599 d->m_presenter.setCenterLatitude( lat, mode );
600}
601
603{
604 d->m_inputhandler->stopInertialEarthRotation();
605 d->m_presenter.setCenterLongitude( lon, mode );
606}
607
608Projection MarbleWidget::projection() const
609{
610 return d->m_map.projection();
611}
612
614{
615 d->m_map.setProjection( projection );
616}
617
618void MarbleWidget::setProjection( int projection )
619{
620 setProjection( Projection( qAbs( projection ) % (Mercator+1) ) );
621}
622
624{
625 d->m_inputhandler->stopInertialEarthRotation();
626 d->m_presenter.moveByStep( -1, 0, mode );
627}
628
630{
631 d->m_inputhandler->stopInertialEarthRotation();
632 d->m_presenter.moveByStep( 1, 0, mode );
633}
634
636{
637 d->m_inputhandler->stopInertialEarthRotation();
638 d->m_presenter.moveByStep( 0, -1, mode );
639}
640
642{
643 d->m_inputhandler->stopInertialEarthRotation();
644 d->m_presenter.moveByStep( 0, 1, mode );
645}
646
648{
649 emit mouseMoveGeoPosition( QCoreApplication::translate( "Marble", NOT_AVAILABLE ) );
650}
651
653{
654 setUpdatesEnabled( false );
655 d->m_map.setSize( event->size() );
656 setUpdatesEnabled( true );
657
659}
660
661void MarbleWidget::connectNotify( const QMetaMethod &signal )
662{
663 if ( d->m_inputhandler && signal == QMetaMethod::fromSignal( &MarbleWidget::mouseMoveGeoPosition ) ) {
664 d->m_inputhandler->setPositionSignalConnected( true );
665 }
666}
667
668void MarbleWidget::disconnectNotify( const QMetaMethod &signal )
669{
670 if ( d->m_inputhandler && signal == QMetaMethod::fromSignal( &MarbleWidget::mouseMoveGeoPosition ) ) {
671 d->m_inputhandler->setPositionSignalConnected( false );
672 }
673}
674
675bool MarbleWidget::screenCoordinates( qreal lon, qreal lat,
676 qreal& x, qreal& y ) const
677{
678 return d->m_map.screenCoordinates( lon, lat, x, y );
679}
680
682 qreal& lon, qreal& lat,
683 GeoDataCoordinates::Unit unit ) const
684{
685 return d->m_map.geoCoordinates( x, y, lon, lat, unit );
686}
687
689{
690 return d->m_map.centerLatitude();
691}
692
694{
695 return d->m_map.centerLongitude();
696}
697
699{
700 return viewport()->mapRegion();
701}
702
704{
706 t.start();
707
708 QPaintDevice *paintDevice = this;
709 QImage image;
710 if (!isEnabled())
711 {
712 // If the globe covers fully the screen then we can use the faster
713 // RGB32 as there are no translucent areas involved.
714 QImage::Format imageFormat = ( d->m_map.viewport()->mapCoversViewport() )
717 // Paint to an intermediate image
718 image = QImage( rect().size(), imageFormat );
719 image.fill( Qt::transparent );
720 paintDevice = &image;
721 }
722
723 {
724 // FIXME: Better way to get the GeoPainter
725 // Create a painter that will do the painting.
726 GeoPainter geoPainter( paintDevice, d->m_map.viewport(), d->m_map.mapQuality() );
727
728 d->m_map.paint( geoPainter, evt->rect() );
729 }
730
731 if ( !isEnabled() )
732 {
733 // Draw a grayscale version of the intermediate image
734 QRgb* pixel = reinterpret_cast<QRgb*>( image.scanLine( 0 ));
735 for (int i=0; i<image.width()*image.height(); ++i, ++pixel) {
736 int gray = qGray( *pixel );
737 *pixel = qRgb( gray, gray, gray );
738 }
739
740 QPainter widgetPainter( this );
741 widgetPainter.drawImage( rect(), image );
742 }
743
744 if ( d->m_showFrameRate )
745 {
746 QPainter painter( this );
747 FpsLayer fpsPainter( &t );
748 fpsPainter.paint( &painter );
749
750 const qreal fps = 1000.0 / (qreal)( t.elapsed() + 1 );
751 emit framesPerSecond( fps );
752 }
753}
754
756{
757 Q_UNUSED( painter );
758 /* This is a NOOP in the base class*/
759}
760
761
763{
764 d->m_inputhandler->stopInertialEarthRotation();
765 d->m_presenter.goHome( mode );
766}
767
768QString MarbleWidget::mapThemeId() const
769{
770 return d->m_model.mapThemeId();
771}
772
773void MarbleWidget::setMapThemeId( const QString& mapThemeId )
774{
775 d->m_map.setMapThemeId( mapThemeId );
776}
777
778void MarbleWidgetPrivate::updateMapTheme()
779{
780 m_map.removeLayer( m_routingLayer );
781
782 m_widget->setRadius( m_widget->radius() ); // Corrects zoom range, if needed
783
784 if (m_model.planetId() == QLatin1String("earth")) {
785 m_map.addLayer( m_routingLayer );
786 }
787
788 emit m_widget->themeChanged( m_map.mapThemeId() );
789
790 // Now we want a full repaint as the atmosphere might differ
791 m_widget->setAttribute( Qt::WA_NoSystemBackground, false );
792
793 m_widget->update();
794}
795
797{
798 return d->m_model.mapTheme();
799}
800
801void MarbleWidget::setPropertyValue( const QString& name, bool value )
802{
803 mDebug() << "In MarbleWidget the property " << name << "was set to " << value;
804 d->m_map.setPropertyValue( name, value );
805}
806
808{
809 d->m_map.setShowOverviewMap( visible );
810}
811
813{
814 d->m_map.setShowScaleBar( visible );
815}
816
818{
819 d->m_map.setShowCompass( visible );
820}
821
822void MarbleWidget::setShowClouds( bool visible )
823{
824 d->m_map.setShowClouds( visible );
825}
826
828{
829 d->m_map.setShowSunShading( visible );
830}
831
833{
834 d->m_map.setShowCityLights( visible );
835}
836
838{
839 if ( d->m_map.isLockedToSubSolarPoint() != visible ) { // Toggling input modifies event filters, so avoid that if not needed
841 setInputEnabled( !d->m_map.isLockedToSubSolarPoint() );
842 }
843}
844
846{
847 if ( d->m_map.isSubSolarPointIconVisible() != visible ) {
849 }
850
853 QList<RenderPlugin *>::const_iterator const end = pluginList.constEnd();
854 for (; i != end; ++i ) {
855 if ((*i)->nameId() == QLatin1String("sun")) {
856 (*i)->setVisible( visible );
857 }
858 }
859}
860
862{
863 d->m_map.setShowAtmosphere( visible );
864}
865
867{
868 d->m_map.setShowCrosshairs( visible );
869}
870
871void MarbleWidget::setShowGrid( bool visible )
872{
873 d->m_map.setShowGrid( visible );
874}
875
876void MarbleWidget::setShowPlaces( bool visible )
877{
878 d->m_map.setShowPlaces( visible );
879}
880
881void MarbleWidget::setShowCities( bool visible )
882{
883 d->m_map.setShowCities( visible );
884}
885
887{
888 d->m_map.setShowTerrain( visible );
889}
890
892{
893 d->m_map.setShowOtherPlaces( visible );
894}
895
896void MarbleWidget::setShowRelief( bool visible )
897{
898 d->m_map.setShowRelief( visible );
899}
900
902{
903 d->m_map.setShowIceLayer( visible );
904}
905
907{
908 d->m_map.setShowBorders( visible );
909}
910
911void MarbleWidget::setShowRivers( bool visible )
912{
913 d->m_map.setShowRivers( visible );
914}
915
916void MarbleWidget::setShowLakes( bool visible )
917{
918 d->m_map.setShowLakes( visible );
919}
920
922{
923 d->m_showFrameRate = visible;
924
925 update();
926}
927
928void MarbleWidget::setShowBackground( bool visible )
929{
930 d->m_map.setShowBackground( visible );
931}
932
934{
935 d->m_map.setShowRuntimeTrace( visible );
936}
937
938bool MarbleWidget::showRuntimeTrace() const
939{
940 return d->m_map.showRuntimeTrace();
941}
942
944{
945 d->m_map.setShowDebugPolygons( visible );
946}
947
948bool MarbleWidget::showDebugPolygons() const
949{
950 return d->m_map.showDebugPolygons();
951}
952
954{
956}
957
958bool MarbleWidget::showDebugBatchRender() const
959{
960 return d->m_map.showDebugBatchRender();
961}
962
964{
966}
967
968bool MarbleWidget::showDebugPlacemarks() const
969{
970 return d->m_map.showDebugPlacemarks();
971}
972
974{
976}
977
978bool MarbleWidget::debugLevelTags() const
979{
980 return d->m_map.levelTagDebugModeEnabled();
981}
982
983void MarbleWidget::setShowTileId( bool visible )
984{
985 d->m_map.setShowTileId( visible );
986}
987
989{
990 qreal lon = 0;
991 qreal lat = 0;
992
993 bool const valid = geoCoordinates( x, y, lon, lat, GeoDataCoordinates::Radian );
994
995 if ( valid ) {
996 emit mouseClickGeoPosition( lon, lat, GeoDataCoordinates::Radian );
997 }
998}
999
1000void MarbleWidget::clearVolatileTileCache()
1001{
1002 mDebug() << "About to clear VolatileTileCache";
1003 d->m_map.clearVolatileTileCache();
1004}
1005
1007{
1009}
1010
1011// This slot will called when the Globe starts to create the tiles.
1012
1013void MarbleWidget::creatingTilesStart( TileCreator *creator,
1014 const QString &name,
1015 const QString &description )
1016{
1017 QPointer<TileCreatorDialog> dialog = new TileCreatorDialog( creator, this );
1018 dialog->setSummary( name, description );
1019 dialog->exec();
1020 delete dialog;
1021}
1022
1024{
1025 return d->m_map.mapQuality( viewContext );
1026}
1027
1029{
1030 d->m_map.setMapQualityForViewContext( quality, viewContext );
1031}
1032
1033ViewContext MarbleWidget::viewContext() const
1034{
1035 return d->m_map.viewContext();
1036}
1037
1039{
1040 // Inform routing layer about view context change. If not done,
1041 // the routing layer causes severe performance problems when dragging the
1042 // map. So either do not remove this line, or keep a similar call in place
1043 // when you refactor it and test your changes wrt drag performance at
1044 // high zoom level with long routes!
1045 d->m_routingLayer->setViewContext( viewContext );
1046
1047 d->m_map.setViewContext( viewContext );
1048}
1049
1051{
1052 return d->m_presenter.animationsEnabled();
1053}
1054
1056{
1057 d->m_presenter.setAnimationsEnabled( enabled );
1058}
1059
1060AngleUnit MarbleWidget::defaultAngleUnit() const
1061{
1062 return d->m_map.defaultAngleUnit();
1063}
1064
1065void MarbleWidget::setDefaultAngleUnit( AngleUnit angleUnit )
1066{
1067 d->m_map.setDefaultAngleUnit( angleUnit );
1068}
1069
1070QFont MarbleWidget::defaultFont() const
1071{
1072 return d->m_map.defaultFont();
1073}
1074
1075void MarbleWidget::setDefaultFont( const QFont& font )
1076{
1077 d->m_map.setDefaultFont( font );
1078}
1079
1080void MarbleWidget::setSelection( const QRect& region )
1081{
1082 d->m_presenter.setSelection( region );
1083}
1084
1086{
1087 return d->m_presenter.distance();
1088}
1089
1090void MarbleWidget::setDistance( qreal newDistance )
1091{
1092 d->m_presenter.setDistance( newDistance );
1093}
1094
1096{
1097 return d->m_presenter.distanceString();
1098}
1099
1100void MarbleWidget::setInputEnabled( bool enabled )
1101{
1102 //if input is set as enabled
1103 if ( enabled )
1104 {
1105 if ( !d->m_inputhandler ) {
1106 d->setInputHandler();
1107 }
1108 else {
1109 installEventFilter( d->m_inputhandler );
1110 }
1111 }
1112
1113 else // input is disabled
1114 {
1115 mDebug() << "MarbleWidget::disableInput";
1116 removeEventFilter( d->m_inputhandler );
1118 }
1119}
1120
1122{
1123 return d->m_map.renderPlugins();
1124}
1125
1127{
1128 for( RenderPlugin *plugin: renderPlugins() ) {
1129 settings.beginGroup(QLatin1String("plugin_") + plugin->nameId());
1130
1132
1133 for ( const QString& key: settings.childKeys() ) {
1134 hash.insert( key, settings.value( key ) );
1135 }
1136
1137 plugin->setSettings( hash );
1138
1139 settings.endGroup();
1140 }
1141}
1142
1144{
1145 for( RenderPlugin *plugin: renderPlugins() ) {
1146 settings.beginGroup(QLatin1String("plugin_") + plugin->nameId());
1147
1148 QHash<QString,QVariant> hash = plugin->settings();
1149
1151 while( it != hash.end() ) {
1152 settings.setValue( it.key(), it.value() );
1153 ++it;
1154 }
1155
1156 settings.endGroup();
1157 }
1158}
1159
1161{
1162 return d->m_map.floatItems();
1163}
1164
1166{
1167 return d->m_map.floatItem( nameId );
1168}
1169
1171{
1172 if ( event->type() == QEvent::EnabledChange )
1173 {
1174 setInputEnabled(isEnabled());
1175 }
1176
1178}
1179
1180void MarbleWidget::flyTo( const GeoDataLookAt &newLookAt, FlyToMode mode )
1181{
1182 d->m_inputhandler->stopInertialEarthRotation();
1183 d->m_presenter.flyTo( newLookAt, mode );
1184}
1185
1187{
1188 d->m_map.reload();
1189}
1190
1191void MarbleWidget::downloadRegion( QVector<TileCoordsPyramid> const & pyramid )
1192{
1193 d->m_map.downloadRegion( pyramid );
1194}
1195
1196GeoDataLookAt MarbleWidget::lookAt() const
1197{
1198 return d->m_presenter.lookAt();
1199}
1200
1202{
1203 return d->m_map.viewport()->focusPoint();
1204}
1205
1207{
1208 d->m_map.viewport()->setFocusPoint( focusPoint );
1209}
1210
1212{
1213 d->m_map.viewport()->resetFocusPoint();
1214}
1215
1216qreal MarbleWidget::radiusFromDistance( qreal distance ) const
1217{
1218 return d->m_presenter.radiusFromDistance( distance );
1219}
1220
1221qreal MarbleWidget::distanceFromRadius( qreal radius ) const
1222{
1223 return d->m_presenter.distanceFromRadius( radius );
1224}
1225
1226qreal MarbleWidget::zoomFromDistance( qreal distance ) const
1227{
1228 return d->m_presenter.zoomFromDistance( distance );
1229}
1230
1231qreal MarbleWidget::distanceFromZoom( qreal zoom ) const
1232{
1233 return d->m_presenter.distanceFromZoom( zoom );
1234}
1235
1236RoutingLayer* MarbleWidget::routingLayer()
1237{
1238 return d->m_routingLayer;
1239}
1240
1241PopupLayer *MarbleWidget::popupLayer()
1242{
1243 return d->m_mapInfoDialog;
1244}
1245
1246const StyleBuilder* MarbleWidget::styleBuilder() const
1247{
1248 return d->m_map.styleBuilder();
1249}
1250
1251void MarbleWidget::setHeading( qreal heading )
1252{
1253 d->m_map.setHeading( heading );
1254}
1255
1256qreal MarbleWidget::heading() const
1257{
1258 return d->m_map.heading();
1259}
1260
1262{
1263 d->m_map.setDebugLevelTag(level);
1264}
1265
1266int MarbleWidget::levelToDebug() const
1267{
1268 return d->m_map.debugLevelTag();
1269}
1270
1271}
1272
1273#include "moc_MarbleWidget.cpp"
This file contains the headers for MarbleMap.
This file contains the headers for MarbleModel.
This file contains the headers for MarbleWidget.
This file contains the headers for ViewportParams.
The abstract class for float item plugins.
A 3d point representation.
Unit
enum used constructor to specify the units used
A class that defines a 2D bounding box for geographic data.
a class representing a point of interest on the map
A painter that allows to draw geometric primitives on the map.
Definition GeoPainter.h:89
A container for features parsed from the DGML file.
void setShowSunShading(bool visible)
Set whether the night shadow is visible.
void paint(GeoPainter &painter, const QRect &dirtyRect)
Paint the map using a give painter.
bool showIceLayer() const
Return whether the ice layer is visible.
void setShowCrosshairs(bool visible)
Set whether the crosshairs are visible.
void setShowRivers(bool visible)
Set whether the rivers are visible.
void setShowDebugPolygons(bool visible)
Set whether to enter the debug mode for polygon node drawing.
bool showCities() const
Return whether the city place marks are visible.
void setShowClouds(bool visible)
Set whether the cloud cover is visible.
void setShowBorders(bool visible)
Set whether the borders visible.
void setShowIceLayer(bool visible)
Set whether the ice layer is visible.
qreal centerLongitude() const
Return the longitude of the center point.
void setShowRelief(bool visible)
Set whether the relief is visible.
void setShowTileId(bool visible)
Set whether the is tile is visible NOTE: This is part of the transitional debug API and might be subj...
void setRadius(int radius)
Set the radius of the globe in pixels.
void setProjection(Projection projection)
Set the Projection used for the map.
bool showScaleBar() const
Return whether the scale bar is visible.
void addLayer(LayerInterface *layer)
Add a layer to be included in rendering.
bool showCityLights() const
Return whether the city lights are shown instead of the night shadow.
quint64 volatileTileCacheLimit() const
Returns the limit in kilobytes of the volatile (in RAM) tile cache.
void setShowGrid(bool visible)
Set whether the coordinate grid overlay is visible.
void setPropertyValue(const QString &name, bool value)
Sets the value of a map theme property.
void removeLayer(LayerInterface *layer)
Remove a layer from being included in rendering.
bool showTerrain() const
Return whether the terrain place marks are visible.
void setShowDebugPlacemarks(bool visible)
Set whether to enter the debug mode for placemark drawing.
bool showBorders() const
Return whether the borders are visible.
bool showLakes() const
Return whether the lakes are visible.
int minimumZoom() const
return the minimum zoom value for the current map theme.
void setShowCompass(bool visible)
Set whether the compass overlay is visible.
bool screenCoordinates(qreal lon, qreal lat, qreal &x, qreal &y) const
Get the screen coordinates corresponding to geographical coordinates in the map.
void setShowScaleBar(bool visible)
Set whether the scale bar overlay is visible.
bool showSunShading() const
Return whether the night shadow is visible.
bool isLockedToSubSolarPoint() const
Return whether the globe is locked to the sub solar point.
QString mapThemeId() const
Get the ID of the current map theme To ensure that a unique identifier is being used the theme does N...
void setShowCityLights(bool visible)
Set whether city lights instead of night shadow are visible.
bool showOtherPlaces() const
Return whether other places are visible.
void setShowFrameRate(bool visible)
Set whether the frame rate gets shown.
bool showOverviewMap() const
Return whether the overview map is visible.
void setMapThemeId(const QString &maptheme)
Set a new map theme.
qreal centerLatitude() const
Return the latitude of the center point.
void setSubSolarPointIconVisible(bool visible)
Set whether the sun icon is shown in the sub solar point.
bool showRelief() const
Return whether the relief is visible.
void setShowTerrain(bool visible)
Set whether the terrain place mark overlay is visible.
Projection projection() const
Get the Projection used for the map.
bool showAtmosphere() const
Return whether the atmospheric glow is visible.
void setLockToSubSolarPoint(bool visible)
Set the globe locked to the sub solar point.
bool showCrosshairs() const
Return whether the crosshairs are visible.
bool showClouds() const
Return whether the cloud cover is visible.
int radius() const
Return the radius of the globe in pixels.
void setShowDebugBatchRender(bool visible)
Set whether to enter the debug mode for visualizing batch rendering.
void setShowOtherPlaces(bool visible)
Set whether the other places overlay is visible.
QList< AbstractDataPluginItem * > whichItemAt(const QPoint &curpos) const
Returns all widgets of dataPlugins on the position curpos.
void setShowAtmosphere(bool visible)
Set whether the atmospheric glow is visible.
bool showPlaces() const
Return whether the place marks are visible.
QList< RenderPlugin * > renderPlugins() const
Returns a list of all RenderPlugins in the model, this includes float items.
void reload()
Reload the currently displayed map by reloading texture tiles from the Internet.
bool showGrid() const
Return whether the coordinate grid is visible.
void setShowOverviewMap(bool visible)
Set whether the overview map overlay is visible.
bool isSubSolarPointIconVisible() const
Return whether the sun icon is shown in the sub solar point.
bool showCompass() const
Return whether the compass bar is visible.
void setVolatileTileCacheLimit(quint64 kiloBytes)
Set the limit of the volatile (in RAM) tile cache.
void setLevelTagDebugModeEnabled(bool visible)
Set whether to enter the debug mode for level tags.
const StyleBuilder * styleBuilder() const
void setShowPlaces(bool visible)
Set whether the place mark overlay is visible.
bool showRivers() const
Return whether the rivers are visible.
int maximumZoom() const
return the minimum zoom value for the current map theme.
AbstractFloatItem * floatItem(const QString &nameId) const
Returns a list of all FloatItems in the model.
void setShowLakes(bool visible)
Set whether the lakes are visible.
bool geoCoordinates(int x, int y, qreal &lon, qreal &lat, GeoDataCoordinates::Unit=GeoDataCoordinates::Degree) const
Get the earth coordinates corresponding to a pixel in the map.
void setShowCities(bool visible)
Set whether the city place mark overlay is visible.
The data model (not based on QAbstractModel) for a MarbleWidget.
Definition MarbleModel.h:87
void setShowDebugBatchRender(bool visible)
Set whether to enter the debug mode for batch rendering.
qreal distance() const
Return the current distance.
void creatingTilesStart(TileCreator *creator, const QString &name, const QString &description)
A slot that is called when the model starts to create new tiles.
void setViewContext(ViewContext viewContext)
Set the view context (i.e.
qreal distanceFromRadius(qreal radius) const
Return the distance (km) at the given globe radius (pixel)
void moveRight(FlyToMode mode=Automatic)
Move right by the moveStep.
void setMapQualityForViewContext(MapQuality quality, ViewContext viewContext)
Set the map quality for the specified view context.
qreal moveStep() const
Return how much the map will move if one of the move slots are called.
void setShowClouds(bool visible)
Set whether the cloud cover is visible.
void setShowAtmosphere(bool visible)
Set whether the atmospheric glow is visible.
RenderState renderState() const
Detailed render status of the current map view.
void setShowOtherPlaces(bool visible)
Set whether the other places overlay is visible.
void writePluginSettings(QSettings &settings) const
Writes the plugin settings in the passed QSettings.
void readPluginSettings(QSettings &settings)
Reads the plugin settings from the passed QSettings.
void setShowCityLights(bool visible)
Set whether city lights instead of night shadow are visible.
MarbleWidget(QWidget *parent=nullptr)
Construct a new MarbleWidget.
void setShowOverviewMap(bool visible)
Set whether the overview map overlay is visible.
void setShowCrosshairs(bool visible)
Set whether the crosshairs are visible.
QList< AbstractDataPluginItem * > whichItemAt(const QPoint &curpos) const
Returns all widgets of dataPlugins on the position curpos.
void setAnimationsEnabled(bool enabled)
Set whether travels to a point should get animated.
void moveDown(FlyToMode mode=Automatic)
Move down by the moveStep.
void setShowLakes(bool visible)
Set whether the lakes are visible.
void setSubSolarPointIconVisible(bool visible)
Set whether the sun icon is shown in the sub solar point.
void setShowRivers(bool visible)
Set whether the rivers are visible.
void setCenterLongitude(qreal lon, FlyToMode mode=Instant)
Set the longitude for the center point.
void setShowDebugPolygons(bool visible)
Set whether to enter the debug mode for polygon node drawing.
virtual void customPaint(GeoPainter *painter)
Enables custom drawing onto the MarbleWidget straight after.
bool animationsEnabled() const
Retrieve whether travels to a point should get animated.
void setRadius(int radius)
Set the radius of the globe in pixels.
void setShowFrameRate(bool visible)
Set whether the frame rate gets shown.
void moveUp(FlyToMode mode=Automatic)
Move up by the moveStep.
void setShowRuntimeTrace(bool visible)
Set whether the runtime tracing for layers gets shown.
void setProjection(int projection)
Set the Projection used for the map.
void setShowCompass(bool visible)
Set whether the compass overlay is visible.
void moveLeft(FlyToMode mode=Automatic)
Move left by the moveStep.
qreal zoomFromDistance(qreal distance) const
Returns the zoom value (no unit) corresponding to the given camera distance (km)
void setVolatileTileCacheLimit(quint64 kiloBytes)
Set the limit of the volatile (in RAM) tile cache.
void setLockToSubSolarPoint(bool visible)
Set the globe locked to the sub solar point.
void reloadMap()
Re-download all visible tiles.
GeoDataLookAt lookAt() const
Return the lookAt.
void paintEvent(QPaintEvent *event) override
Reimplementation of the paintEvent() function in QWidget.
void setDistance(qreal distance)
Set the distance of the observer to the globe in km.
void zoomViewBy(int zoomStep, FlyToMode mode=Instant)
Zoom the view by a certain step.
void setShowTerrain(bool visible)
Set whether the terrain place mark overlay is visible.
void setShowBorders(bool visible)
Set whether the borders visible.
AbstractFloatItem * floatItem(const QString &nameId) const
Returns the FloatItem with the given id.
GeoDataCoordinates focusPoint() const
void changeEvent(QEvent *event) override
Reimplementation of the changeEvent() function in QWidget to react to changes of the enabled state.
void setShowGrid(bool visible)
Set whether the coordinate grid overlay is visible.
QList< AbstractFloatItem * > floatItems() const
Returns a list of all FloatItems on the widget.
void setShowRelief(bool visible)
Set whether the relief is visible.
qreal centerLatitude() const
Return the latitude of the center point.
void setShowTileId(bool visible)
Set whether the is tile is visible NOTE: This is part of the transitional debug API and might be subj...
QPixmap mapScreenShot()
Return a QPixmap with the current contents of the widget.
qreal radiusFromDistance(qreal distance) const
Return the globe radius (pixel) for the given distance (km)
void resetFocusPoint()
Invalidate any focus point set with setFocusPoint.
bool showFrameRate() const
Return whether the frame rate gets displayed.
void setFocusPoint(const GeoDataCoordinates &focusPoint)
Change the point of focus, overridding any previously set focus point.
const StyleBuilder * styleBuilder() const
void removeLayer(LayerInterface *layer)
Remove a layer from being included in rendering.
void setShowPlaces(bool visible)
Set whether the place mark overlay is visible.
void setDebugLevelTags(bool visible)
Set whether to render according to OSM indoor level tags.
QString distanceString() const
Return the current distance string.
void leaveEvent(QEvent *event) override
Reimplementation of the leaveEvent() function in QWidget.
QRegion mapRegion() const
Return the projected region which describes the (shape of the) projected surface.
void setShowIceLayer(bool visible)
Set whether the ice layer is visible.
void setZoom(int zoom, FlyToMode mode=Instant)
Zoom the view to a certain zoomlevel.
void setShowCities(bool visible)
Set whether the city place mark overlay is visible.
void setInputHandler(MarbleWidgetInputHandler *handler)
Set the input handler.
bool geoCoordinates(int x, int y, qreal &lon, qreal &lat, GeoDataCoordinates::Unit=GeoDataCoordinates::Degree) const
Get the earth coordinates corresponding to a pixel in the widget.
int maximumZoom() const
Return the minimum zoom value for the current map theme.
MarbleModel * model()
Return the model that this view shows.
void setShowDebugPlacemarks(bool visible)
Set whether to enter the debug mode for placemark drawing.
MarbleWidgetInputHandler * inputHandler() const
Returns the current input handler.
qreal centerLongitude() const
Return the longitude of the center point.
qreal distanceFromZoom(qreal zoom) const
Returns the distance (km) corresponding to the given zoom value.
void zoomView(int zoom, FlyToMode mode=Instant)
void notifyMouseClick(int x, int y)
Used to notify about the position of the mouse click.
void resizeEvent(QResizeEvent *event) override
Reimplementation of the resizeEvent() function in QWidget.
void setCenterLatitude(qreal lat, FlyToMode mode=Instant)
Set the latitude for the center point.
void zoomIn(FlyToMode mode=Automatic)
Zoom in by the amount zoomStep.
void setShowScaleBar(bool visible)
Set whether the scale bar overlay is visible.
void zoomOut(FlyToMode mode=Automatic)
Zoom out by the amount zoomStep.
void setLevelToDebug(int level)
Set the level to debug.
void setHighlightEnabled(bool enabled)
Toggle whether regions are highlighted when user selects them.
bool screenCoordinates(qreal lon, qreal lat, qreal &x, qreal &y) const
Get the screen coordinates corresponding to geographical coordinates in the widget.
void addLayer(LayerInterface *layer)
Add a layer to be included in rendering.
void rotateBy(const qreal deltaLon, const qreal deltaLat, FlyToMode mode=Instant)
Rotate the view by the two angles phi and theta.
int minimumZoom() const
Return the minimum zoom value for the current map theme.
void themeChanged(const QString &theme)
Signal that the theme has changed.
MapQuality mapQuality(ViewContext=Still) const
Retrieve the map quality depending on the view context.
void setPropertyValue(const QString &name, bool value)
Sets the value of a map theme property.
void setShowSunShading(bool visible)
Set whether the night shadow is visible.
int radius() const
Return the radius of the globe in pixels.
void setMapThemeId(const QString &maptheme)
Set a new map theme.
QList< RenderPlugin * > renderPlugins() const
Returns a list of all RenderPlugins on the widget, this includes float items.
GeoSceneDocument * mapTheme() const
Get the GeoSceneDocument object of the current map theme.
void centerOn(const qreal lon, const qreal lat, bool animated=false)
Center the view on a geographical point.
void flyTo(const GeoDataLookAt &lookAt, FlyToMode mode=Automatic)
Change the camera position to the given position.
void goHome(FlyToMode mode=Automatic)
Center the view on the default start point with the default zoom.
void setVisible(bool visible)
Set visibility of the item.
The abstract class that creates a renderable item.
A paint layer that serves as a view on a route model.
void setViewContext(ViewContext viewContext)
Set the view context to determine whether the map is used interactively.
void setPlacemarkModel(MarblePlacemarkModel *model)
Set the placemark model to use.
void setFocusPoint(const GeoDataCoordinates &focusPoint)
Change the point of focus, overridding any previously set focus point.
void resetFocusPoint()
Invalidate any focus point set with setFocusPoint.
GeoDataCoordinates focusPoint() const
Binds a QML item to a specific geodetic location in screen coordinates.
FlyToMode
Describes possible flight mode (interpolation between source and target camera positions)
ViewContext
This enum is used to choose context in which map quality gets used.
AngleUnit
This enum is used to choose the unit chosen to measure angles.
Projection
This enum is used to choose the projection shown in the view.
@ Mercator
Mercator projection.
MapQuality
This enum is used to choose the map quality shown in the view.
QString translate(const char *context, const char *sourceText, const char *disambiguation, int n)
iterator begin()
iterator end()
iterator insert(const Key &key, const T &value)
void fill(Qt::GlobalColor color)
int height() const const
uchar * scanLine(int i)
int width() const const
const_iterator constBegin() const const
const_iterator constEnd() const const
QMetaMethod fromSignal(PointerToMemberFunction signal)
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
bool disconnect(const QMetaObject::Connection &connection)
void installEventFilter(QObject *filterObj)
T qobject_cast(QObject *object)
void removeEventFilter(QObject *obj)
void beginGroup(QAnyStringView prefix)
QStringList childKeys() const const
void endGroup()
void setValue(QAnyStringView key, const QVariant &value)
QVariant value(QAnyStringView key) const const
bool isEmpty() const const
UniqueConnection
ArrowCursor
WheelFocus
OtherFocusReason
WA_NoSystemBackground
void setAutoFillBackground(bool enabled)
virtual void changeEvent(QEvent *event)
void setCursor(const QCursor &)
virtual bool event(QEvent *event) override
void setFocusPolicy(Qt::FocusPolicy policy)
QPixmap grab(const QRect &rectangle)
void setMinimumSize(const QSize &)
void setMouseTracking(bool enable)
void setPalette(const QPalette &)
virtual void resizeEvent(QResizeEvent *event)
void setAttribute(Qt::WidgetAttribute attribute, bool on)
void setFocus()
void update()
void setUpdatesEnabled(bool enable)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jun 21 2024 12:00:07 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.