summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qabstractitemmodel.cpp
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@gmail.com>2009-06-09 20:44:32 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-06-10 13:45:12 (GMT)
commit09faf56a2e44b4dfa1b341ced75803100483834f (patch)
treef3a4eac74c66959b802017b56f7876b07b57da0e /src/corelib/kernel/qabstractitemmodel.cpp
parentdd3ee408148368a6f900844afc68fff9d86c2e8c (diff)
downloadQt-09faf56a2e44b4dfa1b341ced75803100483834f.zip
Qt-09faf56a2e44b4dfa1b341ced75803100483834f.tar.gz
Qt-09faf56a2e44b4dfa1b341ced75803100483834f.tar.bz2
Added QAbstractItemModelPrivate::canConvertToDouble().
And changed QTreeWidgetItem::operator<() and QTableWidgetItem::operator<() to use it Merge-request: 631 Reviewed-by: Olivier Goffart <ogoffart@trolltech.com>
Diffstat (limited to 'src/corelib/kernel/qabstractitemmodel.cpp')
-rw-r--r--src/corelib/kernel/qabstractitemmodel.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/corelib/kernel/qabstractitemmodel.cpp b/src/corelib/kernel/qabstractitemmodel.cpp
index 935c0aa..0a84ddb 100644
--- a/src/corelib/kernel/qabstractitemmodel.cpp
+++ b/src/corelib/kernel/qabstractitemmodel.cpp
@@ -467,6 +467,23 @@ QAbstractItemModel *QAbstractItemModelPrivate::staticEmptyModel()
return qEmptyModel();
}
+bool QAbstractItemModelPrivate::canConvertToDouble(const QVariant &value)
+{
+ switch (value.type()) {
+ case QVariant::Bool:
+ case QVariant::Int:
+ case QVariant::UInt:
+ case QVariant::LongLong:
+ case QVariant::ULongLong:
+ case QVariant::Double:
+ case QVariant::Char:
+ return true;
+ default:
+ return false;
+ }
+ return false;
+}
+
void QAbstractItemModelPrivate::removePersistentIndexData(QPersistentModelIndexData *data)
{
if (data->index.isValid()) {