Diffstat (limited to 'noncore/graphics/drawpad/drawpadcanvas.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/graphics/drawpad/drawpadcanvas.h | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/noncore/graphics/drawpad/drawpadcanvas.h b/noncore/graphics/drawpad/drawpadcanvas.h index eddcb43..4836a3f 100644 --- a/noncore/graphics/drawpad/drawpadcanvas.h +++ b/noncore/graphics/drawpad/drawpadcanvas.h | |||
@@ -14,7 +14,7 @@ | |||
14 | #ifndef DRAWPADCANVAS_H | 14 | #ifndef DRAWPADCANVAS_H |
15 | #define DRAWPADCANVAS_H | 15 | #define DRAWPADCANVAS_H |
16 | 16 | ||
17 | #include <qwidget.h> | 17 | #include <qscrollview.h> |
18 | 18 | ||
19 | #include <qlist.h> | 19 | #include <qlist.h> |
20 | #include <qpointarray.h> | 20 | #include <qpointarray.h> |
@@ -23,15 +23,16 @@ class DrawPad; | |||
23 | 23 | ||
24 | class QPixmap; | 24 | class QPixmap; |
25 | 25 | ||
26 | class DrawPadCanvas : public QWidget | 26 | class DrawPadCanvas : public QScrollView |
27 | { | 27 | { |
28 | Q_OBJECT | 28 | Q_OBJECT |
29 | 29 | ||
30 | public: | 30 | public: |
31 | DrawPadCanvas(DrawPad* drawPad, QWidget* parent = 0, const char* name = 0, WFlags f = 0); | 31 | DrawPadCanvas(DrawPad* drawPad, QWidget* parent = 0, const char* name = 0); |
32 | ~DrawPadCanvas(); | 32 | ~DrawPadCanvas(); |
33 | 33 | ||
34 | void load(QIODevice* ioDevice); | 34 | void load(QIODevice* ioDevice); |
35 | void initialPage(); | ||
35 | void save(QIODevice* ioDevice); | 36 | void save(QIODevice* ioDevice); |
36 | 37 | ||
37 | bool undoEnabled(); | 38 | bool undoEnabled(); |
@@ -40,6 +41,8 @@ public: | |||
40 | bool goNextPageEnabled(); | 41 | bool goNextPageEnabled(); |
41 | 42 | ||
42 | QPixmap* currentPage(); | 43 | QPixmap* currentPage(); |
44 | uint pagePosition(); | ||
45 | uint pageCount(); | ||
43 | 46 | ||
44 | public slots: | 47 | public slots: |
45 | void clearAll(); | 48 | void clearAll(); |
@@ -60,11 +63,10 @@ signals: | |||
60 | void pageBackupsChanged(); | 63 | void pageBackupsChanged(); |
61 | 64 | ||
62 | protected: | 65 | protected: |
63 | void mousePressEvent(QMouseEvent* e); | 66 | void contentsMousePressEvent(QMouseEvent* e); |
64 | void mouseReleaseEvent(QMouseEvent* e); | 67 | void contentsMouseReleaseEvent(QMouseEvent* e); |
65 | void mouseMoveEvent(QMouseEvent* e); | 68 | void contentsMouseMoveEvent(QMouseEvent* e); |
66 | void resizeEvent(QResizeEvent* e); | 69 | void drawContents(QPainter* p, int cx, int cy, int cw, int ch); |
67 | void paintEvent(QPaintEvent* e); | ||
68 | 70 | ||
69 | private: | 71 | private: |
70 | DrawPad* m_pDrawPad; | 72 | DrawPad* m_pDrawPad; |