Added timestamp to log messages

This commit is contained in:
Michael Mandl 2017-10-18 11:47:04 +02:00 committed by mandlm
parent 9006032f27
commit 9a223073d9

View file

@ -1,6 +1,7 @@
#include "mainwindow.h" #include "mainwindow.h"
#include "ui_mainwindow.h" #include "ui_mainwindow.h"
#include "sniffthread.h" #include "sniffthread.h"
#include <QTime>
MainWindow::MainWindow(QWidget *parent) : MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent), QMainWindow(parent),
@ -22,5 +23,7 @@ MainWindow::~MainWindow()
void MainWindow::dataReceived(QString data) void MainWindow::dataReceived(QString data)
{ {
ui->listWidget->addItem(data); QTime currentTime = QTime::currentTime();
ui->listWidget->addItem(currentTime.toString(Qt::ISODate) + ": " + data);
} }