From 7e43e7d6be713fc5d4d3b1740a8283839e77e72b Mon Sep 17 00:00:00 2001 From: VRonin Date: Tue, 1 Jun 2021 11:11:19 +0100 Subject: [PATCH] IPM::sort let the sourceModel decide if the column is valid Some models like `QSqlTableModel` have a defined behavior when an invalid index is passed to sort. Don't validate the index in the proxy Closes: #46 --- src/insertproxymodel.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/insertproxymodel.cpp b/src/insertproxymodel.cpp index 486b8b4..a6c4b38 100644 --- a/src/insertproxymodel.cpp +++ b/src/insertproxymodel.cpp @@ -769,8 +769,6 @@ void InsertProxyModel::sort(int column, Qt::SortOrder order) { if (!sourceModel()) return; - if (column < 0 || column >= sourceModel()->columnCount()) - return; sourceModel()->sort(column, order); }