16 : QDialog(pwgt, Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
18 m_ptxtFirstName =
new QLineEdit;
19 m_ptxtLastName =
new QLineEdit;
21 QLabel* plblFirstName =
new QLabel(
"&First Name");
22 QLabel* plblLastName =
new QLabel(
"&Last Name");
24 plblFirstName->setBuddy(m_ptxtFirstName);
25 plblLastName->setBuddy(m_ptxtLastName);
27 QPushButton* pcmdOk =
new QPushButton(
"&Ok");
28 QPushButton* pcmdCancel =
new QPushButton(
"&Cancel");
30 connect(pcmdOk, SIGNAL(clicked()), SLOT(accept()));
31 connect(pcmdCancel, SIGNAL(clicked()), SLOT(reject()));
34 QGridLayout* ptopLayout =
new QGridLayout;
35 ptopLayout->addWidget(plblFirstName, 0, 0);
36 ptopLayout->addWidget(plblLastName, 1, 0);
37 ptopLayout->addWidget(m_ptxtFirstName, 0, 1);
38 ptopLayout->addWidget(m_ptxtLastName, 1, 1);
39 ptopLayout->addWidget(pcmdOk, 2,0);
40 ptopLayout->addWidget(pcmdCancel, 2, 1);
41 setLayout(ptopLayout);
47 return m_ptxtFirstName->text();
53 return m_ptxtLastName->text();