在最新Qt5.4,使用QWebengine,如何js调用Qt

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了在最新Qt5.4,使用QWebengine,如何js调用Qt相关的知识,希望对你有一定的参考价值。

参考技术A 一、Qt GUI方面: 1、QOpenGLContext已能够适配现有的native context(如EGL,GLX等)。这使得Qt可以跟其他框架交互,例如游戏引擎。 2、提高对OpenGL ES 3.0/3.1的支持。如果编译Qt库时打开“-opengl es2”选项,高版本的ES头文件会自动包含在Qt...

使用 Qt5 的 QWebEngine

【中文标题】使用 Qt5 的 QWebEngine【英文标题】:Using QWebEngine of Qt5 【发布时间】:2021-03-15 22:27:28 【问题描述】:
[14784] PyInstaller Bootloader 3.x
[14784] LOADER: executable is C:\Users\╫±▐≤ΪΎ≥\Desktop\Papinhio player\exe\dist\Papinhio player.exe
[14784] LOADER: homepath is C:\Users\╫±▐≤ΪΎ≥\Desktop\Papinhio player\exe\dist
[14784] LOADER: _MEIPASS2 is NULL
[14784] LOADER: archivename is C:\Users\╫±▐≤ΪΎ≥\Desktop\Papinhio player\exe\dist\Papinhio player.exe
[14784] LOADER: Cookie found at offset 0x5156904
[14784] LOADER: Extracting binaries
[14784] LOADER: creating directory C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842 with security string: D:(A;;FA;;;S-1-5-21-2491018127-1704774179-573031757-1001)
[14784] LOADER: creating directory C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\PyQt5 with security string: D:(A;;FA;;;S-1-5-21-2491018127-1704774179-573031757-1001)
[14784] LOADER: creating directory C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\PyQt5\Qt with security string: D:(A;;FA;;;S-1-5-21-2491018127-1704774179-573031757-1001)
[14784] LOADER: creating directory C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\PyQt5\Qt\bin with security string: D:(A;;FA;;;S-1-5-21-2491018127-1704774179-573031757-1001)
[14784] LOADER: creating directory C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\PyQt5\Qt\resources with security string: D:(A;;FA;;;S-1-5-21-2491018127-1704774179-573031757-1001)
[14784] LOADER: creating directory C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\PyQt5\Qt\translations with security string: D:(A;;FA;;;S-1-5-21-2491018127-1704774179-573031757-1001)
[14784] LOADER: creating directory C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\PyQt5\Qt\translations\qtwebengine_locales with security string: D:(A;;FA;;;S-1-5-21-2491018127-1704774179-573031757-1001)
[14784] LOADER: creating directory C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\asyncio with security string: D:(A;;FA;;;S-1-5-21-2491018127-1704774179-573031757-1001)
[14784] LOADER: creating directory C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\concurrent with security string: D:(A;;FA;;;S-1-5-21-2491018127-1704774179-573031757-1001)
[14784] LOADER: creating directory C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\concurrent\futures with security string: D:(A;;FA;;;S-1-5-21-2491018127-1704774179-573031757-1001)
[14784] LOADER: creating directory C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\ctypes with security string: D:(A;;FA;;;S-1-5-21-2491018127-1704774179-573031757-1001)
[14784] LOADER: creating directory C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\distutils with security string: D:(A;;FA;;;S-1-5-21-2491018127-1704774179-573031757-1001)
[14784] LOADER: creating directory C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\email with security string: D:(A;;FA;;;S-1-5-21-2491018127-1704774179-573031757-1001)
[14784] LOADER: creating directory C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\html with security string: D:(A;;FA;;;S-1-5-21-2491018127-1704774179-573031757-1001)
[14784] LOADER: creating directory C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\http with security string: D:(A;;FA;;;S-1-5-21-2491018127-1704774179-573031757-1001)
[14784] LOADER: creating directory C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\importlib with security string: D:(A;;FA;;;S-1-5-21-2491018127-1704774179-573031757-1001)
[14784] LOADER: creating directory C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\logging with security string: D:(A;;FA;;;S-1-5-21-2491018127-1704774179-573031757-1001)
[14784] LOADER: creating directory C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\multiprocessing with security string: D:(A;;FA;;;S-1-5-21-2491018127-1704774179-573031757-1001)
[14784] LOADER: creating directory C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\multiprocessing\dummy with security string: D:(A;;FA;;;S-1-5-21-2491018127-1704774179-573031757-1001)
[14784] LOADER: creating directory C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\pydoc_data with security string: D:(A;;FA;;;S-1-5-21-2491018127-1704774179-573031757-1001)
[14784] LOADER: creating directory C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\unittest with security string: D:(A;;FA;;;S-1-5-21-2491018127-1704774179-573031757-1001)
[14784] LOADER: creating directory C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\urllib with security string: D:(A;;FA;;;S-1-5-21-2491018127-1704774179-573031757-1001)
[14784] LOADER: creating directory C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\xml with security string: D:(A;;FA;;;S-1-5-21-2491018127-1704774179-573031757-1001)
[14784] LOADER: creating directory C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\xml\parsers with security string: D:(A;;FA;;;S-1-5-21-2491018127-1704774179-573031757-1001)
[14784] LOADER: creating directory C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\xml\sax with security string: D:(A;;FA;;;S-1-5-21-2491018127-1704774179-573031757-1001)
[14784] LOADER: creating directory C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\xmlrpc with security string: D:(A;;FA;;;S-1-5-21-2491018127-1704774179-573031757-1001)
[14784] LOADER: Executing self as child
[14784] LOADER: set _MEIPASS2 to C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842
[14784] LOADER: Setting up to run child
[14784] LOADER: Creating child process
[14784] LOADER: Waiting for child process to finish...
[11620] PyInstaller Bootloader 3.x
[11620] LOADER: executable is C:\Users\╫±▐≤ΪΎ≥\Desktop\Papinhio player\exe\dist\Papinhio player.exe
[11620] LOADER: homepath is C:\Users\╫±▐≤ΪΎ≥\Desktop\Papinhio player\exe\dist
[11620] LOADER: _MEIPASS2 is C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842
[11620] LOADER: archivename is C:\Users\╫±▐≤ΪΎ≥\Desktop\Papinhio player\exe\dist\Papinhio player.exe
[11620] LOADER: Cookie found at offset 0x5156904
[11620] LOADER: SetDllDirectory(C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842)
[11620] LOADER: Already in the child - running user's code.
[11620] LOADER: manifestpath: C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\Papinhio player.exe.manifest
[11620] LOADER: Error activating the context: ActivateActCtx:
╠ώά Ώ±Ύ≤Ώ▄ϋίώά Ύ±ώ≤ΉΎ² Ώί±ώέ▄ΈΈΎΊΪΎ≥ Ώ±ΎίΏώΈίήΉ▌Ίύ≥ ίΊί±ήΎΏΎ▀ύ≤ύ≥ ϊώί±ήά≤▀ά≥ άΏ▌ΪΫ≈ί, ίΏίώϊ▐ ΪΎ Ώί±ώέ▄ΈΈΎΊ Ώ±ΎίΏώΈίήΉ▌Ίύ≥ ίΊί±ήΎΏΎ▀ύ≤ύ≥ ϊώί±ήά≤▀ά≥ ί▀≈ί ▐ϊύ Ύ±ώ≤Ϊί▀.

[11620] LOADER: ucrtbase.dll found: C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\ucrtbase.dll
[11620] LOADER: Python library: C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\python38.dll
[11620] LOADER: Loaded functions from Python library.
[11620] LOADER: Manipulating environment (sys.path, sys.prefix)
[11620] LOADER: sys.prefix is C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842
[11620] LOADER: Pre-init sys.path is C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\base_library.zip;C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842
[11620] LOADER: Setting runtime options
[11620] LOADER: Bootloader option: pyi-windows-manifest-filename Papinhio player.exe.manifest
[11620] LOADER: Runtime option: v
[11620] LOADER: Initializing python
import _frozen_importlib # frozen
import _imp # builtin
import '_thread' # <class '_frozen_importlib.BuiltinImporter'>
import '_warnings' # <class '_frozen_importlib.BuiltinImporter'>
import '_weakref' # <class '_frozen_importlib.BuiltinImporter'>
import '_frozen_importlib_external' # <class '_frozen_importlib.FrozenImporter'>
import '_io' # <class '_frozen_importlib.BuiltinImporter'>
import 'marshal' # <class '_frozen_importlib.BuiltinImporter'>
import 'nt' # <class '_frozen_importlib.BuiltinImporter'>
import _thread # previously loaded ('_thread')
import '_thread' # <class '_frozen_importlib.BuiltinImporter'>
import _weakref # previously loaded ('_weakref')
import '_weakref' # <class '_frozen_importlib.BuiltinImporter'>
import 'winreg' # <class '_frozen_importlib.BuiltinImporter'>
# installing zipimport hook
import 'time' # <class '_frozen_importlib.BuiltinImporter'>
import 'zipimport' # <class '_frozen_importlib.FrozenImporter'>
# installed zipimport hook
# zipimport: found 148 names in 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\base_library.zip'
import '_codecs' # <class '_frozen_importlib.BuiltinImporter'>
import codecs # loaded from Zip C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\base_library.zip\codecs.pyc
import encodings.aliases # loaded from Zip C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\base_library.zip\encodings\aliases.pyc
import encodings # loaded from Zip C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\base_library.zip\encodings\__init__.pyc
import encodings.utf_8 # loaded from Zip C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\base_library.zip\encodings\utf_8.pyc
import encodings.cp1253 # loaded from Zip C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\base_library.zip\encodings\cp1253.pyc
import '_signal' # <class '_frozen_importlib.BuiltinImporter'>
import encodings.latin_1 # loaded from Zip C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\base_library.zip\encodings\latin_1.pyc
import '_abc' # <class '_frozen_importlib.BuiltinImporter'>
import abc # loaded from Zip C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\base_library.zip\abc.pyc
import io # loaded from Zip C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\base_library.zip\io.pyc
[11620] LOADER: Overriding Python's sys.path
[11620] LOADER: Post-init sys.path is C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\base_library.zip;C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842
[11620] LOADER: Setting sys.argv
[11620] LOADER: setting sys._MEIPASS
[11620] LOADER: importing modules from CArchive
[11620] LOADER: extracted struct
[11620] LOADER: callfunction returned...
import '_struct' # <class '_frozen_importlib.BuiltinImporter'>
[11620] LOADER: extracted pyimod01_os_path
[11620] LOADER: callfunction returned...
[11620] LOADER: extracted pyimod02_archive
[11620] LOADER: callfunction returned...
import 'zlib' # <class '_frozen_importlib.BuiltinImporter'>
[11620] LOADER: extracted pyimod03_importers
[11620] LOADER: callfunction returned...
[11620] LOADER: Installing PYZ archive with Python modules.
[11620] LOADER: PYZ archive: PYZ-00.pyz
[11620] LOADER: Running pyiboot01_bootstrap.py
# PyInstaller: FrozenImporter(C:\Users\Χρήστος\Desktop\Papinhio player\exe\dist\Papinhio player.exe?85267086)
# os not found in PYZ
# code object from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\os.pyc'
# stat not found in PYZ
# code object from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\stat.pyc'
import '_stat' # <class '_frozen_importlib.BuiltinImporter'>
import 'stat' # <_frozen_importlib_external.SourcelessFileLoader object at 0x000001B9BEA4A730>
# _collections_abc not found in PYZ
import _collections_abc # loaded from Zip C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\base_library.zip\_collections_abc.pyc
# ntpath not found in PYZ
# code object from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\ntpath.pyc'
# genericpath not found in PYZ
# code object from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\genericpath.pyc'
import 'genericpath' # <_frozen_importlib_external.SourcelessFileLoader object at 0x000001B9BEA7A940>
import 'ntpath' # <_frozen_importlib_external.SourcelessFileLoader object at 0x000001B9BEA57A30>
import 'os' # <_frozen_importlib_external.SourcelessFileLoader object at 0x000001B9BEA29E80>
# ctypes not found in PYZ
# code object from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\ctypes\\__init__.pyc'
# _ctypes not found in PYZ
# extension module '_ctypes' loaded from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\_ctypes.pyd'
# extension module '_ctypes' executed from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\_ctypes.pyd'
import '_ctypes' # <_frozen_importlib_external.ExtensionFileLoader object at 0x000001B9BEA879A0>
# ctypes._endian not found in PYZ
# code object from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\ctypes\\_endian.pyc'
import 'ctypes._endian' # <_frozen_importlib_external.SourcelessFileLoader object at 0x000001B9BEA99A30>
import 'ctypes' # <_frozen_importlib_external.SourcelessFileLoader object at 0x000001B9BEA439A0>
[11620] LOADER: Running pyi_rth_multiprocessing.py
# re not found in PYZ
# enum not found in PYZ
# types not found in PYZ
import types # loaded from Zip C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\base_library.zip\types.pyc
import enum # loaded from Zip C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\base_library.zip\enum.pyc
# sre_compile not found in PYZ
import '_sre' # <class '_frozen_importlib.BuiltinImporter'>
# sre_parse not found in PYZ
# sre_constants not found in PYZ
import sre_constants # loaded from Zip C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\base_library.zip\sre_constants.pyc
import sre_parse # loaded from Zip C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\base_library.zip\sre_parse.pyc
import sre_compile # loaded from Zip C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\base_library.zip\sre_compile.pyc
# functools not found in PYZ
# collections not found in PYZ
# operator not found in PYZ
import '_operator' # <class '_frozen_importlib.BuiltinImporter'>
import operator # loaded from Zip C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\base_library.zip\operator.pyc
# keyword not found in PYZ
import keyword # loaded from Zip C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\base_library.zip\keyword.pyc
# heapq not found in PYZ
import '_heapq' # <class '_frozen_importlib.BuiltinImporter'>
import heapq # loaded from Zip C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\base_library.zip\heapq.pyc
import 'itertools' # <class '_frozen_importlib.BuiltinImporter'>
# reprlib not found in PYZ
import reprlib # loaded from Zip C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\base_library.zip\reprlib.pyc
import '_collections' # <class '_frozen_importlib.BuiltinImporter'>
import collections # loaded from Zip C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\base_library.zip\collections\__init__.pyc
import '_functools' # <class '_frozen_importlib.BuiltinImporter'>
import functools # loaded from Zip C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\base_library.zip\functools.pyc
import '_locale' # <class '_frozen_importlib.BuiltinImporter'>
# copyreg not found in PYZ
import copyreg # loaded from Zip C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\base_library.zip\copyreg.pyc
import re # loaded from Zip C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\base_library.zip\re.pyc
# multiprocessing not found in PYZ
# code object from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\multiprocessing\\__init__.pyc'
# multiprocessing.context not found in PYZ
# code object from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\multiprocessing\\context.pyc'
# threading not found in PYZ
# code object from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\threading.pyc'
# _weakrefset not found in PYZ
import _weakrefset # loaded from Zip C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\base_library.zip\_weakrefset.pyc
import 'threading' # <_frozen_importlib_external.SourcelessFileLoader object at 0x000001B9C055F8E0>
# multiprocessing.process not found in PYZ
# code object from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\multiprocessing\\process.pyc'
# signal not found in PYZ
# code object from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\signal.pyc'
import 'signal' # <_frozen_importlib_external.SourcelessFileLoader object at 0x000001B9C0581940>
import 'multiprocessing.process' # <_frozen_importlib_external.SourcelessFileLoader object at 0x000001B9C056A550>
# multiprocessing.reduction not found in PYZ
# code object from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\multiprocessing\\reduction.pyc'
# pickle not found in PYZ
# code object from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\pickle.pyc'
# _compat_pickle not found in PYZ
# code object from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\_compat_pickle.pyc'
import '_compat_pickle' # <_frozen_importlib_external.SourcelessFileLoader object at 0x000001B9C05AF340>
import '_pickle' # <class '_frozen_importlib.BuiltinImporter'>
# org not found in PYZ
import 'pickle' # <_frozen_importlib_external.SourcelessFileLoader object at 0x000001B9C0590820>
# socket not found in PYZ
# code object from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\socket.pyc'
# _socket not found in PYZ
# extension module '_socket' loaded from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\_socket.pyd'
# extension module '_socket' executed from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\_socket.pyd'
import '_socket' # <_frozen_importlib_external.ExtensionFileLoader object at 0x000001B9C05AFFD0>
# selectors not found in PYZ
# code object from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\selectors.pyc'
# collections.abc not found in PYZ
import collections.abc # loaded from Zip C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\base_library.zip\collections\abc.pyc
import 'math' # <class '_frozen_importlib.BuiltinImporter'>
# select not found in PYZ
# extension module 'select' loaded from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\select.pyd'
# extension module 'select' executed from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\select.pyd'
import 'select' # <_frozen_importlib_external.ExtensionFileLoader object at 0x000001B9C05DF340>
import 'selectors' # <_frozen_importlib_external.SourcelessFileLoader object at 0x000001B9C05D4190>
import 'errno' # <class '_frozen_importlib.BuiltinImporter'>
import 'socket' # <_frozen_importlib_external.SourcelessFileLoader object at 0x000001B9C0594760>
import '_winapi' # <class '_frozen_importlib.BuiltinImporter'>
import 'multiprocessing.reduction' # <_frozen_importlib_external.SourcelessFileLoader object at 0x000001B9C05818E0>
import 'multiprocessing.context' # <_frozen_importlib_external.SourcelessFileLoader object at 0x000001B9C052D2B0>
import 'multiprocessing' # <_frozen_importlib_external.SourcelessFileLoader object at 0x000001B9C04FCF40>
# multiprocessing.spawn not found in PYZ
# code object from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\multiprocessing\\spawn.pyc'
# runpy not found in PYZ
# code object from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\runpy.pyc'
# importlib not found in PYZ
# code object from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\importlib\\__init__.pyc'
# warnings not found in PYZ
import warnings # loaded from Zip C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\base_library.zip\warnings.pyc
import 'importlib' # <_frozen_importlib_external.SourcelessFileLoader object at 0x000001B9C0615160>
# importlib.machinery not found in PYZ
# code object from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\importlib\\machinery.pyc'
import 'importlib.machinery' # <_frozen_importlib_external.SourcelessFileLoader object at 0x000001B9C06152E0>
# importlib.util not found in PYZ
# code object from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\importlib\\util.pyc'
# importlib.abc not found in PYZ
# code object from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\importlib\\abc.pyc'
import 'importlib.abc' # <_frozen_importlib_external.SourcelessFileLoader object at 0x000001B9C0625190>
# contextlib not found in PYZ
# code object from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\contextlib.pyc'
import 'contextlib' # <_frozen_importlib_external.SourcelessFileLoader object at 0x000001B9C0625940>
import 'importlib.util' # <_frozen_importlib_external.SourcelessFileLoader object at 0x000001B9C0615A30>
# pkgutil not found in PYZ
# code object from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\pkgutil.pyc'
# weakref not found in PYZ
import weakref # loaded from Zip C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\base_library.zip\weakref.pyc
import 'pkgutil' # <_frozen_importlib_external.SourcelessFileLoader object at 0x000001B9C062F730>
import 'runpy' # <_frozen_importlib_external.SourcelessFileLoader object at 0x000001B9C0590220>
# multiprocessing.util not found in PYZ
# code object from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\multiprocessing\\util.pyc'
import 'atexit' # <class '_frozen_importlib.BuiltinImporter'>
# subprocess not found in PYZ
# code object from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\subprocess.pyc'
import 'msvcrt' # <class '_frozen_importlib.BuiltinImporter'>
import 'subprocess' # <_frozen_importlib_external.SourcelessFileLoader object at 0x000001B9C0661340>
import 'multiprocessing.util' # <_frozen_importlib_external.SourcelessFileLoader object at 0x000001B9C062F760>
import 'multiprocessing.spawn' # <_frozen_importlib_external.SourcelessFileLoader object at 0x000001B9C03B9130>
# multiprocessing.popen_spawn_win32 not found in PYZ
# code object from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\multiprocessing\\popen_spawn_win32.pyc'
import 'multiprocessing.popen_spawn_win32' # <_frozen_importlib_external.SourcelessFileLoader object at 0x000001B9C0652E20>
[11620] LOADER: Running pyi_rth_pyqt5webengine.py
[11620] LOADER: Running pyi_rth_pyqt5.py
[11620] LOADER: Running Papinhio_player.py
# main not found in PYZ
# code object from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\main.pyc'
# PyQt5 not found in PYZ
# code object from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\PyQt5\\__init__.pyc'
import 'PyQt5' # <_frozen_importlib_external.SourcelessFileLoader object at 0x000001B9C06734F0>
# PyQt5.QtCore not found in PYZ
# PyQt5.sip not found in PYZ
# extension module 'PyQt5.sip' loaded from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\PyQt5\\sip.cp38-win_amd64.pyd'
# extension module 'PyQt5.sip' executed from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\PyQt5\\sip.cp38-win_amd64.pyd'
import 'PyQt5.sip' # <_frozen_importlib_external.ExtensionFileLoader object at 0x000001B9C0673820>
# extension module 'PyQt5.QtCore' loaded from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\PyQt5\\QtCore.pyd'
# extension module 'PyQt5.QtCore' executed from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\PyQt5\\QtCore.pyd'
import 'PyQt5.QtCore' # <_frozen_importlib_external.ExtensionFileLoader object at 0x000001B9C0673670>
# PyQt5.QtGui not found in PYZ
# extension module 'PyQt5.QtGui' loaded from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\PyQt5\\QtGui.pyd'
# extension module 'PyQt5.QtGui' executed from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\PyQt5\\QtGui.pyd'
import 'PyQt5.QtGui' # <_frozen_importlib_external.ExtensionFileLoader object at 0x000001B9C0908E50>
# PyQt5.QtWidgets not found in PYZ
# extension module 'PyQt5.QtWidgets' loaded from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\PyQt5\\QtWidgets.pyd'
# extension module 'PyQt5.QtWidgets' executed from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\PyQt5\\QtWidgets.pyd'
import 'PyQt5.QtWidgets' # <_frozen_importlib_external.ExtensionFileLoader object at 0x000001B9C09A2820>
# icons_rc not found in PYZ
# code object from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\icons_rc.pyc'
import 'icons_rc' # <_frozen_importlib_external.SourcelessFileLoader object at 0x000001B9C0A40CA0>
import 'main' # <_frozen_importlib_external.SourcelessFileLoader object at 0x000001B9C0673340>
# PyQt5.QtWebEngineWidgets not found in PYZ
# PyQt5.QtWebChannel not found in PYZ
# extension module 'PyQt5.QtWebChannel' loaded from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\PyQt5\\QtWebChannel.pyd'
# extension module 'PyQt5.QtWebChannel' executed from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\PyQt5\\QtWebChannel.pyd'
import 'PyQt5.QtWebChannel' # <_frozen_importlib_external.ExtensionFileLoader object at 0x000001B9C0A40E50>
# PyQt5.QtNetwork not found in PYZ
# extension module 'PyQt5.QtNetwork' loaded from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\PyQt5\\QtNetwork.pyd'
# extension module 'PyQt5.QtNetwork' executed from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\PyQt5\\QtNetwork.pyd'
import 'PyQt5.QtNetwork' # <_frozen_importlib_external.ExtensionFileLoader object at 0x000001B9C0A40F10>
# PyQt5.QtWebEngineCore not found in PYZ
# extension module 'PyQt5.QtWebEngineCore' loaded from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\PyQt5\\QtWebEngineCore.pyd'
# extension module 'PyQt5.QtWebEngineCore' executed from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\PyQt5\\QtWebEngineCore.pyd'
import 'PyQt5.QtWebEngineCore' # <_frozen_importlib_external.ExtensionFileLoader object at 0x000001B9C0A4ADF0>
# PyQt5.QtPrintSupport not found in PYZ
# extension module 'PyQt5.QtPrintSupport' loaded from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\PyQt5\\QtPrintSupport.pyd'
# extension module 'PyQt5.QtPrintSupport' executed from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\PyQt5\\QtPrintSupport.pyd'
import 'PyQt5.QtPrintSupport' # <_frozen_importlib_external.ExtensionFileLoader object at 0x000001B9C0F3B160>
# extension module 'PyQt5.QtWebEngineWidgets' loaded from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\PyQt5\\QtWebEngineWidgets.pyd'
# extension module 'PyQt5.QtWebEngineWidgets' executed from 'C:\\Users\\EFFA~1\\AppData\\Local\\Temp\\_MEI147842\\PyQt5\\QtWebEngineWidgets.pyd'
import 'PyQt5.QtWebEngineWidgets' # <_frozen_importlib_external.ExtensionFileLoader object at 0x000001B9C06733A0>
[11620:5440:0316/002453.755:ERROR:network_service_instance_impl.cc(262)] Network service crashed, restarting service.
[11620:5440:0316/002454.427:ERROR:network_service_instance_impl.cc(262)] Network service crashed, restarting service.
[11620:5440:0316/002455.130:ERROR:network_service_instance_impl.cc(262)] Network service crashed, restarting service.

我正在尝试使用 PyQt5 打开网页(如 html iframe)。程序打开,但生产中没有站点(可执行文件)。 使用 python Papinhio_player.py 可以正确打开。

有什么建议吗?

注意最后三行重复了很多次

编辑:使用python Papinhio_player.py 命令显示网站,但在cmd 中出现以下警告:

Qt WebEngine resources not found at C:/Users/?n?ooio/AppData/Local/Programs/Python/Python38/lib/site-packages/PyQt5/Qt/resources. Trying parent directory...
Qt WebEngine resources not found at C:/Users/?n?ooio/AppData/Local/Programs/Python/Python38/lib/site-packages/PyQt5/Qt. Trying application directory...
Installed Qt WebEngine locales directory not found at location C:/Users/?n?ooio/AppData/Local/Programs/Python/Python38/lib/site-packages/PyQt5/Qt/translations\qtwebengine_locales. Trying application directory...
Qt WebEngine locales directory not found at location C:/Users/???????/AppData/Local/Programs/Python/Python38\qtwebengine_locales. Trying fallback directory... Translations MAY NOT not be correct.
js: Unrecognized feature: 'clipboard-write'.
js: A cookie associated with a cross-site resource at http://youtube.com/ was set without the `SameSite` attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with `SameSite=None` and `Secure`. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5088147346030592 and https://www.chromestatus.com/feature/5633521622188032.
js: A cookie associated with a cross-site resource at http://www.youtube.com/ was set without the `SameSite` attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with `SameSite=None` and `Secure`. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5088147346030592 and https://www.chromestatus.com/feature/5633521622188032.

【问题讨论】:

【参考方案1】:

解决方案:

    我卸载了我在 Windows 中拥有的所有 Python 版本。

    我安装了 python 3.9 @C:\Python

    我用 pip 安装了 PyQt5 , pyqt5-tools

    我通过github 安装了pyinstaller(命令python setup.py buildpython setup.py install

    我将 C:\Python 和 C:\Python\Scripts 添加到环境路径。

    我将我的项目移动到 C:\Python\Scripts

    我用

    制作了可执行文件

pyinstaller --name="Papinhio player" --icon=../src/media/images/papinhio_player.ico ../src/main/python_files/Papinhio_player.py

命令。

    我将资源文件夹的内容复制到 dist 文件夹(从 C:\Python\Scripts\Papinhio player\exe\dist\Papinhio player\PyQt5\Qt\resources 到 C:\Python\Scripts\Papinhio player\exe\分布)

    我将 QtWebEngineProcess.exe 从 C:\Python\Scripts\Papinhio player\exe\dist\Papinhio player\PyQt5\Qt\bin 复制到 C:\Python\Scripts\Papinhio player\exe\dist

就是这样!

我收到如下警告:

Qt WebEngine resources not found at C:/Users/EFFA~1/AppData/Local/Temp/resources. Trying parent directory...
Qt WebEngine resources not found at C:/Users/EFFA~1/AppData/Local/Temp. Trying application directory...
Installed Qt WebEngine locales directory not found at location C:/Users/EFFA~1/AppData/Local/Temp/translations\qtwebengine_locales. Trying application directory...
Qt WebEngine locales directory not found at location C:/Python/Scripts/Papinhio player/exe/dist\qtwebengine_locales. Trying fallback directory... Translations MAY NOT not be correct.
js: Unrecognized feature: 'clipboard-write'.
js: A cookie associated with a cross-site resource at http://youtube.com/ was set without the `SameSite` attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with `SameSite=None` and `Secure`. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5088147346030592 and https://www.chromestatus.com/feature/5633521622188032.
js: A cookie associated with a cross-site resource at http://www.youtube.com/ was set without the `SameSite` attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with `SameSite=None` and `Secure`. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5088147346030592 and https://www.chromestatus.com/feature/5633521622188032.

但网站显示正确。

【讨论】:

以上是关于在最新Qt5.4,使用QWebengine,如何js调用Qt的主要内容,如果未能解决你的问题,请参考以下文章

在最新Qt5.4,使用QWebengine,如何js调用Qt

如何在 Python 函数中执行 QWebEngine

如何在 QWebEngine 中设置 QNetworkCookieJar?

如何在 RequestInterceptor 中正确设置 QWebEngine HTTP 标头

Qt 5.7:使用无头 QWebEngine

QT5.4 计算器程序 打包&发布,解决dll的最新解决方案(图文并茂,很清楚)