summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qvariant_p.h
diff options
context:
space:
mode:
authorJędrzej Nowacki <jedrzej.nowacki@nokia.com>2012-01-30 12:21:43 +0100
committerQt by Nokia <qt-info@nokia.com>2012-02-07 08:52:32 +0100
commit56265031b763736163f1a229a7e7e6b7aaec8a36 (patch)
tree74adf46c46a98ddda122f7bcc150af67af2388a1 /src/corelib/kernel/qvariant_p.h
parenta6505007295c7363ef1b0ee4aa81d15a2b470a7e (diff)
Align QVariant::UserType and QMetaType::User
There is no point in keeping separate values which should mean the same. QVariant::UserType was used also to construct a valid, null QVariant, containing an instance of unknown custom type. The concept was strange and useless as there was no operation that could be done on such QVariant. Therefore it was dropped. Please note that the patch slightly changes behavior of different functions accepting a type id as parameter. Before QVariant::UserType was an invalid type from QMetaType perspective (id 127 was not assigned to any built-in type), but QMetaType::User points to the first registered custom type. Change-Id: I5c7d541a9affdcdacf53a4eda2272bdafaa87b71 Reviewed-by: Kent Hansen <kent.hansen@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Andrew Stanley-Jones <andrew.stanley-jones@nokia.com> Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
Diffstat (limited to 'src/corelib/kernel/qvariant_p.h')
-rw-r--r--src/corelib/kernel/qvariant_p.h15
1 files changed, 1 insertions, 14 deletions
diff --git a/src/corelib/kernel/qvariant_p.h b/src/corelib/kernel/qvariant_p.h
index 7065bcfd6b..30159f1831 100644
--- a/src/corelib/kernel/qvariant_p.h
+++ b/src/corelib/kernel/qvariant_p.h
@@ -348,14 +348,6 @@ public:
void delegate(const QMetaTypeSwitcher::UnknownType*)
{
- if (m_x->type == QVariant::UserType) {
- // TODO get rid of it
- // And yes! we can support historical magic, unkonwn/unconstructed user type isn't that
- // awesome? this QVariant::isValid will be true!
- m_x->is_null = !m_copy;
- m_x->is_shared = false;
- return;
- }
qWarning("Trying to construct an instance of an invalid type, type id: %i", m_x->type);
m_x->type = QVariant::Invalid;
}
@@ -406,8 +398,6 @@ public:
void delegate(const QMetaTypeSwitcher::UnknownType*)
{
- if (m_d->type == QVariant::UserType)
- return;
qWarning("Trying to destruct an instance of an invalid type, type id: %i", m_d->type);
}
// Ignore nonconstructible type
@@ -454,10 +444,7 @@ public:
void delegate(const QMetaTypeSwitcher::UnknownType*)
{
- if (m_d->type == QVariant::UserType)
- m_debugStream.nospace() << "QVariant::UserType";
- else
- qWarning("Trying to stream an instance of an invalid type, type id: %i", m_d->type);
+ qWarning("Trying to stream an instance of an invalid type, type id: %i", m_d->type);
}
void delegate(const void*)
{