QGIS API Documentation  2.2.0-Valmiera
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
qgsmapcanvasmap.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsmapcanvasmap.h - draws the map in map canvas
3  ----------------------
4  begin : February 2006
5  copyright : (C) 2006 by Martin Dobias
6  email : wonder.sk at gmail dot com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #ifndef QGSMAPCANVASMAP_H
17 #define QGSMAPCANVASMAP_H
18 
19 #include <QGraphicsRectItem>
20 #include <QPixmap>
21 
22 #include <qgis.h>
23 
24 class QgsMapRenderer;
25 class QgsMapCanvas;
26 
30 class GUI_EXPORT QgsMapCanvasMap : public QGraphicsRectItem
31 {
32  public:
33 
35  QgsMapCanvasMap( QgsMapCanvas* canvas );
36 
38  void resize( QSize size );
39 
40  void enableAntiAliasing( bool flag ) { mAntiAliasing = flag; }
41 
42  void useImageToRender( bool flag ) { mUseQImageToRender = flag; }
43 
45  void render();
46 
47  void setBackgroundColor( const QColor& color ) { mBgColor = color; }
48 
49  void setPanningOffset( const QPoint& point );
50 
51  QPaintDevice& paintDevice();
52 
53  void paint( QPainter* p, const QStyleOptionGraphicsItem*, QWidget* );
54 
55  QRectF boundingRect() const;
56 
59  void updateContents();
60 
61  private:
62 
65 
68 
69  QPixmap mPixmap;
70  QImage mImage;
71 
72  //QgsMapRenderer* mRender;
74 
75  QColor mBgColor;
76 
77  QPoint mOffset;
78 };
79 
80 #endif