From: Ash Wolf Date: Thu, 26 Dec 2019 01:34:10 +0000 (+0000) Subject: add ms timestamps to WindQt log X-Git-Url: http://git.gwright.org.uk/?a=commitdiff_plain;h=c70ea2828b0988d950380e4b90ad9771b6ecc10e;p=WindEmu.git add ms timestamps to WindQt log --- diff --git a/WindQt/mainwindow.cpp b/WindQt/mainwindow.cpp index ef610d9..deb706c 100644 --- a/WindQt/mainwindow.cpp +++ b/WindQt/mainwindow.cpp @@ -13,8 +13,10 @@ MainWindow::MainWindow(EmuBase *emu, QWidget *parent) : ui->setupUi(this); ui->logView->setMaximumBlockCount(1000); + elapsedTimer.start(); emu->setLogger([&](const char *str) { - ui->logView->appendPlainText(str); + QString fullStr = QStringLiteral("[%1] %2").arg(elapsedTimer.elapsed()).arg(str); + ui->logView->appendPlainText(fullStr); }); timer = new QTimer(this); diff --git a/WindQt/mainwindow.h b/WindQt/mainwindow.h index 5c11efb..636374a 100644 --- a/WindQt/mainwindow.h +++ b/WindQt/mainwindow.h @@ -2,6 +2,7 @@ #define MAINWINDOW_H #include +#include #include "../WindCore/emubase.h" #include "pdascreenwindow.h" @@ -44,6 +45,7 @@ private slots: void on_writeDwordButton_clicked(); private: + QElapsedTimer elapsedTimer; Ui::MainWindow *ui; PDAScreenWindow pdaScreen; EmuBase *emu;