diff --git a/PIL/ImageQt.py b/PIL/ImageQt.py index d8b838d25..b0c477d03 100644 --- a/PIL/ImageQt.py +++ b/PIL/ImageQt.py @@ -8,6 +8,7 @@ # 2006-06-03 fl: created # 2006-06-04 fl: inherit from QImage instead of wrapping it # 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 Fredrik Lundh @@ -18,7 +19,10 @@ from PIL import Image 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.