import sip from Qt.py

This commit is contained in:
KIU Shueng Chuan 2021-01-17 06:45:19 +08:00
parent dcbddb0abf
commit 3ce7f58384
4 changed files with 10 additions and 25 deletions

View File

@ -3,7 +3,7 @@ import time
import weakref import weakref
import warnings import warnings
from ..Qt import QtCore, QtGui, isQObjectAlive from ..Qt import QtCore, QtGui, QT_LIB, isQObjectAlive
from ..Point import Point from ..Point import Point
from .. import functions as fn from .. import functions as fn
from .. import ptime as ptime from .. import ptime as ptime
@ -14,15 +14,9 @@ from .. import getConfigOption
getMillis = lambda: int(round(time.time() * 1000)) getMillis = lambda: int(round(time.time() * 1000))
if hasattr(QtCore, 'PYQT_VERSION'): if QT_LIB.startswith('PyQt'):
try: from ..Qt import sip
try:
from PyQt5 import sip
except ImportError:
import sip
HAVE_SIP = True HAVE_SIP = True
except ImportError:
HAVE_SIP = False
else: else:
HAVE_SIP = False HAVE_SIP = False

View File

@ -1,9 +1,6 @@
from ..Qt import QtGui, QtCore, QT_LIB from ..Qt import QtGui, QtCore, QT_LIB
if QT_LIB in ['PyQt4', 'PyQt5']: if QT_LIB.startswith('PyQt'):
try: from ..Qt import sip
from PyQt5 import sip
except ImportError:
import sip
from .GraphicsItem import GraphicsItem from .GraphicsItem import GraphicsItem
__all__ = ['GraphicsObject'] __all__ = ['GraphicsObject']

View File

@ -1,11 +1,8 @@
from ..Qt import QtGui, QtCore, QT_LIB from ..Qt import QtGui, QtCore, QT_LIB
import weakref import weakref
from .GraphicsObject import GraphicsObject from .GraphicsObject import GraphicsObject
if QT_LIB in ['PyQt4', 'PyQt5']: if QT_LIB.startswith('PyQt'):
try: from ..Qt import sip
from PyQt5 import sip
except ImportError:
import sip
__all__ = ['UIGraphicsItem'] __all__ = ['UIGraphicsItem']
class UIGraphicsItem(GraphicsObject): class UIGraphicsItem(GraphicsObject):

View File

@ -1,9 +1,6 @@
from ..Qt import QtGui, QtCore, QT_LIB from ..Qt import QtGui, QtCore, QT_LIB
if QT_LIB in ['PyQt4', 'PyQt5']: if QT_LIB.startswith('PyQt'):
try: from ..Qt import sip
from PyQt5 import sip
except ImportError:
import sip
from .. import multiprocess as mp from .. import multiprocess as mp
from .GraphicsView import GraphicsView from .GraphicsView import GraphicsView
from .. import CONFIG_OPTIONS from .. import CONFIG_OPTIONS