forked from qt-creator/qt-creator
Gerrit: Allow sorting
Change-Id: I3e84a62b486ea4bde586467fa3e00a453364ae2c Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
committed by
Tobias Hunger
parent
e4b3a4b72c
commit
c1abef38a4
@@ -142,6 +142,7 @@ GerritDialog::GerritDialog(const QSharedPointer<GerritParameters> &p,
|
|||||||
m_treeView->setUniformRowHeights(true);
|
m_treeView->setUniformRowHeights(true);
|
||||||
m_treeView->setRootIsDecorated(false);
|
m_treeView->setRootIsDecorated(false);
|
||||||
m_treeView->setSelectionBehavior(QAbstractItemView::SelectRows);
|
m_treeView->setSelectionBehavior(QAbstractItemView::SelectRows);
|
||||||
|
m_treeView->setSortingEnabled(true);
|
||||||
|
|
||||||
QItemSelectionModel *selectionModel = m_treeView->selectionModel();
|
QItemSelectionModel *selectionModel = m_treeView->selectionModel();
|
||||||
connect(selectionModel, SIGNAL(currentChanged(QModelIndex,QModelIndex)),
|
connect(selectionModel, SIGNAL(currentChanged(QModelIndex,QModelIndex)),
|
||||||
@@ -245,6 +246,7 @@ void GerritDialog::slotRefresh()
|
|||||||
const QString &query = m_queryLineEdit->text().trimmed();
|
const QString &query = m_queryLineEdit->text().trimmed();
|
||||||
updateCompletions(query);
|
updateCompletions(query);
|
||||||
m_model->refresh(query);
|
m_model->refresh(query);
|
||||||
|
m_treeView->sortByColumn(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
const QStandardItem *GerritDialog::itemAt(const QModelIndex &i, int column) const
|
const QStandardItem *GerritDialog::itemAt(const QModelIndex &i, int column) const
|
||||||
|
|||||||
Reference in New Issue
Block a user