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 "DataMigration.h"
12#include "FileManager.h"
13#include "FpsLayer.h"
14#include "GeoDataLatLonAltBox.h"
15#include "GeoDataLookAt.h"
16#include "GeoDataPlacemark.h"
17#include "GeoPainter.h"
18#include "MarbleAbstractPresenter.h"
19#include "MarbleClock.h"
20#include "MarbleDebug.h"
21#include "MarbleDirs.h"
22#include "MarbleLocale.h"
23#include "MarbleMap.h"
24#include "MarbleModel.h"
25#include "MarbleWidgetInputHandler.h"
26#include "MarbleWidgetPopupMenu.h"
27#include "Planet.h"
28#include "PopupLayer.h"
29#include "RenderPlugin.h"
30#include "RenderState.h"
31#include "StyleBuilder.h"
32#include "SunLocator.h"
33#include "TileCreatorDialog.h"
34#include "ViewportParams.h"
35#include "routing/RoutingLayer.h"
36#include <QElapsedTimer>
37#include <QHash>
38#include <QMetaMethod>
39#include <QNetworkProxy>
40#include <QPaintEngine>
41#include <QPaintEvent>
42#include <QRegion>
43#include <QSettings>
44#include <qmath.h>
45
46namespace Marble
47{
48
49class MarbleWidget::CustomPaintLayer : public LayerInterface
50{
51public:
52 explicit CustomPaintLayer(MarbleWidget *widget)
53 : m_widget(widget)
54 {
55 }
56
57 QStringList renderPosition() const override
58 {
59 return QStringList() << QStringLiteral("USER_TOOLS");
60 }
61
62 bool render(GeoPainter *painter, ViewportParams *viewport, const QString &renderPos, GeoSceneLayer *layer) override
63 {
64 Q_UNUSED(viewport);
65 Q_UNUSED(renderPos);
66 Q_UNUSED(layer);
67
68 painter->setPen(Qt::black);
69 m_widget->customPaint(painter);
70
71 return true;
72 }
73
74 qreal zValue() const override
75 {
76 return 1.0e7;
77 }
78
79 RenderState renderState() const override
80 {
81 return RenderState(QStringLiteral("Custom Widget Paint"));
82 }
83
84 QString runtimeTrace() const override
85 {
86 return QStringLiteral("MarbleWidget::CustomPaintLayer");
87 }
88
89private:
90 MarbleWidget *const m_widget;
91};
92
93class MarbleWidgetPrivate
94{
95public:
96 explicit MarbleWidgetPrivate(MarbleWidget *parent)
97 : m_widget(parent)
98 , m_model()
99 , m_map(&m_model)
100 , m_presenter(&m_map)
101 , m_inputhandler(nullptr)
102 , m_routingLayer(nullptr)
103 , m_mapInfoDialog(nullptr)
104 , m_customPaintLayer(parent)
105 , m_popupmenu(nullptr)
106 , m_showFrameRate(false)
107 {
108 }
109
110 ~MarbleWidgetPrivate()
111 {
112 m_map.removeLayer(&m_customPaintLayer);
113 m_map.removeLayer(m_mapInfoDialog);
114 delete m_mapInfoDialog;
115 delete m_popupmenu;
116 }
117
118 void construct();
119
120 void updateMapTheme();
121
122 void setInputHandler();
123 void setInputHandler(MarbleWidgetInputHandler *handler);
124
125 /**
126 * @brief Update widget flags and cause a full repaint
127 *
128 * The background of the widget only needs to be redrawn in certain cases. This
129 * method sets the widget flags accordingly and triggers a repaint.
130 */
131 void updateSystemBackgroundAttribute();
132
133 MarbleWidget *const m_widget;
134
135 MarbleModel m_model;
136 MarbleMap m_map;
137
138 MarbleAbstractPresenter m_presenter;
139
140 MarbleWidgetInputHandler *m_inputhandler;
141
142 RoutingLayer *m_routingLayer;
143 PopupLayer *m_mapInfoDialog;
144 MarbleWidget::CustomPaintLayer m_customPaintLayer;
145
146 MarbleWidgetPopupMenu *m_popupmenu;
147
148 bool m_showFrameRate;
149};
150
152 : QWidget(parent)
153 , d(new MarbleWidgetPrivate(this))
154{
155 // setAttribute( Qt::WA_PaintOnScreen, true );
156 d->construct();
157}
158
159MarbleWidget::~MarbleWidget()
160{
161 // Remove and delete an existing InputHandler
162 // initialized in d->construct()
163 setInputHandler(nullptr);
164
165 delete d;
166}
167
168void MarbleWidgetPrivate::construct()
169{
170 QPointer<DataMigration> dataMigration = new DataMigration(m_widget);
171 dataMigration->exec();
172 delete dataMigration;
173
174 // Widget settings
175 m_widget->setMinimumSize(200, 300);
178
179 // Set background: black.
180 m_widget->setPalette(QPalette(Qt::black));
181
182 // Set whether the black space gets displayed or the earth gets simply
183 // displayed on the widget background.
184 m_widget->setAutoFillBackground(true);
185
186 // Initialize the map and forward some signals.
187 m_map.setSize(m_widget->width(), m_widget->height());
188 m_map.setShowFrameRate(false); // never let the map draw the frame rate,
189 // we do this differently here in the widget
190
191 m_widget->connect(&m_presenter, SIGNAL(regionSelected(GeoDataLatLonBox)), m_widget, SIGNAL(regionSelected(GeoDataLatLonBox)));
192
193 m_widget->connect(&m_presenter, SIGNAL(zoomChanged(int)), m_widget, SIGNAL(zoomChanged(int)));
194 m_widget->connect(&m_presenter, SIGNAL(distanceChanged(QString)), m_widget, SIGNAL(distanceChanged(QString)));
195
196 // forward some signals of m_map
197 m_widget->connect(&m_map, SIGNAL(visibleLatLonAltBoxChanged(GeoDataLatLonAltBox)), m_widget, SIGNAL(visibleLatLonAltBoxChanged(GeoDataLatLonAltBox)));
198 m_widget->connect(&m_map, SIGNAL(projectionChanged(Projection)), m_widget, SIGNAL(projectionChanged(Projection)));
199 m_widget->connect(&m_map, SIGNAL(tileLevelChanged(int)), m_widget, SIGNAL(tileLevelChanged(int)));
200 m_widget->connect(&m_map, SIGNAL(framesPerSecond(qreal)), m_widget, SIGNAL(framesPerSecond(qreal)));
201 m_widget->connect(&m_map, SIGNAL(viewContextChanged(ViewContext)), m_widget, SLOT(setViewContext(ViewContext)));
202
203 m_widget->connect(&m_map, SIGNAL(pluginSettingsChanged()), m_widget, SIGNAL(pluginSettingsChanged()));
204 m_widget->connect(&m_map, SIGNAL(renderPluginInitialized(RenderPlugin *)), m_widget, SIGNAL(renderPluginInitialized(RenderPlugin *)));
205
206 // react to some signals of m_map
207 m_widget->connect(&m_map, SIGNAL(themeChanged(QString)), m_widget, SLOT(updateMapTheme()));
208 m_widget->connect(&m_map, SIGNAL(viewContextChanged(ViewContext)), m_widget, SIGNAL(viewContextChanged(ViewContext)));
209 m_widget->connect(&m_map, SIGNAL(repaintNeeded(QRegion)), m_widget, SLOT(update()));
210 m_widget->connect(&m_map, SIGNAL(visibleLatLonAltBoxChanged(GeoDataLatLonAltBox)), m_widget, SLOT(updateSystemBackgroundAttribute()));
211 m_widget->connect(&m_map, SIGNAL(renderStatusChanged(RenderStatus)), m_widget, SIGNAL(renderStatusChanged(RenderStatus)));
212 m_widget->connect(&m_map, SIGNAL(renderStateChanged(RenderState)), m_widget, SIGNAL(renderStateChanged(RenderState)));
213
214 m_widget->connect(&m_map, SIGNAL(propertyValueChanged(QString, bool)), m_widget, SIGNAL(propertyValueChanged(QString, bool)));
215
216 m_widget->connect(m_model.fileManager(), SIGNAL(centeredDocument(GeoDataLatLonBox)), m_widget, SLOT(centerOn(GeoDataLatLonBox)));
217
218 // Show a progress dialog when the model calculates new map tiles.
219 m_widget->connect(&m_model,
220 SIGNAL(creatingTilesStart(TileCreator *, const QString &, const QString &)),
221 m_widget,
222 SLOT(creatingTilesStart(TileCreator *, const QString &, const QString &)));
223
224 m_popupmenu = new MarbleWidgetPopupMenu(m_widget, &m_model);
225
226 m_routingLayer = new RoutingLayer(m_widget, m_widget);
227 m_routingLayer->setPlacemarkModel(nullptr);
228 QObject::connect(m_routingLayer, SIGNAL(repaintNeeded(QRect)), m_widget, SLOT(update()));
229
230 m_mapInfoDialog = new PopupLayer(m_widget, m_widget);
231 m_mapInfoDialog->setVisible(false);
232 m_widget->connect(m_mapInfoDialog, SIGNAL(repaintNeeded()), m_widget, SLOT(update()));
233 m_map.addLayer(m_mapInfoDialog);
234
235 setInputHandler();
236 m_widget->setMouseTracking(true);
237
238 m_map.addLayer(&m_customPaintLayer);
239
240 m_widget->connect(m_inputhandler,
241 SIGNAL(mouseClickGeoPosition(qreal, qreal, GeoDataCoordinates::Unit)),
242 m_widget,
243 SIGNAL(highlightedPlacemarksChanged(qreal, qreal, GeoDataCoordinates::Unit)));
244 m_widget->setHighlightEnabled(true);
245}
246
247void MarbleWidgetPrivate::setInputHandler()
248{
249 setInputHandler(new MarbleWidgetInputHandler(&m_presenter, m_widget));
250}
251
252void MarbleWidgetPrivate::setInputHandler(MarbleWidgetInputHandler *handler)
253{
254 delete m_inputhandler;
255 m_inputhandler = handler;
256
257 if (m_inputhandler) {
258 m_widget->installEventFilter(m_inputhandler);
259
260 QObject::connect(m_inputhandler, SIGNAL(mouseClickScreenPosition(int, int)), m_widget, SLOT(notifyMouseClick(int, int)));
261
262 QObject::connect(m_inputhandler, SIGNAL(mouseMoveGeoPosition(QString)), m_widget, SIGNAL(mouseMoveGeoPosition(QString)));
263 }
264}
265
266void MarbleWidgetPrivate::updateSystemBackgroundAttribute()
267{
268 // We only have to repaint the background every time if the earth
269 // doesn't cover the whole image.
270 const bool isOn = m_map.viewport()->mapCoversViewport() && !m_model.mapThemeId().isEmpty();
272}
273
274// ----------------------------------------------------------------
275
277{
278 return &d->m_model;
279}
280
281const MarbleModel *MarbleWidget::model() const
282{
283 return &d->m_model;
284}
285
286ViewportParams *MarbleWidget::viewport()
287{
288 return d->m_map.viewport();
289}
290
291const ViewportParams *MarbleWidget::viewport() const
292{
293 return d->m_map.viewport();
294}
295
296MarbleWidgetPopupMenu *MarbleWidget::popupMenu()
297{
298 return d->m_popupmenu;
299}
300
301void MarbleWidget::setInputHandler(MarbleWidgetInputHandler *handler)
302{
303 d->setInputHandler(handler);
304}
305
306MarbleWidgetInputHandler *MarbleWidget::inputHandler() const
307{
308 return d->m_inputhandler;
309}
310
312{
313 return d->m_map.radius();
314}
315
317{
318 d->m_map.setRadius(radius);
319}
320
322{
323 return d->m_presenter.moveStep();
324}
325
326int MarbleWidget::zoom() const
327{
328 return d->m_presenter.logzoom();
329}
330
331int MarbleWidget::tileZoomLevel() const
332{
333 return d->m_map.tileZoomLevel();
334}
335
337{
338 return d->m_map.minimumZoom();
339}
340
342{
343 return d->m_map.maximumZoom();
344}
345
346QList<const GeoDataFeature *> MarbleWidget::whichFeatureAt(const QPoint &curpos) const
347{
348 return d->m_map.whichFeatureAt(curpos);
349}
350
352{
353 return d->m_map.whichItemAt(curpos);
354}
355
356void MarbleWidget::addLayer(LayerInterface *layer)
357{
358 d->m_map.addLayer(layer);
359}
360
361void MarbleWidget::removeLayer(LayerInterface *layer)
362{
363 d->m_map.removeLayer(layer);
364}
365
366Marble::TextureLayer *MarbleWidget::textureLayer() const
367{
368 return d->m_map.textureLayer();
369}
370
371VectorTileLayer *MarbleWidget::vectorTileLayer() const
372{
373 return d->m_map.vectorTileLayer();
374}
375
377{
378 return grab();
379}
380
381RenderStatus MarbleWidget::renderStatus() const
382{
383 return d->m_map.renderStatus();
384}
385
386RenderState MarbleWidget::renderState() const
387{
388 return d->m_map.renderState();
389}
390
392{
393 if (enabled) {
394 connect(this,
395 SIGNAL(highlightedPlacemarksChanged(qreal, qreal, GeoDataCoordinates::Unit)),
396 &d->m_map,
397 SIGNAL(highlightedPlacemarksChanged(qreal, qreal, GeoDataCoordinates::Unit)),
399 } else {
400 disconnect(this,
401 SIGNAL(highlightedPlacemarksChanged(qreal, qreal, GeoDataCoordinates::Unit)),
402 &d->m_map,
403 SIGNAL(highlightedPlacemarksChanged(qreal, qreal, GeoDataCoordinates::Unit)));
404 }
405}
406
407bool MarbleWidget::showOverviewMap() const
408{
409 return d->m_map.showOverviewMap();
410}
411
412bool MarbleWidget::showScaleBar() const
413{
414 return d->m_map.showScaleBar();
415}
416
417bool MarbleWidget::showCompass() const
418{
419 return d->m_map.showCompass();
420}
421
422bool MarbleWidget::showClouds() const
423{
424 return d->m_map.showClouds();
425}
426
427bool MarbleWidget::showSunShading() const
428{
429 return d->m_map.showSunShading();
430}
431
432bool MarbleWidget::showCityLights() const
433{
434 return d->m_map.showCityLights();
435}
436
437bool MarbleWidget::isLockedToSubSolarPoint() const
438{
439 return d->m_map.isLockedToSubSolarPoint();
440}
441
442bool MarbleWidget::isSubSolarPointIconVisible() const
443{
444 return d->m_map.isSubSolarPointIconVisible();
445}
446
447bool MarbleWidget::showAtmosphere() const
448{
449 return d->m_map.showAtmosphere();
450}
451
452bool MarbleWidget::showCrosshairs() const
453{
454 return d->m_map.showCrosshairs();
455}
456
457bool MarbleWidget::showGrid() const
458{
459 return d->m_map.showGrid();
460}
461
462bool MarbleWidget::showPlaces() const
463{
464 return d->m_map.showPlaces();
465}
466
467bool MarbleWidget::showCities() const
468{
469 return d->m_map.showCities();
470}
471
472bool MarbleWidget::showTerrain() const
473{
474 return d->m_map.showTerrain();
475}
476
477bool MarbleWidget::showOtherPlaces() const
478{
479 return d->m_map.showOtherPlaces();
480}
481
482bool MarbleWidget::showRelief() const
483{
484 return d->m_map.showRelief();
485}
486
487bool MarbleWidget::showIceLayer() const
488{
489 return d->m_map.showIceLayer();
490}
491
492bool MarbleWidget::showBorders() const
493{
494 return d->m_map.showBorders();
495}
496
497bool MarbleWidget::showRivers() const
498{
499 return d->m_map.showRivers();
500}
501
502bool MarbleWidget::showLakes() const
503{
504 return d->m_map.showLakes();
505}
506
508{
509 return d->m_showFrameRate;
510}
511
512bool MarbleWidget::showBackground() const
513{
514 return d->m_map.showBackground();
515}
516
517quint64 MarbleWidget::volatileTileCacheLimit() const
518{
519 return d->m_map.volatileTileCacheLimit();
520}
521
522void MarbleWidget::setZoom(int newZoom, FlyToMode mode)
523{
524 d->m_inputhandler->stopInertialEarthRotation();
525 d->m_presenter.setZoom(newZoom, mode);
526}
527
529{
530 d->m_inputhandler->stopInertialEarthRotation();
531 d->m_presenter.zoomView(zoom, mode);
532}
533
534void MarbleWidget::zoomViewBy(int zoomStep, FlyToMode mode)
535{
536 d->m_inputhandler->stopInertialEarthRotation();
537 d->m_presenter.zoomViewBy(zoomStep, mode);
538}
539
541{
542 d->m_inputhandler->stopInertialEarthRotation();
543 d->m_presenter.zoomIn(mode);
544}
545
547{
548 d->m_inputhandler->stopInertialEarthRotation();
549 d->m_presenter.zoomOut(mode);
550}
551
552void MarbleWidget::rotateBy(const qreal deltaLon, const qreal deltaLat, FlyToMode mode)
553{
554 d->m_inputhandler->stopInertialEarthRotation();
555 d->m_presenter.rotateBy(deltaLon, deltaLat, mode);
556}
557
558void MarbleWidget::centerOn(const qreal lon, const qreal lat, bool animated)
559{
560 d->m_inputhandler->stopInertialEarthRotation();
561 d->m_presenter.centerOn(lon, lat, animated);
562}
563
564void MarbleWidget::centerOn(const GeoDataCoordinates &position, bool animated)
565{
566 d->m_inputhandler->stopInertialEarthRotation();
567 d->m_presenter.centerOn(position, animated);
568}
569
570void MarbleWidget::centerOn(const GeoDataLatLonBox &box, bool animated)
571{
572 d->m_inputhandler->stopInertialEarthRotation();
573 d->m_presenter.centerOn(box, animated);
574}
575
576void MarbleWidget::centerOn(const GeoDataPlacemark &placemark, bool animated)
577{
578 d->m_inputhandler->stopInertialEarthRotation();
579 d->m_presenter.centerOn(placemark, animated);
580}
581
583{
584 d->m_inputhandler->stopInertialEarthRotation();
585 d->m_presenter.setCenterLatitude(lat, mode);
586}
587
589{
590 d->m_inputhandler->stopInertialEarthRotation();
591 d->m_presenter.setCenterLongitude(lon, mode);
592}
593
594Projection MarbleWidget::projection() const
595{
596 return d->m_map.projection();
597}
598
600{
601 d->m_map.setProjection(projection);
602}
603
604void MarbleWidget::setProjection(int projection)
605{
606 setProjection(Projection(qAbs(projection) % (Mercator + 1)));
607}
608
610{
611 d->m_inputhandler->stopInertialEarthRotation();
612 d->m_presenter.moveByStep(-1, 0, mode);
613}
614
616{
617 d->m_inputhandler->stopInertialEarthRotation();
618 d->m_presenter.moveByStep(1, 0, mode);
619}
620
622{
623 d->m_inputhandler->stopInertialEarthRotation();
624 d->m_presenter.moveByStep(0, -1, mode);
625}
626
628{
629 d->m_inputhandler->stopInertialEarthRotation();
630 d->m_presenter.moveByStep(0, 1, mode);
631}
632
634{
635 Q_EMIT mouseMoveGeoPosition(QCoreApplication::translate("Marble", NOT_AVAILABLE));
636}
637
639{
640 setUpdatesEnabled(false);
641 d->m_map.setSize(event->size());
642 setUpdatesEnabled(true);
643
645}
646
647void MarbleWidget::connectNotify(const QMetaMethod &signal)
648{
649 if (d->m_inputhandler && signal == QMetaMethod::fromSignal(&MarbleWidget::mouseMoveGeoPosition)) {
650 d->m_inputhandler->setPositionSignalConnected(true);
651 }
652}
653
654void MarbleWidget::disconnectNotify(const QMetaMethod &signal)
655{
656 if (d->m_inputhandler && signal == QMetaMethod::fromSignal(&MarbleWidget::mouseMoveGeoPosition)) {
657 d->m_inputhandler->setPositionSignalConnected(false);
658 }
659}
660
661bool MarbleWidget::screenCoordinates(qreal lon, qreal lat, qreal &x, qreal &y) const
662{
663 return d->m_map.screenCoordinates(lon, lat, x, y);
664}
665
666bool MarbleWidget::geoCoordinates(int x, int y, qreal &lon, qreal &lat, GeoDataCoordinates::Unit unit) const
667{
668 return d->m_map.geoCoordinates(x, y, lon, lat, unit);
669}
670
672{
673 return d->m_map.centerLatitude();
674}
675
677{
678 return d->m_map.centerLongitude();
679}
680
682{
683 return viewport()->mapRegion();
684}
685
687{
689 t.start();
690
691 QPaintDevice *paintDevice = this;
692 QImage image;
693 if (!isEnabled()) {
694 // If the globe covers fully the screen then we can use the faster
695 // RGB32 as there are no translucent areas involved.
696 QImage::Format imageFormat = (d->m_map.viewport()->mapCoversViewport()) ? QImage::Format_RGB32 : QImage::Format_ARGB32_Premultiplied;
697 // Paint to an intermediate image
698 image = QImage(rect().size(), imageFormat);
699 image.fill(Qt::transparent);
700 paintDevice = &image;
701 }
702
703 {
704 // FIXME: Better way to get the GeoPainter
705 // Create a painter that will do the painting.
706 GeoPainter geoPainter(paintDevice, d->m_map.viewport(), d->m_map.mapQuality());
707
708 d->m_map.paint(geoPainter, evt->rect());
709 }
710
711 if (!isEnabled()) {
712 // Draw a grayscale version of the intermediate image
713 QRgb *pixel = reinterpret_cast<QRgb *>(image.scanLine(0));
714 for (int i = 0; i < image.width() * image.height(); ++i, ++pixel) {
715 int gray = qGray(*pixel);
716 *pixel = qRgb(gray, gray, gray);
717 }
718
719 QPainter widgetPainter(this);
720 widgetPainter.drawImage(rect(), image);
721 }
722
723 if (d->m_showFrameRate) {
724 QPainter painter(this);
725 FpsLayer fpsPainter(&t);
726 fpsPainter.paint(&painter);
727
728 const qreal fps = 1000.0 / (qreal)(t.elapsed() + 1);
729 Q_EMIT framesPerSecond(fps);
730 }
731}
732
734{
735 Q_UNUSED(painter);
736 /* This is a NOOP in the base class*/
737}
738
740{
741 d->m_inputhandler->stopInertialEarthRotation();
742 d->m_presenter.goHome(mode);
743}
744
745QString MarbleWidget::mapThemeId() const
746{
747 return d->m_model.mapThemeId();
748}
749
751{
752 d->m_map.setMapThemeId(mapThemeId);
753}
754
755void MarbleWidgetPrivate::updateMapTheme()
756{
757 m_map.removeLayer(m_routingLayer);
758
759 m_widget->setRadius(m_widget->radius()); // Corrects zoom range, if needed
760
761 if (m_model.planetId() == QLatin1StringView("earth")) {
762 m_map.addLayer(m_routingLayer);
763 }
764
765 Q_EMIT m_widget->themeChanged(m_map.mapThemeId());
766
767 // Now we want a full repaint as the atmosphere might differ
768 m_widget->setAttribute(Qt::WA_NoSystemBackground, false);
769
770 m_widget->update();
771}
772
774{
775 return d->m_model.mapTheme();
776}
777
778void MarbleWidget::setPropertyValue(const QString &name, bool value)
779{
780 mDebug() << "In MarbleWidget the property " << name << "was set to " << value;
781 d->m_map.setPropertyValue(name, value);
782}
783
785{
786 d->m_map.setShowOverviewMap(visible);
787}
788
790{
791 d->m_map.setShowScaleBar(visible);
792}
793
795{
796 d->m_map.setShowCompass(visible);
797}
798
800{
801 d->m_map.setShowClouds(visible);
802}
803
805{
806 d->m_map.setShowSunShading(visible);
807}
808
810{
811 d->m_map.setShowCityLights(visible);
812}
813
815{
816 if (d->m_map.isLockedToSubSolarPoint() != visible) { // Toggling input modifies event filters, so avoid that if not needed
818 setInputEnabled(!d->m_map.isLockedToSubSolarPoint());
819 }
820}
821
823{
824 if (d->m_map.isSubSolarPointIconVisible() != visible) {
826 }
827
830 QList<RenderPlugin *>::const_iterator const end = pluginList.constEnd();
831 for (; i != end; ++i) {
832 if ((*i)->nameId() == QLatin1StringView("sun")) {
833 (*i)->setVisible(visible);
834 }
835 }
836}
837
839{
840 d->m_map.setShowAtmosphere(visible);
841}
842
844{
845 d->m_map.setShowCrosshairs(visible);
846}
847
849{
850 d->m_map.setShowGrid(visible);
851}
852
854{
855 d->m_map.setShowPlaces(visible);
856}
857
859{
860 d->m_map.setShowCities(visible);
861}
862
864{
865 d->m_map.setShowTerrain(visible);
866}
867
869{
870 d->m_map.setShowOtherPlaces(visible);
871}
872
874{
875 d->m_map.setShowRelief(visible);
876}
877
879{
880 d->m_map.setShowIceLayer(visible);
881}
882
884{
885 d->m_map.setShowBorders(visible);
886}
887
889{
890 d->m_map.setShowRivers(visible);
891}
892
894{
895 d->m_map.setShowLakes(visible);
896}
897
899{
900 d->m_showFrameRate = visible;
901
902 update();
903}
904
905void MarbleWidget::setShowBackground(bool visible)
906{
907 d->m_map.setShowBackground(visible);
908}
909
911{
912 d->m_map.setShowRuntimeTrace(visible);
913}
914
915bool MarbleWidget::showRuntimeTrace() const
916{
917 return d->m_map.showRuntimeTrace();
918}
919
921{
923}
924
925bool MarbleWidget::showDebugPolygons() const
926{
927 return d->m_map.showDebugPolygons();
928}
929
934
935bool MarbleWidget::showDebugBatchRender() const
936{
937 return d->m_map.showDebugBatchRender();
938}
939
941{
943}
944
945bool MarbleWidget::showDebugPlacemarks() const
946{
947 return d->m_map.showDebugPlacemarks();
948}
949
951{
953}
954
955bool MarbleWidget::debugLevelTags() const
956{
957 return d->m_map.levelTagDebugModeEnabled();
958}
959
961{
962 d->m_map.setShowTileId(visible);
963}
964
966{
967 qreal lon = 0;
968 qreal lat = 0;
969
970 bool const valid = geoCoordinates(x, y, lon, lat, GeoDataCoordinates::Radian);
971
972 if (valid) {
973 Q_EMIT mouseClickGeoPosition(lon, lat, GeoDataCoordinates::Radian);
974 }
975}
976
977void MarbleWidget::clearVolatileTileCache()
978{
979 mDebug() << "About to clear VolatileTileCache";
980 d->m_map.clearVolatileTileCache();
981}
982
984{
985 d->m_map.setVolatileTileCacheLimit(kiloBytes);
986}
987
988// This slot will called when the Globe starts to create the tiles.
989
990void MarbleWidget::creatingTilesStart(TileCreator *creator, const QString &name, const QString &description)
991{
992 QPointer<TileCreatorDialog> dialog = new TileCreatorDialog(creator, this);
993 dialog->setSummary(name, description);
994 dialog->exec();
995 delete dialog;
996}
997
999{
1000 return d->m_map.mapQuality(viewContext);
1001}
1002
1004{
1005 d->m_map.setMapQualityForViewContext(quality, viewContext);
1006}
1007
1008ViewContext MarbleWidget::viewContext() const
1009{
1010 return d->m_map.viewContext();
1011}
1012
1014{
1015 // Inform routing layer about view context change. If not done,
1016 // the routing layer causes severe performance problems when dragging the
1017 // map. So either do not remove this line, or keep a similar call in place
1018 // when you refactor it and test your changes wrt drag performance at
1019 // high zoom level with long routes!
1020 d->m_routingLayer->setViewContext(viewContext);
1021
1022 d->m_map.setViewContext(viewContext);
1023}
1024
1026{
1027 return d->m_presenter.animationsEnabled();
1028}
1029
1031{
1032 d->m_presenter.setAnimationsEnabled(enabled);
1033}
1034
1035AngleUnit MarbleWidget::defaultAngleUnit() const
1036{
1037 return d->m_map.defaultAngleUnit();
1038}
1039
1040void MarbleWidget::setDefaultAngleUnit(AngleUnit angleUnit)
1041{
1042 d->m_map.setDefaultAngleUnit(angleUnit);
1043}
1044
1045QFont MarbleWidget::defaultFont() const
1046{
1047 return d->m_map.defaultFont();
1048}
1049
1050void MarbleWidget::setDefaultFont(const QFont &font)
1051{
1052 d->m_map.setDefaultFont(font);
1053}
1054
1055void MarbleWidget::setSelection(const QRect &region)
1056{
1057 d->m_presenter.setSelection(region);
1058}
1059
1061{
1062 return d->m_presenter.distance();
1063}
1064
1065void MarbleWidget::setDistance(qreal newDistance)
1066{
1067 d->m_presenter.setDistance(newDistance);
1068}
1069
1071{
1072 return d->m_presenter.distanceString();
1073}
1074
1075void MarbleWidget::setInputEnabled(bool enabled)
1076{
1077 // if input is set as enabled
1078 if (enabled) {
1079 if (!d->m_inputhandler) {
1080 d->setInputHandler();
1081 } else {
1082 installEventFilter(d->m_inputhandler);
1083 }
1084 }
1085
1086 else // input is disabled
1087 {
1088 mDebug() << "MarbleWidget::disableInput";
1089 removeEventFilter(d->m_inputhandler);
1091 }
1092}
1093
1095{
1096 return d->m_map.renderPlugins();
1097}
1098
1100{
1101 for (RenderPlugin *plugin : renderPlugins()) {
1102 settings.beginGroup(QLatin1StringView("plugin_") + plugin->nameId());
1103
1105
1106 for (const QString &key : settings.childKeys()) {
1107 hash.insert(key, settings.value(key));
1108 }
1109
1110 plugin->setSettings(hash);
1111
1112 settings.endGroup();
1113 }
1114}
1115
1117{
1118 for (RenderPlugin *plugin : renderPlugins()) {
1119 settings.beginGroup(QLatin1StringView("plugin_") + plugin->nameId());
1120
1121 QHash<QString, QVariant> hash = plugin->settings();
1122
1124 while (it != hash.end()) {
1125 settings.setValue(it.key(), it.value());
1126 ++it;
1127 }
1128
1129 settings.endGroup();
1130 }
1131}
1132
1134{
1135 return d->m_map.floatItems();
1136}
1137
1139{
1140 return d->m_map.floatItem(nameId);
1141}
1142
1144{
1145 if (event->type() == QEvent::EnabledChange) {
1146 setInputEnabled(isEnabled());
1147 }
1148
1150}
1151
1152void MarbleWidget::flyTo(const GeoDataLookAt &newLookAt, FlyToMode mode)
1153{
1154 d->m_inputhandler->stopInertialEarthRotation();
1155 d->m_presenter.flyTo(newLookAt, mode);
1156}
1157
1159{
1160 d->m_map.reload();
1161}
1162
1163void MarbleWidget::downloadRegion(QList<TileCoordsPyramid> const &pyramid)
1164{
1165 d->m_map.downloadRegion(pyramid);
1166}
1167
1168GeoDataLookAt MarbleWidget::lookAt() const
1169{
1170 return d->m_presenter.lookAt();
1171}
1172
1174{
1175 return d->m_map.viewport()->focusPoint();
1176}
1177
1179{
1180 d->m_map.viewport()->setFocusPoint(focusPoint);
1181}
1182
1184{
1185 d->m_map.viewport()->resetFocusPoint();
1186}
1187
1188qreal MarbleWidget::radiusFromDistance(qreal distance) const
1189{
1190 return d->m_presenter.radiusFromDistance(distance);
1191}
1192
1193qreal MarbleWidget::distanceFromRadius(qreal radius) const
1194{
1195 return d->m_presenter.distanceFromRadius(radius);
1196}
1197
1198qreal MarbleWidget::zoomFromDistance(qreal distance) const
1199{
1200 return d->m_presenter.zoomFromDistance(distance);
1201}
1202
1203qreal MarbleWidget::distanceFromZoom(qreal zoom) const
1204{
1205 return d->m_presenter.distanceFromZoom(zoom);
1206}
1207
1208RoutingLayer *MarbleWidget::routingLayer()
1209{
1210 return d->m_routingLayer;
1211}
1212
1213PopupLayer *MarbleWidget::popupLayer()
1214{
1215 return d->m_mapInfoDialog;
1216}
1217
1218const StyleBuilder *MarbleWidget::styleBuilder() const
1219{
1220 return d->m_map.styleBuilder();
1221}
1222
1223void MarbleWidget::setHeading(qreal heading)
1224{
1225 d->m_map.setHeading(heading);
1226}
1227
1228qreal MarbleWidget::heading() const
1229{
1230 return d->m_map.heading();
1231}
1232
1234{
1235 d->m_map.setDebugLevelTag(level);
1236}
1237
1238int MarbleWidget::levelToDebug() const
1239{
1240 return d->m_map.debugLevelTag();
1241}
1242
1243}
1244
1245#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:86
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:84
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)
qint64 elapsed() const const
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)
Q_EMITQ_EMIT
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
bool disconnect(const QMetaObject::Connection &connection)
void installEventFilter(QObject *filterObj)
void removeEventFilter(QObject *obj)
void drawImage(const QPoint &point, const QImage &image)
const QRect & rect() const const
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 Nov 8 2024 12:02:44 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.