~ubuntu-branches/ubuntu/saucy/merkaartor/saucy

« back to all changes in this revision

Viewing changes to Utils/PixmapWidget.h

  • Committer: Bazaar Package Importer
  • Author(s): Bernd Zeimetz
  • Date: 2009-09-13 00:52:12 UTC
  • mto: (1.2.7 upstream) (0.1.3 upstream) (3.1.7 sid)
  • mto: This revision was merged to the branch mainline in revision 10.
  • Revision ID: james.westby@ubuntu.com-20090913005212-pjecal8zxm07x0fj
ImportĀ upstreamĀ versionĀ 0.14+svnfixes~20090912

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef PIXMAPWIDGET_H
2
 
#define PIXMAPWIDGET_H
3
 
 
4
 
#include <QWidget>
5
 
#include <QString>
6
 
 
7
 
class QPixmap;
8
 
class QSvgRenderer;
9
 
 
10
 
class PixmapWidget : public QWidget
11
 
{
12
 
        Q_OBJECT
13
 
 
14
 
public:
15
 
        PixmapWidget( QWidget *parent=0 );
16
 
        ~PixmapWidget();
17
 
 
18
 
        void loadFile( const QString &filename );
19
 
        void setPixmap( const QPixmap &aPix );
20
 
        QPixmap* pixmap();
21
 
 
22
 
        bool isPixmap();
23
 
        bool isSvg();
24
 
 
25
 
public slots:
26
 
        void setZoomFactor( float );
27
 
 
28
 
signals:
29
 
        void zoomFactorChanged( float );
30
 
 
31
 
protected:
32
 
        virtual void paintEvent( QPaintEvent* anEvent);
33
 
        virtual void wheelEvent( QWheelEvent* anEvent);
34
 
        virtual void resizeEvent ( QResizeEvent * anEvent );
35
 
 
36
 
        virtual void mousePressEvent ( QMouseEvent * anEvent ) ;
37
 
        virtual void mouseReleaseEvent ( QMouseEvent * anEvent );
38
 
        virtual void mouseMoveEvent ( QMouseEvent * anEvent );
39
 
 
40
 
private:
41
 
        QPixmap *m_pm;
42
 
        QSvgRenderer *m_svgr;
43
 
        double zoomFactor;
44
 
        bool Panning;
45
 
        QPoint Delta;
46
 
        QPoint FirstPan, LastPan;
47
 
        bool done;
48
 
};
49
 
 
50
 
#endif // PIXMAPWIDGET_H