-rw-r--r-- | microkde/klineeditdlg.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/microkde/klineeditdlg.h b/microkde/klineeditdlg.h new file mode 100644 index 0000000..68e9252 --- a/dev/null +++ b/microkde/klineeditdlg.h | |||
@@ -0,0 +1,34 @@ | |||
1 | #ifndef MICROKDE_KLINEEDITDLG_H | ||
2 | #define MICROKDE_KLINEEDITDLG_H | ||
3 | |||
4 | #include "kdialogbase.h" | ||
5 | #include <klineedit.h> | ||
6 | #include <qlayout.h> | ||
7 | #include <qlabel.h> | ||
8 | #include <qdialog.h> | ||
9 | #include <qpushbutton.h> | ||
10 | |||
11 | class KLineEditDlg : public QDialog | ||
12 | { | ||
13 | public: | ||
14 | KLineEditDlg( const QString & text, const QString & editText, QWidget *parent ) : | ||
15 | QDialog( parent,"lineedit", true ) { | ||
16 | QLabel* lab = new QLabel( text, this ); | ||
17 | mEdit = new KLineEdit( this ); | ||
18 | QVBoxLayout* vl = new QVBoxLayout( this ); | ||
19 | vl->setSpacing(5); | ||
20 | vl->setMargin(7); | ||
21 | vl->addWidget( lab ); | ||
22 | vl->addWidget( mEdit ); | ||
23 | mEdit->setText( editText ); | ||
24 | QPushButton * p = new QPushButton (" OK ", this ); | ||
25 | vl->addWidget( p ); | ||
26 | connect( p, SIGNAL ( clicked () ), this , SLOT (accept() ) ); | ||
27 | } | ||
28 | |||
29 | QString text() { return mEdit->text(); } | ||
30 | private: | ||
31 | KLineEdit* mEdit; | ||
32 | }; | ||
33 | |||
34 | #endif | ||