summaryrefslogtreecommitdiffstats
path: root/examples/serialbus/can/mainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/serialbus/can/mainwindow.cpp')
-rw-r--r--examples/serialbus/can/mainwindow.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/examples/serialbus/can/mainwindow.cpp b/examples/serialbus/can/mainwindow.cpp
index a04a0f4..0c6790b 100644
--- a/examples/serialbus/can/mainwindow.cpp
+++ b/examples/serialbus/can/mainwindow.cpp
@@ -44,6 +44,7 @@
#include <QCanBusFrame>
#include <QCanBus>
+#include <QCloseEvent>
#include <QTimer>
#include <QtCore/qbytearray.h>
@@ -170,6 +171,12 @@ void MainWindow::framesWritten(qint64 count)
qDebug() << "Number of frames written:" << count;
}
+void MainWindow::closeEvent(QCloseEvent *event)
+{
+ m_connectDialog->close();
+ event->accept();
+}
+
static QByteArray dataToHex(const QByteArray &data)
{
QByteArray result = data.toHex().toUpper();