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',
|
'density_scale': '0',
|
||||||
|
|
||||||
# environ
|
# environ
|
||||||
'pyside2': True,
|
'pyside6': True,
|
||||||
'linux': True,
|
'linux': True,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -137,6 +137,8 @@ class RuntimeStylesheets(QMainWindow, QtStyleTools):
|
|||||||
self.main.pushButton_folder_dialog.clicked.connect(
|
self.main.pushButton_folder_dialog.clicked.connect(
|
||||||
lambda: QFileDialog.get_existing_directory(self.main))
|
lambda: QFileDialog.get_existing_directory(self.main))
|
||||||
|
|
||||||
|
self.main.comboBox_8.style_sheet = """*{border-color: red; color: red}"""
|
||||||
|
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
def custom_styles(self):
|
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('.'):
|
if not os.path.isabs(output) and not output.startswith('.'):
|
||||||
output = f'.{output}'
|
output = f'.{output}'
|
||||||
|
|
||||||
stylesheet = build_stylesheet(theme, invert_secondary, extra, output)
|
stylesheet = build_stylesheet(
|
||||||
|
theme, invert_secondary, extra, output, export=True)
|
||||||
|
|
||||||
if output.startswith('.'):
|
if output.startswith('.'):
|
||||||
output = output[1:]
|
output = output[1:]
|
||||||
@ -81,8 +82,10 @@ 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):
|
||||||
""""""
|
""""""
|
||||||
|
|
||||||
|
if not export:
|
||||||
try:
|
try:
|
||||||
add_fonts()
|
add_fonts()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user