diff --git a/examples/exporter/exporter.py b/examples/exporter/exporter.py index b83b811..c51ee70 100644 --- a/examples/exporter/exporter.py +++ b/examples/exporter/exporter.py @@ -16,7 +16,7 @@ extra = { 'density_scale': '0', # environ - 'pyside2': True, + 'pyside6': True, 'linux': True, } diff --git a/examples/full_features/main.py b/examples/full_features/main.py index 419a695..7c8cd03 100644 --- a/examples/full_features/main.py +++ b/examples/full_features/main.py @@ -137,6 +137,8 @@ class RuntimeStylesheets(QMainWindow, QtStyleTools): self.main.pushButton_folder_dialog.clicked.connect( lambda: QFileDialog.get_existing_directory(self.main)) + self.main.comboBox_8.style_sheet = """*{border-color: red; color: red}""" + # ---------------------------------------------------------------------- def custom_styles(self): """""" diff --git a/qt_material/__init__.py b/qt_material/__init__.py index fac5cff..0bb9d7c 100644 --- a/qt_material/__init__.py +++ b/qt_material/__init__.py @@ -48,7 +48,8 @@ def export_theme(theme='', qss=None, rcc=None, invert_secondary=False, extra={}, if not os.path.isabs(output) and not output.startswith('.'): output = f'.{output}' - stylesheet = build_stylesheet(theme, invert_secondary, extra, output) + stylesheet = build_stylesheet( + theme, invert_secondary, extra, output, export=True) if output.startswith('.'): output = output[1:] @@ -81,12 +82,14 @@ def export_theme(theme='', qss=None, rcc=None, invert_secondary=False, extra={}, # ---------------------------------------------------------------------- -def build_stylesheet(theme='', invert_secondary=False, extra={}, parent='theme', template=TEMPLATE_FILE): +def build_stylesheet(theme='', invert_secondary=False, extra={}, parent='theme', template=TEMPLATE_FILE, export=False): """""" - try: - add_fonts() - except Exception as e: - logging.warning(e) + + if not export: + try: + add_fonts() + except Exception as e: + logging.warning(e) theme = get_theme(theme, invert_secondary) if theme is None: