fix: 修复启动白屏与地图崩溃问题
- SetUseOpenGL(false): QGLWidget 在当前系统不兼容,改用软件渲染 - ExtensionHost_v2: 添加 contributionRegistry() getter 修复空指针 - main.cpp: 两阶段启动 (show → QTimer::singleShot → initialize) - mainwindow: 分离构造函数与 initialize(),结尾调用 onTabIndexChanged(3) - 修复 Qt DLL 部署:使用 windeployqt 确保运行时库版本匹配
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
#ifndef LOGVIEWER_H
|
||||
#define LOGVIEWER_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QTextEdit>
|
||||
#include <QComboBox>
|
||||
#include <QPushButton>
|
||||
#include <QLineEdit>
|
||||
#include <QLabel>
|
||||
#include <QCheckBox>
|
||||
|
||||
class LogViewer : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit LogViewer(QWidget *parent = nullptr);
|
||||
~LogViewer() override = default;
|
||||
|
||||
private slots:
|
||||
void onFilterChanged(const QString &text);
|
||||
void onLevelChanged(int index);
|
||||
void onClear();
|
||||
void onExport();
|
||||
void onAutoScrollToggled(bool enabled);
|
||||
|
||||
private:
|
||||
void installMessageHandler();
|
||||
void restoreMessageHandler();
|
||||
static void logMessageHandler(QtMsgType type,
|
||||
const QMessageLogContext &context,
|
||||
const QString &msg);
|
||||
|
||||
QTextEdit *m_logView;
|
||||
QLineEdit *m_filterEdit;
|
||||
QComboBox *m_levelCombo;
|
||||
QCheckBox *m_autoScroll;
|
||||
QPushButton *m_clearBtn;
|
||||
QPushButton *m_exportBtn;
|
||||
QLabel *m_countLabel;
|
||||
int m_logCount = 0;
|
||||
|
||||
static LogViewer *s_instance;
|
||||
static QtMessageHandler s_oldHandler;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user