Commit 371ab14c authored by Tobias Hunger's avatar Tobias Hunger
Browse files

VariableChooser: Sort model



Task-number: QTCREATORBUG-16670
Change-Id: I9dc3641409dbd351491f8b91795bb0adafcb686d
Reviewed-by: default avatarhjk <hjk@qt.io>
parent 5378aef6
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#include <QMenu> #include <QMenu>
#include <QPlainTextEdit> #include <QPlainTextEdit>
#include <QPointer> #include <QPointer>
#include <QSortFilterProxyModel>
#include <QTextEdit> #include <QTextEdit>
#include <QTimer> #include <QTimer>
#include <QTreeView> #include <QTreeView>
...@@ -257,7 +258,10 @@ VariableChooserPrivate::VariableChooserPrivate(VariableChooser *parent) ...@@ -257,7 +258,10 @@ VariableChooserPrivate::VariableChooserPrivate(VariableChooser *parent)
m_variableTree = new VariableTreeView(q, this); m_variableTree = new VariableTreeView(q, this);
m_variableDescription = new QLabel(q); m_variableDescription = new QLabel(q);
m_variableTree->setModel(&m_model); auto sorter = new QSortFilterProxyModel(this);
sorter->setSourceModel(&m_model);
sorter->sort(0);
m_variableTree->setModel(sorter);
m_variableDescription->setText(m_defaultDescription); m_variableDescription->setText(m_defaultDescription);
m_variableDescription->setMinimumSize(QSize(0, 60)); m_variableDescription->setMinimumSize(QSize(0, 60));
m_variableDescription->setAlignment(Qt::AlignLeft|Qt::AlignTop); m_variableDescription->setAlignment(Qt::AlignLeft|Qt::AlignTop);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment