mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-18 19:24:47 +03:00
Merge c97229466c
into c05099f45c
This commit is contained in:
commit
50d1ff4260
|
@ -5,7 +5,7 @@ from PIL import ImageQt, Image
|
||||||
|
|
||||||
|
|
||||||
if ImageQt.qt_is_installed:
|
if ImageQt.qt_is_installed:
|
||||||
from PIL.ImageQt import QImage, QPixmap
|
from PIL.ImageQt import QImage
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from PyQt5 import QtGui
|
from PyQt5 import QtGui
|
||||||
|
@ -21,7 +21,6 @@ if ImageQt.qt_is_installed:
|
||||||
from PySide.QtGui import QWidget, QHBoxLayout, QLabel, QApplication
|
from PySide.QtGui import QWidget, QHBoxLayout, QLabel, QApplication
|
||||||
QT_VERSION = 4
|
QT_VERSION = 4
|
||||||
|
|
||||||
|
|
||||||
class TestToQImage(PillowQtTestCase, PillowTestCase):
|
class TestToQImage(PillowQtTestCase, PillowTestCase):
|
||||||
|
|
||||||
def test_sanity(self):
|
def test_sanity(self):
|
||||||
|
@ -59,12 +58,13 @@ class TestToQImage(PillowQtTestCase, PillowTestCase):
|
||||||
src = src.convert('P')
|
src = src.convert('P')
|
||||||
self.assert_image_equal(reloaded, src)
|
self.assert_image_equal(reloaded, src)
|
||||||
|
|
||||||
|
|
||||||
def test_segfault(self):
|
def test_segfault(self):
|
||||||
PillowQtTestCase.setUp(self)
|
PillowQtTestCase.setUp(self)
|
||||||
|
|
||||||
app = QApplication([])
|
app = QApplication([])
|
||||||
ex = Example()
|
ex = Example()
|
||||||
|
assert(app) # Silence warning
|
||||||
|
assert(ex) # Silence warning
|
||||||
|
|
||||||
|
|
||||||
if ImageQt.qt_is_installed:
|
if ImageQt.qt_is_installed:
|
||||||
|
@ -73,7 +73,7 @@ if ImageQt.qt_is_installed:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(Example, self).__init__()
|
super(Example, self).__init__()
|
||||||
|
|
||||||
img = hopper().resize((1000,1000))
|
img = hopper().resize((1000, 1000))
|
||||||
|
|
||||||
qimage = ImageQt.ImageQt(img)
|
qimage = ImageQt.ImageQt(img)
|
||||||
|
|
||||||
|
@ -86,15 +86,5 @@ if ImageQt.qt_is_installed:
|
||||||
lbl.setPixmap(pixmap1.copy())
|
lbl.setPixmap(pixmap1.copy())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
|
||||||
app = QApplication(sys.argv)
|
|
||||||
ex = Example()
|
|
||||||
sys.exit(app.exec_())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user