Move ComboBoxLoadFromSettings function to settingspage
This commit is contained in:
@@ -371,20 +371,3 @@ void SettingsDialog::CurrentItemChanged(QTreeWidgetItem *item) {
|
||||
|
||||
}
|
||||
|
||||
void SettingsDialog::ComboBoxLoadFromSettings(const QSettings &s, QComboBox *combobox, const QString &setting, const QString &default_value) {
|
||||
|
||||
QString value = s.value(setting, default_value).toString();
|
||||
int i = combobox->findData(value);
|
||||
if (i == -1) i = combobox->findData(default_value);
|
||||
combobox->setCurrentIndex(i);
|
||||
|
||||
}
|
||||
|
||||
void SettingsDialog::ComboBoxLoadFromSettings(const QSettings &s, QComboBox *combobox, const QString &setting, const int default_value) {
|
||||
|
||||
int value = s.value(setting, default_value).toInt();
|
||||
int i = combobox->findData(value);
|
||||
if (i == -1) i = combobox->findData(default_value);
|
||||
combobox->setCurrentIndex(i);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user