author | pohly <pohly> | 2004-08-24 20:52:45 (UTC) |
---|---|---|
committer | pohly <pohly> | 2004-08-24 20:52:45 (UTC) |
commit | 73253e93327cf4ef0932de1b4afb56af22a0f37e (patch) (unidiff) | |
tree | 1c9a7a6dd3341e036a894d348a3372525d29acec /noncore/apps/opie-reader/GraphicWin.h | |
parent | e90847c784c48bd21bf8768cb38edb853b832697 (diff) | |
download | opie-73253e93327cf4ef0932de1b4afb56af22a0f37e.zip opie-73253e93327cf4ef0932de1b4afb56af22a0f37e.tar.gz opie-73253e93327cf4ef0932de1b4afb56af22a0f37e.tar.bz2 |
updated source to opie-reader 0.7g
Diffstat (limited to 'noncore/apps/opie-reader/GraphicWin.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/GraphicWin.h | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/noncore/apps/opie-reader/GraphicWin.h b/noncore/apps/opie-reader/GraphicWin.h index 31811d2..70d5f7e 100644 --- a/noncore/apps/opie-reader/GraphicWin.h +++ b/noncore/apps/opie-reader/GraphicWin.h | |||
@@ -2,10 +2,12 @@ | |||
2 | #define __GRAPHICWIN_H | 2 | #define __GRAPHICWIN_H |
3 | 3 | ||
4 | #include <qscrollview.h> | 4 | #include <qscrollview.h> |
5 | #include <qpixmap.h> | 5 | #include <qpixmap.h> |
6 | #include <qimage.h> | ||
6 | #include <qpushbutton.h> | 7 | #include <qpushbutton.h> |
7 | #include <qlayout.h> | 8 | #include <qlayout.h> |
9 | #include <qwmatrix.h> | ||
8 | 10 | ||
9 | class GraphicScroll : public QScrollView | 11 | class GraphicScroll : public QScrollView |
10 | { | 12 | { |
11 | Q_OBJECT | 13 | Q_OBJECT |
@@ -26,40 +28,29 @@ class GraphicScroll : public QScrollView | |||
26 | { | 28 | { |
27 | m_picture->setFixedSize(pm.size()); | 29 | m_picture->setFixedSize(pm.size()); |
28 | m_picture->setBackgroundPixmap(pm); | 30 | m_picture->setBackgroundPixmap(pm); |
29 | } | 31 | } |
30 | /* | ||
31 | private slots: | ||
32 | void graphicClose() { emit Close(); } | ||
33 | signals: | ||
34 | void Close(); | ||
35 | */ | ||
36 | |||
37 | }; | 32 | }; |
38 | 33 | ||
39 | 34 | ||
40 | class GraphicWin : public QWidget | 35 | class GraphicWin : public QWidget |
41 | { | 36 | { |
42 | Q_OBJECT | 37 | Q_OBJECT |
43 | 38 | ||
44 | GraphicScroll* m_scroll; | 39 | GraphicScroll* m_scroll; |
40 | QImage m_im; | ||
41 | QImage resizeimage(int w, int h); | ||
42 | void resetpm(); | ||
43 | bool m_isFitted, m_isRotated; | ||
45 | signals: | 44 | signals: |
46 | void Closed(); | 45 | void Closed(); |
47 | private slots: | 46 | private slots: |
48 | void slotClosed() { emit Closed(); } | 47 | void slotClosed() { emit Closed(); } |
49 | 48 | void slotFit(); | |
49 | void slotRotate(); | ||
50 | public: | 50 | public: |
51 | |||
52 | void setPixmap(QPixmap& pm) { m_scroll->setPixmap(pm); } | 51 | void setPixmap(QPixmap& pm) { m_scroll->setPixmap(pm); } |
53 | GraphicWin( QWidget *parent=0, const char *name=0, WFlags f = 0) | 52 | void setImage(QImage& im); |
54 | : QWidget(parent, name, f) | 53 | GraphicWin( QWidget *parent=0, const char *name=0, WFlags f = 0); |
55 | { | ||
56 | QVBoxLayout* grid = new QVBoxLayout(this); | ||
57 | m_scroll = new GraphicScroll(this); | ||
58 | QPushButton* exitButton = new QPushButton("Close", this); | ||
59 | connect(exitButton, SIGNAL( released() ), this, SLOT( slotClosed() ) ); | ||
60 | grid->addWidget(m_scroll,1); | ||
61 | grid->addWidget(exitButton); | ||
62 | } | ||
63 | }; | 54 | }; |
64 | 55 | ||
65 | #endif | 56 | #endif |