Add Qt5 support.

This commit is contained in:
Aurélien Ballier 2013-11-04 12:44:41 +01:00 committed by wiredfool
parent ac25dab915
commit 938323bd2b

View File

@ -8,6 +8,7 @@
# 2006-06-03 fl: created # 2006-06-03 fl: created
# 2006-06-04 fl: inherit from QImage instead of wrapping it # 2006-06-04 fl: inherit from QImage instead of wrapping it
# 2006-06-05 fl: removed toimage helper; move string support to ImageQt # 2006-06-05 fl: removed toimage helper; move string support to ImageQt
# 2013-11-13 fl: add support for Qt5 (aurelien.ballier@cyclonit.com)
# #
# Copyright (c) 2006 by Secret Labs AB # Copyright (c) 2006 by Secret Labs AB
# Copyright (c) 2006 by Fredrik Lundh # Copyright (c) 2006 by Fredrik Lundh
@ -18,7 +19,10 @@
from PIL import Image from PIL import Image
from PIL._util import isPath from PIL._util import isPath
from PyQt4.QtGui import QImage, qRgb try:
from PyQt5.QtGui import QImage, qRgb
except:
from PyQt4.QtGui import QImage, qRgb
## ##
# (Internal) Turns an RGB color into a Qt compatible color integer. # (Internal) Turns an RGB color into a Qt compatible color integer.