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:
Christiaan Janssen
2011-07-18 14:24:33 +02:00
parent f054d0dc8f
commit b3a6489752

View File

@@ -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()) {