From 4a31fc0d6067381447a132d59c1fa3bfec1d9acf Mon Sep 17 00:00:00 2001 From: Milian Wolff Date: Wed, 16 Dec 2015 12:56:54 +0100 Subject: [PATCH] Sort cost columns initially in descending order. --- gui/treemodel.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gui/treemodel.cpp b/gui/treemodel.cpp index fcbf3fc..2aa992d 100644 --- a/gui/treemodel.cpp +++ b/gui/treemodel.cpp @@ -59,6 +59,14 @@ QVariant TreeModel::headerData(int section, Qt::Orientation orientation, int rol if (orientation != Qt::Horizontal || section < 0 || section >= NUM_COLUMNS) { return {}; } + if (role == Qt::InitialSortOrderRole) { + if (section == AllocatedColumn || section == AllocationsColumn + || section == PeakColumn || section == LeakedColumn + || section == TemporaryColumn) + { + return Qt::DescendingOrder; + } + } if (role == Qt::DisplayRole) { switch (static_cast(section)) { case FileColumn: -- 2.7.4