diff --git a/Web/QtWebExamples/authorization/authorization.pro b/Web/QtWebExamples/authorization/authorization.pro index 209f6ca674d99c606ad0e9b5af2597ad4d29fb66..fb17dcadacee98a3e911a1d965fb0fdc4c4332ea 100644 --- a/Web/QtWebExamples/authorization/authorization.pro +++ b/Web/QtWebExamples/authorization/authorization.pro @@ -33,10 +33,16 @@ VERSION = 1.0.0 DEFINES += APP_VERSION=\\\"$$VERSION\\\" contains(QT_ARCH, i386){ # 使用32位编译器 -DESTDIR = $$PWD/../bin # 程序输出路径 +path = $$PWD/../bin # 程序输出路径 }else{ -DESTDIR = $$PWD/../bin64 # 使用64位编译器 +path = $$PWD/../bin64 # 使用64位编译器 } +DESTDIR = $$path # 指定编译后的文件存放路径 +# 程序编译后需要使用nmake install(msvc)或make install (linux)将web文件夹拷贝到当前路径下,或者自己手动拷贝 + +webFile.path = $$path +webFile.files = $$PWD/video.html +INSTALLS += webFile # 将web文件夹拷贝到path路径下,需要配置Custom Process Step: nmake install才生效 # msvc 编译器使用utf-8编码 msvc { diff --git a/Web/QtWebExamples/channelDemo/channelDemo.pro b/Web/QtWebExamples/channelDemo/channelDemo.pro index 677412c7da0a1a7fce030592e8bacbe6fb7c4556..3717a92b0ad9d5d385b490e156db4d63ded715b5 100644 --- a/Web/QtWebExamples/channelDemo/channelDemo.pro +++ b/Web/QtWebExamples/channelDemo/channelDemo.pro @@ -43,12 +43,9 @@ path = $$PWD/../bin64 # 使用64位编译器 DESTDIR = $$path # 指定编译后的文件存放路径 # 程序编译后需要使用nmake install(msvc)或make install (linux)将web文件夹拷贝到当前路径下,或者自己手动拷贝 -exists ($$PWD/web) { # 判断文件夹是否存在 - webFile.path = $$path - webFile.files = $$PWD/web - INSTALLS += webFile # 将web文件夹拷贝到path路径下,需要配置Custom Process Step: nmake install才生效 -} - +webFile.path = $$path +webFile.files = $$PWD/web +INSTALLS += webFile # 将web文件夹拷贝到path路径下,需要配置Custom Process Step: nmake install才生效 # msvc 编译器使用utf-8编码 msvc { diff --git a/Web/Web.assets/image-20221214171041497.png b/Web/Web.assets/image-20221214171041497.png new file mode 100644 index 0000000000000000000000000000000000000000..e72b1de803f3bd251995ed5b48fcf4d1c36f2452 Binary files /dev/null and b/Web/Web.assets/image-20221214171041497.png differ diff --git a/Web/Web.assets/image-20221214171147965.png b/Web/Web.assets/image-20221214171147965.png new file mode 100644 index 0000000000000000000000000000000000000000..6856a731e88a983fec883de30bc32b74732e5ff3 Binary files /dev/null and b/Web/Web.assets/image-20221214171147965.png differ diff --git a/Web/Web.assets/image-20221215174224272.png b/Web/Web.assets/image-20221215174224272.png new file mode 100644 index 0000000000000000000000000000000000000000..d59dee809010b0768f0d90ef32716ec8ba798d9c Binary files /dev/null and b/Web/Web.assets/image-20221215174224272.png differ diff --git a/Web/Web.md b/Web/Web.md index 74b7afd09140536766eae9df74eb8796524025bd..c95bef87aee74a7fe3d5be7fb7591e5224a77418 100644 --- a/Web/Web.md +++ b/Web/Web.md @@ -6,9 +6,11 @@ ## 1、说明 -| 类名 | 功能 | -| :-----------: | ------------------------------------------------------------ | -| minimal | 使用QWebEngineView加载显示Web页面的最小示例1 | +| 类名 | 功能 | +| :-----------: | -------------------------------------------- | +| minimal | 使用QWebEngineView加载显示Web页面的最小示例1 | +| minimal2 | 使用QWebEngineView加载显示Web页面的最小示例2 | +| authorization | 使用QWebEnginePage打开摄像头演示权限管理 | @@ -31,3 +33,30 @@ > 3. 详细的注释,对初学者更友好。 ![image-20221211210252527](Web.assets/image-20221211210252527.png) + + + +### 1.2 minimal2 + +> 1. 使用QWebEngineView加载显示Web页面的最小示例2 +> 2. 保留最简单功能,去掉不易于理解的功能; +> 3. 分别演示了【QWebEngineView::setHtml】【QWebEngineView::setContent】的使用方法; +> 4. 详细的注释,对初学者更友好。 + +* setHtml加载html代码 + + ![image-20221214171041497](Web.assets/image-20221214171041497.png) + +* setHtml加载html代码,并通过相对路径引用参数2的地址中的图片 + + ![image-20221214171147965](Web.assets/image-20221214171147965.png) + + + +### 1.3 authorization + +> 1. 使用QWebEnginePage有时需要权限,例如打开摄像头、麦克风; +> 2. 这里演示了怎么实现授权功能; +> 3. 分别展示了打开【网络地址授权】和打开【本地html授权】。 + +![image-20221215174224272](Web.assets/image-20221215174224272.png)