From 9a223073d979ecaea356f121fe5e13a3f1daee01 Mon Sep 17 00:00:00 2001 From: Michael Mandl Date: Wed, 18 Oct 2017 11:47:04 +0200 Subject: [PATCH] Added timestamp to log messages --- source/mainwindow.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/mainwindow.cpp b/source/mainwindow.cpp index 5dc32b1..e886d46 100644 --- a/source/mainwindow.cpp +++ b/source/mainwindow.cpp @@ -1,6 +1,7 @@ #include "mainwindow.h" #include "ui_mainwindow.h" #include "sniffthread.h" +#include MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), @@ -22,5 +23,7 @@ MainWindow::~MainWindow() void MainWindow::dataReceived(QString data) { - ui->listWidget->addItem(data); + QTime currentTime = QTime::currentTime(); + + ui->listWidget->addItem(currentTime.toString(Qt::ISODate) + ": " + data); }