References #2

This commit is contained in:
carsten.pluntke
2010-09-02 15:58:09 +00:00
parent 9a8b208c62
commit f5e983f5b9
9 changed files with 429 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
#include <QtGui>
#include "pindialog.h"
PinDialog::PinDialog(QWidget *parent)
: QDialog(parent)
{
label=new QLabel(tr("Enter &PIN:"));
lineEdit=new QLineEdit;
lineEdit->setEchoMode(QLineEdit::Password);
label->setBuddy(lineEdit);
okButton=new QPushButton(tr("&OK"));
okButton->setDefault(true);
cancelButton=new QPushButton(tr("&Cancel"));
connect(okButton, SIGNAL(clicked()), this, SLOT(accept()));
connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
QHBoxLayout* tl= new QHBoxLayout;
tl->addWidget(label);
tl->addWidget(lineEdit);
QHBoxLayout* bl= new QHBoxLayout;
bl->addStretch();
bl->addWidget(okButton);
bl->addWidget(cancelButton);
QVBoxLayout* ml= new QVBoxLayout;
ml->addLayout(tl);
ml->addLayout(bl);
setLayout(ml);
}
QString PinDialog::pin() const {
// TODO: Cleanup of internal strings as soon as the PIN is retrieved
return lineEdit ? lineEdit->text() : "";
}