QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
gui
qgsmapoverviewcanvas.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsmapoverviewcanvas.h
3
Map canvas subclassed for overview
4
-------------------
5
begin : 09/14/2005
6
copyright : (C) 2005 by Martin Dobias
7
email : won.der at centrum.sk
8
***************************************************************************/
9
10
/***************************************************************************
11
* *
12
* This program is free software; you can redistribute it and/or modify *
13
* it under the terms of the GNU General Public License as published by *
14
* the Free Software Foundation; either version 2 of the License, or *
15
* (at your option) any later version. *
16
* *
17
***************************************************************************/
18
19
#ifndef QGSMAPOVERVIEWCANVAS_H
20
#define QGSMAPOVERVIEWCANVAS_H
21
22
#include <QPixmap>
23
#include <QWidget>
24
25
class
QMouseEvent;
26
class
QgsMapCanvas
;
27
class
QgsPanningWidget;
// defined in .cpp
28
class
QgsRectangle
;
29
30
class
QgsMapRendererQImageJob
;
31
#include "
qgsmapsettings.h
"
32
#include "qgis_gui.h"
33
38
class
GUI_EXPORT
QgsMapOverviewCanvas
:
public
QWidget
39
{
40
Q_OBJECT
41
42
public
:
43
QgsMapOverviewCanvas
( QWidget *parent
SIP_TRANSFERTHIS
=
nullptr
,
QgsMapCanvas
*mapCanvas =
nullptr
);
44
46
void
refresh
();
47
49
void
setBackgroundColor
(
const
QColor &color );
50
52
void
setLayers
(
const
QList<QgsMapLayer *> &
layers
);
53
55
QList<QgsMapLayer *>
layers
()
const
;
56
57
void
enableAntiAliasing
(
bool
flag )
58
{
59
mSettings
.setFlag(
Qgis::MapSettingsFlag::Antialiasing
, flag );
60
mSettings
.setFlag(
Qgis::MapSettingsFlag::HighQualityImageTransforms
, flag );
61
}
62
63
void
updateFullExtent();
64
65
protected
slots:
66
void
mapRenderingFinished();
67
71
void
layerRepaintRequested(
bool
deferred =
false
);
72
73
protected
:
75
void
drawExtentRect();
76
78
void
destinationCrsChanged();
79
81
void
transformContextChanged();
82
84
void
paintEvent( QPaintEvent *pe )
override
;
85
87
void
showEvent( QShowEvent *e )
override
;
88
90
void
resizeEvent( QResizeEvent *e )
override
;
91
93
void
mouseMoveEvent( QMouseEvent *e )
override
;
94
96
void
mousePressEvent( QMouseEvent *e )
override
;
97
99
void
mouseReleaseEvent( QMouseEvent *e )
override
;
100
102
void
wheelEvent( QWheelEvent *e )
override
;
103
105
void
updatePanningWidget( QPoint pos );
106
108
QgsPanningWidget *
mPanningWidget
=
nullptr
;
109
111
QPoint
mPanningCursorOffset
;
112
114
QgsMapCanvas
*
mMapCanvas
=
nullptr
;
115
117
QPixmap
mPixmap
;
118
120
QgsMapSettings
mSettings
;
121
123
QgsMapRendererQImageJob
*
mJob
=
nullptr
;
124
};
125
126
127
#ifndef SIP_RUN
128
130
// Widget that serves as rectangle showing current extent in overview
131
class
QgsPanningWidget :
public
QWidget
132
{
133
Q_OBJECT
134
135
QPolygon mPoly;
136
137
public
:
138
explicit
QgsPanningWidget( QWidget *parent );
139
140
void
setPolygon(
const
QPolygon &p );
141
142
void
paintEvent( QPaintEvent *pe )
override
;
143
};
145
146
#endif
147
148
#endif
Qgis::MapSettingsFlag::Antialiasing
@ Antialiasing
Enable anti-aliasing for map rendering.
Definition
qgis.h:2930
Qgis::MapSettingsFlag::HighQualityImageTransforms
@ HighQualityImageTransforms
Enable high quality image transformations, which results in better appearance of scaled or rotated ra...
Definition
qgis.h:2945
QgsMapCanvas
Map canvas is a class for displaying all GIS data types on a canvas.
Definition
qgsmapcanvas.h:96
QgsMapOverviewCanvas::mPanningCursorOffset
QPoint mPanningCursorOffset
position of cursor inside panning widget
Definition
qgsmapoverviewcanvas.h:111
QgsMapOverviewCanvas::setLayers
void setLayers(const QList< QgsMapLayer * > &layers)
updates layer set for overview
Definition
qgsmapoverviewcanvas.cpp:292
QgsMapOverviewCanvas::refresh
void refresh()
renders overview and updates panning widget
Definition
qgsmapoverviewcanvas.cpp:212
QgsMapOverviewCanvas::setBackgroundColor
void setBackgroundColor(const QColor &color)
changes background color
Definition
qgsmapoverviewcanvas.cpp:282
QgsMapOverviewCanvas::QgsMapOverviewCanvas
QgsMapOverviewCanvas(QWidget *parent=nullptr, QgsMapCanvas *mapCanvas=nullptr)
Definition
qgsmapoverviewcanvas.cpp:46
QgsMapOverviewCanvas::mJob
QgsMapRendererQImageJob * mJob
for rendering overview
Definition
qgsmapoverviewcanvas.h:123
QgsMapOverviewCanvas::mPixmap
QPixmap mPixmap
pixmap where the map is stored
Definition
qgsmapoverviewcanvas.h:117
QgsMapOverviewCanvas::mPanningWidget
QgsPanningWidget * mPanningWidget
widget for panning map in overview
Definition
qgsmapoverviewcanvas.h:108
QgsMapOverviewCanvas::enableAntiAliasing
void enableAntiAliasing(bool flag)
Definition
qgsmapoverviewcanvas.h:57
QgsMapOverviewCanvas::mSettings
QgsMapSettings mSettings
map settings used for rendering of the overview map
Definition
qgsmapoverviewcanvas.h:120
QgsMapOverviewCanvas::layers
QList< QgsMapLayer * > layers() const
Returns list of layers visible in the overview.
Definition
qgsmapoverviewcanvas.cpp:352
QgsMapOverviewCanvas::mMapCanvas
QgsMapCanvas * mMapCanvas
main map canvas - used to get/set extent
Definition
qgsmapoverviewcanvas.h:114
QgsMapRendererQImageJob
Intermediate base class adding functionality that allows a client to query the rendered image.
Definition
qgsmaprendererjob.h:731
QgsMapSettings
Contains configuration for rendering maps.
Definition
qgsmapsettings.h:91
QgsRectangle
A rectangle specified with double values.
Definition
qgsrectangle.h:47
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition
qgis_sip.h:52
qgsmapsettings.h
Generated on
for QGIS API Documentation by
1.17.0