Skip to content

Commit

Permalink
try to set QTWEBENGINE_CHROMIUM_FLAGS
Browse files Browse the repository at this point in the history
Signed-off-by: minff <[email protected]>
  • Loading branch information
minff committed Mar 7, 2024
1 parent c18af8c commit b3ae9a1
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions XYZHubConnector/xyz_qgis/common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ def get_qml_full_path(qml_file):
def add_qml_import_path(qml_engine):
# Setup for the MAC OS X platform:
# return

setChromiumFlags()
if platform.system() == "Darwin" or os.name == "mac":
install_qml_dependencies()
qml_engine.addImportPath(os.path.join(get_qml_import_base_path(), "qml"))
Expand Down Expand Up @@ -246,6 +248,18 @@ def install_qml_dependencies():
)


def setChromiumFlags():
KEY = "QTWEBENGINE_CHROMIUM_FLAGS"
OPTIONS = ["--ignore-gpu-blocklist", "--enable-gpu-rasterization"]

if KEY in os.environ:
for opt in OPTIONS:
if opt not in os.environ[KEY]:
os.environ[KEY] += " " + opt
else:
os.environ[KEY] = " ".join(OPTIONS)


def get_qml_import_base_path():
prefix = sysconfig.get_path("purelib")
lib_path = f"{prefix}/PyQt5/Qt5"
Expand Down

0 comments on commit b3ae9a1

Please sign in to comment.