+void UiStyle::setFormat(FormatType ftype, QTextCharFormat fmt, Settings::Mode mode) {
+ if(mode == Settings::Default) {
+ _defaultFormats[ftype] = fmt;
+ } else {
+ UiStyleSettings s(_settingsKey);
+ if(fmt != _defaultFormats[ftype]) {
+ _customFormats[ftype] = fmt;
+ s.setCustomFormat(ftype, fmt);
+ } else {
+ _customFormats[ftype] = QTextFormat().toCharFormat();
+ s.removeCustomFormat(ftype);
+ }
+ }