mirror of
https://github.com/bec-project/bec_widgets.git
synced 2026-04-30 12:02:29 +02:00
31 lines
944 B
Python
31 lines
944 B
Python
import os
|
|
import sys
|
|
|
|
import bec_widgets.widgets.containers.qt_ads as QtAds
|
|
|
|
__all__ = ["BECWidget", "SafeSlot", "SafeProperty"]
|
|
|
|
|
|
def __getattr__(name):
|
|
if name == "BECWidget":
|
|
from bec_widgets.utils.bec_widget import BECWidget
|
|
|
|
return BECWidget
|
|
if name in {"SafeSlot", "SafeProperty"}:
|
|
from bec_widgets.utils.error_popups import SafeProperty, SafeSlot
|
|
|
|
return {"SafeSlot": SafeSlot, "SafeProperty": SafeProperty}[name]
|
|
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
|
|
|
|
|
if sys.platform.startswith("linux"):
|
|
qt_platform = os.environ.get("QT_QPA_PLATFORM", "")
|
|
if qt_platform != "offscreen":
|
|
os.environ["QT_QPA_PLATFORM"] = "xcb"
|
|
|
|
# Default QtAds configuration
|
|
QtAds.CDockManager.setConfigFlag(QtAds.CDockManager.eConfigFlag.FocusHighlighting, True)
|
|
QtAds.CDockManager.setConfigFlag(
|
|
QtAds.CDockManager.eConfigFlag.RetainTabSizeWhenCloseButtonHidden, True
|
|
)
|