Go back to Richel Bilderbeek's homepage.
Go back to Richel Bilderbeek's C++ page.
Answer of exercise: Qt hide and show #2 is the answer of
the exercise Qt hide and show #2.
Solution
Qt project file: CppExerciseQtHideAndShow2Answer.pro
QT += core gui
TARGET = CppExerciseQtHideAndShow2Answer
TEMPLATE = app
SOURCES += \
main.cpp\
firstdialog.cpp \
seconddialog.cpp \
thirddialog.cpp
HEADERS += \
firstdialog.h \
seconddialog.h \
thirddialog.h
FORMS += \
firstdialog.ui \
seconddialog.ui \
thirddialog.ui
|
firstdialog.h
firstdialog.cpp
main.cpp
seconddialog.h
seconddialog.cpp
thirddialog.h
thirddialog.cpp
#include "thirddialog.h"
#include "ui_thirddialog.h"
ThirdDialog::ThirdDialog(QWidget *parent) :
QDialog(parent),
m_back_to_which_dialog(2), //When user closes the dialog, go back to the previous/second dialog
ui(new Ui::ThirdDialog)
{
ui->setupUi(this);
}
ThirdDialog::~ThirdDialog()
{
delete ui;
}
void ThirdDialog::closeEvent(QCloseEvent *)
{
emit close_me();
}
void ThirdDialog::on_button_back_to_first_clicked()
{
m_back_to_which_dialog = 1;
close();
}
void ThirdDialog::on_button_back_to_second_clicked()
{
m_back_to_which_dialog = 2;
close();
}
|
Go back to Richel Bilderbeek's C++ page.
Go back to Richel Bilderbeek's homepage.

This page has been created by the tool CodeToHtml