forked from qt-creator/qt-creator
QmlProfiler: enabled sorting in Callers/Callees tabs
Change-Id: Ieede8580df9f9e7384865aaa9944a29925008fb1 Reviewed-on: http://codereview.qt.nokia.com/1758 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
This commit is contained in:
@@ -50,9 +50,13 @@ public:
|
||||
{
|
||||
if (data().type() == QVariant::String) {
|
||||
// first column
|
||||
return data(FilenameRole).toString() == other.data(FilenameRole).toString() ?
|
||||
if (column() == 0) {
|
||||
return data(FilenameRole).toString() == other.data(FilenameRole).toString() ?
|
||||
data(LineRole).toInt() < other.data(LineRole).toInt() :
|
||||
data(FilenameRole).toString() < other.data(FilenameRole).toString();
|
||||
} else {
|
||||
return data().toString() < other.data().toString();
|
||||
}
|
||||
}
|
||||
|
||||
return data().toDouble() < other.data().toDouble();
|
||||
@@ -408,7 +412,7 @@ void QmlProfilerEventsView::buildModel()
|
||||
bool hasBranches = d->m_fieldShown[Parents] || d->m_fieldShown[Children];
|
||||
setRootIsDecorated(hasBranches);
|
||||
|
||||
setSortingEnabled(!hasBranches);
|
||||
setSortingEnabled(true);
|
||||
|
||||
if (!hasBranches)
|
||||
sortByColumn(d->m_firstNumericColumn,Qt::DescendingOrder);
|
||||
@@ -474,6 +478,7 @@ void QmlProfilerEventsView::QmlProfilerEventsViewPrivate::buildModelFromList( co
|
||||
|
||||
if (m_fieldShown[Details]) {
|
||||
newRow << new EventsViewItem(*binding->details);
|
||||
newRow.last()->setData(QVariant(*binding->details));
|
||||
}
|
||||
|
||||
if (!newRow.isEmpty()) {
|
||||
|
||||
Reference in New Issue
Block a user