Commit 63ce81db authored by Tobias Hunger's avatar Tobias Hunger

CMake: Sort Project CMake configuration via the Proxy model

Makes renaming items feel more natural as they do no longer stick to the
top (note that currently you can only rename newly added items!).

Change-Id: I89d0dc7cb73e08d8b60900a96ffd2ab1c2b490c2
Reviewed-by: default avatarhjk <hjk@qt.io>
parent 8e552821
......@@ -146,12 +146,15 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc)
m_configFilterModel->setFilterFixedString("0");
m_configTextFilterModel->setSourceModel(m_configFilterModel);
m_configTextFilterModel->setSortRole(Qt::DisplayRole);
m_configTextFilterModel->setFilterKeyColumn(-1);
m_configTextFilterModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
m_configView->setModel(m_configTextFilterModel);
m_configView->setMinimumHeight(300);
m_configView->setUniformRowHeights(true);
m_configView->setSortingEnabled(true);
m_configView->sortByColumn(0, Qt::AscendingOrder);
auto stretcher = new Utils::HeaderViewStretcher(m_configView->header(), 1);
m_configView->setSelectionMode(QAbstractItemView::SingleSelection);
m_configView->setSelectionBehavior(QAbstractItemView::SelectItems);
......
......@@ -151,11 +151,6 @@ QList<ConfigModel::DataItem> ConfigModel::configurationChanges() const
void ConfigModel::setConfiguration(const QList<ConfigModel::InternalDataItem> &config)
{
QList<InternalDataItem> tmp = config;
Utils::sort(tmp,
[](const ConfigModel::InternalDataItem &i, const ConfigModel::InternalDataItem &j) {
return i.key < j.key;
});
auto newIt = tmp.constBegin();
auto newEndIt = tmp.constEnd();
auto oldIt = m_configuration.constBegin();
......
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