Quantum GIS API Documentation  1.7.5-Wroclaw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator 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 /* $Id$ */
16 
17 #ifndef QGSMAPCANVASMAP_H
18 #define QGSMAPCANVASMAP_H
19 
20 #include <QGraphicsRectItem>
21 #include <QPixmap>
22 
23 #include <qgis.h>
24 
25 class QgsMapRenderer;
26 class QgsMapCanvas;
27 
31 class GUI_EXPORT QgsMapCanvasMap : public QGraphicsRectItem
32 {
33  public:
34 
36  QgsMapCanvasMap( QgsMapCanvas* canvas );
37 
39  void resize( QSize size );
40 
41  void enableAntiAliasing( bool flag ) { mAntiAliasing = flag; }
42 
43  void useImageToRender( bool flag ) { mUseQImageToRender = flag; }
44 
46  void render();
47 
48  void setBackgroundColor( const QColor& color ) { mBgColor = color; }
49 
50  void setPanningOffset( const QPoint& point );
51 
53  Q_DECL_DEPRECATED QPixmap& pixmap() { return mPixmap; }
54 
55  QPaintDevice& paintDevice();
56 
57  void paint( QPainter* p, const QStyleOptionGraphicsItem*, QWidget* );
58 
59  QRectF boundingRect() const;
60 
63  void updateContents();
64 
65  private:
66 
69 
72 
73  QPixmap mPixmap;
74  QImage mImage;
75 
76  //QgsMapRenderer* mRender;
78 
79  QColor mBgColor;
80 
81  QPoint mOffset;
82 };
83 
84 #endif