-
Notifications
You must be signed in to change notification settings - Fork 0
/
qtdotmatrixmenudialog.cpp
84 lines (70 loc) · 1.85 KB
/
qtdotmatrixmenudialog.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#include "qtdotmatrixmenudialog.h"
#include <QDesktopWidget>
#include <QKeyEvent>
#include "dotmatrixmenudialog.h"
#include "qtaboutdialog.h"
#include "qtdotmatrixsinglelinemaindialog.h"
#include "qtdotmatrixmultilinemaindialog.h"
#include "qthideandshowdialog.h"
#include "testtimer.h"
#include "trace.h"
#include "ui_qtdotmatrixmenudialog.h"
ribi::QtDotMatrixMenuDialog::QtDotMatrixMenuDialog(
QWidget *parent)
: QtHideAndShowDialog(parent),
ui(new Ui::QtDotMatrixMenuDialog)
{
#ifndef NDEBUG
Test();
#endif
ui->setupUi(this);
}
ribi::QtDotMatrixMenuDialog::~QtDotMatrixMenuDialog() noexcept
{
delete ui;
}
void ribi::QtDotMatrixMenuDialog::keyPressEvent(QKeyEvent * event)
{
if (event->key() == Qt::Key_Escape) { close(); return; }
}
void ribi::QtDotMatrixMenuDialog::on_button_about_clicked()
{
About a = DotMatrixMenuDialog().GetAbout();
a.AddLibrary("QtHideAndShowDialog version: " + QtHideAndShowDialog::GetVersion());
QtAboutDialog d(a);
d.setWindowIcon(this->windowIcon());
d.setStyleSheet(this->styleSheet());
this->ShowChild(&d);
}
void ribi::QtDotMatrixMenuDialog::on_button_quit_clicked()
{
close();
}
#ifndef NDEBUG
void ribi::QtDotMatrixMenuDialog::Test() noexcept
{
{
static bool is_tested{false};
if (is_tested) return;
is_tested = true;
}
DotMatrixMenuDialog();
QtDotMatrixSingleLineMainDialog();
QtDotMatrixMultiLineMainDialog();
const TestTimer test_timer(__func__,__FILE__,1.0);
}
#endif
void ribi::QtDotMatrixMenuDialog::on_button_start_single_line_clicked()
{
QtDotMatrixSingleLineMainDialog d;
d.setWindowIcon(this->windowIcon());
d.setStyleSheet(this->styleSheet());
ShowChild(&d);
}
void ribi::QtDotMatrixMenuDialog::on_button_start_multi_line_clicked()
{
QtDotMatrixMultiLineMainDialog d;
d.setWindowIcon(this->windowIcon());
d.setStyleSheet(this->styleSheet());
ShowChild(&d);
}