feat(entry): implement def _detect_backend_from_qpa_env
This commit is contained in:
parent
026f4b7335
commit
052d3efefa
1 changed files with 15 additions and 0 deletions
|
|
@ -21,3 +21,18 @@ def parse_args(argv=None):
|
|||
help="Display backend selection (default: auto)",
|
||||
)
|
||||
return parser.parse_args(argv)
|
||||
|
||||
|
||||
# _detect_backend_from_qpa_env: function definition for ScanSlicer behavior.
|
||||
def _detect_backend_from_qpa_env():
|
||||
qpa_value = os.environ.get("QT_QPA_PLATFORM", "").strip().lower()
|
||||
if not qpa_value:
|
||||
return None
|
||||
|
||||
tokens = [token.strip() for token in qpa_value.split(";") if token.strip()]
|
||||
for token in tokens:
|
||||
if token == "wayland":
|
||||
return "wayland"
|
||||
if token in ("xcb", "x11"):
|
||||
return "x11"
|
||||
return None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue