summaryrefslogtreecommitdiffabout
path: root/microkde/klineeditdlg.h
blob: 68e9252b96387ef40289e9d912c8b145cb6fb7a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef MICROKDE_KLINEEDITDLG_H
#define MICROKDE_KLINEEDITDLG_H

#include "kdialogbase.h"
#include <klineedit.h>
#include <qlayout.h>
#include <qlabel.h>
#include <qdialog.h>
#include <qpushbutton.h>

class KLineEditDlg : public QDialog
{
  public:
    KLineEditDlg( const QString & text, const QString & editText, QWidget *parent ) :
      QDialog( parent,"lineedit", true ) {
        QLabel* lab = new QLabel( text, this );
        mEdit = new KLineEdit( this );
        QVBoxLayout* vl = new QVBoxLayout( this );
        vl->setSpacing(5);
        vl->setMargin(7);
        vl->addWidget( lab );
        vl->addWidget( mEdit );
        mEdit->setText( editText );
        QPushButton * p = new QPushButton (" OK ", this );
        vl->addWidget( p );
        connect( p, SIGNAL ( clicked () ), this , SLOT (accept() ) );
    }

    QString text() { return mEdit->text(); }
 private:
    KLineEdit* mEdit;
};

#endif