Merge pull request #1003 from AurelienBallier/master

Use PyQt4 if already imported
This commit is contained in:
wiredfool 2014-11-12 22:12:46 -08:00
commit 212f9d7d8b

View File

@ -18,12 +18,15 @@
from PIL import Image from PIL import Image
from PIL._util import isPath from PIL._util import isPath
import sys
try: if 'PyQt4.QtGui' not in sys.modules:
try:
from PyQt5.QtGui import QImage, qRgba from PyQt5.QtGui import QImage, qRgba
except: except:
from PyQt4.QtGui import QImage, qRgba from PyQt4.QtGui import QImage, qRgba
else: #PyQt4 is used
from PyQt4.QtGui import QImage, qRgba
## ##
# (Internal) Turns an RGB color into a Qt compatible color integer. # (Internal) Turns an RGB color into a Qt compatible color integer.