00001
00007
00008 #ifndef MAP_H
00009 #define MAP_H
00010
00011 #include <math.h>
00012 #include <QList>
00013 #include <QMultiHash>
00014 #include <QWheelEvent>
00015 #include <QGraphicsView>
00016 #include <QGraphicsScene>
00017 #include <QErrorMessage>
00018
00027 class Map : public QGraphicsView
00028 {
00029 Q_OBJECT
00030
00031 public :
00032
00034 Map( QWidget *parent = 0 ) ;
00035
00038 Map( QGraphicsScene *scene, QWidget *parent = 0 ) ;
00039
00043 void setName( const QString &name ) ;
00044
00047 QString name() ;
00048
00051 void addItem( QGraphicsItem *item ) ;
00052
00053 signals :
00054
00056 void mapSetVisible( bool ) ;
00057
00059 void mapClosed() ;
00060
00061 public slots :
00062
00065 void zoomIn() ;
00066
00069 void zoomOut() ;
00070
00073 void fitView() ;
00074
00077 void scaleDefault() ;
00078
00079 protected :
00080
00083 void closeEvent ( QCloseEvent * event ) ;
00084
00087 void wheelEvent( QWheelEvent *event) ;
00088
00091 void scaleView( qreal scaleFactor ) ;
00092
00097 void scaleView( qreal scaleFactor, const QPoint &pos ) ;
00098
00099 private :
00100
00102 QString _name ;
00103
00105 QGraphicsScene *_scene ;
00106 } ;
00107
00108 #endif // MAP_H
00109