Commit 87d5c23c authored by Dennis Rassmann's avatar Dennis Rassmann

add back button in the first few forms

Signed-off-by: Dennis Rassmann's avatarshowp1984 <showp1984@gmail.com>
parent 4a52f706
......@@ -3,6 +3,7 @@
#include "detect.h"
#include "ui_detect.h"
#include "mainwindow.h"
detect::detect(QWidget *parent) :
QMainWindow(parent),
......@@ -536,3 +537,11 @@ void detect::on_btn_yes_clicked()
this->close();
}
}
void detect::on_btn_back_clicked()
{
set_back_detect(true);
MainWindow *mainwind = new MainWindow();
mainwind->show();
this->close();
}
......@@ -45,6 +45,7 @@ private:
bool firstcall;
private slots:
void on_btn_back_clicked();
void on_btn_yes_clicked();
void on_btn_no_clicked();
void on_btn_quit_clicked();
......
......@@ -633,6 +633,19 @@ p, li { white-space: pre-wrap; }
<set>Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing</set>
</property>
</widget>
<widget class="QPushButton" name="btn_back">
<property name="geometry">
<rect>
<x>530</x>
<y>460</y>
<width>93</width>
<height>27</height>
</rect>
</property>
<property name="text">
<string>Back</string>
</property>
</widget>
</widget>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
......
......@@ -3,6 +3,8 @@
#include "mainwindow.h"
#include "ui_mainwindow.h"
static bool back_detect = false;
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
......@@ -10,12 +12,26 @@ MainWindow::MainWindow(QWidget *parent) :
ui->setupUi(this);
ui->btn_go->show();
ui->btn_back->hide();
ui->lbl_welcome->show();
ui->btn_go_2->hide();
ui->lbl_disclaimer_accept->hide();
ui->txt_disclaimer->hide();
ui->chk_agreed->hide();
ui->line->hide();
if (back_detect) {
alertbox.exec();
back_detect = false;
ui->btn_go->hide();
ui->btn_back->show();
ui->lbl_welcome->hide();
ui->btn_go_2->show();
ui->lbl_disclaimer_accept->show();
ui->txt_disclaimer->show();
ui->chk_agreed->show();
ui->line->show();
}
}
MainWindow::~MainWindow()
......@@ -68,6 +84,7 @@ void MainWindow::on_btn_go_clicked()
{
//hide label & go, visible label2 and go2
ui->btn_go->hide();
ui->btn_back->show();
ui->lbl_welcome->hide();
ui->btn_go_2->show();
ui->lbl_disclaimer_accept->show();
......@@ -75,3 +92,19 @@ void MainWindow::on_btn_go_clicked()
ui->chk_agreed->show();
ui->line->show();
}
void MainWindow::on_btn_back_clicked()
{
ui->btn_go->show();
ui->btn_back->hide();
ui->lbl_welcome->show();
ui->btn_go_2->hide();
ui->lbl_disclaimer_accept->hide();
ui->txt_disclaimer->hide();
ui->chk_agreed->hide();
ui->line->hide();
}
void set_back_detect(bool bo) {
back_detect = bo;
}
......@@ -26,6 +26,7 @@ private:
detect *detectwind;
private slots:
void on_btn_back_clicked();
void on_btn_go_clicked();
void on_btn_go_2_clicked();
void on_btn_quit_clicked();
......@@ -33,4 +34,6 @@ private slots:
void on_actionQuit_triggered();
};
void set_back_detect(bool);
#endif // MAINWINDOW_H
......@@ -269,6 +269,19 @@ p, li { white-space: pre-wrap; }
<enum>Qt::Horizontal</enum>
</property>
</widget>
<widget class="QPushButton" name="btn_back">
<property name="geometry">
<rect>
<x>430</x>
<y>460</y>
<width>93</width>
<height>27</height>
</rect>
</property>
<property name="text">
<string>Back</string>
</property>
</widget>
</widget>
<widget class="QMenuBar" name="menuBar">
<property name="geometry">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment