提交 4aa8b92f 编写于 作者: mahuifa's avatar mahuifa

fix:修改qmake自动安装依赖功能

    1、每次qmake时判断依赖文件是否存在,如果存在则不安装,避免每次重复安装耗费时间。
上级 5dc5f7d4
......@@ -76,8 +76,9 @@ webFile.files = $$PWD/hello.html
# msvc需要配置【Custom Process Step: nmake install】或者【Custom Process Step: D:\Qt\Qt5.12.5\Tools\QtCreator\bin\jom.exe install】才生效,或者自己手动拷贝
# Debug和Release需要分别配置
INSTALLS += webFile # 将hello.html拷贝到path路径下
INSTALLS += cefDLL # 将CEF库文件拷贝到path路径下
# 执行之前先qmake,如果不想每次手动qmake,可以点击【工具】->【选项】->【构建和运行】->【qmake】->勾选【Run qmake every build】
!exists($$webFile.path/hello.html): INSTALLS += webFile # 将hello.html拷贝到path路径下
!exists($$cefDLL.path/QCefView.dll): INSTALLS += cefDLL # 将CEF库文件拷贝到path路径下
# msvc >= 2017 编译器使用utf-8编码
msvc {
......
......@@ -5,7 +5,6 @@
void initCefConfig(QCefConfig& config)
{
// QCefConfig config;
config.setUserAgent("QCefViewTest"); // 设置用户代理
config.setLogLevel(QCefConfig::LOGSEVERITY_DEFAULT); // 设置日志级别
config.setBridgeObjectName("CallBridge"); // 设置网桥对象名称
......@@ -92,6 +91,7 @@ int main(int argc, char *argv[])
QCefConfig config;
initCefConfig(config);
QCefContext cefContext(&a, argc, argv, &config);
// 获取可执行程序所在的路径,然后添加 bin 目录到库的搜索路径中
Widget w;
w.show();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册