kernel/qmetatype.cpp

Switch to Source codePreprocessed file
LineSource CodeCoverage
1 -
2 -
3 -
4 -
5 -
6 -
7 -
8 -
9 -
10 -
11 -
12 -
13 -
14namespace { -
15struct DefinedTypesFilter { -
16 template<typename T> -
17 struct Acceptor { -
18 static const bool IsAccepted = QtMetaTypePrivate::TypeDefinition<T>::IsAvailable && QModulesPrivate::QTypeModuleInfo<T>::IsCore; -
19 }; -
20}; -
21} -
22static const struct { const char * typeName; int typeNameLength; int type; } types[] = { -
23 { "void", sizeof("void") - 1, 43 }, { "bool", sizeof("bool") - 1, 1 }, { "int", sizeof("int") - 1, 2 }, { "uint", sizeof("uint") - 1, 3 }, { "qlonglong", sizeof("qlonglong") - 1, 4 }, { "qulonglong", sizeof("qulonglong") - 1, 5 }, { "double", sizeof("double") - 1, 6 }, { "long", sizeof("long") - 1, 32 }, { "short", sizeof("short") - 1, 33 }, { "char", sizeof("char") - 1, 34 }, { "ulong", sizeof("ulong") - 1, 35 }, { "ushort", sizeof("ushort") - 1, 36 }, { "uchar", sizeof("uchar") - 1, 37 }, { "float", sizeof("float") - 1, 38 }, { "signed char", sizeof("signed char") - 1, 40 }, { "void*", sizeof("void*") - 1, 31 }, { "QChar", sizeof("QChar") - 1, 7 }, { "QString", sizeof("QString") - 1, 10 }, { "QStringList", sizeof("QStringList") - 1, 11 }, { "QByteArray", sizeof("QByteArray") - 1, 12 }, { "QBitArray", sizeof("QBitArray") - 1, 13 }, { "QDate", sizeof("QDate") - 1, 14 }, { "QTime", sizeof("QTime") - 1, 15 }, { "QDateTime", sizeof("QDateTime") - 1, 16 }, { "QUrl", sizeof("QUrl") - 1, 17 }, { "QLocale", sizeof("QLocale") - 1, 18 }, { "QRect", sizeof("QRect") - 1, 19 }, { "QRectF", sizeof("QRectF") - 1, 20 }, { "QSize", sizeof("QSize") - 1, 21 }, { "QSizeF", sizeof("QSizeF") - 1, 22 }, { "QLine", sizeof("QLine") - 1, 23 }, { "QLineF", sizeof("QLineF") - 1, 24 }, { "QPoint", sizeof("QPoint") - 1, 25 }, { "QPointF", sizeof("QPointF") - 1, 26 }, { "QRegExp", sizeof("QRegExp") - 1, 27 }, { "QEasingCurve", sizeof("QEasingCurve") - 1, 29 }, { "QUuid", sizeof("QUuid") - 1, 30 }, { "QVariant", sizeof("QVariant") - 1, 41 }, { "QModelIndex", sizeof("QModelIndex") - 1, 42 }, { "QRegularExpression", sizeof("QRegularExpression") - 1, 44 }, { "QJsonValue", sizeof("QJsonValue") - 1, 45 }, { "QJsonObject", sizeof("QJsonObject") - 1, 46 }, { "QJsonArray", sizeof("QJsonArray") - 1, 47 }, { "QJsonDocument", sizeof("QJsonDocument") - 1, 48 }, { "QObject*", sizeof("QObject*") - 1, 39 }, { "QVariantMap", sizeof("QVariantMap") - 1, 8 }, { "QVariantList", sizeof("QVariantList") - 1, 9 }, { "QVariantHash", sizeof("QVariantHash") - 1, 28 }, { "QFont", sizeof("QFont") - 1, 64 }, { "QPixmap", sizeof("QPixmap") - 1, 65 }, { "QBrush", sizeof("QBrush") - 1, 66 }, { "QColor", sizeof("QColor") - 1, 67 }, { "QPalette", sizeof("QPalette") - 1, 68 }, { "QIcon", sizeof("QIcon") - 1, 69 }, { "QImage", sizeof("QImage") - 1, 70 }, { "QPolygon", sizeof("QPolygon") - 1, 71 }, { "QRegion", sizeof("QRegion") - 1, 72 }, { "QBitmap", sizeof("QBitmap") - 1, 73 }, { "QCursor", sizeof("QCursor") - 1, 74 }, { "QKeySequence", sizeof("QKeySequence") - 1, 75 }, { "QPen", sizeof("QPen") - 1, 76 }, { "QTextLength", sizeof("QTextLength") - 1, 77 }, { "QTextFormat", sizeof("QTextFormat") - 1, 78 }, { "QMatrix", sizeof("QMatrix") - 1, 79 }, { "QTransform", sizeof("QTransform") - 1, 80 }, { "QMatrix4x4", sizeof("QMatrix4x4") - 1, 81 }, { "QVector2D", sizeof("QVector2D") - 1, 82 }, { "QVector3D", sizeof("QVector3D") - 1, 83 }, { "QVector4D", sizeof("QVector4D") - 1, 84 }, { "QQuaternion", sizeof("QQuaternion") - 1, 85 }, { "QPolygonF", sizeof("QPolygonF") - 1, 86 }, { "QSizePolicy", sizeof("QSizePolicy") - 1, 121 }, -
24 { "unsigned long", sizeof("unsigned long") - 1, QMetaType::ULong }, { "unsigned int", sizeof("unsigned int") - 1, QMetaType::UInt }, { "unsigned short", sizeof("unsigned short") - 1, QMetaType::UShort }, { "unsigned char", sizeof("unsigned char") - 1, QMetaType::UChar }, { "long long", sizeof("long long") - 1, QMetaType::LongLong }, { "unsigned long long", sizeof("unsigned long long") - 1, QMetaType::ULongLong }, { "qint8", sizeof("qint8") - 1, QMetaType::SChar }, { "quint8", sizeof("quint8") - 1, QMetaType::UChar }, { "qint16", sizeof("qint16") - 1, QMetaType::Short }, { "quint16", sizeof("quint16") - 1, QMetaType::UShort }, { "qint32", sizeof("qint32") - 1, QMetaType::Int }, { "quint32", sizeof("quint32") - 1, QMetaType::UInt }, { "qint64", sizeof("qint64") - 1, QMetaType::LongLong }, { "quint64", sizeof("quint64") - 1, QMetaType::ULongLong }, { "QList<QVariant>", sizeof("QList<QVariant>") - 1, QMetaType::QVariantList }, { "QMap<QString,QVariant>", sizeof("QMap<QString,QVariant>") - 1, QMetaType::QVariantMap }, { "QHash<QString,QVariant>", sizeof("QHash<QString,QVariant>") - 1, QMetaType::QVariantHash }, -
25 { "qreal", sizeof("qreal") - 1, QMetaTypeId2<qreal>::MetaType }, -
26 {0, 0, QMetaType::UnknownType} -
27}; -
28 -
29__attribute__((visibility("default"))) const QMetaTypeInterface *qMetaTypeGuiHelper = 0; -
30__attribute__((visibility("default"))) const QMetaTypeInterface *qMetaTypeWidgetsHelper = 0; -
31__attribute__((visibility("default"))) const QMetaObject *qMetaObjectWidgetsHelper = 0; -
32 -
33class QCustomTypeInfo : public QMetaTypeInterface -
34{ -
35public: -
36 QCustomTypeInfo() -
37 : alias(-1) -
38 { -
39 QMetaTypeInterface empty = { (QtMetaTypePrivate::QMetaTypeFunctionHelper<void, QtMetaTypePrivate::TypeDefinition<void>::IsAvailable>::Create), (QtMetaTypePrivate::QMetaTypeFunctionHelper<void, QtMetaTypePrivate::TypeDefinition<void>::IsAvailable>::Delete), (QtMetaTypePrivate::QMetaTypeFunctionHelper<void, QtMetaTypePrivate::TypeDefinition<void>::IsAvailable>::Save), (QtMetaTypePrivate::QMetaTypeFunctionHelper<void, QtMetaTypePrivate::TypeDefinition<void>::IsAvailable>::Load), (QtMetaTypePrivate::QMetaTypeFunctionHelper<void, QtMetaTypePrivate::TypeDefinition<void>::IsAvailable>::Construct), (QtMetaTypePrivate::QMetaTypeFunctionHelper<void, QtMetaTypePrivate::TypeDefinition<void>::IsAvailable>::Destruct), (QTypeInfo<void>::sizeOf), QtPrivate::QMetaTypeTypeFlags<void>::Flags, (QtPrivate::MetaObjectForType<void>::value()) }; -
40 *static_cast<QMetaTypeInterface*>(this) = empty; -
41 }
executed: }
Execution Count:4190
4190
42 QByteArray typeName; -
43 int alias; -
44}; -
45 -
46namespace -
47{ -
48union CheckThatItIsPod -
49{ -
50 QMetaTypeInterface iface; -
51}; -
52} -
53 -
54template<> class QTypeInfo<QCustomTypeInfo > { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QCustomTypeInfo)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0), sizeOf = sizeof(QCustomTypeInfo) }; static inline const char *name() { return "QCustomTypeInfo"; } }; -
55static QVector<QCustomTypeInfo> *customTypes() { static QGlobalStatic<QVector<QCustomTypeInfo> > thisGlobalStatic = { { (0) }, false }; if (!thisGlobalStatic.pointer.load() && !thisGlobalStatic.destroyed) { QVector<QCustomTypeInfo> *x = new QVector<QCustomTypeInfo>; if (!thisGlobalStatic.pointer.testAndSetOrdered(0, x)) delete x; else static QGlobalStaticDeleter<QVector<QCustomTypeInfo> > cleanup(thisGlobalStatic); } return thisGlobalStatic.pointer.load(); }
executed: delete x;
Execution Count:1
executed: return thisGlobalStatic.pointer.load();
Execution Count:491550
evaluated: !thisGlobalStatic.pointer.testAndSetOrdered(0, x)
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:65
evaluated: !thisGlobalStatic.pointer.load()
TRUEFALSE
yes
Evaluation Count:67
yes
Evaluation Count:491518
evaluated: !thisGlobalStatic.destroyed
TRUEFALSE
yes
Evaluation Count:66
yes
Evaluation Count:1
1-491550
56static QReadWriteLock *customTypesLock() { static QGlobalStatic<QReadWriteLock > thisGlobalStatic = { { (0) }, false }; if (!thisGlobalStatic.pointer.load() && !thisGlobalStatic.destroyed) { QReadWriteLock *x = new QReadWriteLock; if (!thisGlobalStatic.pointer.testAndSetOrdered(0, x)) delete x; else static QGlobalStaticDeleter<QReadWriteLock > cleanup(thisGlobalStatic); } return thisGlobalStatic.pointer.load(); }
executed: delete x;
Execution Count:1
evaluated: !thisGlobalStatic.pointer.testAndSetOrdered(0, x)
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:65
executed: return thisGlobalStatic.pointer.load();
Execution Count:474352
evaluated: !thisGlobalStatic.pointer.load()
TRUEFALSE
yes
Evaluation Count:67
yes
Evaluation Count:474376
evaluated: !thisGlobalStatic.destroyed
TRUEFALSE
yes
Evaluation Count:66
yes
Evaluation Count:1
1-474376
57 -
58 -
59 -
60 -
61 -
62void QMetaType::registerStreamOperators(const char *typeName, SaveOperator saveOp, -
63 LoadOperator loadOp) -
64{ -
65 registerStreamOperators(type(typeName), saveOp, loadOp); -
66}
executed: }
Execution Count:5
5
67 -
68 -
69 -
70 -
71void QMetaType::registerStreamOperators(int idx, SaveOperator saveOp, -
72 LoadOperator loadOp) -
73{ -
74 if (idx < User)
evaluated: idx < User
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:6
2-6
75 return;
executed: return;
Execution Count:2
2
76 QVector<QCustomTypeInfo> *ct = customTypes(); -
77 if (!ct)
partially evaluated: !ct
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:6
0-6
78 return;
never executed: return;
0
79 QWriteLocker locker(customTypesLock()); -
80 QCustomTypeInfo &inf = (*ct)[idx - User]; -
81 inf.saveOp = saveOp; -
82 inf.loadOp = loadOp; -
83}
executed: }
Execution Count:6
6
84const char *QMetaType::typeName(int typeId) -
85{ -
86 const uint type = typeId; -
87 -
88 -
89 -
90 static const char *namesCache[QMetaType::HighestInternalId + 1]; -
91 -
92 const char *result; -
93 if (type <= QMetaType::HighestInternalId && ((result = namesCache[type])))
evaluated: type <= QMetaType::HighestInternalId
TRUEFALSE
yes
Evaluation Count:22138
yes
Evaluation Count:3791
evaluated: ((result = namesCache[type]))
TRUEFALSE
yes
Evaluation Count:21536
yes
Evaluation Count:602
602-22138
94 return result;
executed: return result;
Execution Count:21536
21536
95 -
96 -
97 -
98 -
99 switch (QMetaType::Type(type)) { -
100 case QMetaType::Void: result = "void"; break; case QMetaType::Bool: result = "bool"; break; case QMetaType::Int: result = "int"; break; case QMetaType::UInt: result = "uint"; break; case QMetaType::LongLong: result = "qlonglong"; break; case QMetaType::ULongLong: result = "qulonglong"; break; case QMetaType::Double: result = "double"; break; case QMetaType::Long: result = "long"; break; case QMetaType::Short: result = "short"; break; case QMetaType::Char: result = "char"; break; case QMetaType::ULong: result = "ulong"; break; case QMetaType::UShort: result = "ushort"; break; case QMetaType::UChar: result = "uchar"; break; case QMetaType::Float: result = "float"; break; case QMetaType::SChar: result = "signed char"; break; case QMetaType::VoidStar: result = "void*"; break; case QMetaType::QChar: result = "QChar"; break; case QMetaType::QString: result = "QString"; break; case QMetaType::QStringList: result = "QStringList"; break; case QMetaType::QByteArray: result = "QByteArray"; break; case QMetaType::QBitArray: result = "QBitArray"; break; case QMetaType::QDate: result = "QDate"; break; case QMetaType::QTime: result = "QTime"; break; case QMetaType::QDateTime: result = "QDateTime"; break; case QMetaType::QUrl: result = "QUrl"; break; case QMetaType::QLocale: result = "QLocale"; break; case QMetaType::QRect: result = "QRect"; break; case QMetaType::QRectF: result = "QRectF"; break; case QMetaType::QSize: result = "QSize"; break; case QMetaType::QSizeF: result = "QSizeF"; break; case QMetaType::QLine: result = "QLine"; break; case QMetaType::QLineF: result = "QLineF"; break; case QMetaType::QPoint: result = "QPoint"; break; case QMetaType::QPointF: result = "QPointF"; break; case QMetaType::QRegExp: result = "QRegExp"; break; case QMetaType::QEasingCurve: result = "QEasingCurve"; break; case QMetaType::QUuid: result = "QUuid"; break; case QMetaType::QVariant: result = "QVariant"; break; case QMetaType::QModelIndex: result = "QModelIndex"; break; case QMetaType::QRegularExpression: result = "QRegularExpression"; break; case QMetaType::QJsonValue: result = "QJsonValue"; break; case QMetaType::QJsonObject: result = "QJsonObject"; break; case QMetaType::QJsonArray: result = "QJsonArray"; break; case QMetaType::QJsonDocument: result = "QJsonDocument"; break; case QMetaType::QObjectStar: result = "QObject*"; break; case QMetaType::QVariantMap: result = "QVariantMap"; break; case QMetaType::QVariantList: result = "QVariantList"; break; case QMetaType::QVariantHash: result = "QVariantHash"; break; case QMetaType::QFont: result = "QFont"; break; case QMetaType::QPixmap: result = "QPixmap"; break; case QMetaType::QBrush: result = "QBrush"; break; case QMetaType::QColor: result = "QColor"; break; case QMetaType::QPalette: result = "QPalette"; break; case QMetaType::QIcon: result = "QIcon"; break; case QMetaType::QImage: result = "QImage"; break; case QMetaType::QPolygon: result = "QPolygon"; break; case QMetaType::QRegion: result = "QRegion"; break; case QMetaType::QBitmap: result = "QBitmap"; break; case QMetaType::QCursor: result = "QCursor"; break; case QMetaType::QKeySequence: result = "QKeySequence"; break; case QMetaType::QPen: result = "QPen"; break; case QMetaType::QTextLength: result = "QTextLength"; break; case QMetaType::QTextFormat: result = "QTextFormat"; break; case QMetaType::QMatrix: result = "QMatrix"; break; case QMetaType::QTransform: result = "QTransform"; break; case QMetaType::QMatrix4x4: result = "QMatrix4x4"; break; case QMetaType::QVector2D: result = "QVector2D"; break; case QMetaType::QVector3D: result = "QVector3D"; break; case QMetaType::QVector4D: result = "QVector4D"; break; case QMetaType::QQuaternion: result = "QQuaternion"; break; case QMetaType::QPolygonF: result = "QPolygonF"; break; case QMetaType::QSizePolicy: result = "QSizePolicy"; break;
executed: break;
Execution Count:6
executed: break;
Execution Count:30
executed: break;
Execution Count:48
executed: break;
Execution Count:29
executed: break;
Execution Count:31
executed: break;
Execution Count:29
executed: break;
Execution Count:32
executed: break;
Execution Count:4
executed: break;
Execution Count:28
executed: break;
Execution Count:3
executed: break;
Execution Count:3
executed: break;
Execution Count:28
executed: break;
Execution Count:5
executed: break;
Execution Count:3
executed: break;
Execution Count:2
executed: break;
Execution Count:9
executed: break;
Execution Count:3
executed: break;
Execution Count:35
executed: break;
Execution Count:16
executed: break;
Execution Count:14
executed: break;
Execution Count:2
executed: break;
Execution Count:4
executed: break;
Execution Count:3
executed: break;
Execution Count:6
executed: break;
Execution Count:5
executed: break;
Execution Count:2
executed: break;
Execution Count:8
executed: break;
Execution Count:3
executed: break;
Execution Count:2
executed: break;
Execution Count:3
executed: break;
Execution Count:2
executed: break;
Execution Count:2
executed: break;
Execution Count:7
executed: break;
Execution Count:3
executed: break;
Execution Count:3
executed: break;
Execution Count:3
executed: break;
Execution Count:2
executed: break;
Execution Count:6
executed: break;
Execution Count:17
executed: break;
Execution Count:2
executed: break;
Execution Count:2
executed: break;
Execution Count:2
executed: break;
Execution Count:2
executed: break;
Execution Count:2
executed: break;
Execution Count:11
executed: break;
Execution Count:4
executed: break;
Execution Count:5
executed: break;
Execution Count:2
executed: break;
Execution Count:5
executed: break;
Execution Count:4
executed: break;
Execution Count:4
executed: break;
Execution Count:4
executed: break;
Execution Count:4
executed: break;
Execution Count:3
executed: break;
Execution Count:5
executed: break;
Execution Count:4
executed: break;
Execution Count:4
executed: break;
Execution Count:4
executed: break;
Execution Count:4
executed: break;
Execution Count:4
executed: break;
Execution Count:4
executed: break;
Execution Count:4
executed: break;
Execution Count:4
executed: break;
Execution Count:4
executed: break;
Execution Count:4
executed: break;
Execution Count:5
executed: break;
Execution Count:5
executed: break;
Execution Count:5
executed: break;
Execution Count:5
executed: break;
Execution Count:5
executed: break;
Execution Count:3
executed: break;
Execution Count:2
2-48
101 -
102 default: { -
103 if (__builtin_expect(!!(type < QMetaType::User), false)) {
evaluated: __builtin_expect(!!(type < QMetaType::User), false)
TRUEFALSE
yes
Evaluation Count:30
yes
Evaluation Count:3791
30-3791
104 return 0;
executed: return 0;
Execution Count:30
30
105 } else { -
106 const QVector<QCustomTypeInfo> * const ct = customTypes(); -
107 QReadLocker locker(customTypesLock()); -
108 return ct && uint(ct->count()) > type - QMetaType::User && !ct->at(type - QMetaType::User).typeName.isEmpty() 3790
109 ? ct->at(type - QMetaType::User).typeName.constData() 3790
110 : 0;
executed: return ct && uint(ct->count()) > type - QMetaType::User && !ct->at(type - QMetaType::User).typeName.isEmpty() ? ct->at(type - QMetaType::User).typeName.constData() : 0;
Execution Count:3790
3790
111 } -
112 } -
113 } -
114 -
115 -
116 qt_noop(); -
117 namesCache[type] = result; -
118 return result;
executed: return result;
Execution Count:572
572
119} -
120 -
121 -
122 -
123 -
124 -
125static inline int qMetaTypeStaticType(const char *typeName, int length) -
126{ -
127 int i = 0; -
128 while (types[i].typeName && ((length != types[i].typeNameLength)
evaluated: types[i].typeName
TRUEFALSE
yes
Evaluation Count:44712674
yes
Evaluation Count:307977
evaluated: (length != types[i].typeNameLength)
TRUEFALSE
yes
Evaluation Count:42343236
yes
Evaluation Count:2371665
307977-44712674
129 || strcmp(typeName, types[i].typeName))) {
evaluated: strcmp(typeName, types[i].typeName)
TRUEFALSE
yes
Evaluation Count:1413558
yes
Evaluation Count:958148
958148-1413558
130 ++i; -
131 }
executed: }
Execution Count:43754786
43754786
132 return types[i].type;
executed: return types[i].type;
Execution Count:1266114
1266114
133} -
134 -
135 -
136 -
137 -
138 -
139 -
140static int qMetaTypeCustomType_unlocked(const char *typeName, int length) -
141{ -
142 const QVector<QCustomTypeInfo> * const ct = customTypes(); -
143 if (!ct)
partially evaluated: !ct
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:308088
0-308088
144 return QMetaType::UnknownType;
never executed: return QMetaType::UnknownType;
0
145 -
146 for (int v = 0; v < ct->count(); ++v) {
evaluated: v < ct->count()
TRUEFALSE
yes
Evaluation Count:13350002
yes
Evaluation Count:104903
104903-13350002
147 const QCustomTypeInfo &customInfo = ct->at(v); -
148 if ((length == customInfo.typeName.size())
evaluated: (length == customInfo.typeName.size())
TRUEFALSE
yes
Evaluation Count:6817064
yes
Evaluation Count:6654602
6654602-6817064
149 && !strcmp(typeName, customInfo.typeName.constData())) {
evaluated: !strcmp(typeName, customInfo.typeName.constData())
TRUEFALSE
yes
Evaluation Count:203172
yes
Evaluation Count:6617490
203172-6617490
150 if (customInfo.alias >= 0)
evaluated: customInfo.alias >= 0
TRUEFALSE
yes
Evaluation Count:57
yes
Evaluation Count:203115
57-203115
151 return customInfo.alias;
executed: return customInfo.alias;
Execution Count:57
57
152 return v + QMetaType::User;
executed: return v + QMetaType::User;
Execution Count:203113
203113
153 } -
154 }
executed: }
Execution Count:13147365
13147365
155 return QMetaType::UnknownType;
executed: return QMetaType::UnknownType;
Execution Count:104903
104903
156} -
157 -
158 -
159 -
160 -
161 -
162 -
163 -
164int QMetaType::registerType(const char *typeName, Deleter deleter, -
165 Creator creator) -
166{ -
167 return registerType(typeName, deleter, creator, 0
168 QtMetaTypePrivate::QMetaTypeFunctionHelper<void>::Destruct, 0
169 QtMetaTypePrivate::QMetaTypeFunctionHelper<void>::Construct, 0, TypeFlags(), 0);
never executed: return registerType(typeName, deleter, creator, QtMetaTypePrivate::QMetaTypeFunctionHelper<void>::Destruct, QtMetaTypePrivate::QMetaTypeFunctionHelper<void>::Construct, 0, TypeFlags(), 0);
0
170} -
171int QMetaType::registerType(const char *typeName, Deleter deleter, -
172 Creator creator, -
173 Destructor destructor, -
174 Constructor constructor, -
175 int size, TypeFlags flags, const QMetaObject *metaObject) -
176{ -
177 -
178 -
179 -
180 ::QByteArray normalizedTypeName = QMetaObject::normalizedType(typeName); -
181 -
182 -
183 return registerNormalizedType(normalizedTypeName, deleter, creator, destructor, constructor, size, flags, metaObject);
executed: return registerNormalizedType(normalizedTypeName, deleter, creator, destructor, constructor, size, flags, metaObject);
Execution Count:5
5
184} -
185int QMetaType::registerNormalizedType(const ::QByteArray &normalizedTypeName, Deleter deleter, -
186 Creator creator, -
187 Destructor destructor, -
188 Constructor constructor, -
189 int size, TypeFlags flags, const QMetaObject *metaObject) -
190{ -
191 QVector<QCustomTypeInfo> *ct = customTypes(); -
192 if (!ct || normalizedTypeName.isEmpty() || !deleter || !creator || !destructor || !constructor)
partially evaluated: !ct
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:16270
partially evaluated: normalizedTypeName.isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:16279
partially evaluated: !deleter
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:16287
partially evaluated: !creator
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:16289
partially evaluated: !destructor
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:16288
partially evaluated: !constructor
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:16289
0-16289
193 return -1;
never executed: return -1;
0
194 -
195 int idx = qMetaTypeStaticType(normalizedTypeName.constData(), -
196 normalizedTypeName.size()); -
197 -
198 int previousSize = 0; -
199 int previousFlags = 0; -
200 if (idx == UnknownType) {
partially evaluated: idx == UnknownType
TRUEFALSE
yes
Evaluation Count:16218
no
Evaluation Count:0
0-16218
201 QWriteLocker locker(customTypesLock()); -
202 idx = qMetaTypeCustomType_unlocked(normalizedTypeName.constData(), -
203 normalizedTypeName.size()); -
204 if (idx == UnknownType) {
evaluated: idx == UnknownType
TRUEFALSE
yes
Evaluation Count:4178
yes
Evaluation Count:12126
4178-12126
205 QCustomTypeInfo inf; -
206 inf.typeName = normalizedTypeName; -
207 inf.creator = creator; -
208 inf.deleter = deleter; -
209 -
210 inf.loadOp = 0; -
211 inf.saveOp = 0; -
212 -
213 inf.alias = -1; -
214 inf.constructor = constructor; -
215 inf.destructor = destructor; -
216 inf.size = size; -
217 inf.flags = flags; -
218 inf.metaObject = metaObject; -
219 idx = ct->size() + User; -
220 ct->append(inf); -
221 return idx;
executed: return idx;
Execution Count:4178
4178
222 } -
223 -
224 if (idx >= User) {
partially evaluated: idx >= User
TRUEFALSE
yes
Evaluation Count:12126
no
Evaluation Count:0
0-12126
225 previousSize = ct->at(idx - User).size; -
226 previousFlags = ct->at(idx - User).flags; -
227 }
executed: }
Execution Count:12126
12126
228 }
executed: }
Execution Count:12126
12126
229 -
230 if (idx < User) {
partially evaluated: idx < User
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:12126
0-12126
231 previousSize = QMetaType::sizeOf(idx); -
232 previousFlags = QMetaType::typeFlags(idx); -
233 }
never executed: }
0
234 -
235 if (previousSize != size) {
partially evaluated: previousSize != size
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:12126
0-12126
236 QMessageLogger("kernel/qmetatype.cpp", 644, __PRETTY_FUNCTION__).fatal("QMetaType::registerType: Binary compatibility break " -
237 "-- Size mismatch for type '%s' [%i]. Previously registered " -
238 "size %i, now registering size %i.", -
239 normalizedTypeName.constData(), idx, previousSize, size); -
240 }
never executed: }
0
241 if (previousFlags != flags) {
partially evaluated: previousFlags != flags
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:12126
0-12126
242 QMessageLogger("kernel/qmetatype.cpp", 650, __PRETTY_FUNCTION__).fatal("QMetaType::registerType: Binary compatibility break " -
243 "-- Type flags for type '%s' [%i] don't match. Previously " -
244 "registered TypeFlags(0x%x), now registering TypeFlags(0x%x).", -
245 normalizedTypeName.constData(), idx, previousFlags, int(flags)); -
246 }
never executed: }
0
247 -
248 return idx;
executed: return idx;
Execution Count:12126
12126
249} -
250 -
251 -
252 -
253 -
254 -
255 -
256 -
257int QMetaType::registerTypedef(const char* typeName, int aliasId) -
258{ -
259 -
260 -
261 -
262 ::QByteArray normalizedTypeName = QMetaObject::normalizedType(typeName); -
263 -
264 -
265 return registerNormalizedTypedef(normalizedTypeName, aliasId);
never executed: return registerNormalizedTypedef(normalizedTypeName, aliasId);
0
266} -
267int QMetaType::registerNormalizedTypedef(const ::QByteArray &normalizedTypeName, int aliasId) -
268{ -
269 QVector<QCustomTypeInfo> *ct = customTypes(); -
270 if (!ct || normalizedTypeName.isEmpty())
partially evaluated: !ct
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:688
partially evaluated: normalizedTypeName.isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:688
0-688
271 return -1;
never executed: return -1;
0
272 -
273 int idx = qMetaTypeStaticType(normalizedTypeName.constData(), -
274 normalizedTypeName.size()); -
275 -
276 if (idx == UnknownType) {
evaluated: idx == UnknownType
TRUEFALSE
yes
Evaluation Count:681
yes
Evaluation Count:7
7-681
277 QWriteLocker locker(customTypesLock()); -
278 idx = qMetaTypeCustomType_unlocked(normalizedTypeName.constData(), -
279 normalizedTypeName.size()); -
280 -
281 if (idx == UnknownType) {
evaluated: idx == UnknownType
TRUEFALSE
yes
Evaluation Count:12
yes
Evaluation Count:669
12-669
282 QCustomTypeInfo inf; -
283 inf.typeName = normalizedTypeName; -
284 inf.alias = aliasId; -
285 inf.creator = 0; -
286 inf.deleter = 0; -
287 ct->append(inf); -
288 return aliasId;
executed: return aliasId;
Execution Count:12
12
289 } -
290 }
executed: }
Execution Count:669
669
291 -
292 if (idx != aliasId) {
partially evaluated: idx != aliasId
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:676
0-676
293 QMessageLogger("kernel/qmetatype.cpp", 710, __PRETTY_FUNCTION__).fatal("QMetaType::registerTypedef: Binary compatibility break " -
294 "-- Type name '%s' previously registered as typedef of '%s' [%i], " -
295 "now registering as typedef of '%s' [%i].", -
296 normalizedTypeName.constData(), QMetaType::typeName(idx), idx, -
297 QMetaType::typeName(aliasId), aliasId); -
298 }
never executed: }
0
299 return idx;
executed: return idx;
Execution Count:676
676
300} -
301 -
302 -
303 -
304 -
305 -
306 -
307 -
308bool QMetaType::isRegistered(int type) -
309{ -
310 -
311 if ((type >= FirstCoreType && type <= LastCoreType)
evaluated: type >= FirstCoreType
TRUEFALSE
yes
Evaluation Count:39877
yes
Evaluation Count:3
evaluated: type <= LastCoreType
TRUEFALSE
yes
Evaluation Count:24794
yes
Evaluation Count:15083
3-39877
312 || (type >= FirstGuiType && type <= LastGuiType)
evaluated: type >= FirstGuiType
TRUEFALSE
yes
Evaluation Count:15085
yes
Evaluation Count:5
evaluated: type <= LastGuiType
TRUEFALSE
yes
Evaluation Count:67
yes
Evaluation Count:15017
5-15085
313 || (type >= FirstWidgetsType && type <= LastWidgetsType)) {
evaluated: type >= FirstWidgetsType
TRUEFALSE
yes
Evaluation Count:15015
yes
Evaluation Count:6
evaluated: type <= LastWidgetsType
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:15018
1-15018
314 return true;
executed: return true;
Execution Count:24862
24862
315 } -
316 -
317 QReadLocker locker(customTypesLock()); -
318 const QVector<QCustomTypeInfo> * const ct = customTypes(); -
319 return ((type >= User) && (ct && ct->count() > type - User) && !ct->at(type - User).typeName.isEmpty());
executed: return ((type >= User) && (ct && ct->count() > type - User) && !ct->at(type - User).typeName.isEmpty());
Execution Count:15028
15028
320} -
321 -
322 -
323 -
324 -
325 -
326 -
327 -
328template <bool tryNormalizedType> -
329static inline int qMetaTypeTypeImpl(const char *typeName) -
330{ -
331 int length = qstrlen(typeName); -
332 if (!length)
evaluated: !length
TRUEFALSE
yes
Evaluation Count:102
yes
Evaluation Count:1249126
102-1249126
333 return QMetaType::UnknownType;
executed: return QMetaType::UnknownType;
Execution Count:102
102
334 int type = qMetaTypeStaticType(typeName, length); -
335 if (type == QMetaType::UnknownType) {
evaluated: type == QMetaType::UnknownType
TRUEFALSE
yes
Evaluation Count:290984
yes
Evaluation Count:958140
290984-958140
336 QReadLocker locker(customTypesLock()); -
337 type = qMetaTypeCustomType_unlocked(typeName, length); -
338 -
339 if ((type == QMetaType::UnknownType) && tryNormalizedType) {
evaluated: (type == QMetaType::UnknownType)
TRUEFALSE
yes
Evaluation Count:100612
yes
Evaluation Count:190371
evaluated: tryNormalizedType
TRUEFALSE
yes
Evaluation Count:107
yes
Evaluation Count:100505
107-190371
340 const ::QByteArray normalizedTypeName = QMetaObject::normalizedType(typeName); -
341 type = qMetaTypeStaticType(normalizedTypeName.constData(), -
342 normalizedTypeName.size()); -
343 if (type == QMetaType::UnknownType) {
evaluated: type == QMetaType::UnknownType
TRUEFALSE
yes
Evaluation Count:105
yes
Evaluation Count:2
2-105
344 type = qMetaTypeCustomType_unlocked(normalizedTypeName.constData(), -
345 normalizedTypeName.size()); -
346 }
executed: }
Execution Count:105
105
347 }
executed: }
Execution Count:107
107
348 -
349 }
executed: }
Execution Count:290981
290981
350 return type;
executed: return type;
Execution Count:1249137
1249137
351} -
352 -
353 -
354 -
355 -
356 -
357 -
358 -
359int QMetaType::type(const char *typeName) -
360{ -
361 return qMetaTypeTypeImpl< true>(typeName);
executed: return qMetaTypeTypeImpl< true>(typeName);
Execution Count:122057
122057
362} -
363int qMetaTypeTypeInternal(const char *typeName) -
364{ -
365 return qMetaTypeTypeImpl< false>(typeName);
executed: return qMetaTypeTypeImpl< false>(typeName);
Execution Count:1127179
1127179
366} -
367bool QMetaType::save(QDataStream &stream, int type, const void *data) -
368{ -
369 if (!data || !isRegistered(type))
evaluated: !data
TRUEFALSE
yes
Evaluation Count:25
yes
Evaluation Count:12358
partially evaluated: !isRegistered(type)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:12358
0-12358
370 return false;
executed: return false;
Execution Count:25
25
371 -
372 switch(type) { -
373 case QMetaType::UnknownType: -
374 case QMetaType::Void: -
375 case QMetaType::VoidStar: -
376 case QMetaType::QObjectStar: -
377 case QMetaType::QModelIndex: -
378 case QMetaType::QJsonValue: -
379 case QMetaType::QJsonObject: -
380 case QMetaType::QJsonArray: -
381 case QMetaType::QJsonDocument: -
382 return false;
executed: return false;
Execution Count:7
7
383 case QMetaType::Long: -
384 stream << qlonglong(*static_cast<const long *>(data)); -
385 break;
executed: break;
Execution Count:5
5
386 case QMetaType::Int: -
387 stream << *static_cast<const int *>(data); -
388 break;
executed: break;
Execution Count:175
175
389 case QMetaType::Short: -
390 stream << *static_cast<const short *>(data); -
391 break;
executed: break;
Execution Count:5
5
392 case QMetaType::Char: -
393 -
394 stream << *static_cast<const signed char *>(data); -
395 break;
executed: break;
Execution Count:5
5
396 case QMetaType::ULong: -
397 stream << qulonglong(*static_cast<const ulong *>(data)); -
398 break;
executed: break;
Execution Count:5
5
399 case QMetaType::UInt: -
400 stream << *static_cast<const uint *>(data); -
401 break;
executed: break;
Execution Count:4
4
402 case QMetaType::LongLong: -
403 stream << *static_cast<const qlonglong *>(data); -
404 break;
executed: break;
Execution Count:3
3
405 case QMetaType::ULongLong: -
406 stream << *static_cast<const qulonglong *>(data); -
407 break;
executed: break;
Execution Count:3
3
408 case QMetaType::UShort: -
409 stream << *static_cast<const ushort *>(data); -
410 break;
executed: break;
Execution Count:5
5
411 case QMetaType::SChar: -
412 stream << *static_cast<const signed char *>(data); -
413 break;
executed: break;
Execution Count:1
1
414 case QMetaType::UChar: -
415 stream << *static_cast<const uchar *>(data); -
416 break;
executed: break;
Execution Count:5
5
417 case QMetaType::Bool: -
418 stream << qint8(*static_cast<const bool *>(data)); -
419 break;
executed: break;
Execution Count:3
3
420 case QMetaType::Float: -
421 stream << *static_cast<const float *>(data); -
422 break;
executed: break;
Execution Count:7
7
423 case QMetaType::Double: -
424 stream << *static_cast<const double *>(data); -
425 break;
executed: break;
Execution Count:6
6
426 case QMetaType::QChar: -
427 stream << *static_cast<const ::QChar *>(data); -
428 break;
executed: break;
Execution Count:5
5
429 -
430 case QMetaType::QVariantMap: -
431 stream << *static_cast<const ::QVariantMap*>(data); -
432 break;
executed: break;
Execution Count:5
5
433 case QMetaType::QVariantHash: -
434 stream << *static_cast<const ::QVariantHash*>(data); -
435 break;
executed: break;
Execution Count:3
3
436 case QMetaType::QVariantList: -
437 stream << *static_cast<const ::QVariantList*>(data); -
438 break;
executed: break;
Execution Count:19
19
439 case QMetaType::QVariant: -
440 stream << *static_cast<const ::QVariant*>(data); -
441 break;
executed: break;
Execution Count:3
3
442 -
443 case QMetaType::QByteArray: -
444 stream << *static_cast<const ::QByteArray*>(data); -
445 break;
executed: break;
Execution Count:6
6
446 case QMetaType::QString: -
447 stream << *static_cast<const ::QString*>(data); -
448 break;
executed: break;
Execution Count:11934
11934
449 case QMetaType::QStringList: -
450 stream << *static_cast<const ::QStringList*>(data); -
451 break;
executed: break;
Execution Count:8
8
452 -
453 case QMetaType::QBitArray: -
454 stream << *static_cast<const ::QBitArray*>(data); -
455 break;
executed: break;
Execution Count:5
5
456 -
457 case QMetaType::QDate: -
458 stream << *static_cast<const ::QDate*>(data); -
459 break;
executed: break;
Execution Count:5
5
460 case QMetaType::QTime: -
461 stream << *static_cast<const ::QTime*>(data); -
462 break;
executed: break;
Execution Count:5
5
463 case QMetaType::QDateTime: -
464 stream << *static_cast<const ::QDateTime*>(data); -
465 break;
executed: break;
Execution Count:5
5
466 -
467 case QMetaType::QUrl: -
468 stream << *static_cast<const ::QUrl*>(data); -
469 break;
executed: break;
Execution Count:3
3
470 -
471 case QMetaType::QLocale: -
472 stream << *static_cast<const ::QLocale*>(data); -
473 break;
executed: break;
Execution Count:3
3
474 -
475 case QMetaType::QRect: -
476 stream << *static_cast<const ::QRect*>(data); -
477 break;
executed: break;
Execution Count:5
5
478 case QMetaType::QRectF: -
479 stream << *static_cast<const ::QRectF*>(data); -
480 break;
executed: break;
Execution Count:3
3
481 case QMetaType::QSize: -
482 stream << *static_cast<const ::QSize*>(data); -
483 break;
executed: break;
Execution Count:6
6
484 case QMetaType::QSizeF: -
485 stream << *static_cast<const ::QSizeF*>(data); -
486 break;
executed: break;
Execution Count:3
3
487 case QMetaType::QLine: -
488 stream << *static_cast<const ::QLine*>(data); -
489 break;
executed: break;
Execution Count:3
3
490 case QMetaType::QLineF: -
491 stream << *static_cast<const ::QLineF*>(data); -
492 break;
executed: break;
Execution Count:3
3
493 case QMetaType::QPoint: -
494 stream << *static_cast<const ::QPoint*>(data); -
495 break;
executed: break;
Execution Count:5
5
496 case QMetaType::QPointF: -
497 stream << *static_cast<const ::QPointF*>(data); -
498 break;
executed: break;
Execution Count:3
3
499 -
500 -
501 case QMetaType::QRegExp: -
502 stream << *static_cast<const ::QRegExp*>(data); -
503 break;
executed: break;
Execution Count:47
47
504 -
505 -
506 -
507 case QMetaType::QRegularExpression: -
508 stream << *static_cast<const ::QRegularExpression*>(data); -
509 break;
executed: break;
Execution Count:4
4
510 -
511 case QMetaType::QEasingCurve: -
512 stream << *static_cast<const ::QEasingCurve*>(data); -
513 break;
executed: break;
Execution Count:1
1
514 -
515 case QMetaType::QFont: -
516 case QMetaType::QPixmap: -
517 case QMetaType::QBrush: -
518 case QMetaType::QColor: -
519 case QMetaType::QPalette: -
520 case QMetaType::QImage: -
521 case QMetaType::QPolygon: -
522 case QMetaType::QPolygonF: -
523 case QMetaType::QRegion: -
524 case QMetaType::QBitmap: -
525 case QMetaType::QCursor: -
526 case QMetaType::QKeySequence: -
527 case QMetaType::QPen: -
528 case QMetaType::QTextLength: -
529 case QMetaType::QTextFormat: -
530 case QMetaType::QMatrix: -
531 case QMetaType::QTransform: -
532 case QMetaType::QMatrix4x4: -
533 case QMetaType::QVector2D: -
534 case QMetaType::QVector3D: -
535 case QMetaType::QVector4D: -
536 case QMetaType::QQuaternion: -
537 case QMetaType::QIcon: -
538 if (!qMetaTypeGuiHelper)
partially evaluated: !qMetaTypeGuiHelper
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:20
0-20
539 return false;
never executed: return false;
0
540 qMetaTypeGuiHelper[type - FirstGuiType].saveOp(stream, data); -
541 break;
executed: break;
Execution Count:20
20
542 case QMetaType::QSizePolicy: -
543 if (!qMetaTypeWidgetsHelper)
never evaluated: !qMetaTypeWidgetsHelper
0
544 return false;
never executed: return false;
0
545 qMetaTypeWidgetsHelper[type - FirstWidgetsType].saveOp(stream, data); -
546 break;
never executed: break;
0
547 case QMetaType::QUuid: -
548 stream << *static_cast<const ::QUuid*>(data); -
549 break;
executed: break;
Execution Count:2
2
550 default: { -
551 const QVector<QCustomTypeInfo> * const ct = customTypes(); -
552 if (!ct)
partially evaluated: !ct
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5
0-5
553 return false;
never executed: return false;
0
554 -
555 SaveOperator saveOp = 0; -
556 { -
557 QReadLocker locker(customTypesLock()); -
558 saveOp = ct->at(type - User).saveOp; -
559 } -
560 -
561 if (!saveOp)
evaluated: !saveOp
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:4
1-4
562 return false;
executed: return false;
Execution Count:1
1
563 saveOp(stream, data); -
564 break; }
executed: break;
Execution Count:4
4
565 } -
566 -
567 return true;
executed: return true;
Execution Count:12350
12350
568} -
569bool QMetaType::load(QDataStream &stream, int type, void *data) -
570{ -
571 if (!data || !isRegistered(type))
evaluated: !data
TRUEFALSE
yes
Evaluation Count:25
yes
Evaluation Count:12437
partially evaluated: !isRegistered(type)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:12437
0-12437
572 return false;
executed: return false;
Execution Count:25
25
573 -
574 switch(type) { -
575 case QMetaType::UnknownType: -
576 case QMetaType::Void: -
577 case QMetaType::VoidStar: -
578 case QMetaType::QObjectStar: -
579 case QMetaType::QModelIndex: -
580 case QMetaType::QJsonValue: -
581 case QMetaType::QJsonObject: -
582 case QMetaType::QJsonArray: -
583 case QMetaType::QJsonDocument: -
584 return false;
executed: return false;
Execution Count:7
7
585 case QMetaType::Long: { -
586 qlonglong l; -
587 stream >> l; -
588 *static_cast<long *>(data) = long(l); -
589 break; }
executed: break;
Execution Count:9
9
590 case QMetaType::Int: -
591 stream >> *static_cast<int *>(data); -
592 break;
executed: break;
Execution Count:146
146
593 case QMetaType::Short: -
594 stream >> *static_cast<short *>(data); -
595 break;
executed: break;
Execution Count:9
9
596 case QMetaType::Char: -
597 -
598 stream >> *static_cast<signed char *>(data); -
599 break;
executed: break;
Execution Count:9
9
600 case QMetaType::ULong: { -
601 qulonglong ul; -
602 stream >> ul; -
603 *static_cast<ulong *>(data) = ulong(ul); -
604 break; }
executed: break;
Execution Count:9
9
605 case QMetaType::UInt: -
606 stream >> *static_cast<uint *>(data); -
607 break;
executed: break;
Execution Count:8
8
608 case QMetaType::LongLong: -
609 stream >> *static_cast<qlonglong *>(data); -
610 break;
executed: break;
Execution Count:7
7
611 case QMetaType::ULongLong: -
612 stream >> *static_cast<qulonglong *>(data); -
613 break;
executed: break;
Execution Count:7
7
614 case QMetaType::UShort: -
615 stream >> *static_cast<ushort *>(data); -
616 break;
executed: break;
Execution Count:9
9
617 case QMetaType::SChar: -
618 stream >> *static_cast<signed char *>(data); -
619 break;
executed: break;
Execution Count:3
3
620 case QMetaType::UChar: -
621 stream >> *static_cast<uchar *>(data); -
622 break;
executed: break;
Execution Count:9
9
623 case QMetaType::Bool: { -
624 qint8 b; -
625 stream >> b; -
626 *static_cast<bool *>(data) = b; -
627 break; }
executed: break;
Execution Count:7
7
628 case QMetaType::Float: -
629 stream >> *static_cast<float *>(data); -
630 break;
executed: break;
Execution Count:11
11
631 case QMetaType::Double: -
632 stream >> *static_cast<double *>(data); -
633 break;
executed: break;
Execution Count:10
10
634 case QMetaType::QChar: -
635 stream >> *static_cast< ::QChar*>(data); -
636 break;
executed: break;
Execution Count:9
9
637 -
638 case QMetaType::QVariantMap: -
639 stream >> *static_cast< ::QVariantMap*>(data); -
640 break;
executed: break;
Execution Count:8
8
641 case QMetaType::QVariantHash: -
642 stream >> *static_cast< ::QVariantHash*>(data); -
643 break;
executed: break;
Execution Count:7
7
644 case QMetaType::QVariantList: -
645 stream >> *static_cast< ::QVariantList*>(data); -
646 break;
executed: break;
Execution Count:12
12
647 case QMetaType::QVariant: -
648 stream >> *static_cast< ::QVariant*>(data); -
649 break;
executed: break;
Execution Count:7
7
650 -
651 case QMetaType::QByteArray: -
652 stream >> *static_cast< ::QByteArray*>(data); -
653 break;
executed: break;
Execution Count:9
9
654 case QMetaType::QString: -
655 stream >> *static_cast< ::QString*>(data); -
656 break;
executed: break;
Execution Count:11907
11907
657 case QMetaType::QStringList: -
658 stream >> *static_cast< ::QStringList*>(data); -
659 break;
executed: break;
Execution Count:12
12
660 -
661 case QMetaType::QBitArray: -
662 stream >> *static_cast< ::QBitArray*>(data); -
663 break;
executed: break;
Execution Count:9
9
664 -
665 case QMetaType::QDate: -
666 stream >> *static_cast< ::QDate*>(data); -
667 break;
executed: break;
Execution Count:9
9
668 case QMetaType::QTime: -
669 stream >> *static_cast< ::QTime*>(data); -
670 break;
executed: break;
Execution Count:9
9
671 case QMetaType::QDateTime: -
672 stream >> *static_cast< ::QDateTime*>(data); -
673 break;
executed: break;
Execution Count:9
9
674 -
675 case QMetaType::QUrl: -
676 stream >> *static_cast< ::QUrl*>(data); -
677 break;
executed: break;
Execution Count:7
7
678 -
679 case QMetaType::QLocale: -
680 stream >> *static_cast< ::QLocale*>(data); -
681 break;
executed: break;
Execution Count:7
7
682 -
683 case QMetaType::QRect: -
684 stream >> *static_cast< ::QRect*>(data); -
685 break;
executed: break;
Execution Count:9
9
686 case QMetaType::QRectF: -
687 stream >> *static_cast< ::QRectF*>(data); -
688 break;
executed: break;
Execution Count:7
7
689 case QMetaType::QSize: -
690 stream >> *static_cast< ::QSize*>(data); -
691 break;
executed: break;
Execution Count:10
10
692 case QMetaType::QSizeF: -
693 stream >> *static_cast< ::QSizeF*>(data); -
694 break;
executed: break;
Execution Count:7
7
695 case QMetaType::QLine: -
696 stream >> *static_cast< ::QLine*>(data); -
697 break;
executed: break;
Execution Count:7
7
698 case QMetaType::QLineF: -
699 stream >> *static_cast< ::QLineF*>(data); -
700 break;
executed: break;
Execution Count:7
7
701 case QMetaType::QPoint: -
702 stream >> *static_cast< ::QPoint*>(data); -
703 break;
executed: break;
Execution Count:9
9
704 case QMetaType::QPointF: -
705 stream >> *static_cast< ::QPointF*>(data); -
706 break;
executed: break;
Execution Count:7
7
707 -
708 -
709 case QMetaType::QRegExp: -
710 stream >> *static_cast< ::QRegExp*>(data); -
711 break;
executed: break;
Execution Count:51
51
712 -
713 -
714 -
715 case QMetaType::QRegularExpression: -
716 stream >> *static_cast< ::QRegularExpression*>(data); -
717 break;
executed: break;
Execution Count:7
7
718 -
719 case QMetaType::QEasingCurve: -
720 stream >> *static_cast< ::QEasingCurve*>(data); -
721 break;
executed: break;
Execution Count:3
3
722 -
723 case QMetaType::QFont: -
724 case QMetaType::QPixmap: -
725 case QMetaType::QBrush: -
726 case QMetaType::QColor: -
727 case QMetaType::QPalette: -
728 case QMetaType::QImage: -
729 case QMetaType::QPolygon: -
730 case QMetaType::QPolygonF: -
731 case QMetaType::QRegion: -
732 case QMetaType::QBitmap: -
733 case QMetaType::QCursor: -
734 case QMetaType::QKeySequence: -
735 case QMetaType::QPen: -
736 case QMetaType::QTextLength: -
737 case QMetaType::QTextFormat: -
738 case QMetaType::QMatrix: -
739 case QMetaType::QTransform: -
740 case QMetaType::QMatrix4x4: -
741 case QMetaType::QVector2D: -
742 case QMetaType::QVector3D: -
743 case QMetaType::QVector4D: -
744 case QMetaType::QQuaternion: -
745 case QMetaType::QIcon: -
746 if (!qMetaTypeGuiHelper)
partially evaluated: !qMetaTypeGuiHelper
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:19
0-19
747 return false;
never executed: return false;
0
748 qMetaTypeGuiHelper[type - FirstGuiType].loadOp(stream, data); -
749 break;
executed: break;
Execution Count:19
19
750 case QMetaType::QSizePolicy: -
751 if (!qMetaTypeWidgetsHelper)
never evaluated: !qMetaTypeWidgetsHelper
0
752 return false;
never executed: return false;
0
753 qMetaTypeWidgetsHelper[type - FirstWidgetsType].loadOp(stream, data); -
754 break;
never executed: break;
0
755 case QMetaType::QUuid: -
756 stream >> *static_cast< ::QUuid*>(data); -
757 break;
executed: break;
Execution Count:5
5
758 default: { -
759 const QVector<QCustomTypeInfo> * const ct = customTypes(); -
760 if (!ct)
partially evaluated: !ct
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8
0-8
761 return false;
never executed: return false;
0
762 -
763 LoadOperator loadOp = 0; -
764 { -
765 QReadLocker locker(customTypesLock()); -
766 loadOp = ct->at(type - User).loadOp; -
767 } -
768 -
769 if (!loadOp)
evaluated: !loadOp
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:6
2-6
770 return false;
executed: return false;
Execution Count:2
2
771 loadOp(stream, data); -
772 break; }
executed: break;
Execution Count:6
6
773 } -
774 return true;
executed: return true;
Execution Count:12428
12428
775} -
776 -
777namespace { -
778class TypeCreator { -
779 template<typename T, bool IsAcceptedType = DefinedTypesFilter::Acceptor<T>::IsAccepted> -
780 struct CreatorImpl { -
781 static void *Create(const int , const void *copy) -
782 { -
783 -
784 -
785 return copy ? new T(*static_cast<const T*>(copy)) : new T();
executed: return copy ? new T(*static_cast<const T*>(copy)) : new T();
Execution Count:185874
185874
786 } -
787 }; -
788 template<typename T> -
789 struct CreatorImpl<T, false> { -
790 static void *Create(const int type, const void *copy) -
791 { -
792 if (QModulesPrivate::QTypeModuleInfo<T>::IsGui) {
evaluated: QModulesPrivate::QTypeModuleInfo<T>::IsGui
TRUEFALSE
yes
Evaluation Count:2918
yes
Evaluation Count:3
3-2918
793 if (__builtin_expect(!!(qMetaTypeGuiHelper), true))
evaluated: __builtin_expect(!!(qMetaTypeGuiHelper), true)
TRUEFALSE
yes
Evaluation Count:2895
yes
Evaluation Count:23
23-2895
794 return qMetaTypeGuiHelper[type - QMetaType::FirstGuiType].creator(copy);
executed: return qMetaTypeGuiHelper[type - QMetaType::FirstGuiType].creator(copy);
Execution Count:2895
2895
795 }
executed: }
Execution Count:23
23
796 if (QModulesPrivate::QTypeModuleInfo<T>::IsWidget) {
evaluated: QModulesPrivate::QTypeModuleInfo<T>::IsWidget
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:23
3-23
797 if (__builtin_expect(!!(qMetaTypeWidgetsHelper), true))
evaluated: __builtin_expect(!!(qMetaTypeWidgetsHelper), true)
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:1
1-2
798 return qMetaTypeWidgetsHelper[type - QMetaType::FirstWidgetsType].creator(copy);
executed: return qMetaTypeWidgetsHelper[type - QMetaType::FirstWidgetsType].creator(copy);
Execution Count:2
2
799 }
executed: }
Execution Count:1
1
800 -
801 -
802 return 0;
executed: return 0;
Execution Count:24
24
803 } -
804 }; -
805public: -
806 TypeCreator(const int type) -
807 : m_type(type) -
808 {}
executed: }
Execution Count:237801
237801
809 -
810 template<typename T> -
811 void *delegate(const T *copy) { return CreatorImpl<T>::Create(m_type, copy); }
executed: return CreatorImpl<T>::Create(m_type, copy);
Execution Count:188795
188795
812 void *delegate(const void*) { return 0; }
executed: return 0;
Execution Count:3
3
813 void *delegate(const QMetaTypeSwitcher::UnknownType *) { return 0; }
executed: return 0;
Execution Count:86
86
814 void *delegate(const QMetaTypeSwitcher::NotBuiltinType *copy) -
815 { -
816 QMetaType::Creator creator; -
817 const QVector<QCustomTypeInfo> * const ct = customTypes(); -
818 { -
819 QReadLocker locker(customTypesLock()); -
820 if (__builtin_expect(!!(m_type < QMetaType::User || !ct || ct->count() <= m_type - QMetaType::User), false))
partially evaluated: __builtin_expect(!!(m_type < QMetaType::User || !ct || ct->count() <= m_type - QMetaType::User), false)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:48927
0-48927
821 return 0;
never executed: return 0;
0
822 creator = ct->at(m_type - QMetaType::User).creator; -
823 } -
824 qt_noop(); -
825 return creator(copy);
executed: return creator(copy);
Execution Count:48931
48931
826 } -
827private: -
828 const int m_type; -
829}; -
830} -
831 -
832 -
833 -
834 -
835 -
836 -
837 -
838void *QMetaType::create(int type, const void *copy) -
839{ -
840 TypeCreator typeCreator(type); -
841 return QMetaTypeSwitcher::switcher<void*>(typeCreator, type, copy);
executed: return QMetaTypeSwitcher::switcher<void*>(typeCreator, type, copy);
Execution Count:237801
237801
842} -
843 -
844namespace { -
845class TypeDestroyer { -
846 template<typename T, bool IsAcceptedType = DefinedTypesFilter::Acceptor<T>::IsAccepted> -
847 struct DestroyerImpl { -
848 static void Destroy(const int , void *where) { QtMetaTypePrivate::QMetaTypeFunctionHelper<T>::Delete(where); }
executed: }
Execution Count:185778
185778
849 }; -
850 template<typename T> -
851 struct DestroyerImpl<T, false> { -
852 static void Destroy(const int type, void *where) -
853 { -
854 if (QModulesPrivate::QTypeModuleInfo<T>::IsGui) {
evaluated: QModulesPrivate::QTypeModuleInfo<T>::IsGui
TRUEFALSE
yes
Evaluation Count:2918
yes
Evaluation Count:3
3-2918
855 if (__builtin_expect(!!(qMetaTypeGuiHelper), true))
evaluated: __builtin_expect(!!(qMetaTypeGuiHelper), true)
TRUEFALSE
yes
Evaluation Count:2895
yes
Evaluation Count:23
23-2895
856 qMetaTypeGuiHelper[type - QMetaType::FirstGuiType].deleter(where);
executed: qMetaTypeGuiHelper[type - QMetaType::FirstGuiType].deleter(where);
Execution Count:2895
2895
857 return;
executed: return;
Execution Count:2918
2918
858 } -
859 if (QModulesPrivate::QTypeModuleInfo<T>::IsWidget) {
partially evaluated: QModulesPrivate::QTypeModuleInfo<T>::IsWidget
TRUEFALSE
yes
Evaluation Count:3
no
Evaluation Count:0
0-3
860 if (__builtin_expect(!!(qMetaTypeWidgetsHelper), true))
evaluated: __builtin_expect(!!(qMetaTypeWidgetsHelper), true)
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:1
1-2
861 qMetaTypeWidgetsHelper[type - QMetaType::FirstWidgetsType].deleter(where);
executed: qMetaTypeWidgetsHelper[type - QMetaType::FirstWidgetsType].deleter(where);
Execution Count:2
2
862 return;
executed: return;
Execution Count:3
3
863 } -
864 -
865 -
866 }
never executed: }
0
867 }; -
868public: -
869 TypeDestroyer(const int type) -
870 : m_type(type) -
871 {}
executed: }
Execution Count:235375
235375
872 -
873 template<typename T> -
874 void delegate(const T *where) { DestroyerImpl<T>::Destroy(m_type, const_cast<T*>(where)); }
executed: }
Execution Count:188699
188699
875 void delegate(const void *) {} -
876 void delegate(const QMetaTypeSwitcher::UnknownType*) {} -
877 void delegate(const QMetaTypeSwitcher::NotBuiltinType *where) { customTypeDestroyer(m_type, (void*)where); }
executed: }
Execution Count:46685
46685
878 -
879private: -
880 static void customTypeDestroyer(const int type, void *where) -
881 { -
882 QMetaType::Destructor deleter; -
883 const QVector<QCustomTypeInfo> * const ct = customTypes(); -
884 { -
885 QReadLocker locker(customTypesLock()); -
886 if (__builtin_expect(!!(type < QMetaType::User || !ct || ct->count() <= type - QMetaType::User), false))
evaluated: __builtin_expect(!!(type < QMetaType::User || !ct || ct->count() <= type - QMetaType::User), false)
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:46685
1-46685
887 return;
executed: return;
Execution Count:1
1
888 deleter = ct->at(type - QMetaType::User).deleter; -
889 } -
890 qt_noop(); -
891 deleter(where); -
892 }
executed: }
Execution Count:46684
46684
893 -
894 const int m_type; -
895}; -
896} -
897 -
898 -
899 -
900 -
901 -
902 -
903 -
904void QMetaType::destroy(int type, void *data) -
905{ -
906 TypeDestroyer deleter(type); -
907 QMetaTypeSwitcher::switcher<void>(deleter, type, data); -
908}
executed: }
Execution Count:235387
235387
909 -
910namespace { -
911class TypeConstructor { -
912 template<typename T, bool IsAcceptedType = DefinedTypesFilter::Acceptor<T>::IsAccepted> -
913 struct ConstructorImpl { -
914 static void *Construct(const int , void *where, const void *copy) { return QtMetaTypePrivate::QMetaTypeFunctionHelper<T>::Construct(where, copy); }
executed: return QtMetaTypePrivate::QMetaTypeFunctionHelper<T>::Construct(where, copy);
Execution Count:86
86
915 }; -
916 template<typename T> -
917 struct ConstructorImpl<T, false> { -
918 static void *Construct(const int type, void *where, const void *copy) -
919 { -
920 if (QModulesPrivate::QTypeModuleInfo<T>::IsGui)
partially evaluated: QModulesPrivate::QTypeModuleInfo<T>::IsGui
TRUEFALSE
yes
Evaluation Count:42
no
Evaluation Count:0
0-42
921 return __builtin_expect(!!(qMetaTypeGuiHelper), true) ? qMetaTypeGuiHelper[type - QMetaType::FirstGuiType].constructor(where, copy) : 0;
executed: return __builtin_expect(!!(qMetaTypeGuiHelper), true) ? qMetaTypeGuiHelper[type - QMetaType::FirstGuiType].constructor(where, copy) : 0;
Execution Count:42
42
922 -
923 if (QModulesPrivate::QTypeModuleInfo<T>::IsWidget)
never evaluated: QModulesPrivate::QTypeModuleInfo<T>::IsWidget
0
924 return __builtin_expect(!!(qMetaTypeWidgetsHelper), true) ? qMetaTypeWidgetsHelper[type - QMetaType::FirstWidgetsType].constructor(where, copy) : 0;
never executed: return __builtin_expect(!!(qMetaTypeWidgetsHelper), true) ? qMetaTypeWidgetsHelper[type - QMetaType::FirstWidgetsType].constructor(where, copy) : 0;
0
925 -
926 -
927 -
928 return 0;
never executed: return 0;
0
929 } -
930 }; -
931public: -
932 TypeConstructor(const int type, void *where) -
933 : m_type(type) -
934 , m_where(where) -
935 {}
executed: }
Execution Count:6125
6125
936 -
937 template<typename T> -
938 void *delegate(const T *copy) { return ConstructorImpl<T>::Construct(m_type, m_where, copy); }
executed: return ConstructorImpl<T>::Construct(m_type, m_where, copy);
Execution Count:128
128
939 void *delegate(const void *) { return m_where; }
never executed: return m_where;
0
940 void *delegate(const QMetaTypeSwitcher::UnknownType*) { return m_where; }
never executed: return m_where;
0
941 void *delegate(const QMetaTypeSwitcher::NotBuiltinType *copy) { return customTypeConstructor(m_type, m_where, copy); }
executed: return customTypeConstructor(m_type, m_where, copy);
Execution Count:5998
5998
942 -
943private: -
944 static void *customTypeConstructor(const int type, void *where, const void *copy) -
945 { -
946 QMetaType::Constructor ctor; -
947 const QVector<QCustomTypeInfo> * const ct = customTypes(); -
948 { -
949 QReadLocker locker(customTypesLock()); -
950 if (__builtin_expect(!!(type < QMetaType::User || !ct || ct->count() <= type - QMetaType::User), false))
partially evaluated: __builtin_expect(!!(type < QMetaType::User || !ct || ct->count() <= type - QMetaType::User), false)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5999
0-5999
951 return 0;
never executed: return 0;
0
952 ctor = ct->at(type - QMetaType::User).constructor; -
953 } -
954 qt_noop(); -
955 return ctor(where, copy);
executed: return ctor(where, copy);
Execution Count:5998
5998
956 } -
957 -
958 const int m_type; -
959 void *m_where; -
960}; -
961} -
962void *QMetaType::construct(int type, void *where, const void *copy) -
963{ -
964 if (!where)
evaluated: !where
TRUEFALSE
yes
Evaluation Count:90
yes
Evaluation Count:6126
90-6126
965 return 0;
executed: return 0;
Execution Count:90
90
966 TypeConstructor constructor(type, where); -
967 return QMetaTypeSwitcher::switcher<void*>(constructor, type, copy);
executed: return QMetaTypeSwitcher::switcher<void*>(constructor, type, copy);
Execution Count:6126
6126
968} -
969 -
970 -
971namespace { -
972class TypeDestructor { -
973 template<typename T, bool IsAcceptedType = DefinedTypesFilter::Acceptor<T>::IsAccepted> -
974 struct DestructorImpl { -
975 static void Destruct(const int , void *where) { QtMetaTypePrivate::QMetaTypeFunctionHelper<T>::Destruct(where); }
executed: }
Execution Count:86
86
976 }; -
977 template<typename T> -
978 struct DestructorImpl<T, false> { -
979 static void Destruct(const int type, void *where) -
980 { -
981 if (QModulesPrivate::QTypeModuleInfo<T>::IsGui) {
partially evaluated: QModulesPrivate::QTypeModuleInfo<T>::IsGui
TRUEFALSE
yes
Evaluation Count:42
no
Evaluation Count:0
0-42
982 if (__builtin_expect(!!(qMetaTypeGuiHelper), true))
partially evaluated: __builtin_expect(!!(qMetaTypeGuiHelper), true)
TRUEFALSE
yes
Evaluation Count:42
no
Evaluation Count:0
0-42
983 qMetaTypeGuiHelper[type - QMetaType::FirstGuiType].destructor(where);
executed: qMetaTypeGuiHelper[type - QMetaType::FirstGuiType].destructor(where);
Execution Count:42
42
984 return;
executed: return;
Execution Count:42
42
985 } -
986 if (QModulesPrivate::QTypeModuleInfo<T>::IsWidget) {
never evaluated: QModulesPrivate::QTypeModuleInfo<T>::IsWidget
0
987 if (__builtin_expect(!!(qMetaTypeWidgetsHelper), true))
never evaluated: __builtin_expect(!!(qMetaTypeWidgetsHelper), true)
0
988 qMetaTypeWidgetsHelper[type - QMetaType::FirstWidgetsType].destructor(where);
never executed: qMetaTypeWidgetsHelper[type - QMetaType::FirstWidgetsType].destructor(where);
0
989 return;
never executed: return;
0
990 } -
991 -
992 -
993 }
never executed: }
0
994 }; -
995public: -
996 TypeDestructor(const int type) -
997 : m_type(type) -
998 {}
executed: }
Execution Count:22836
22836
999 -
1000 template<typename T> -
1001 void delegate(const T *where) { DestructorImpl<T>::Destruct(m_type, const_cast<T*>(where)); }
executed: }
Execution Count:128
128
1002 void delegate(const void *) {} -
1003 void delegate(const QMetaTypeSwitcher::UnknownType*) {} -
1004 void delegate(const QMetaTypeSwitcher::NotBuiltinType *where) { customTypeDestructor(m_type, (void*)where); }
executed: }
Execution Count:22710
22710
1005 -
1006private: -
1007 static void customTypeDestructor(const int type, void *where) -
1008 { -
1009 QMetaType::Destructor dtor; -
1010 const QVector<QCustomTypeInfo> * const ct = customTypes(); -
1011 { -
1012 QReadLocker locker(customTypesLock()); -
1013 if (__builtin_expect(!!(type < QMetaType::User || !ct || ct->count() <= type - QMetaType::User), false))
partially evaluated: __builtin_expect(!!(type < QMetaType::User || !ct || ct->count() <= type - QMetaType::User), false)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:22711
0-22711
1014 return;
never executed: return;
0
1015 dtor = ct->at(type - QMetaType::User).destructor; -
1016 } -
1017 qt_noop(); -
1018 dtor(where); -
1019 }
executed: }
Execution Count:22709
22709
1020 -
1021 const int m_type; -
1022}; -
1023} -
1024void QMetaType::destruct(int type, void *where) -
1025{ -
1026 if (!where)
evaluated: !where
TRUEFALSE
yes
Evaluation Count:46
yes
Evaluation Count:22838
46-22838
1027 return;
executed: return;
Execution Count:46
46
1028 TypeDestructor destructor(type); -
1029 QMetaTypeSwitcher::switcher<void>(destructor, type, where); -
1030}
executed: }
Execution Count:22838
22838
1031 -
1032 -
1033namespace { -
1034class SizeOf { -
1035 template<typename T, bool IsAcceptedType = DefinedTypesFilter::Acceptor<T>::IsAccepted> -
1036 struct SizeOfImpl { -
1037 static int Size(const int) { return QTypeInfo<T>::sizeOf; }
executed: return QTypeInfo<T>::sizeOf;
Execution Count:89
89
1038 }; -
1039 template<typename T> -
1040 struct SizeOfImpl<T, false> { -
1041 static int Size(const int type) -
1042 { -
1043 if (QModulesPrivate::QTypeModuleInfo<T>::IsGui)
partially evaluated: QModulesPrivate::QTypeModuleInfo<T>::IsGui
TRUEFALSE
yes
Evaluation Count:63
no
Evaluation Count:0
0-63
1044 return __builtin_expect(!!(qMetaTypeGuiHelper), true) ? qMetaTypeGuiHelper[type - QMetaType::FirstGuiType].size : 0;
executed: return __builtin_expect(!!(qMetaTypeGuiHelper), true) ? qMetaTypeGuiHelper[type - QMetaType::FirstGuiType].size : 0;
Execution Count:63
63
1045 -
1046 if (QModulesPrivate::QTypeModuleInfo<T>::IsWidget)
never evaluated: QModulesPrivate::QTypeModuleInfo<T>::IsWidget
0
1047 return __builtin_expect(!!(qMetaTypeWidgetsHelper), true) ? qMetaTypeWidgetsHelper[type - QMetaType::FirstWidgetsType].size : 0;
never executed: return __builtin_expect(!!(qMetaTypeWidgetsHelper), true) ? qMetaTypeWidgetsHelper[type - QMetaType::FirstWidgetsType].size : 0;
0
1048 -
1049 -
1050 -
1051 return 0;
never executed: return 0;
0
1052 } -
1053 }; -
1054 -
1055public: -
1056 SizeOf(int type) -
1057 : m_type(type) -
1058 {}
executed: }
Execution Count:220
220
1059 -
1060 template<typename T> -
1061 int delegate(const T*) { return SizeOfImpl<T>::Size(m_type); }
executed: return SizeOfImpl<T>::Size(m_type);
Execution Count:152
152
1062 int delegate(const QMetaTypeSwitcher::UnknownType*) { return 0; }
executed: return 0;
Execution Count:3
3
1063 int delegate(const QMetaTypeSwitcher::NotBuiltinType*) { return customTypeSizeOf(m_type); }
executed: return customTypeSizeOf(m_type);
Execution Count:65
65
1064private: -
1065 static int customTypeSizeOf(const int type) -
1066 { -
1067 const QVector<QCustomTypeInfo> * const ct = customTypes(); -
1068 QReadLocker locker(customTypesLock()); -
1069 if (__builtin_expect(!!(type < QMetaType::User || !ct || ct->count() <= type - QMetaType::User), false))
evaluated: __builtin_expect(!!(type < QMetaType::User || !ct || ct->count() <= type - QMetaType::User), false)
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:64
1-64
1070 return 0;
executed: return 0;
Execution Count:1
1
1071 return ct->at(type - QMetaType::User).size;
executed: return ct->at(type - QMetaType::User).size;
Execution Count:64
64
1072 } -
1073 -
1074 const int m_type; -
1075}; -
1076} -
1077int QMetaType::sizeOf(int type) -
1078{ -
1079 SizeOf sizeOf(type); -
1080 return QMetaTypeSwitcher::switcher<int>(sizeOf, type, 0);
executed: return QMetaTypeSwitcher::switcher<int>(sizeOf, type, 0);
Execution Count:220
220
1081} -
1082 -
1083namespace { -
1084class Flags -
1085{ -
1086 template<typename T, bool IsAcceptedType = DefinedTypesFilter::Acceptor<T>::IsAccepted> -
1087 struct FlagsImpl -
1088 { -
1089 static quint32 Flags(const int ) -
1090 { -
1091 return QtPrivate::QMetaTypeTypeFlags<T>::Flags;
executed: return QtPrivate::QMetaTypeTypeFlags<T>::Flags;
Execution Count:491
491
1092 } -
1093 }; -
1094 template<typename T> -
1095 struct FlagsImpl<T, false> -
1096 { -
1097 static quint32 Flags(const int type) -
1098 { -
1099 if (QModulesPrivate::QTypeModuleInfo<T>::IsGui)
evaluated: QModulesPrivate::QTypeModuleInfo<T>::IsGui
TRUEFALSE
yes
Evaluation Count:163
yes
Evaluation Count:1
1-163
1100 return __builtin_expect(!!(qMetaTypeGuiHelper), true) ? qMetaTypeGuiHelper[type - QMetaType::FirstGuiType].flags : 0;
executed: return __builtin_expect(!!(qMetaTypeGuiHelper), true) ? qMetaTypeGuiHelper[type - QMetaType::FirstGuiType].flags : 0;
Execution Count:163
163
1101 -
1102 if (QModulesPrivate::QTypeModuleInfo<T>::IsWidget)
partially evaluated: QModulesPrivate::QTypeModuleInfo<T>::IsWidget
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
1103 return __builtin_expect(!!(qMetaTypeWidgetsHelper), true) ? qMetaTypeWidgetsHelper[type - QMetaType::FirstWidgetsType].flags : 0;
executed: return __builtin_expect(!!(qMetaTypeWidgetsHelper), true) ? qMetaTypeWidgetsHelper[type - QMetaType::FirstWidgetsType].flags : 0;
Execution Count:1
1
1104 -
1105 -
1106 -
1107 return 0;
never executed: return 0;
0
1108 } -
1109 }; -
1110public: -
1111 Flags(const int type) -
1112 : m_type(type) -
1113 {}
executed: }
Execution Count:4987
4987
1114 template<typename T> -
1115 quint32 delegate(const T*) { return FlagsImpl<T>::Flags(m_type); }
executed: return FlagsImpl<T>::Flags(m_type);
Execution Count:655
655
1116 quint32 delegate(const void*) { return 0; }
executed: return 0;
Execution Count:1
1
1117 quint32 delegate(const QMetaTypeSwitcher::UnknownType*) { return 0; }
executed: return 0;
Execution Count:14
14
1118 quint32 delegate(const QMetaTypeSwitcher::NotBuiltinType*) { return customTypeFlags(m_type); }
executed: return customTypeFlags(m_type);
Execution Count:4317
4317
1119private: -
1120 const int m_type; -
1121 static quint32 customTypeFlags(const int type) -
1122 { -
1123 const QVector<QCustomTypeInfo> * const ct = customTypes(); -
1124 if (__builtin_expect(!!(!ct || type < QMetaType::User), false))
partially evaluated: __builtin_expect(!!(!ct || type < QMetaType::User), false)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4317
0-4317
1125 return 0;
never executed: return 0;
0
1126 QReadLocker locker(customTypesLock()); -
1127 if (__builtin_expect(!!(ct->count() <= type - QMetaType::User), false))
evaluated: __builtin_expect(!!(ct->count() <= type - QMetaType::User), false)
TRUEFALSE
yes
Evaluation Count:5
yes
Evaluation Count:4312
5-4312
1128 return 0;
executed: return 0;
Execution Count:5
5
1129 return ct->at(type - QMetaType::User).flags;
executed: return ct->at(type - QMetaType::User).flags;
Execution Count:4312
4312
1130 } -
1131}; -
1132} -
1133QMetaType::TypeFlags QMetaType::typeFlags(int type) -
1134{ -
1135 Flags flags(type); -
1136 return static_cast<QMetaType::TypeFlags>(QMetaTypeSwitcher::switcher<quint32>(flags, type, 0));
executed: return static_cast<QMetaType::TypeFlags>(QMetaTypeSwitcher::switcher<quint32>(flags, type, 0));
Execution Count:4987
4987
1137} -
1138 -
1139 -
1140namespace { -
1141class MetaObject -
1142{ -
1143public: -
1144 MetaObject(const int type) -
1145 : m_type(type) -
1146 {}
executed: }
Execution Count:7
7
1147 template<typename T> -
1148 const QMetaObject *delegate(const T*) { return QtPrivate::MetaObjectForType<T>::value(); }
executed: return QtPrivate::MetaObjectForType<T>::value();
Execution Count:2
2
1149 const QMetaObject *delegate(const void*) { return 0; }
never executed: return 0;
0
1150 const QMetaObject *delegate(const QMetaTypeSwitcher::UnknownType*) { return 0; }
never executed: return 0;
0
1151 const QMetaObject *delegate(const QMetaTypeSwitcher::NotBuiltinType*) { return customMetaObject(m_type); }
executed: return customMetaObject(m_type);
Execution Count:5
5
1152private: -
1153 const int m_type; -
1154 static const QMetaObject *customMetaObject(const int type) -
1155 { -
1156 const QVector<QCustomTypeInfo> * const ct = customTypes(); -
1157 if (__builtin_expect(!!(!ct || type < QMetaType::User), false))
partially evaluated: __builtin_expect(!!(!ct || type < QMetaType::User), false)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5
0-5
1158 return 0;
never executed: return 0;
0
1159 QReadLocker locker(customTypesLock()); -
1160 if (__builtin_expect(!!(ct->count() <= type - QMetaType::User), false))
partially evaluated: __builtin_expect(!!(ct->count() <= type - QMetaType::User), false)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5
0-5
1161 return 0;
never executed: return 0;
0
1162 return ct->at(type - QMetaType::User).metaObject;
executed: return ct->at(type - QMetaType::User).metaObject;
Execution Count:5
5
1163 } -
1164}; -
1165} -
1166 -
1167 -
1168 -
1169 -
1170 -
1171 -
1172 -
1173const QMetaObject *QMetaType::metaObjectForType(int type) -
1174{ -
1175 -
1176 MetaObject mo(type); -
1177 return QMetaTypeSwitcher::switcher<const QMetaObject*>(mo, type, 0);
executed: return QMetaTypeSwitcher::switcher<const QMetaObject*>(mo, type, 0);
Execution Count:7
7
1178 -
1179 -
1180 -
1181 -
1182} -
1183namespace { -
1184class TypeInfo { -
1185 template<typename T, bool IsAcceptedType = DefinedTypesFilter::Acceptor<T>::IsAccepted> -
1186 struct TypeInfoImpl -
1187 { -
1188 TypeInfoImpl(const uint , QMetaTypeInterface &info) -
1189 { -
1190 QMetaTypeInterface tmp = { (QtMetaTypePrivate::QMetaTypeFunctionHelper<T, QtMetaTypePrivate::TypeDefinition<T>::IsAvailable>::Create), (QtMetaTypePrivate::QMetaTypeFunctionHelper<T, QtMetaTypePrivate::TypeDefinition<T>::IsAvailable>::Delete), 0, 0, (QtMetaTypePrivate::QMetaTypeFunctionHelper<T, QtMetaTypePrivate::TypeDefinition<T>::IsAvailable>::Construct), (QtMetaTypePrivate::QMetaTypeFunctionHelper<T, QtMetaTypePrivate::TypeDefinition<T>::IsAvailable>::Destruct), (QTypeInfo<T>::sizeOf), QtPrivate::QMetaTypeTypeFlags<T>::Flags, (QtPrivate::MetaObjectForType<T>::value()) }; -
1191 info = tmp; -
1192 }
executed: }
Execution Count:282
282
1193 }; -
1194 -
1195 template<typename T> -
1196 struct TypeInfoImpl<T, false> -
1197 { -
1198 TypeInfoImpl(const uint type, QMetaTypeInterface &info) -
1199 { -
1200 if (QModulesPrivate::QTypeModuleInfo<T>::IsGui) {
never evaluated: QModulesPrivate::QTypeModuleInfo<T>::IsGui
0
1201 if (__builtin_expect(!!(qMetaTypeGuiHelper), true))
never evaluated: __builtin_expect(!!(qMetaTypeGuiHelper), true)
0
1202 info = qMetaTypeGuiHelper[type - QMetaType::FirstGuiType];
never executed: info = qMetaTypeGuiHelper[type - QMetaType::FirstGuiType];
0
1203 return;
never executed: return;
0
1204 } -
1205 if (QModulesPrivate::QTypeModuleInfo<T>::IsWidget) {
never evaluated: QModulesPrivate::QTypeModuleInfo<T>::IsWidget
0
1206 if (__builtin_expect(!!(qMetaTypeWidgetsHelper), true))
never evaluated: __builtin_expect(!!(qMetaTypeWidgetsHelper), true)
0
1207 info = qMetaTypeWidgetsHelper[type - QMetaType::FirstWidgetsType];
never executed: info = qMetaTypeWidgetsHelper[type - QMetaType::FirstWidgetsType];
0
1208 return;
never executed: return;
0
1209 } -
1210 }
never executed: }
0
1211 }; -
1212public: -
1213 QMetaTypeInterface info; -
1214 TypeInfo(const uint type) -
1215 : m_type(type) -
1216 { -
1217 QMetaTypeInterface tmp = { 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -
1218 info = tmp; -
1219 }
executed: }
Execution Count:19705
19705
1220 template<typename T> -
1221 void delegate(const T*) { TypeInfoImpl<T>(m_type, info); }
executed: }
Execution Count:282
282
1222 void delegate(const QMetaTypeSwitcher::UnknownType*) {} -
1223 void delegate(const QMetaTypeSwitcher::NotBuiltinType*) { customTypeInfo(m_type); }
executed: }
Execution Count:19409
19409
1224private: -
1225 void customTypeInfo(const uint type) -
1226 { -
1227 const QVector<QCustomTypeInfo> * const ct = customTypes(); -
1228 if (__builtin_expect(!!(!ct), false))
partially evaluated: __builtin_expect(!!(!ct), false)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:19409
0-19409
1229 return;
never executed: return;
0
1230 QReadLocker locker(customTypesLock()); -
1231 if (__builtin_expect(!!(uint(ct->count()) > type - QMetaType::User), true))
evaluated: __builtin_expect(!!(uint(ct->count()) > type - QMetaType::User), true)
TRUEFALSE
yes
Evaluation Count:19378
yes
Evaluation Count:31
31-19378
1232 info = ct->at(type - QMetaType::User);
executed: info = ct->at(type - QMetaType::User);
Execution Count:19377
19377
1233 }
executed: }
Execution Count:19408
19408
1234 -
1235 const uint m_type; -
1236}; -
1237} -
1238 -
1239 -
1240 -
1241 -
1242 -
1243QMetaType QMetaType::typeInfo(const int type) -
1244{ -
1245 TypeInfo typeInfo(type); -
1246 QMetaTypeSwitcher::switcher<void>(typeInfo, type, 0); -
1247 return typeInfo.info.creator ? QMetaType(QMetaType::NoExtensionFlags 19705
1248 , static_cast<const QMetaTypeInterface *>(0) 19705
1249 , typeInfo.info.creator 19705
1250 , typeInfo.info.deleter 19705
1251 , typeInfo.info.saveOp 19705
1252 , typeInfo.info.loadOp 19705
1253 , typeInfo.info.constructor 19705
1254 , typeInfo.info.destructor 19705
1255 , typeInfo.info.size 19705
1256 , typeInfo.info.flags 19705
1257 , type 19705
1258 , typeInfo.info.metaObject) 19705
1259 : QMetaType(UnknownType);
executed: return typeInfo.info.creator ? QMetaType(QMetaType::NoExtensionFlags , static_cast<const QMetaTypeInterface *>(0) , typeInfo.info.creator , typeInfo.info.deleter , typeInfo.info.saveOp , typeInfo.info.loadOp , typeInfo.info.constructor , typeInfo.info.destructor , typeInfo.info.size , typeInfo.info.flags , type , typeInfo.info.metaObject) : QMetaType(UnknownType);
Execution Count:19705
19705
1260} -
1261 -
1262 -
1263 -
1264 -
1265 -
1266 -
1267 -
1268QMetaType::QMetaType(const int typeId) -
1269 : m_typeId(typeId) -
1270{ -
1271 if (__builtin_expect(!!(typeId == UnknownType), false)) {
evaluated: __builtin_expect(!!(typeId == UnknownType), false)
TRUEFALSE
yes
Evaluation Count:47
yes
Evaluation Count:19705
47-19705
1272 -
1273 m_extensionFlags = 0xffffffff; -
1274 qt_noop(); -
1275 } else {
executed: }
Execution Count:47
47
1276 -
1277 *this = QMetaType::typeInfo(typeId); -
1278 if (m_typeId == UnknownType)
evaluated: m_typeId == UnknownType
TRUEFALSE
yes
Evaluation Count:45
yes
Evaluation Count:19660
45-19660
1279 m_extensionFlags = 0xffffffff;
executed: m_extensionFlags = 0xffffffff;
Execution Count:45
45
1280 else if (m_typeId == QMetaType::Void)
evaluated: m_typeId == QMetaType::Void
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:19658
2-19658
1281 m_extensionFlags = CreateEx | DestroyEx | ConstructEx | DestructEx;
executed: m_extensionFlags = CreateEx | DestroyEx | ConstructEx | DestructEx;
Execution Count:2
2
1282 } -
1283} -
1284 -
1285 -
1286 -
1287 -
1288 -
1289 -
1290 -
1291QMetaType::QMetaType(const QMetaType &other) -
1292 : m_creator(other.m_creator) -
1293 , m_deleter(other.m_deleter) -
1294 , m_saveOp(other.m_saveOp) -
1295 , m_loadOp(other.m_loadOp) -
1296 , m_constructor(other.m_constructor) -
1297 , m_destructor(other.m_destructor) -
1298 , m_extension(other.m_extension) -
1299 , m_size(other.m_size) -
1300 , m_typeFlags(other.m_typeFlags) -
1301 , m_extensionFlags(other.m_extensionFlags) -
1302 , m_typeId(other.m_typeId) -
1303 , m_metaObject(other.m_metaObject) -
1304{}
never executed: }
0
1305 -
1306QMetaType &QMetaType::operator =(const QMetaType &other) -
1307{ -
1308 m_creator = other.m_creator; -
1309 m_deleter = other.m_deleter; -
1310 m_saveOp = other.m_saveOp; -
1311 m_loadOp = other.m_loadOp; -
1312 m_constructor = other.m_constructor; -
1313 m_destructor = other.m_destructor; -
1314 m_size = other.m_size; -
1315 m_typeFlags = other.m_typeFlags; -
1316 m_extensionFlags = other.m_extensionFlags; -
1317 m_extension = other.m_extension; -
1318 m_typeId = other.m_typeId; -
1319 m_metaObject = other.m_metaObject; -
1320 return *this;
executed: return *this;
Execution Count:19705
19705
1321} -
1322void QMetaType::ctor(const QMetaTypeInterface *info) -
1323{ -
1324 -
1325 -
1326 -
1327 qt_noop(); -
1328 (void)info;; -
1329 m_extensionFlags = CreateEx | DestroyEx | ConstructEx | DestructEx; -
1330}
executed: }
Execution Count:2
2
1331void QMetaType::dtor() -
1332{} -
1333void *QMetaType::createExtended(const void *copy) const -
1334{ -
1335 (void)copy;; -
1336 return 0;
never executed: return 0;
0
1337} -
1338void QMetaType::destroyExtended(void *data) const -
1339{ -
1340 (void)data;; -
1341}
never executed: }
0
1342void *QMetaType::constructExtended(void *where, const void *copy) const -
1343{ -
1344 (void)where;; -
1345 (void)copy;; -
1346 return 0;
never executed: return 0;
0
1347} -
1348void QMetaType::destructExtended(void *data) const -
1349{ -
1350 (void)data;; -
1351}
never executed: }
0
1352uint QMetaType::sizeExtended() const -
1353{ -
1354 return 0;
executed: return 0;
Execution Count:18
18
1355} -
1356QMetaType::TypeFlags QMetaType::flagsExtended() const -
1357{ -
1358 return 0;
executed: return 0;
Execution Count:3
3
1359} -
1360const QMetaObject *QMetaType::metaObjectExtended() const -
1361{ -
1362 return 0;
never executed: return 0;
0
1363} -
1364 -
1365 -
1366namespace QtPrivate -
1367{ -
1368const QMetaObject *metaObjectForQWidget() -
1369{ -
1370 if (!qMetaTypeWidgetsHelper)
never evaluated: !qMetaTypeWidgetsHelper
0
1371 return 0;
never executed: return 0;
0
1372 return qMetaObjectWidgetsHelper;
never executed: return qMetaObjectWidgetsHelper;
0
1373} -
1374} -
1375 -
1376 -
1377 -
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial