Qt 5.10 Book Examples
chapter32
InputDialog
StartDialog.h
Go to the documentation of this file.
1
// ======================================================================
2
// StartDialog.h
3
// ======================================================================
4
// This file is a part of the book
5
// "Qt 5.10 Professional programming with C++"
6
// http://qt-book.com
7
// ======================================================================
8
// Copyright (c) 2017 by Max Schlee
9
// ======================================================================
10
11
#pragma once
12
13
#include <QtWidgets>
14
#include "
InputDialog.h
"
15
16
// ======================================================================
17
class
StartDialog
:
public
QPushButton {
18
Q_OBJECT
19
public
:
20
StartDialog
(QWidget* pwgt = 0) : QPushButton(
"Press Me"
, pwgt)
21
{
22
connect(
this
, SIGNAL(clicked()), SLOT(
slotButtonClicked
()));
23
}
24
25
public
slots:
26
void
slotButtonClicked
()
27
{
28
InputDialog
* pInputDialog =
new
InputDialog
;
29
if
(pInputDialog->exec() == QDialog::Accepted) {
30
QMessageBox::information(0,
31
"Information"
,
32
"First Name: "
33
+ pInputDialog->
firstName
()
34
+
"\nLast Name: "
35
+ pInputDialog->
lastName
()
36
);
37
}
38
delete
pInputDialog;
39
}
40
};
InputDialog::firstName
QString firstName() const
Definition:
InputDialog.cpp:45
StartDialog::slotButtonClicked
void slotButtonClicked()
Definition:
StartDialog.h:26
InputDialog::lastName
QString lastName() const
Definition:
InputDialog.cpp:51
InputDialog.h
StartDialog
Definition:
StartDialog.h:17
InputDialog
Definition:
InputDialog.h:17
StartDialog::StartDialog
StartDialog(QWidget *pwgt=0)
Definition:
StartDialog.h:20
Generated by
1.8.14