1
0
mirror of https://gitlab.com/openlp/openlp.git synced 2024-12-25 11:14:07 +00:00

Remove dependency on PIL since the latest version does not support PyQt5

This commit is contained in:
Tomas Groth 2023-07-13 14:09:11 +00:00 committed by Raoul Snyman
parent 3d21a6acf5
commit b0bf26e530
3 changed files with 7 additions and 8 deletions

View File

@ -22,9 +22,8 @@
The :mod:`~openlp.core.api.tab` module contains the settings tab for the API The :mod:`~openlp.core.api.tab` module contains the settings tab for the API
""" """
import PIL.ImageQt
import PIL.Image
import qrcode import qrcode
from qrcode.image.svg import SvgPathFillImage
from time import sleep from time import sleep
@ -287,10 +286,12 @@ class ApiTab(SettingsTab):
self.stage_url.setText(f'<a href="{http_url}stage">{http_url}stage</a>') self.stage_url.setText(f'<a href="{http_url}stage">{http_url}stage</a>')
self.chords_url.setText(f'<a href="{http_url}chords">{http_url}chords</a>') self.chords_url.setText(f'<a href="{http_url}chords">{http_url}chords</a>')
self.live_url.setText(f'<a href="{http_url}main">{http_url}main</a>') self.live_url.setText(f'<a href="{http_url}main">{http_url}main</a>')
img = qrcode.make(http_url) # create a QR code SVG, size will be about 300x300
img = PIL.ImageQt.ImageQt(img) qr = qrcode.QRCode(box_size=24)
image = QtGui.QPixmap.fromImage(img) qr.add_data(http_url)
self.app_qr_code_label.setPixmap(image) img = qr.make_image(image_factory=SvgPathFillImage)
qimg = QtGui.QImage.fromData(img.to_string())
self.app_qr_code_label.setPixmap(QtGui.QPixmap.fromImage(qimg))
def set_server_states(self): def set_server_states(self):
""" """

View File

@ -151,7 +151,6 @@ class UiAboutDialog(object):
'<li><a href="https://mkleehammer.github.io/pyodbc/">pyodbc</a> (MIT)</li>' '<li><a href="https://mkleehammer.github.io/pyodbc/">pyodbc</a> (MIT)</li>'
'<li><a href="http://initd.org/psycopg/">psycopg2</a> (LGPL3+)</li>' '<li><a href="http://initd.org/psycopg/">psycopg2</a> (LGPL3+)</li>'
'<li><a href="https://github.com/lincolnloop/python-qrcode/">qrcode</a> (MIT)</li>' '<li><a href="https://github.com/lincolnloop/python-qrcode/">qrcode</a> (MIT)</li>'
'<li><a href="https://pillow.readthedocs.io/en/stable/index.html/">pillow</a> (HPND)</li>'
'</ul>') '</ul>')
final_credit = translate('OpenLP.AboutForm', '<h3>Final credit:</h3>' final_credit = translate('OpenLP.AboutForm', '<h3>Final credit:</h3>'
'<blockquote><p>For God so loved the world that He gave His one and only Son, so that ' '<blockquote><p>For God so loved the world that He gave His one and only Son, so that '

View File

@ -95,7 +95,6 @@ MODULES = [
'pymediainfo', 'pymediainfo',
'vlc', 'vlc',
'qrcode', 'qrcode',
'PIL.ImageQt'
] ]