Skip to content

Commit 5eabc5d

Browse files
committed
Add exit action in the file menu
1 parent 541aeed commit 5eabc5d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

mainwindow.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ MainWindow::MainWindow(QWidget *parent)
152152

153153
QAction *writeFile = new QAction("Write &file");
154154
QAction *exportAction = new QAction("&Export");
155+
QAction *exitAction = new QAction("&Exit");
155156
QAction *continuousSendAction = new QAction("&Continuous send");
156157
QAction *pinoutSignalsAction = new QAction("&Pinout signals");
157158
QAction *byteReceiveTimesAction = new QAction("&Byte receive times");
@@ -165,6 +166,7 @@ MainWindow::MainWindow(QWidget *parent)
165166
auto fileMenu = menuBar()->addMenu("&File");
166167
fileMenu->addAction(writeFile);
167168
fileMenu->addAction(exportAction);
169+
fileMenu->addAction(exitAction);
168170

169171
auto toolsMenu = menuBar()->addMenu("&Tools");
170172
toolsMenu->addAction(continuousSendAction);
@@ -181,6 +183,7 @@ MainWindow::MainWindow(QWidget *parent)
181183

182184
connect(writeFile, &QAction::triggered, this, &MainWindow::sendFromFile);
183185
connect(exportAction, &QAction::triggered, this, &MainWindow::exportData);
186+
connect(exitAction, &QAction::triggered, this, &QMainWindow::close);
184187
connect(continuousSendAction, &QAction::triggered, this, &MainWindow::continuousSend);
185188
connect(pinoutSignalsAction, &QAction::triggered, this, &MainWindow::showPinoutSignals);
186189
connect(byteReceiveTimesAction, &QAction::triggered, this, &MainWindow::showByteReceiveTimes);

0 commit comments

Comments
 (0)