summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorBradley T. Hughes <bradley.hughes@nokia.com>2009-06-10 15:08:15 (GMT)
committerBradley T. Hughes <bradley.hughes@nokia.com>2009-06-10 15:08:15 (GMT)
commitd8f65a7f0707d8a97801ad20d690672e0124b491 (patch)
tree0c881ac70d9063044ca1ca09290d0747bf322693 /src/corelib
parent9683cf068c3f933f836dc2a5b4a19b1c2f86d38a (diff)
parent747444c6776d948dad479e7b6f3564d0515d4e52 (diff)
downloadQt-d8f65a7f0707d8a97801ad20d690672e0124b491.zip
Qt-d8f65a7f0707d8a97801ad20d690672e0124b491.tar.gz
Qt-d8f65a7f0707d8a97801ad20d690672e0124b491.tar.bz2
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt
Conflicts: src/gui/graphicsview/qgraphicsitem.cpp src/gui/graphicsview/qgraphicsitem_p.h src/gui/graphicsview/qgraphicsscene_p.h
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/kernel/qabstractitemmodel.cpp31
-rw-r--r--src/corelib/kernel/qabstractitemmodel_p.h1
-rw-r--r--src/corelib/kernel/qobject.cpp2
3 files changed, 33 insertions, 1 deletions
diff --git a/src/corelib/kernel/qabstractitemmodel.cpp b/src/corelib/kernel/qabstractitemmodel.cpp
index 935c0aa..6d6caf5 100644
--- a/src/corelib/kernel/qabstractitemmodel.cpp
+++ b/src/corelib/kernel/qabstractitemmodel.cpp
@@ -467,6 +467,37 @@ QAbstractItemModel *QAbstractItemModelPrivate::staticEmptyModel()
return qEmptyModel();
}
+/*!
+ \internal
+ return true if \a value contains a numerical type
+
+ This function is used by our Q{Tree,Widget,Table}WidgetModel classes to sort.
+ We cannot rely on QVariant::canConvert because this would take strings as double
+ and then not sort strings correctly
+*/
+bool QAbstractItemModelPrivate::canConvertToDouble(const QVariant &value)
+{
+ switch (value.userType()) {
+ case QVariant::Bool:
+ case QVariant::Int:
+ case QVariant::UInt:
+ case QVariant::LongLong:
+ case QVariant::ULongLong:
+ case QVariant::Double:
+ case QVariant::Char:
+ case QMetaType::Float:
+ case QMetaType::Short:
+ case QMetaType::UShort:
+ case QMetaType::UChar:
+ case QMetaType::ULong:
+ case QMetaType::Long:
+ return true;
+ default:
+ return false;
+ }
+ return false;
+}
+
void QAbstractItemModelPrivate::removePersistentIndexData(QPersistentModelIndexData *data)
{
if (data->index.isValid()) {
diff --git a/src/corelib/kernel/qabstractitemmodel_p.h b/src/corelib/kernel/qabstractitemmodel_p.h
index 27f1b28..70c35cb 100644
--- a/src/corelib/kernel/qabstractitemmodel_p.h
+++ b/src/corelib/kernel/qabstractitemmodel_p.h
@@ -89,6 +89,7 @@ public:
void columnsAboutToBeRemoved(const QModelIndex &parent, int first, int last);
void columnsRemoved(const QModelIndex &parent, int first, int last);
static QAbstractItemModel *staticEmptyModel();
+ static bool canConvertToDouble(const QVariant &value);
inline QModelIndex createIndex(int row, int column, void *data = 0) const {
return q_func()->createIndex(row, column, data);
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index a095e0a..55d70c1 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -3440,7 +3440,7 @@ void QObject::dumpObjectInfo()
qDebug(" SIGNALS IN");
if (d->senders) {
- for (QObjectPrivate::Connection *s = d->senders; s; s = s->next)
+ for (QObjectPrivate::Connection *s = d->senders; s; s = s->next) {
const QMetaMethod slot = metaObject()->method(s->method);
qDebug(" <-- %s::%s %s",
s->sender->metaObject()->className(),