如何选择方便、实用的建筑工程项目管理考试科目软件?

2442人阅读
软件编译(2)
公司一款产品的客户端使用了c/s、b/s混合模式,其中在线媒体浏览使用Html5的多媒体支持特性实现。然后,问题出来了:Qt自带的Webengine版本(Qt 5.6)不支持.mp4格式的多媒体文件,只能在线播放ogg。编译使用了visual studio 2015。
【编译参考】
1、修改webengine编译参数
C:\Qt\qt-everywhere-opensource-src-5.6.0\qtwebengine\src\core\gyp_run.pro:
看到有下面的信息:
contains(WEBENGINE_CONFIG, use_proprietary_codecs): GYP_CONFIG += proprietary_codecs=1 ffmpeg_branding=Chrome
所以修改(绿色字体):
&&& # !cross_compile
&&& GYP_ARGS = &-D qt_cross_compile=0&
&&& linux: include(config/desktop_linux.pri)
&&& mac: include(config/mac_osx.pri)
&&& win32: include(config/windows.pri)
#//!zf 启用所有编码器
GYP_CONFIG += proprietary_codecs=1 ffmpeg_branding=Chrome
2、ffmpeg配置
C:\Qt\qt-everywhere-opensource-src-5.6.0\qtwebengine\src\3rdparty\chromium\third_party\ffmpeg\ffmpeg.gyp:
& 'variables': {
&&& 'use_system_ffmpeg%': 0,
增加一行:
& 'variables': {
&&& 'use_system_ffmpeg%': 0,
&&&& 'ffmpeg_branding%':&Chrome&,
另外在qtwebengine的pro文件增加选项(不能确定是否必须):C:\Qt\qt-everywhere-opensource-src-5.6.0\qtwebengine\qtwebengine.pro
load(qt_build_config)
load(qt_parts)
WEBENGINE_CONFIG += use_proprietary_codecs
3、运行configure后nmake module-qtwebengine
参考:configure -mp -debug -nomake examples -nomake tests -opensource &-platform win32-msvc2015 -qmake -icu -opensource -c++11 -make libs -ID:\libraries\include\icu&
-L D:\libraries\lib
ICU库可以从这里下载:http://site.icu-project.org/download/
脚本会根据上述两个文件确定是否增加其他的解码器
常见错误:
1、运行时缺少资源文件
QML debugging is enabled. Only use this in a safe environment.
Qt WebEngine ICU data not found at C:/Qt/qt-everywhere-opensource-src-5.6.0/qtba
se/resources. Trying parent directory...
Qt WebEngine ICU data not found at C:/Qt/qt-everywhere-opensource-src-5.6.0/qtba
se. Trying application directory...
Qt WebEngine ICU data not found at g:/build-QtWebEngine-Desktop_Qt_5_6_0_MSVC201
5_64bit-Debug/debug. Trying fallback directory... The application MAY NOT work.
Installed Qt WebEngine locales directory not found at location C:/Qt/qt-everywhe
re-opensource-src-5.6.0/qtbase/translations\qtwebengine_locales. Trying applicat
ion directory...
Qt WebEngine locales directory not found at location g:/build-QtWebEngine-Deskto
p_Qt_5_6_0_MSVC2015_64bit-Debug/debug\qtwebengine_locales. Trying fallback direc
tory... Translations MAY NOT not be correct.
(qtwebengine\src\core\Debug_x64\gen\repack可以找到:
qtwebengine_locales文件夹(对应translations)
qtwebengine_resources.pak、qtwebengine_resources_100p.pak、qtwebengine_resources_200p.pak(对应resources)
qtwebengine\src\core\Debug_x64可以找到:
icudtl.dat
在bin目录下分别建立两个文件夹:
resources、translations,将上述文件(夹)copy进去)
2、重新配置:
C:\Qt\qt-everywhere-opensource-src-5.6.0\qtwebengine\src\core
删除Makefile.* 文件
解决ninja文件不存在的问题:
nmake如果C:\Qt\qt-everywhere-opensource-src-5.6.0\qtwebengine\src\core\Debug_x64\obj\下面的误删除了ninja文件,会报错,重新生成ninja文件的方式为:
在\qtwebengine\src\core运行qmake& gyp_run.pro -o Makefile.gyp_run
3、文件编码
ninja: build stopped: subcommand failed.
NMAKE : fatal error U1077: 'C:\Qt\qt-everywhere-opensource-src-5.6.0\qtwebengine
\src\3rdparty\ninja\ninja.exe' : return code '0x1'
NMAKE : fatal error U1077: '&C:\Program Files (x86)\Microsoft Visual Studio 14.0
\VC\BIN\amd64\nmake.exe&' : return code '0x2'
NMAKE : fatal error U1077: '(' : return code '0x2'
NMAKE : fatal error U1077: 'cd' : return code '0x2'
NMAKE : fatal error U1077: 'cd' : return code '0x2'
c:\qt\qt-everywhere-opensource-src-5.6.0\qtwebengine\src\3rdparty\chromium\third
_party\libjingle\source\talk\app\webrtc\dtmfsender.cc: error C2220: warning trea
ted as error - no 'object' file generated
c:\qt\qt-everywhere-opensource-src-5.6.0\qtwebengine\src\3rdparty\chromium\third
_party\libjingle\source\talk\app\webrtc\dtmfsender.cc: warning C4819:
The file c
ontains a character that cannot be represented in the current code page (936). S
ave the file in Unicode format to prevent data loss
解决办法是把文件格式转变为utf-8 bom (utf-8-sig)
如果不想一个个的转换,把下属列表保存到一个文本文件内,使用后面的python脚本转换:
c:\qt\qt-everywhere-opensource-src-5.6.0\qtwebengine\src\3rdparty\chromium\third_party\snappy\src\snappy-stubs-internal.h
c:\qt\qt-everywhere-opensource-src-5.6.0\qtwebengine\src\3rdparty\chromium\third_party\re2\re2\unicode_casefold.h
c:\qt\qt-everywhere-opensource-src-5.6.0\qtwebengine\src\3rdparty\chromium\third_party\qcms\src\qcms.h
c:\qt\qt-everywhere-opensource-src-5.6.0\qtwebengine\src\3rdparty\chromium\third_party\openmax_dl\dl\api\omxtypes.h
c:\qt\qt-everywhere-opensource-src-5.6.0\qtwebengine\src\3rdparty\chromium\third_party\harfbuzz-ng\src\hb-private.hh
c:\qt\qt-everywhere-opensource-src-5.6.0\qtwebengine\src\3rdparty\chromium\third_party\harfbuzz-ng\src\hb-ot-head-table.hh
c:\qt\qt-everywhere-opensource-src-5.6.0\qtwebengine\src\3rdparty\chromium\third_party\harfbuzz-ng\src\hb-ot-layout-common-private.hh
c:\qt\qt-everywhere-opensource-src-5.6.0\qtwebengine\src\3rdparty\chromium\third_party\harfbuzz-ng\src\hb-ot-shape-complex-indic.cc
c:\qt\qt-everywhere-opensource-src-5.6.0\qtwebengine\src\3rdparty\chromium\third_party\harfbuzz-ng\src\hb-ot-shape-complex-thai.cc
c:\qt\qt-everywhere-opensource-src-5.6.0\qtwebengine\src\3rdparty\chromium\third_party\boringssl\src\include\openssl\aead.h
c:\qt\qt-everywhere-opensource-src-5.6.0\qtwebengine\src\3rdparty\chromium\third_party\boringssl\src\include\openssl\engine.h
c:\qt\qt-everywhere-opensource-src-5.6.0\qtwebengine\src\3rdparty\chromium\third_party\boringssl\src\crypto\cmac\cmac.c
c:\qt\qt-everywhere-opensource-src-5.6.0\qtwebengine\src\3rdparty\chromium\third_party\boringssl\src\crypto\rsa\internal.h
c:\qt\qt-everywhere-opensource-src-5.6.0\qtwebengine\src\3rdparty\chromium\third_party\skia\src\effects\skdisplacementmapeffect.cpp
c:\qt\qt-everywhere-opensource-src-5.6.0\qtwebengine\src\3rdparty\chromium\crypto\p224.h
c:\qt\qt-everywhere-opensource-src-5.6.0\qtwebengine\src\3rdparty\chromium\crypto\p224.cc
c:\qt\qt-everywhere-opensource-src-5.6.0\qtwebengine\src\3rdparty\chromium\v8\src\parser.cc
c:\qt\qt-everywhere-opensource-src-5.6.0\qtwebengine\src\3rdparty\chromium\third_party\libxslt\libxslt\xslt.c
c:\qt\qt-everywhere-opensource-src-5.6.0\qtwebengine\src\3rdparty\chromium\net\quic\crypto\crypto_handshake_message.h
c:\qt\qt-everywhere-opensource-src-5.6.0\qtwebengine\src\3rdparty\chromium\media\formats\mp2t\ts_section_pmt.h
c:\qt\qt-everywhere-opensource-src-5.6.0\qtwebengine\src\3rdparty\chromium\third_party\libjingle\source\talk\app\webrtc\dtmfsender.cc
import sys
import codecs
import chardet
def utf8_converter(file_path , universal_endline =True ):
# Read from file
print(&file:&+ file_path)
file_open = open(file_path, &rb&)
raw = file_open.read()
encoding_name = chardet.detect(raw)[ 'encoding']
print(encoding_name )
file_open.close()
raw = raw.decode(encoding_name)
# Remove windows end line
if universal_endline:
raw = raw.replace( '\r\n', '\n')
# Encode to UTF-8-sig
raw = raw.encode('utf-8-sig')
file_open = open(file_path, 'wb')
file_open.write(raw)
file_open.close()
if __name__ == '__main__' :
file = sys.argv[1].encode( 'unicode_escape')
f = open(sys.argv[1], &r&)
s = f.read()
files = s.split(&\n&)
for file in files:
utf8_converter(file, False)
4、测试结果,3D加速不能用
: This library
converts OpenGL ES 2.0 API calls to DirectX 11 or DirectX 9 calls (depending on availability), removing the need to install graphics drivers on the target machines.
For&&2 to work, a graphics driver that provides
OpenGL 2.1 or higher is required. The default driver from Windows is OpenGL 1.1. Qt includes a version of the&&project
which is included from the Windows Qt installers. ANGLE implements the OpenGL ES 2.0 API on top of DirectX 11 or DirectX 9. ANGLE requires that the DirectX SDK is installed when building Qt.
ANGLE chooses the render backend depending on availability. DirectX 11 is usually preferable. However, some graphics cards may not fully support it. For these cases, the environment variableQT_ANGLE_PLATFORM&(introduced
in Qt 5.4) can be used to control the render backend. Possible values are&d3d11,&d3d9&and&warp.
To use a custom version of ANGLE, set the&ANGLE_DIR&environment variable to point to the ANGLE source tree before building Qt.
set&QT_ANGLE_PLATFORM=3d39
C:\Qt\qt-everywhere-opensource-src-5.6.0\qtwebengine\src\3rdparty\chromium\third_party\angle\src\angle.gyp
c:\Qt\qt-everywhere-opensource-src-5.6.0\qtwebengine\src\core\web_engine_context.cpp
中有这么一段代码:
&&& if (usingANGLE() ||usingSoftwareDynamicGL() || usingQtQuick2DRenderer()) {
&&&&&&& parsedCommandLine-&AppendSwitch(switches::kDisableGpu);
&&& } else {
&&&&&&& const char *glType = 0;
&&&&&&& if (qt_gl_global_share_context()-&isOpenGLES()) {
&&&&&&&&&&& glType = gfx::kGLImplementationEGLN
&&&&&&& } else {
&&&&&&&&&&& glType = gfx::kGLImplementationDesktopN
&&&&&&& parsedCommandLine-&AppendSwitchASCII(switches::kUseGL, glType);
nmake cleandist 太漫长了,直接configure:
configure -mp -debug -nomake examples -nomake tests&-opensource& -platform win32-msvc2015 -qmake -icu -opensource -confirm-license-opengl desktop &-no-angle&-I D:\libraries\include\icu& -L D:\libraries\lib
不使用angle,看看编译后是否支持3d。
..........
..........
可能是没完全清理的缘故,编译后还是无法启用webgl。安装Qt的官方编译版本,检查加载的动态库,发现的确是不包含opengl es相关库。
(编译一次太漫长了,如果有人解决过类似问题,请不吝指教)
附上本人使用vs2015sp1编译的debug版本:
/s/1kVHFvzL
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:97173次
积分:1447
积分:1447
排名:千里之外
原创:31篇
译文:16篇
评论:45条
(5)(1)(1)(1)(2)(2)(1)(1)(2)(4)(2)(1)(1)(1)(1)(3)(1)(3)(2)(1)(7)(1)(1)(1)(1)QT .5.4!Qt WebEngine!你准备好了吗? - QTCN开发网 - Powered by phpwind
查看完整版本: [--
QT .5.4!Qt WebEngine!你准备好了吗?
使用QtWebkit遇到一些问题无法解决。坛中朋友提示Qt 5.4推出了新的Qt WebEngine,所以这几天在看Qt 5.4 Beta的有关内容。 Qt 5.4的重要更改是引入了Qt WebEngine,QtWebkit将不再更新,转而使用Qt WebEngine替代。 Qt WebEngine使用了Chromium web engine, 在的网站上看到: Build Instructions (Windows)
Build environmentSetting up the environment for Visual Studio 2013Building with Visual Studio 2013 is theonly supported configuration after .Building with Visual Studio2013 Express is currently broken () You must have Windows 7 x64 orlater. x86 OSsare unsupported.
并且没有见到Chromium支持MinGW的内容。 这是不是意味着如果Qt要跟随Chromium的更新,那么在windows下,以后将只能使用Visual Studio 2013的64位版,连Visual Studio 2013 Express都不能用了?有一种Qt会被Chromium劫持的感觉。或者Qt会在Chromium的现有基础上另开一枝?或者就此打住,不跟随Chromium的更新?
根据项目实际需要来,以项目为导向.
相信Qt会做相应工作的。否则,Qt受限太多了。
Qt webengine 是基于Chromium 但是也做了其他很多工作的、、5.4 beta现在在win下是支持vs2013,只是Express 也能用,X86版同样能用、、、5.4 出beta后迟迟不发rc和正式版,可能就和Webengine有关系吧、、、、5.4 beta现在放出来的版本,chromium的内核版本是37、、、、
浏览器内核这块 害死不少人,我们现在发现Webkit一直存在内存泄露,还有加入到插件里面 卸载插件崩溃的问题一直没有解决,现在换成新的webengine又这么多受限,让我对Qt的前景堪忧啊
:浏览器内核这块 害死不少人,我们现在发现Webkit一直存在内存泄露,还有加入到插件里面 卸载插件崩溃的问题一直没有解决,现在换成新的webengine又这么多受限,让我对Qt的前景堪忧啊[表情]  ( 10:42) 可以自己用其他的引擎啊、、例如libcef3、、、
估计以后QT会出现两个分支:webengine版和非webengine版。元芳,你怎么看?
:估计以后QT会出现两个分支:webengine版和非webengine版。元芳,你怎么看? ( 17:30) 感觉不会这样分支的、、webkit还会维护的、、现在webengine去取代webkit还不行的、、很多接口都没有移植过来的、、、今天研究下webengine 的brower的例子,还去看了些chromium的解析类的博客,简单扒下QtWebengine的代码,QtWebengine缺失的东西的确很多的、、插件接口,代理设置,现在都是不能用的、、QtWebkit的时候,网络,I/O,还有绘图层都是Qt的东西、、、现在的QtWebEngine不是了、、这些都是Chromium的、、、Qt应该只是在Content API层面上进行封装的,而且很多接口Qt没有进行封装处理,和QtNetwork几乎没有关联,所以在5.4版本下,QtWebngine的可用性有待商讨的、、、注:我下的是Qt 5.4 Beta版,但是我扒的代码不是最新的是aplha版本的代码、、
QtWebEngine 这个版本的样子,着实让人失望啊、、哎、、本想这次就用上的、、看来还是不得不去研究libcef了、、
关于Qt Webkit 的未来,Qt 5.4 beta 的发布公告是这样说的:Qt 5.4 also contains Qt WebKit. It is still supported, but as of Qt 5.4 we consider it done, so no new functionality will be added to it. We are also planning to deprecate Qt WebKit in future releases, as the new Qt WebEngine provides what is needed. In most use cases, migrating from Qt WebKit to Qt WebEngine is rather straightforward.所以不能再指望未来的Qt 版本能解决Qt Webkit 目前所存在的问题了。只希望Qt WebEngine 能尽快完善起来。至于windows下的构建工具,我要转向VS了。还有一个问题就是不知道Qt WebEngine 究竟会怎么样。先试试吧。
对于患有开源强迫症的人来说,使用VS2013确实是一件可怕的事情。但是我的病情并不严重,当我克服了这一心理后,使用VS2013来玩QT5.4还是很不错的。使用QTCreator时感觉不到VS2013的存在。
windows系统我已经不用了,vs就算了吧。谁用我的软件,谁负责在windows下编译,呵呵。
到底现在什么开发工具前途最好呢 ~~~
根据个人喜好,认准任意一个足以,前途都不错。个人最近在用js开发,感觉也是爽透了。html5协议已经敲定,js前途乐观
Qt 5.4 Release Candidate Available QtWebEngine is separated as its own installable binary package in the installers component tree几乎被猜中了,看来也只有这样才能解决平台和工具依赖的问题。
查看完整版本: [--
Powered by
Gzip disabledQt 5.4 Beta Available - Qt Blog

我要回帖

更多关于 项目管理考试科目 的文章

 

随机推荐