Files
Loren Eteval 00c86a91c3 Initial commit
Signed-off-by: Loren Eteval <loren.eteval@proton.me>
2024-01-26 23:52:46 +08:00

30 lines
678 B
Python

from Furious.Utility.Constants import *
import time
__all__ = ['PySide6LegacyEnumValueWrapper', 'PySide6LegacyEventLoopWait']
def PySide6LegacyEnumValueWrapper(enum):
# Protect PySide6 enum wrapper behavior changes
if PYSIDE6_VERSION < '6.2.2':
return enum
else:
return enum.value
def PySide6LegacyEventLoopWait(ms):
# Protect qWait method does not exist in some
# old PySide6 version
if PYSIDE6_VERSION < '6.3.1':
for counter in range(0, ms, 10):
time.sleep(10 / 1000)
APP().processEvents()
else:
from PySide6.QtTest import QTest
QTest.qWait(ms)
APP().processEvents()