1010import os
1111
1212from PySide6 .QtCore import QDir , QFile , QObject , QSettings , Signal
13- from PySide6 .QtGui import QFont
1413from PySide6 .QtUiTools import QUiLoader
1514from PySide6 .QtWidgets import (
1615 QCheckBox ,
16+ QComboBox ,
1717 QDialog ,
1818 QFileDialog ,
19- QFontComboBox ,
2019 QLineEdit ,
2120 QPushButton ,
2221 QRadioButton ,
@@ -89,7 +88,7 @@ def _load_ui(self, parent: QWidget | None) -> None:
8988 self .dialog : QDialog = loaded # type: ignore[assignment]
9089
9190 self ._font_family_combo = _require (
92- self .dialog .findChild (QFontComboBox , "fontFamilyComboBox" ),
91+ self .dialog .findChild (QComboBox , "fontFamilyComboBox" ),
9392 "fontFamilyComboBox" ,
9493 )
9594 self ._font_size_spin = _require (
@@ -136,8 +135,8 @@ def _connect_signals(self) -> None:
136135 def _load_from_settings (self ) -> None :
137136 """Populate widgets from QSettings (falls back to DEFAULTS for missing keys)."""
138137 settings = QSettings ()
139- self ._font_family_combo .setCurrentFont (
140- QFont ( str (settings .value (KEY_FONT_FAMILY , DEFAULTS [KEY_FONT_FAMILY ]) ))
138+ self ._font_family_combo .setCurrentText (
139+ str (settings .value (KEY_FONT_FAMILY , DEFAULTS [KEY_FONT_FAMILY ]))
141140 )
142141 self ._font_size_spin .setValue (
143142 int (settings .value (KEY_FONT_SIZE , DEFAULTS [KEY_FONT_SIZE ]))
@@ -158,7 +157,7 @@ def _load_from_settings(self) -> None:
158157 def _write_to_settings (self ) -> None :
159158 """Persist current widget values to QSettings."""
160159 settings = QSettings ()
161- settings .setValue (KEY_FONT_FAMILY , self ._font_family_combo .currentFont (). family ())
160+ settings .setValue (KEY_FONT_FAMILY , self ._font_family_combo .currentText ())
162161 settings .setValue (KEY_FONT_SIZE , self ._font_size_spin .value ())
163162 settings .setValue (KEY_WORD_WRAP , self ._word_wrap_cb .isChecked ())
164163 settings .setValue (KEY_LINE_NUMBERS , self ._line_numbers_cb .isChecked ())
0 commit comments