summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJędrzej Nowacki <jedrzej.nowacki@nokia.com>2012-03-26 10:04:21 +0200
committerQt by Nokia <qt-info@nokia.com>2012-04-18 12:15:52 +0200
commit6f0065944dc3c638553519bc7d4883f2cca6e04f (patch)
treeadd507d6b43f569acbd0c7142059a4f5fe4e0240
parent7e0beba891cb963a1d535bd45b0be78b43b8d07f (diff)
Hide QTypeModuleInfo in a private namespace.
The class is private and shouldn't pollute global namespace. Change-Id: Ib44473fd72e5a70096eeff1662e88b29263d19c6 Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
-rw-r--r--src/corelib/kernel/qmetatype.cpp30
-rw-r--r--src/corelib/kernel/qmetatype_p.h2
-rw-r--r--src/corelib/kernel/qvariant.cpp2
-rw-r--r--src/gui/kernel/qguivariant.cpp2
4 files changed, 18 insertions, 18 deletions
diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp
index fba1aaf9b6..1207d995b0 100644
--- a/src/corelib/kernel/qmetatype.cpp
+++ b/src/corelib/kernel/qmetatype.cpp
@@ -82,7 +82,7 @@ namespace {
struct DefinedTypesFilter {
template<typename T>
struct Acceptor {
- static const bool IsAccepted = QtMetaTypePrivate::TypeDefinition<T>::IsAvailable && QTypeModuleInfo<T>::IsCore;
+ static const bool IsAccepted = QtMetaTypePrivate::TypeDefinition<T>::IsAvailable && QModulesPrivate::QTypeModuleInfo<T>::IsCore;
};
};
} // namespace
@@ -1061,11 +1061,11 @@ class TypeCreator {
struct CreatorImpl<T, /* IsAcceptedType = */ false> {
static void *Create(const int type, const void *copy)
{
- if (QTypeModuleInfo<T>::IsGui) {
+ if (QModulesPrivate::QTypeModuleInfo<T>::IsGui) {
if (Q_LIKELY(qMetaTypeGuiHelper))
return qMetaTypeGuiHelper[type - QMetaType::FirstGuiType].creator(copy);
}
- if (QTypeModuleInfo<T>::IsWidget) {
+ if (QModulesPrivate::QTypeModuleInfo<T>::IsWidget) {
if (Q_LIKELY(qMetaTypeWidgetsHelper))
return qMetaTypeWidgetsHelper[type - QMetaType::FirstWidgetsType].creator(copy);
}
@@ -1123,12 +1123,12 @@ class TypeDestroyer {
struct DestroyerImpl<T, /* IsAcceptedType = */ false> {
static void Destroy(const int type, void *where)
{
- if (QTypeModuleInfo<T>::IsGui) {
+ if (QModulesPrivate::QTypeModuleInfo<T>::IsGui) {
if (Q_LIKELY(qMetaTypeGuiHelper))
qMetaTypeGuiHelper[type - QMetaType::FirstGuiType].deleter(where);
return;
}
- if (QTypeModuleInfo<T>::IsWidget) {
+ if (QModulesPrivate::QTypeModuleInfo<T>::IsWidget) {
if (Q_LIKELY(qMetaTypeWidgetsHelper))
qMetaTypeWidgetsHelper[type - QMetaType::FirstWidgetsType].deleter(where);
return;
@@ -1189,10 +1189,10 @@ class TypeConstructor {
struct ConstructorImpl<T, /* IsAcceptedType = */ false> {
static void *Construct(const int type, void *where, const void *copy)
{
- if (QTypeModuleInfo<T>::IsGui)
+ if (QModulesPrivate::QTypeModuleInfo<T>::IsGui)
return Q_LIKELY(qMetaTypeGuiHelper) ? qMetaTypeGuiHelper[type - QMetaType::FirstGuiType].constructor(where, copy) : 0;
- if (QTypeModuleInfo<T>::IsWidget)
+ if (QModulesPrivate::QTypeModuleInfo<T>::IsWidget)
return Q_LIKELY(qMetaTypeWidgetsHelper) ? qMetaTypeWidgetsHelper[type - QMetaType::FirstWidgetsType].constructor(where, copy) : 0;
// This point can be reached only for known types that definition is not available, for example
@@ -1277,12 +1277,12 @@ class TypeDestructor {
struct DestructorImpl<T, /* IsAcceptedType = */ false> {
static void Destruct(const int type, void *where)
{
- if (QTypeModuleInfo<T>::IsGui) {
+ if (QModulesPrivate::QTypeModuleInfo<T>::IsGui) {
if (Q_LIKELY(qMetaTypeGuiHelper))
qMetaTypeGuiHelper[type - QMetaType::FirstGuiType].destructor(where);
return;
}
- if (QTypeModuleInfo<T>::IsWidget) {
+ if (QModulesPrivate::QTypeModuleInfo<T>::IsWidget) {
if (Q_LIKELY(qMetaTypeWidgetsHelper))
qMetaTypeWidgetsHelper[type - QMetaType::FirstWidgetsType].destructor(where);
return;
@@ -1350,10 +1350,10 @@ class SizeOf {
struct SizeOfImpl<T, /* IsAcceptedType = */ false> {
static int Size(const int type)
{
- if (QTypeModuleInfo<T>::IsGui)
+ if (QModulesPrivate::QTypeModuleInfo<T>::IsGui)
return Q_LIKELY(qMetaTypeGuiHelper) ? qMetaTypeGuiHelper[type - QMetaType::FirstGuiType].size : 0;
- if (QTypeModuleInfo<T>::IsWidget)
+ if (QModulesPrivate::QTypeModuleInfo<T>::IsWidget)
return Q_LIKELY(qMetaTypeWidgetsHelper) ? qMetaTypeWidgetsHelper[type - QMetaType::FirstWidgetsType].size : 0;
// This point can be reached only for known types that definition is not available, for example
@@ -1418,10 +1418,10 @@ class Flags
{
static quint32 Flags(const int type)
{
- if (QTypeModuleInfo<T>::IsGui)
+ if (QModulesPrivate::QTypeModuleInfo<T>::IsGui)
return Q_LIKELY(qMetaTypeGuiHelper) ? qMetaTypeGuiHelper[type - QMetaType::FirstGuiType].flags : 0;
- if (QTypeModuleInfo<T>::IsWidget)
+ if (QModulesPrivate::QTypeModuleInfo<T>::IsWidget)
return Q_LIKELY(qMetaTypeWidgetsHelper) ? qMetaTypeWidgetsHelper[type - QMetaType::FirstWidgetsType].flags : 0;
// This point can be reached only for known types that definition is not available, for example
@@ -1601,12 +1601,12 @@ class TypeInfo {
{
TypeInfoImpl(const uint type, QMetaTypeInterface &info)
{
- if (QTypeModuleInfo<T>::IsGui) {
+ if (QModulesPrivate::QTypeModuleInfo<T>::IsGui) {
if (Q_LIKELY(qMetaTypeGuiHelper))
info = qMetaTypeGuiHelper[type - QMetaType::FirstGuiType];
return;
}
- if (QTypeModuleInfo<T>::IsWidget) {
+ if (QModulesPrivate::QTypeModuleInfo<T>::IsWidget) {
if (Q_LIKELY(qMetaTypeWidgetsHelper))
info = qMetaTypeWidgetsHelper[type - QMetaType::FirstWidgetsType];
return;
diff --git a/src/corelib/kernel/qmetatype_p.h b/src/corelib/kernel/qmetatype_p.h
index 2ab4a3896f..74229d3f3c 100644
--- a/src/corelib/kernel/qmetatype_p.h
+++ b/src/corelib/kernel/qmetatype_p.h
@@ -70,7 +70,6 @@ static inline int moduleForType(const int typeId)
return Widgets;
return Unknown;
}
-}
template <typename T>
class QTypeModuleInfo
@@ -114,6 +113,7 @@ QT_FOR_EACH_STATIC_CORE_CLASS(QT_DECLARE_CORE_MODULE_TYPES_ITER)
QT_FOR_EACH_STATIC_CORE_TEMPLATE(QT_DECLARE_CORE_MODULE_TYPES_ITER)
QT_FOR_EACH_STATIC_GUI_CLASS(QT_DECLARE_GUI_MODULE_TYPES_ITER)
QT_FOR_EACH_STATIC_WIDGETS_CLASS(QT_DECLARE_WIDGETS_MODULE_TYPES_ITER)
+} // namespace QModulesPrivate
#undef QT_DECLARE_CORE_MODULE_TYPES_ITER
#undef QT_DECLARE_GUI_MODULE_TYPES_ITER
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<typename T>
struct Acceptor {
- static const bool IsAccepted = QTypeModuleInfo<T>::IsCore && QtMetaTypePrivate::TypeDefinition<T>::IsAvailable;
+ static const bool IsAccepted = QModulesPrivate::QTypeModuleInfo<T>::IsCore && QtMetaTypePrivate::TypeDefinition<T>::IsAvailable;
};
};
} // annonymous
diff --git a/src/gui/kernel/qguivariant.cpp b/src/gui/kernel/qguivariant.cpp
index 436688a295..44dc2d27ca 100644
--- a/src/gui/kernel/qguivariant.cpp
+++ b/src/gui/kernel/qguivariant.cpp
@@ -101,7 +101,7 @@ namespace {
struct GuiTypesFilter {
template<typename T>
struct Acceptor {
- static const bool IsAccepted = QTypeModuleInfo<T>::IsGui && QtMetaTypePrivate::TypeDefinition<T>::IsAvailable;
+ static const bool IsAccepted = QModulesPrivate::QTypeModuleInfo<T>::IsGui && QtMetaTypePrivate::TypeDefinition<T>::IsAvailable;
};
};