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>bb10
parent
7e0beba891
commit
6f0065944d
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue