summaryrefslogtreecommitdiffstats
path: root/src/gui/itemviews/qstandarditemmodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/itemviews/qstandarditemmodel.cpp')
-rw-r--r--src/gui/itemviews/qstandarditemmodel.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/itemviews/qstandarditemmodel.cpp b/src/gui/itemviews/qstandarditemmodel.cpp
index f2fc37e..9ae3214 100644
--- a/src/gui/itemviews/qstandarditemmodel.cpp
+++ b/src/gui/itemviews/qstandarditemmodel.cpp
@@ -1806,7 +1806,7 @@ bool QStandardItem::operator<(const QStandardItem &other) const
const int role = model() ? model()->sortRole() : Qt::DisplayRole;
const QVariant l = data(role), r = other.data(role);
// this code is copied from QSortFilterProxyModel::lessThan()
- switch (l.type()) {
+ switch (l.userType()) {
case QVariant::Invalid:
return (r.type() == QVariant::Invalid);
case QVariant::Int:
@@ -1817,6 +1817,8 @@ bool QStandardItem::operator<(const QStandardItem &other) const
return l.toLongLong() < r.toLongLong();
case QVariant::ULongLong:
return l.toULongLong() < r.toULongLong();
+ case QMetaType::Float:
+ return l.toFloat() < r.toFloat();
case QVariant::Double:
return l.toDouble() < r.toDouble();
case QVariant::Char: