Of course, you can create widgets such as buttons without WYSIWYG tools (e.g. QtDesinger)
Write this code inside the slot of "exit" button:
void ThisWindowClass::exitClicked()
{
// ...
QPushButton *thanksButton = new QPushButton(this /*parent widget*/);
connect(thanksButton, SIGNAL(clicked(bool)), this, SLOT(thanksClicked(bool)));
// ...
}
And you must have a slot method named thanksClicked
:
void ThisWindowClass::thanksClicked(bool checked)
{
// Do something
}