summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/GraphicWin.h
authorllornkcor <llornkcor>2002-12-20 01:35:01 (UTC)
committer llornkcor <llornkcor>2002-12-20 01:35:01 (UTC)
commit876e1a4724a7bd75dc642e295de354241096e028 (patch) (side-by-side diff)
treea37c5dcc9d78e04bb6b859ab89d8cf81e6745087 /noncore/apps/opie-reader/GraphicWin.h
parent5fd6636ba3d94b48dd543887316c47c5388a43c2 (diff)
downloadopie-876e1a4724a7bd75dc642e295de354241096e028.zip
opie-876e1a4724a7bd75dc642e295de354241096e028.tar.gz
opie-876e1a4724a7bd75dc642e295de354241096e028.tar.bz2
update - sorry it took so long. hope this works correctly
Diffstat (limited to 'noncore/apps/opie-reader/GraphicWin.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/GraphicWin.h65
1 files changed, 65 insertions, 0 deletions
diff --git a/noncore/apps/opie-reader/GraphicWin.h b/noncore/apps/opie-reader/GraphicWin.h
new file mode 100644
index 0000000..31811d2
--- a/dev/null
+++ b/noncore/apps/opie-reader/GraphicWin.h
@@ -0,0 +1,65 @@
+#ifndef __GRAPHICWIN_H
+#define __GRAPHICWIN_H
+
+#include <qscrollview.h>
+#include <qpixmap.h>
+#include <qpushbutton.h>
+#include <qlayout.h>
+
+class GraphicScroll : public QScrollView
+{
+ Q_OBJECT
+ QWidget* m_picture;
+ protected:
+ void hideEvent( QHideEvent * p)
+ {
+ m_picture->setFixedSize(1,1);
+ }
+ public:
+ GraphicScroll( QWidget *parent=0, const char *name=0, WFlags f = 0)
+ : QScrollView(parent, name, f)
+ {
+ m_picture = new QWidget(viewport());
+ addChild(m_picture);
+ }
+ void setPixmap(QPixmap& pm)
+ {
+ m_picture->setFixedSize(pm.size());
+ m_picture->setBackgroundPixmap(pm);
+ }
+/*
+ private slots:
+ void graphicClose() { emit Close(); }
+ signals:
+ void Close();
+*/
+
+};
+
+
+class GraphicWin : public QWidget
+{
+ Q_OBJECT
+
+ GraphicScroll* m_scroll;
+ signals:
+ void Closed();
+ private slots:
+ void slotClosed() { emit Closed(); }
+
+ public:
+
+ void setPixmap(QPixmap& pm) { m_scroll->setPixmap(pm); }
+ GraphicWin( QWidget *parent=0, const char *name=0, WFlags f = 0)
+ : QWidget(parent, name, f)
+ {
+ QVBoxLayout* grid = new QVBoxLayout(this);
+ m_scroll = new GraphicScroll(this);
+ QPushButton* exitButton = new QPushButton("Close", this);
+ connect(exitButton, SIGNAL( released() ), this, SLOT( slotClosed() ) );
+ grid->addWidget(m_scroll,1);
+ grid->addWidget(exitButton);
+ }
+};
+
+#endif