问题描述
我在 Qt 5.11.2 和 64 位 Windows 10 上安装了 QGIS 3.16.3-Hannover。在另外两台计算机上,我也在类似的条件下安装了它。
我将 PyQgis 用于 Qgis 的独立应用程序,我认为在 PyQgis 中有些地方不能很好地工作,因为我无法使用 QWebEngineView 和 QWebKit 是的。
我的症状是:
1.- 如果在安装了Qgis的QtDesigner中,我在设计中添加了QWebEngineView小部件,程序直接崩溃停止运行。
2.- 如果在独立应用程序中我启动 QWebEngineView 它会给我一个错误:
代码:
from qgis.PyQt.QtWidgets import QWidget,QApplication,QMainWindow,QFileDialog
from PyQt5.QtWebEngineWidgets import QWebEngineView
import sys
class temp (QWebEngineView):
def __init __ (self):
super () .__ init __ ()
if __name__ == '__main__':
# We create the instance of the created class and show the window on the screen
app = QApplication (sys.argv)
win = temp ()
win.show ()
sys.exit (app.exec_ ())
它给出的错误是:
Qt WebEngine ICU data not found at C: /OSGeo4W64/apps/Qt5/resources.Trying parent directory ...
Qt WebEngine ICU data not found at C: / OSGeo4W64 / apps / Qt5. Trying application directory ...
Qt WebEngine ICU data not found at C: / OSGeo4W64 / apps / python37. Trying fallback directory ... The application MAY NOT work. Installed
Qt WebEngine locales directory not found at location C: / OSGeo4W64 / apps / Qt5 / translationss \ qtwebengine_locales. Trying application directory ...
Qt WebEngine locales directory not found at location C: / OSGeo4W64 / apps / python37 \ qtwebengine_locales. Trying fallback directory ... Translations MAY NOT not be correct.
[0205 / 214808.373: ERROR: icu_util.cc (179)] Invalid file descriptor to
ICU data received.
[0205 / 214808.491: FATAL: icu_util.cc (311)] Check Failed: result. Backtrace:
我看过这个链接:
https://issues.qgis.org/issues/18155 3年前好像无法解决这个错误...
然后与另一个:
https://forum.qt.io/topic/70457/qt-5-7-qtwebenginewidgets-not-working-on-linux/3
似乎缺少以下文件夹,其中包括我的安装中没有的文件夹:resources、qtwebengine_locales、...
我已经卸载了带有 OsGeo4W 设置的 qwebengine。然后我重新安装了它。
我看到QGis使用的是5.10.1版本,我尝试通过pip install安装它,但它告诉我只有5.12版本。
我认为一定是QWebEngineView没有正确安装Qgis。因为如果我将它与 python38 或 python 39 的安装一起使用的话。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)