Skip to content

Commit cb26912

Browse files
Fix remainder qt warnings
1 parent f5600dc commit cb26912

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

xfer.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env python3
22

33
import click
4+
import os
45
import cv2
56
import qrcode
67
import pyzbar.pyzbar as pyzbar
@@ -12,6 +13,18 @@
1213
import logging
1314
import time
1415

16+
17+
def _configure_qt_env() -> None:
18+
fallback_fontdir = os.environ.get("XFER_QT_FONTDIR")
19+
if fallback_fontdir:
20+
current_fontdir = os.environ.get("QT_QPA_FONTDIR", "")
21+
if not current_fontdir or "/cv2/qt/fonts" in current_fontdir:
22+
os.environ["QT_QPA_FONTDIR"] = fallback_fontdir
23+
os.environ.setdefault("QT_QPA_PLATFORM", "xcb")
24+
25+
26+
_configure_qt_env()
27+
1528
## tweakable params
1629
CHUNK_SIZE = 256
1730
PAYLOAD_SIZE = 537

0 commit comments

Comments
 (0)