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,42 @@
|
||||
#ifndef PLUGINIMPORTER_H
|
||||
#define PLUGINIMPORTER_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
|
||||
class ExtensionHost;
|
||||
|
||||
class PluginImporter : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit PluginImporter(ExtensionHost *extHost, QObject *parent = nullptr);
|
||||
|
||||
enum ImportResult {
|
||||
Success = 0,
|
||||
InvalidPlugin,
|
||||
FileNotFound,
|
||||
CopyFailed,
|
||||
AlreadyExists,
|
||||
LoadFailed
|
||||
};
|
||||
|
||||
ImportResult importFromDirectory(const QString &dirPath);
|
||||
ImportResult importFromZip(const QString &zipPath);
|
||||
QString lastError() const { return m_lastError; }
|
||||
|
||||
signals:
|
||||
void importProgress(const QString &step, int percent);
|
||||
void importCompleted(const QString &pluginName, bool success);
|
||||
void importError(const QString &error);
|
||||
|
||||
private:
|
||||
ImportResult copyPluginFiles(const QString &sourceDir, const QString &targetDir);
|
||||
bool validatePlugin(const QString &dirPath);
|
||||
|
||||
ExtensionHost *m_extHost;
|
||||
QString m_lastError;
|
||||
QString m_pluginsDir;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user