mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-01 11:32:21 +08:00
Cabana: redirect qt logs to status bar (#26187)
Redirect qt logs to status bar old-commit-hash: ae1d15094169b5cad2921e5320bc53ce3bcb6b96
This commit is contained in:
@@ -8,7 +8,15 @@
|
||||
|
||||
#include "tools/replay/util.h"
|
||||
|
||||
static MainWindow *main_win = nullptr;
|
||||
void qLogMessageHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg) {
|
||||
main_win->showStatusMessage(msg);
|
||||
}
|
||||
|
||||
MainWindow::MainWindow() : QWidget() {
|
||||
main_win = this;
|
||||
qInstallMessageHandler(qLogMessageHandler);
|
||||
|
||||
QVBoxLayout *main_layout = new QVBoxLayout(this);
|
||||
main_layout->setContentsMargins(11, 11, 11, 5);
|
||||
main_layout->setSpacing(0);
|
||||
|
||||
@@ -14,6 +14,7 @@ class MainWindow : public QWidget {
|
||||
public:
|
||||
MainWindow();
|
||||
void dockCharts(bool dock);
|
||||
void showStatusMessage(const QString &msg, int timeout = 0) { status_bar->showMessage(msg, timeout); }
|
||||
|
||||
signals:
|
||||
void logMessageFromReplay(const QString &msg, int timeout);
|
||||
|
||||
Reference in New Issue
Block a user