From 8d714649c13636ea0b1edf6a631fdfc2084ec7f2 Mon Sep 17 00:00:00 2001 From: Mark Harfouche Date: Sun, 19 May 2024 13:38:00 -0400 Subject: [PATCH] Check for instance of QApplication before creating on in images util --- qdarkstyle/utils/images.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/qdarkstyle/utils/images.py b/qdarkstyle/utils/images.py index 3aae4a8c..2f519239 100644 --- a/qdarkstyle/utils/images.py +++ b/qdarkstyle/utils/images.py @@ -97,7 +97,8 @@ def create_palette_image(base_svg_path=SVG_PATH, path=IMAGES_PATH, Create palette image svg and png image on specified path. """ # Needed to use QPixmap - _ = QApplication([]) + if not QApplication.instance(): + _ = QApplication([]) if palette is None: _logger.error("Please pass a palette class in order to create its " @@ -147,7 +148,8 @@ def create_images(base_svg_path=SVG_PATH, rc_path=None, palette=None): """ # Needed to use QPixmap - _ = QApplication([]) + if not QApplication.instance(): + _ = QApplication([]) if palette is None: _logger.error("Please pass a palette class in order to create its "