comparison panner.h @ 45:4286836bb3c9

* Some more work on graph layout; ensure LANG is set for parseable UTF8 output when running Hg
author Chris Cannam <cannam@all-day-breakfast.com>
date Wed, 10 Nov 2010 12:44:11 +0000
parents
children f583e44d9d31
comparison
equal deleted inserted replaced
44:bed7ab59f62e 45:4286836bb3c9
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2
3 /*
4 Rosegarden
5 A MIDI and audio sequencer and musical notation editor.
6 Copyright 2000-2010 the Rosegarden development team.
7
8 Other copyrights also apply to some parts of this work. Please
9 see the AUTHORS file and individual file headers for details.
10
11 This program is free software; you can redistribute it and/or
12 modify it under the terms of the GNU General Public License as
13 published by the Free Software Foundation; either version 2 of the
14 License, or (at your option) any later version. See the file
15 COPYING included with this distribution for more information.
16 */
17
18 #ifndef _RG_PANNER_H_
19 #define _RG_PANNER_H_
20
21 #include <QGraphicsView>
22
23 class Panned;
24
25 class Panner : public QGraphicsView
26 {
27 Q_OBJECT
28
29 public:
30 Panner();
31 virtual ~Panner() { }
32
33 virtual void setScene(QGraphicsScene *);
34
35 void connectToPanned(Panned *p);
36
37 signals:
38 void pannedRectChanged(QRectF);
39 void pannerChanged(QRectF);
40 void zoomIn();
41 void zoomOut();
42
43 public slots:
44 void slotSetPannedRect(QRectF);
45
46 protected slots:
47 void slotSceneRectChanged(const QRectF &);
48
49 protected:
50 QRectF m_pannedRect;
51
52 void moveTo(QPoint);
53
54 virtual void paintEvent(QPaintEvent *);
55 virtual void mousePressEvent(QMouseEvent *e);
56 virtual void mouseMoveEvent(QMouseEvent *e);
57 virtual void mouseReleaseEvent(QMouseEvent *e);
58 virtual void mouseDoubleClickEvent(QMouseEvent *e);
59 virtual void wheelEvent(QWheelEvent *e);
60
61 virtual void resizeEvent(QResizeEvent *);
62
63 virtual void updateScene(const QList<QRectF> &);
64 virtual void drawItems(QPainter *, int, QGraphicsItem *[],
65 const QStyleOptionGraphicsItem []);
66
67 bool m_clicked;
68 QRectF m_clickedRect;
69 QPoint m_clickedPoint;
70
71 QPixmap m_cache;
72 };
73
74 #endif
75