From 6f0065944dc3c638553519bc7d4883f2cca6e04f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Nowacki?= Date: Mon, 26 Mar 2012 10:04:21 +0200 Subject: Hide QTypeModuleInfo in a private namespace. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The class is private and shouldn't pollute global namespace. Change-Id: Ib44473fd72e5a70096eeff1662e88b29263d19c6 Reviewed-by: João Abecasis --- src/corelib/kernel/qvariant.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib/kernel/qvariant.cpp') diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index 82e0435d0a..7b0fab887b 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -103,7 +103,7 @@ namespace { struct CoreTypesFilter { template struct Acceptor { - static const bool IsAccepted = QTypeModuleInfo::IsCore && QtMetaTypePrivate::TypeDefinition::IsAvailable; + static const bool IsAccepted = QModulesPrivate::QTypeModuleInfo::IsCore && QtMetaTypePrivate::TypeDefinition::IsAvailable; }; }; } // annonymous -- cgit v1.2.3 From ab0bcd0792af76a938f8665c9c1082d9b9eb3c3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Nowacki?= Date: Tue, 3 Apr 2012 15:12:47 +0200 Subject: Remove redundant checks in QVariant. QVariant and QMetaType have aligned type naming implementation. Change-Id: I9eaae1045c492c148e3e9d23f4e04d48272f7ec2 Reviewed-by: Stephen Kelly --- src/corelib/kernel/qvariant.cpp | 6 ------ 1 file changed, 6 deletions(-) (limited to 'src/corelib/kernel/qvariant.cpp') diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index 7b0fab887b..179a33ca6e 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -1582,9 +1582,6 @@ void QVariant::clear() */ const char *QVariant::typeToName(int typeId) { - if (typeId == Invalid) - return 0; - return QMetaType::typeName(typeId); } @@ -1598,9 +1595,6 @@ const char *QVariant::typeToName(int typeId) */ QVariant::Type QVariant::nameToType(const char *name) { - if (!name || !*name) - return Invalid; - int metaType = QMetaType::type(name); return metaType <= int(UserType) ? QVariant::Type(metaType) : UserType; } -- cgit v1.2.3 From ff55d64f6788563a6ef9da2b6d0b6dc23bb936aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Nowacki?= Date: Fri, 13 Apr 2012 14:52:34 +0200 Subject: Remove QVariant constructor taking Qt::GlobalColor. The constructor is wrong, it creates instance of QVariant encapsulating a QColor instance. QVariant should not implicitly convert data, never. Change-Id: Idc794ecdecb42d8b53fee3f993bf51ddd43f595d Reviewed-by: Lars Knoll --- src/corelib/kernel/qvariant.cpp | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'src/corelib/kernel/qvariant.cpp') diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index 179a33ca6e..10b86bcb48 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -1349,19 +1349,6 @@ QVariant::QVariant(const char *val) Constructs a new variant with the regular expression value \a re. */ -/*! \since 4.2 - \fn QVariant::QVariant(Qt::GlobalColor color) - - Constructs a new variant of type QVariant::Color and initializes - it with \a color. - - This is a convenience constructor that allows \c{QVariant(Qt::blue);} - to create a valid QVariant storing a QColor. - - Note: This constructor will assert if the application does not link - to the Qt GUI library. - */ - QVariant::QVariant(Type type) { create(type, 0); } QVariant::QVariant(int typeId, const void *copy) @@ -1443,7 +1430,6 @@ QVariant::QVariant(const QRegExp ®Exp) { d.is_null = false; d.type = RegExp; QVariant::QVariant(const QRegularExpression &re) { d.is_null = false; d.type = QMetaType::QRegularExpression; v_construct(&d, re); } #endif // QT_BOOTSTRAPPED #endif // QT_NO_REGEXP -QVariant::QVariant(Qt::GlobalColor color) { create(62, &color); } /*! Returns the storage type of the value stored in the variant. -- cgit v1.2.3