From 13dc22de9f99e321fd54f7ec45b8e95c7b9f5c23 Mon Sep 17 00:00:00 2001 From: Bent Witthold Date: Sun, 1 Mar 2026 11:34:06 +0100 Subject: [PATCH] Add type roles to the model sorting capabilities. --- model/generalsortfiltermodel.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/model/generalsortfiltermodel.cpp b/model/generalsortfiltermodel.cpp index 1dd5cf3..7f4d7a4 100644 --- a/model/generalsortfiltermodel.cpp +++ b/model/generalsortfiltermodel.cpp @@ -59,6 +59,12 @@ bool GeneralSortFilterModel::lessThan(const QModelIndex& source_left, const QString rightString = rightData.toString(); return m_collator.compare(leftString, rightString) > 0; } + const bool isType = TYPE_ROLES.contains(role); + if (isType) { + const QString leftString = leftData.toString(); + const QString rightString = rightData.toString(); + return m_collator.compare(leftString, rightString) > 0; + } const bool isInt = INT_ROLES.contains(role); if (isInt) { const int leftInt = leftData.toInt();