add ms timestamps to WindQt log

This commit is contained in:
Ash Wolf 2019-12-26 01:34:10 +00:00
parent 607c194eb6
commit c70ea2828b
2 changed files with 5 additions and 1 deletions

View File

@ -13,8 +13,10 @@ MainWindow::MainWindow(EmuBase *emu, QWidget *parent) :
ui->setupUi(this); ui->setupUi(this);
ui->logView->setMaximumBlockCount(1000); ui->logView->setMaximumBlockCount(1000);
elapsedTimer.start();
emu->setLogger([&](const char *str) { 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); timer = new QTimer(this);

View File

@ -2,6 +2,7 @@
#define MAINWINDOW_H #define MAINWINDOW_H
#include <QMainWindow> #include <QMainWindow>
#include <QElapsedTimer>
#include "../WindCore/emubase.h" #include "../WindCore/emubase.h"
#include "pdascreenwindow.h" #include "pdascreenwindow.h"
@ -44,6 +45,7 @@ private slots:
void on_writeDwordButton_clicked(); void on_writeDwordButton_clicked();
private: private:
QElapsedTimer elapsedTimer;
Ui::MainWindow *ui; Ui::MainWindow *ui;
PDAScreenWindow pdaScreen; PDAScreenWindow pdaScreen;
EmuBase *emu; EmuBase *emu;