diff options
author | Thierry Bastian <thierry.bastian@nokia.com> | 2009-08-17 10:51:37 (GMT) |
---|---|---|
committer | Thierry Bastian <thierry.bastian@nokia.com> | 2009-08-17 10:52:07 (GMT) |
commit | dc2771eb57702a0daf5164b0f9ad569c9fe0e5ba (patch) | |
tree | 7de557caf7a4d7bfb52aaf68572f81c0cdba01da /src/gui/itemviews/qlistwidget.cpp | |
parent | 213e2c937b667dba7e4996b0857ae5791c6d5fc8 (diff) | |
download | Qt-dc2771eb57702a0daf5164b0f9ad569c9fe0e5ba.zip Qt-dc2771eb57702a0daf5164b0f9ad569c9fe0e5ba.tar.gz Qt-dc2771eb57702a0daf5164b0f9ad569c9fe0e5ba.tar.bz2 |
Better handling of qreal with QVariant
Diffstat (limited to 'src/gui/itemviews/qlistwidget.cpp')
-rw-r--r-- | src/gui/itemviews/qlistwidget.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/gui/itemviews/qlistwidget.cpp b/src/gui/itemviews/qlistwidget.cpp index 2792bbd..a1f8288 100644 --- a/src/gui/itemviews/qlistwidget.cpp +++ b/src/gui/itemviews/qlistwidget.cpp @@ -708,9 +708,7 @@ QVariant QListWidgetItem::data(int role) const bool QListWidgetItem::operator<(const QListWidgetItem &other) const { const QVariant v1 = data(Qt::DisplayRole), v2 = other.data(Qt::DisplayRole); - if (QAbstractItemModelPrivate::canConvertToDouble(v1) && QAbstractItemModelPrivate::canConvertToDouble(v2)) - return v1.toDouble() < v2.toDouble(); - return v1.toString() < v2.toString(); + return QAbstractItemModelPrivate::variantLessThan(v1, v2); } #ifndef QT_NO_DATASTREAM |