mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 11:00:44 -06:00
preferencesdialog: Remove unnecessary sort model
Turns out that the use of a QSortFilterProxyModel wasn't necessary, as it's possible to sort the QCombobox using its model directly.
This commit is contained in:
@@ -7,7 +7,6 @@
|
||||
#include <QFileDialog>
|
||||
#include <QColorDialog>
|
||||
#include <QMessageBox>
|
||||
#include <QSortFilterProxyModel>
|
||||
|
||||
QHash<QString, QVariant> PreferencesDialog::m_hCache;
|
||||
|
||||
@@ -18,15 +17,6 @@ PreferencesDialog::PreferencesDialog(QWidget* parent)
|
||||
ui->setupUi(this);
|
||||
ui->treeSyntaxHighlighting->setColumnHidden(0, true);
|
||||
|
||||
// Model to sort the languages in the language combo box
|
||||
QSortFilterProxyModel *proxy = new QSortFilterProxyModel(ui->languageComboBox);
|
||||
proxy->setSourceModel(ui->languageComboBox->model());
|
||||
|
||||
// Prevent setModel() from deleting the current model (now source of the proxy model)
|
||||
ui->languageComboBox->model()->setParent(proxy);
|
||||
|
||||
ui->languageComboBox->setModel(proxy);
|
||||
|
||||
loadSettings();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user