添加调用系统程序打开文件接口
parent
5928e49884
commit
bfb2adb7f9
|
@ -6,7 +6,7 @@ set(CMAKE_AUTOMOC ON)
|
|||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
|
||||
find_package(Qt6 COMPONENTS Quick WebEngineQuick REQUIRED)
|
||||
find_package(Qt6 COMPONENTS Gui Quick WebEngineQuick REQUIRED)
|
||||
|
||||
#遍历所有Cpp文件
|
||||
file(GLOB_RECURSE CPP_FILES src/*.cpp src/*.h)
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include <QJsonDocument>
|
||||
#include <QtConcurrent/QtConcurrent>
|
||||
#include <fstream>
|
||||
#include <QDesktopServices>
|
||||
|
||||
static const std::string baseUrl = "https://api.hammer-hfut.tk:233/aics/file/";
|
||||
//static const std::string baseUrl = "http://127.0.0.1:4523/m1/2914957-0-6e5f2db1/";
|
||||
|
@ -426,3 +427,8 @@ void FileTransferManager::getMarkdown(const QString &fileId)
|
|||
});
|
||||
}
|
||||
|
||||
void FileTransferManager::openLocalFile(const QString &fileName)
|
||||
{
|
||||
QDesktopServices::openUrl(QUrl::fromLocalFile("D:\\Downloads\\"+ fileName));
|
||||
}
|
||||
|
||||
|
|
|
@ -32,6 +32,8 @@ public:
|
|||
|
||||
Q_INVOKABLE void getMarkdown(const QString &fileId);
|
||||
|
||||
Q_INVOKABLE void openLocalFile(const QString &fileName);
|
||||
|
||||
signals:
|
||||
void transferComplete(bool download, QString fileId, QString fileName);
|
||||
void markdownData(QString data);
|
||||
|
|
Loading…
Reference in New Issue