Sort cost columns initially in descending order.
authorMilian Wolff <mail@milianw.de>
Wed, 16 Dec 2015 11:56:54 +0000 (12:56 +0100)
committerMilian Wolff <mail@milianw.de>
Wed, 16 Dec 2015 11:56:54 +0000 (12:56 +0100)
gui/treemodel.cpp

index fcbf3fc..2aa992d 100644 (file)
@@ -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<Columns>(section)) {
             case FileColumn: