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

View File

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

View File

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

View File

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