QGIS API Documentation  2.2.0-Valmiera
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
23 #include <QMouseEvent>
24 #include <QWheelEvent>
25 #include <QWidget>
26 #include <QStringList>
27 #include <QPixmap>
28 
29 class QgsMapCanvas;
30 class QgsMapRenderer;
31 class QgsPanningWidget; // defined in .cpp
32 class QgsRectangle;
33 
37 class GUI_EXPORT QgsMapOverviewCanvas : public QWidget
38 {
39  Q_OBJECT
40 
41  public:
42  QgsMapOverviewCanvas( QWidget * parent = 0, QgsMapCanvas* mapCanvas = NULL );
43 
45 
47  void drawExtentRect();
48 
50  void refresh();
51 
53  void setBackgroundColor( const QColor& color );
54 
56  void setLayerSet( const QStringList& layerSet );
57 
58  QStringList& layerSet();
59 
60  void enableAntiAliasing( bool flag ) { mAntiAliasing = flag; }
61 
62  void updateFullExtent();
63 
64  public slots:
65 
66  void hasCrsTransformEnabled( bool flag );
67 
68  void destinationSrsChanged();
69 
70  protected:
71 
73  void paintEvent( QPaintEvent * pe );
74 
76  void resizeEvent( QResizeEvent * e );
77 
79  void mouseMoveEvent( QMouseEvent * e );
80 
82  void mousePressEvent( QMouseEvent * e );
83 
85  void mouseReleaseEvent( QMouseEvent * e );
86 
88  void updatePanningWidget( const QPoint& pos );
89 
92 
95 
98 
101 
103  QPixmap mPixmap;
104 
106  QColor mBgColor;
107 
110 
112  QSize mNewSize;
113 };
114 
115 #endif
QSize mNewSize
resized canvas size
QPoint mPanningCursorOffset
position of cursor inside panning widget
A rectangle specified with double values.
Definition: qgsrectangle.h:35
A widget that displays an overview map.
bool mAntiAliasing
indicates whether antialiasing will be used for rendering
QgsMapCanvas * mMapCanvas
main map canvas - used to get/set extent
QColor mBgColor
background color
A non GUI class for rendering a map layer set onto a QPainter.
widget that serves as rectangle showing current extent in overview
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:99
void enableAntiAliasing(bool flag)
QgsPanningWidget * mPanningWidget
widget for panning map in overview
QPixmap mPixmap
pixmap where the map is stored
QgsMapRenderer * mMapRenderer
for rendering overview