summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/CAnnoEdit.h
Unidiff
Diffstat (limited to 'noncore/apps/opie-reader/CAnnoEdit.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/CAnnoEdit.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/noncore/apps/opie-reader/CAnnoEdit.h b/noncore/apps/opie-reader/CAnnoEdit.h
index 3cc9f78..f320061 100644
--- a/noncore/apps/opie-reader/CAnnoEdit.h
+++ b/noncore/apps/opie-reader/CAnnoEdit.h
@@ -11,48 +11,49 @@ class CAnnoEdit : public QWidget
11 Q_OBJECT 11 Q_OBJECT
12 12
13 QLineEdit* m_name; 13 QLineEdit* m_name;
14 QMultiLineEdit* m_anno; 14 QMultiLineEdit* m_anno;
15 size_t m_posn; 15 size_t m_posn;
16 public: 16 public:
17 void setPosn(size_t p) { m_posn = p; } 17 void setPosn(size_t p) { m_posn = p; }
18 size_t getPosn() { return m_posn; } 18 size_t getPosn() { return m_posn; }
19 void setName(const QString& name) 19 void setName(const QString& name)
20 { 20 {
21 m_name->setText(name); 21 m_name->setText(name);
22 } 22 }
23 void setAnno(const QString& name) 23 void setAnno(const QString& name)
24 { 24 {
25 m_anno->setText(name); 25 m_anno->setText(name);
26 m_anno->setEdited(false); 26 m_anno->setEdited(false);
27 } 27 }
28 bool edited() { return m_anno->edited(); } 28 bool edited() { return m_anno->edited(); }
29 CAnnoEdit(QWidget *parent=0, const char *name=0, WFlags f = 0) : 29 CAnnoEdit(QWidget *parent=0, const char *name=0, WFlags f = 0) :
30 QWidget(parent, name, f) 30 QWidget(parent, name, f)
31 { 31 {
32 QVBoxLayout* grid = new QVBoxLayout(this); 32 QVBoxLayout* grid = new QVBoxLayout(this);
33 m_name = new QLineEdit(this, "Name"); 33 m_name = new QLineEdit(this, "Name");
34 m_anno = new QMultiLineEdit(this, "Annotation"); 34 m_anno = new QMultiLineEdit(this, "Annotation");
35 m_anno->setWordWrap(QMultiLineEdit::WidgetWidth);
35 QPushButton* exitButton = new QPushButton("Okay", this); 36 QPushButton* exitButton = new QPushButton("Okay", this);
36 connect(exitButton, SIGNAL( released() ), this, SLOT( slotOkay() ) ); 37 connect(exitButton, SIGNAL( released() ), this, SLOT( slotOkay() ) );
37 QPushButton* cancelButton = new QPushButton("Cancel", this); 38 QPushButton* cancelButton = new QPushButton("Cancel", this);
38 connect(cancelButton, SIGNAL( released() ), this, SLOT( slotCancel() ) ); 39 connect(cancelButton, SIGNAL( released() ), this, SLOT( slotCancel() ) );
39 QLabel *l = new QLabel("Text",this); 40 QLabel *l = new QLabel("Text",this);
40 grid->addWidget(l); 41 grid->addWidget(l);
41 grid->addWidget(m_name); 42 grid->addWidget(m_name);
42 l = new QLabel("Annotation",this); 43 l = new QLabel("Annotation",this);
43 grid->addWidget(l); 44 grid->addWidget(l);
44 grid->addWidget(m_anno,1); 45 grid->addWidget(m_anno,1);
45 QHBoxLayout* hgrid = new QHBoxLayout(grid); 46 QHBoxLayout* hgrid = new QHBoxLayout(grid);
46 hgrid->addWidget(cancelButton); 47 hgrid->addWidget(cancelButton);
47 hgrid->addWidget(exitButton); 48 hgrid->addWidget(exitButton);
48 } 49 }
49 private slots: 50 private slots:
50 void slotOkay() { emit finished(m_name->text(), m_anno->text()); } 51 void slotOkay() { emit finished(m_name->text(), m_anno->text()); }
51 void slotCancel() { emit cancelled(); } 52 void slotCancel() { emit cancelled(); }
52 public: 53 public:
53 signals: 54 signals:
54 void finished(const QString&, const QString&); 55 void finished(const QString&, const QString&);
55 void cancelled(); 56 void cancelled();
56}; 57};
57 58
58#endif 59#endif