]> localhost Git - WindEmu.git/commitdiff
add ms timestamps to WindQt log
authorAsh Wolf <ninji@wuffs.org>
Thu, 26 Dec 2019 01:34:10 +0000 (01:34 +0000)
committerAsh Wolf <ninji@wuffs.org>
Thu, 26 Dec 2019 01:34:10 +0000 (01:34 +0000)
WindQt/mainwindow.cpp
WindQt/mainwindow.h

index ef610d985132e3691706665a4a59083ef40c3cdc..deb706c8cd8e8a06f8df982925954c0b74838732 100644 (file)
@@ -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);
index 5c11efb9169ebfa14da61f56a7649fc47d7eaaa5..636374abf88a9361886924e9d8e2582cfb416283 100644 (file)
@@ -2,6 +2,7 @@
 #define MAINWINDOW_H
 
 #include <QMainWindow>
+#include <QElapsedTimer>
 #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;