mirror of
https://github.com/UN-GCPDS/qt-material.git
synced 2025-01-27 17:02:57 +08:00
export_theme not needs QFontDatabase
This commit is contained in:
parent
594baaa7cd
commit
2a5bf7e8fa
@ -16,7 +16,7 @@ extra = {
|
||||
'density_scale': '0',
|
||||
|
||||
# environ
|
||||
'pyside2': True,
|
||||
'pyside6': True,
|
||||
'linux': True,
|
||||
|
||||
}
|
||||
|
@ -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):
|
||||
""""""
|
||||
|
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user