Skip to content

Commit

Permalink
Detect qt5ct and workaround it (#198)
Browse files Browse the repository at this point in the history
* Detect qt5ct and workaround it

The documentation of python's `os` module recommends modifying `os.environ`
directly, rather than using `os.unsetenv()`. (Modifying the former causes
the latter to be called; using the latter doesn't update the former.)
  • Loading branch information
s0600204 committed Feb 15, 2020
1 parent d705d88 commit 95bd2f6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lisp/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import logging
import sys
from itertools import chain
from os import path
from os import environ, path

from PyQt5.QtCore import QTranslator, QLocale, QLibraryInfo
from PyQt5.QtGui import QFont, QIcon
Expand Down Expand Up @@ -63,6 +63,11 @@ def main():
level=log
)

# Detect qt5ct (icons do not appear when qt5ct is installed)
if 'QT_QPA_PLATFORMTHEME' in environ and environ['QT_QPA_PLATFORMTHEME'] == 'qt5ct':
logging.warning('qt5ct detected. Linux Show Player and qt5ct are not compatible. Overriding.')
del environ['QT_QPA_PLATFORMTHEME']

# Create the QApplication
qt_app = QApplication(sys.argv)
qt_app.setApplicationName('Linux Show Player')
Expand Down

0 comments on commit 95bd2f6

Please sign in to comment.