qmetaobject.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/corelib/kernel/qmetaobject.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9static inline const QMetaObjectPrivate *priv(const uint* data)-
10{ return reinterpret_cast<const QMetaObjectPrivate*>(data); }-
11-
12static inline const QByteArray stringData(const QMetaObject *mo, int index)-
13{-
14 ((!(priv(mo->d.data)->revision >= 7)) ? qt_assert("priv(mo->d.data)->revision >= 7",__FILE__,144150) : qt_noop());-
15 const QByteArrayDataPtr data = { const_cast<QByteArrayData*>(&mo->d.stringdata[index]) };-
16 ((!(data.ptr->ref.isStatic())) ? qt_assert("data.ptr->ref.isStatic()",__FILE__,146152) : qt_noop());-
17 ((!(data.ptr->alloc == 0)) ? qt_assert("data.ptr->alloc == 0",__FILE__,147153) : qt_noop());-
18 ((!(data.ptr->capacityReserved == 0)) ? qt_assert("data.ptr->capacityReserved == 0",__FILE__,148154) : qt_noop());-
19 ((!(data.ptr->size >= 0)) ? qt_assert("data.ptr->size >= 0",__FILE__,149155) : qt_noop());-
20 return data;-
21}-
22-
23static inline const char *rawStringData(const QMetaObject *mo, int index)-
24{-
25 return stringData(mo, index).data();-
26}-
27-
28static inline QByteArray typeNameFromTypeInfo(const QMetaObject *mo, uint typeInfo)-
29{-
30 if (typeInfo & IsUnresolvedType) {-
31 return stringData(mo, typeInfo & TypeNameIndexMask);-
32 } else {-
33-
34 const char *t = QMetaType::typeName(typeInfo);-
35 return QByteArray::fromRawData(t, qstrlen(t));-
36 }-
37}-
38-
39static inline const char *rawTypeNameFromTypeInfo(const QMetaObject *mo, uint typeInfo)-
40{-
41 return typeNameFromTypeInfo(mo, typeInfo).constData();-
42}-
43-
44static inline int typeFromTypeInfo(const QMetaObject *mo, uint typeInfo)-
45{-
46 if (!(typeInfo & IsUnresolvedType))-
47 return typeInfo;-
48 return QMetaType::type(stringData(mo, typeInfo & TypeNameIndexMask));-
49}-
50-
51class QMetaMethodPrivate : public QMetaMethod-
52{-
53public:-
54 static const QMetaMethodPrivate *get(const QMetaMethod *q)-
55 { return static_cast<const QMetaMethodPrivate *>(q); }-
56-
57 inline QByteArray signature() const;-
58 inline QByteArray name() const;-
59 inline int typesDataIndex() const;-
60 inline const char *rawReturnTypeName() const;-
61 inline int returnType() const;-
62 inline int parameterCount() const;-
63 inline int parametersDataIndex() const;-
64 inline uint parameterTypeInfo(int index) const;-
65 inline int parameterType(int index) const;-
66 inline void getParameterTypes(int *types) const;-
67 inline QList<QByteArray> parameterTypes() const;-
68 inline QList<QByteArray> parameterNames() const;-
69 inline QByteArray tag() const;-
70 inline int ownMethodIndex() const;-
71-
72private:-
73 QMetaMethodPrivate();-
74};-
75QObject *QMetaObject::newInstance(QGenericArgument val0,-
76 QGenericArgument val1,-
77 QGenericArgument val2,-
78 QGenericArgument val3,-
79 QGenericArgument val4,-
80 QGenericArgument val5,-
81 QGenericArgument val6,-
82 QGenericArgument val7,-
83 QGenericArgument val8,-
84 QGenericArgument val9) const-
85{-
86 QByteArray constructorName = className();-
87 {-
88 int idx = constructorName.lastIndexOf(':');-
89 if (idx != -1)-
90 constructorName.remove(0, idx+1);-
91 }-
92 QVarLengthArray<char, 512> sig;-
93 sig.append(constructorName.constData(), constructorName.length());-
94 sig.append('(');-
95-
96 enum { MaximumParamCount = 10 };-
97 const char *typeNames[] = {val0.name(), val1.name(), val2.name(), val3.name(), val4.name(),-
98 val5.name(), val6.name(), val7.name(), val8.name(), val9.name()};-
99-
100 int paramCount;-
101 for (paramCount = 0; paramCount < MaximumParamCount; ++paramCount) {-
102 int len = qstrlen(typeNames[paramCount]);-
103 if (len <= 0)-
104 break;-
105 sig.append(typeNames[paramCount], len);-
106 sig.append(',');-
107 }-
108 if (paramCount == 0)-
109 sig.append(')');-
110 else-
111 sig[sig.size() - 1] = ')';-
112 sig.append('\0');-
113-
114 int idx = indexOfConstructor(sig.constData());-
115 if (idx < 0) {-
116 QByteArray norm = QMetaObject::normalizedSignature(sig.constData());-
117 idx = indexOfConstructor(norm.constData());-
118 }-
119 if (idx < 0)-
120 return 0;-
121-
122 QObject *returnValue = 0;-
123 void *param[] = {&returnValue, val0.data(), val1.data(), val2.data(), val3.data(), val4.data(),-
124 val5.data(), val6.data(), val7.data(), val8.data(), val9.data()};-
125-
126 if (static_metacall(CreateInstance, idx, param) >= 0)-
127 return 0;-
128 return returnValue;-
129}-
130-
131-
132-
133-
134int QMetaObject::static_metacall(Call cl, int idx, void **argv) const-
135{-
136 ((!(priv(d.data)->revision >= 6)) ? qt_assert("priv(d.data)->revision >= 6",__FILE__,280286) : qt_noop());-
137 if (!d.static_metacall)-
138 return 0;-
139 d.static_metacall(0, cl, idx, argv);-
140 return -1;-
141}-
142-
143-
144-
145-
146int QMetaObject::metacall(QObject *object, Call cl, int idx, void **argv)-
147{-
148 if (object->d_ptr->metaObject)-
149 return object->d_ptr->metaObject->metaCall(object, cl, idx, argv);-
150 else-
151 return object->qt_metacall(cl, idx, argv);-
152}-
153-
154static inline const char *objectClassName(const QMetaObject *m)-
155{-
156 return rawStringData(m, priv(m->d.data)->className);-
157}-
158-
159-
160-
161-
162-
163-
164const char *QMetaObject::className() const-
165{-
166 return objectClassName(this);-
167}-
QObject *bool QMetaObject::castinherits(QObjectconst QMetaObject *objmetaObject) const {
if (obj)noexcept
169{-
170 const QMetaObject *m = obj->metaObject();this;-
171 do {-
172 if (mmetaObject
metaObject == mDescription
TRUEevaluated 10998745 times by 545 tests
Evaluated by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSocket
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • ...
FALSEevaluated 11516969 times by 264 tests
Evaluated by:
  • tst_Gestures
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • ...
== thism
metaObject == mDescription
TRUEevaluated 10998745 times by 545 tests
Evaluated by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSocket
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • ...
FALSEevaluated 11516969 times by 264 tests
Evaluated by:
  • tst_Gestures
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • ...
)
10998745-11516969
173 return
executed 10998745 times by 545 tests: return true;
Executed by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSocket
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • ...
objtrue;
executed 10998745 times by 545 tests: return true;
Executed by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSocket
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • ...
10998745
174 }
executed 11516969 times by 264 tests: end of block
Executed by:
  • tst_Gestures
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • ...
while ((
(m = m->d.superdata)Description
TRUEevaluated 10480169 times by 264 tests
Evaluated by:
  • tst_Gestures
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • ...
FALSEevaluated 1036800 times by 215 tests
Evaluated by:
  • tst_Gestures
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QClipboard
  • tst_QColorDialog
  • tst_QColumnView
  • ...
m = m->d.superdata)
(m = m->d.superdata)Description
TRUEevaluated 10480169 times by 264 tests
Evaluated by:
  • tst_Gestures
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • ...
FALSEevaluated 1036800 times by 215 tests
Evaluated by:
  • tst_Gestures
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QClipboard
  • tst_QColorDialog
  • tst_QColumnView
  • ...
);
1036800-11516969
175 }return
executed 1036800 times by 215 tests: return false;
Executed by:
  • tst_Gestures
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QClipboard
  • tst_QColorDialog
  • tst_QColumnView
  • ...
0false;
executed 1036800 times by 215 tests: return false;
Executed by:
  • tst_Gestures
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QClipboard
  • tst_QColorDialog
  • tst_QColumnView
  • ...
1036800
176}-
177-
178-
179-
180-
181-
182-
183-
constQObject *QMetaObject::cast(constQObject *obj) const
185{-
186-
187 ifreturn
executed 12063925 times by 655 tests: return const_cast<QObject*>(cast(const_cast<const QObject*>(obj)));
Executed by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSocket
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • ...
executed 12063925 times by 655 tests: return const_cast<QObject*>(cast(const_cast<const QObject*>(obj)));
Executed by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSocket
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • ...
const_cast<QObject*>(cast(const_cast<const QObject*>(obj) {)));
executed 12063925 times by 655 tests: return const_cast<QObject*>(cast(const_cast<const QObject*>(obj)));
Executed by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSocket
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • ...
12063925
188}-
189-
190-
191-
192-
193-
194-
195-
196const QObject *QMetaObject::cast(const QObject *m =obj) const-
197{-
198 return
executed 12338177 times by 655 tests: return (obj && obj->metaObject()->inherits(this)) ? obj : nullptr;
Executed by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSocket
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • ...
(obj &&
executed 12338177 times by 655 tests: return (obj && obj->metaObject()->inherits(this)) ? obj : nullptr;
Executed by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSocket
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • ...
executed 12338177 times by 655 tests: return (obj && obj->metaObject()->inherits(this)) ? obj : nullptr;
Executed by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSocket
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • ...
obj->metaObject();
executed 12338177 times by 655 tests: return (obj && obj->metaObject()->inherits(this)) ? obj : nullptr;
Executed by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSocket
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • ...
12338177
do {
executed 12338177 times by 655 tests: return (obj && obj->metaObject()->inherits(this)) ? obj : nullptr;
Executed by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSocket
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • ...
if
executed 12338177 times by 655 tests: return (obj && obj->metaObject()->inherits(this)) ? obj : nullptr;
Executed by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSocket
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • ...
executed 12338177 times by 655 tests: return (obj && obj->metaObject()->inherits(this)) ? obj : nullptr;
Executed by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSocket
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • ...
()->inherits(m ==this)
executed 12338177 times by 655 tests: return (obj && obj->metaObject()->inherits(this)) ? obj : nullptr;
Executed by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSocket
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • ...
return
executed 12338177 times by 655 tests: return (obj && obj->metaObject()->inherits(this)) ? obj : nullptr;
Executed by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSocket
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • ...
executed 12338177 times by 655 tests: return (obj && obj->metaObject()->inherits(this)) ? obj : nullptr;
Executed by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSocket
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • ...
)) ? obj ;
executed 12338177 times by 655 tests: return (obj && obj->metaObject()->inherits(this)) ? obj : nullptr;
Executed by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSocket
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • ...
} while ((m = m->d.superdata));
executed 12338177 times by 655 tests: return (obj && obj->metaObject()->inherits(this)) ? obj : nullptr;
Executed by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSocket
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • ...
}
executed 12338177 times by 655 tests: return (obj && obj->metaObject()->inherits(this)) ? obj : nullptr;
Executed by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSocket
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • ...
return 0
executed 12338177 times by 655 tests: return (obj && obj->metaObject()->inherits(this)) ? obj : nullptr;
Executed by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSocket
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • ...
executed 12338177 times by 655 tests: return (obj && obj->metaObject()->inherits(this)) ? obj : nullptr;
Executed by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSocket
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • ...
: nullptr;
executed 12338177 times by 655 tests: return (obj && obj->metaObject()->inherits(this)) ? obj : nullptr;
Executed by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSocket
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • ...
199}-
200-
201-
202-
203-
204-
205QString QMetaObject::tr(const char *s, const char *c, int n) const-
206{-
207 return QCoreApplication::translate(objectClassName(this), s, c, n);-
208}-
209int QMetaObject::methodOffset() const-
210{-
211 int offset = 0;-
212 const QMetaObject *m = d.superdata;-
213 while (m) {-
214 offset += priv(m->d.data)->methodCount;-
215 m = m->d.superdata;-
216 }-
217 return offset;-
218}-
219int QMetaObject::enumeratorOffset() const-
220{-
221 int offset = 0;-
222 const QMetaObject *m = d.superdata;-
223 while (m) {-
224 offset += priv(m->d.data)->enumeratorCount;-
225 m = m->d.superdata;-
226 }-
227 return offset;-
228}-
229int QMetaObject::propertyOffset() const-
230{-
231 int offset = 0;-
232 const QMetaObject *m = d.superdata;-
233 while (m) {-
234 offset += priv(m->d.data)->propertyCount;-
235 m = m->d.superdata;-
236 }-
237 return offset;-
238}-
239int QMetaObject::classInfoOffset() const-
240{-
241 int offset = 0;-
242 const QMetaObject *m = d.superdata;-
243 while (m) {-
244 offset += priv(m->d.data)->classInfoCount;-
245 m = m->d.superdata;-
246 }-
247 return offset;-
248}-
249int QMetaObject::constructorCount() const-
250{-
251 ((!(priv(d.data)->revision >= 2)) ? qt_assert("priv(d.data)->revision >= 2",__FILE__,462473) : qt_noop());-
252 return priv(d.data)->constructorCount;-
253}-
254int QMetaObject::methodCount() const-
255{-
256 int n = priv(d.data)->methodCount;-
257 const QMetaObject *m = d.superdata;-
258 while (m) {-
259 n += priv(m->d.data)->methodCount;-
260 m = m->d.superdata;-
261 }-
262 return n;-
263}-
264-
265-
266-
267-
268-
269-
270int QMetaObject::enumeratorCount() const-
271{-
272 int n = priv(d.data)->enumeratorCount;-
273 const QMetaObject *m = d.superdata;-
274 while (m) {-
275 n += priv(m->d.data)->enumeratorCount;-
276 m = m->d.superdata;-
277 }-
278 return n;-
279}-
280int QMetaObject::propertyCount() const-
281{-
282 int n = priv(d.data)->propertyCount;-
283 const QMetaObject *m = d.superdata;-
284 while (m) {-
285 n += priv(m->d.data)->propertyCount;-
286 m = m->d.superdata;-
287 }-
288 return n;-
289}-
290-
291-
292-
293-
294-
295-
296int QMetaObject::classInfoCount() const-
297{-
298 int n = priv(d.data)->classInfoCount;-
299 const QMetaObject *m = d.superdata;-
300 while (m) {-
301 n += priv(m->d.data)->classInfoCount;-
302 m = m->d.superdata;-
303 }-
304 return n;-
305}-
306-
307-
308-
309-
310static bool methodMatch(const QMetaObject *m, int handle,-
311 const QByteArray &name, int argc,-
312 const QArgumentType *types)-
313{-
314 ((!(priv(m->d.data)->revision >= 7)) ? qt_assert("priv(m->d.data)->revision >= 7",__FILE__,550561) : qt_noop());-
315 if (int(m->d.data[handle + 1]) != argc)-
316 return false;-
317-
318 if (stringData(m, m->d.data[handle]) != name)-
319 return false;-
320-
321 int paramsIndex = m->d.data[handle + 2] + 1;-
322 for (int i = 0; i < argc; ++i) {-
323 uint typeInfo = m->d.data[paramsIndex + i];-
324 if (types[i].type()) {-
325 if (types[i].type() != typeFromTypeInfo(m, typeInfo))-
326 return false;-
327 } else {-
328 if (types[i].name() != typeNameFromTypeInfo(m, typeInfo))-
329 return false;-
330 }-
331 }-
332-
333 return true;-
334}-
335-
336-
337-
338-
339-
340-
341-
342template<int MethodType>-
343static inline int indexOfMethodRelative(const QMetaObject **baseObject,-
344 const QByteArray &name, int argc,-
345 const QArgumentType *types)-
346{-
347 for (const QMetaObject *m = *baseObject; m; m = m->d.superdata) {-
348 ((!(priv(m->d.data)->revision >= 7)) ? qt_assert("priv(m->d.data)->revision >= 7",__FILE__,584595) : qt_noop());-
349 int i = (MethodType == MethodSignal)-
350 ? (priv(m->d.data)->signalCount - 1) : (priv(m->d.data)->methodCount - 1);-
351 const int end = (MethodType == MethodSlot)-
352 ? (priv(m->d.data)->signalCount) : 0;-
353-
354 for (; i >= end; --i) {-
355 int handle = priv(m->d.data)->methodData + 5*i;-
356 if (methodMatch(m, handle, name, argc, types)) {-
357 *baseObject = m;-
358 return i;-
359 }-
360 }-
361 }-
362 return -1;-
363}-
364int QMetaObject::indexOfConstructor(const char *constructor) const-
365{-
366 ((!(priv(d.data)->revision >= 7)) ? qt_assert("priv(d.data)->revision >= 7",__FILE__,614625) : qt_noop());-
367 QArgumentTypeArray types;-
368 QByteArray name = QMetaObjectPrivate::decodeMethodSignature(constructor, types);-
369 return QMetaObjectPrivate::indexOfConstructor(this, name, types.size(), types.constData());-
370}-
371int QMetaObject::indexOfMethod(const char *method) const-
372{-
373 const QMetaObject *m = this;-
374 int i;-
375 ((!(priv(m->d.data)->revision >= 7)) ? qt_assert("priv(m->d.data)->revision >= 7",__FILE__,632643) : qt_noop());-
376 QArgumentTypeArray types;-
377 QByteArray name = QMetaObjectPrivate::decodeMethodSignature(method, types);-
378 i = indexOfMethodRelative<0>(&m, name, types.size(), types.constData());-
379 if (i >= 0)-
380 i += m->methodOffset();-
381 return i;-
382}-
383-
384-
385-
386static void argumentTypesFromString(const char *str, const char *end,-
387 QArgumentTypeArray &types)-
388{-
389 ((!(str <= end)) ? qt_assert("str <= end",__FILE__,646657) : qt_noop());-
390 while (str != end) {-
391 if (!types.isEmpty())-
392 ++str;-
393 const char *begin = str;-
394 int level = 0;-
395 while (str != end && (level > 0 || *str != ',')) {-
396 if (*str == '<')-
397 ++level;-
398 else if (*str == '>')-
399 --level;-
400 ++str;-
401 }-
402 types += QArgumentType(QByteArray(begin, str - begin));-
403 }-
404}-
405-
406-
407-
408QByteArray QMetaObjectPrivate::decodeMethodSignature(-
409 const char *signature, QArgumentTypeArray &types)-
410{-
411 ((!(signature != 0)) ? qt_assert("signature != 0",__FILE__,668679) : qt_noop());-
412 const char *lparens = strchr(signature, '(');-
413 if (!lparens)-
414 return QByteArray();-
415 const char *rparens = strrchr(lparens + 1, ')');-
416 if (!rparens || *(rparens+1))-
417 return QByteArray();-
418 int nameLength = lparens - signature;-
419 argumentTypesFromString(lparens + 1, rparens, types);-
420 return QByteArray::fromRawData(signature, nameLength);-
421}-
422int QMetaObject::indexOfSignal(const char *signal) const-
423{-
424 const QMetaObject *m = this;-
425 int i;-
426 ((!(priv(m->d.data)->revision >= 7)) ? qt_assert("priv(m->d.data)->revision >= 7",__FILE__,695706) : qt_noop());-
427 QArgumentTypeArray types;-
428 QByteArray name = QMetaObjectPrivate::decodeMethodSignature(signal, types);-
429 i = QMetaObjectPrivate::indexOfSignalRelative(&m, name, types.size(), types.constData());-
430 if (i >= 0)-
431 i += m->methodOffset();-
432 return i;-
433}-
434-
435-
436-
437-
438-
439-
440-
441int QMetaObjectPrivate::indexOfSignalRelative(const QMetaObject **baseObject,-
442 const QByteArray &name, int argc,-
443 const QArgumentType *types)-
444{-
445 int i = indexOfMethodRelative<MethodSignal>(baseObject, name, argc, types);-
446-
447 const QMetaObject *m = *baseObject;-
448 if (i >= 0 && m && m->d.superdata) {-
449 int conflict = indexOfMethod(m->d.superdata, name, argc, types);-
450 if (conflict >= 0) {-
451 QMetaMethod conflictMethod = m->d.superdata->method(conflict);-
452 QMessageLogger(__FILE__, 721732, __PRETTY_FUNCTION__).warning("QMetaObject::indexOfSignal: signal %s from %s redefined in %s",-
453 conflictMethod.methodSignature().constData(),-
454 objectClassName(m->d.superdata), objectClassName(m));-
455 }-
456 }-
457-
458 return i;-
459}-
460int QMetaObject::indexOfSlot(const char *slot) const-
461{-
462 const QMetaObject *m = this;-
463 int i;-
464 ((!(priv(m->d.data)->revision >= 7)) ? qt_assert("priv(m->d.data)->revision >= 7",__FILE__,742753) : qt_noop());-
465 QArgumentTypeArray types;-
466 QByteArray name = QMetaObjectPrivate::decodeMethodSignature(slot, types);-
467 i = QMetaObjectPrivate::indexOfSlotRelative(&m, name, types.size(), types.constData());-
468 if (i >= 0)-
469 i += m->methodOffset();-
470 return i;-
471}-
472-
473-
474int QMetaObjectPrivate::indexOfSlotRelative(const QMetaObject **m,-
475 const QByteArray &name, int argc,-
476 const QArgumentType *types)-
477{-
478 return indexOfMethodRelative<MethodSlot>(m, name, argc, types);-
479}-
480-
481int QMetaObjectPrivate::indexOfSignal(const QMetaObject *m, const QByteArray &name,-
482 int argc, const QArgumentType *types)-
483{-
484 int i = indexOfSignalRelative(&m, name, argc, types);-
485 if (i >= 0)-
486 i += m->methodOffset();-
487 return i;-
488}-
489-
490int QMetaObjectPrivate::indexOfSlot(const QMetaObject *m, const QByteArray &name,-
491 int argc, const QArgumentType *types)-
492{-
493 int i = indexOfSlotRelative(&m, name, argc, types);-
494 if (i >= 0)-
495 i += m->methodOffset();-
496 return i;-
497}-
498-
499int QMetaObjectPrivate::indexOfMethod(const QMetaObject *m, const QByteArray &name,-
500 int argc, const QArgumentType *types)-
501{-
502 int i = indexOfMethodRelative<0>(&m, name, argc, types);-
503 if (i >= 0)-
504 i += m->methodOffset();-
505 return i;-
506}-
507-
508int QMetaObjectPrivate::indexOfConstructor(const QMetaObject *m, const QByteArray &name,-
509 int argc, const QArgumentType *types)-
510{-
511 for (int i = priv(m->d.data)->constructorCount-1; i >= 0; --i) {-
512 int handle = priv(m->d.data)->constructorData + 5*i;-
513 if (methodMatch(m, handle, name, argc, types))-
514 return i;-
515 }-
516 return -1;-
517}-
518int QMetaObjectPrivate::signalOffset(const QMetaObject *m)-
519{-
520 ((!(m != 0)) ? qt_assert("m != 0",__FILE__,809820) : qt_noop());-
521 int offset = 0;-
522 for (m = m->d.superdata; m; m = m->d.superdata)-
523 offset += priv(m->d.data)->signalCount;-
524 return offset;-
525}-
526int QMetaObjectPrivate::absoluteSignalCount(const QMetaObject *m)-
527{-
528 ((!(m != 0)) ? qt_assert("m != 0",__FILE__,828839) : qt_noop());-
529 int n = priv(m->d.data)->signalCount;-
530 for (m = m->d.superdata; m; m = m->d.superdata)-
531 n += priv(m->d.data)->signalCount;-
532 return n;-
533}-
534int QMetaObjectPrivate::signalIndex(const QMetaMethod &m)-
535{-
536 if (!m.mobj)-
537 return -1;-
538 return QMetaMethodPrivate::get(&m)->ownMethodIndex() + signalOffset(m.mobj);-
539}-
540QMetaMethod QMetaObjectPrivate::signal(const QMetaObject *m, int signal_index)-
541{-
542 QMetaMethod result;-
543 if (signal_index < 0)-
544 return result;-
545 ((!(m != 0)) ? qt_assert("m != 0",__FILE__,865876) : qt_noop());-
546 int i = signal_index;-
547 i -= signalOffset(m);-
548 if (i < 0 && m->d.superdata)-
549 return signal(m->d.superdata, signal_index);-
550-
551 if (i >= 0 && i < priv(m->d.data)->signalCount) {-
552 result.mobj = m;-
553 result.handle = priv(m->d.data)->methodData + 5*i;-
554 }-
555 return result;-
556}-
557-
558-
559-
560-
561-
562-
563-
564bool QMetaObjectPrivate::checkConnectArgs(int signalArgc, const QArgumentType *signalTypes,-
565 int methodArgc, const QArgumentType *methodTypes)-
566{-
567 if (signalArgc < methodArgc)-
568 return false;-
569 for (int i = 0; i < methodArgc; ++i) {-
570 if (signalTypes[i] != methodTypes[i])-
571 return false;-
572 }-
573 return true;-
574}-
575-
576-
577-
578-
579-
580-
581-
582bool QMetaObjectPrivate::checkConnectArgs(const QMetaMethodPrivate *signal,-
583 const QMetaMethodPrivate *method)-
584{-
585 if (signal->methodType() != QMetaMethod::Signal)-
586 return false;-
587 if (signal->parameterCount() < method->parameterCount())-
588 return false;-
589 const QMetaObject *smeta = signal->enclosingMetaObject();-
590 const QMetaObject *rmeta = method->enclosingMetaObject();-
591 for (int i = 0; i < method->parameterCount(); ++i) {-
592 uint sourceTypeInfo = signal->parameterTypeInfo(i);-
593 uint targetTypeInfo = method->parameterTypeInfo(i);-
594 if ((sourceTypeInfo & IsUnresolvedType)-
595 || (targetTypeInfo & IsUnresolvedType)) {-
596 QByteArray sourceName = typeNameFromTypeInfo(smeta, sourceTypeInfo);-
597 QByteArray targetName = typeNameFromTypeInfo(rmeta, targetTypeInfo);-
598 if (sourceName != targetName)-
599 return false;-
600 } else {-
601 int sourceType = typeFromTypeInfo(smeta, sourceTypeInfo);-
602 int targetType = typeFromTypeInfo(rmeta, targetTypeInfo);-
603 if (sourceType != targetType)-
604 return false;-
605 }-
606 }-
607 return true;-
608}-
609-
610static const QMetaObject *QMetaObject_findMetaObject(const QMetaObject *self, const char *name)-
611{-
612 while (self) {-
613 if (strcmp(objectClassName(self), name) == 0)-
614 return self;-
615 if (self->d.relatedMetaObjects) {-
616 ((!(priv(self->d.data)->revision >= 2)) ? qt_assert("priv(self->d.data)->revision >= 2",__FILE__,936947) : qt_noop());-
617 const QMetaObject * const *e = self->d.relatedMetaObjects;-
618 if (e) {-
619 while (*e) {-
620 if (const QMetaObject *m =QMetaObject_findMetaObject((*e), name))-
621 return m;-
622 ++e;-
623 }-
624 }-
625 }-
626 self = self->d.superdata;-
627 }-
628 return self;-
629}-
630-
631-
632-
633-
634-
635-
636-
637int QMetaObject::indexOfEnumerator(const char *name) const-
638{-
639 const QMetaObject *m = this;-
640 while (m) {-
641 const QMetaObjectPrivate *d = priv(m->d.data);-
642 for (int i = d->enumeratorCount - 1; i >= 0; --i) {-
643 const char *prop = rawStringData(m, m->d.data[d->enumeratorData + 4*i]);-
644 if (name[0] == prop[0] && strcmp(name + 1, prop + 1) == 0) {-
645 i += m->enumeratorOffset();-
646 return i;-
647 }-
648 }-
649 m = m->d.superdata;-
650 }-
651 return -1;-
652}-
653-
654-
655-
656-
657-
658-
659-
660int QMetaObject::indexOfProperty(const char *name) const-
661{-
662 const QMetaObject *m = this;-
663 while (m) {-
664 const QMetaObjectPrivate *d = priv(m->d.data);-
665 for (int i = d->propertyCount-1; i >= 0; --i) {-
666 const char *prop = rawStringData(m, m->d.data[d->propertyData + 3*i]);-
667 if (name[0] == prop[0] && strcmp(name + 1, prop + 1) == 0) {-
668 i += m->propertyOffset();-
669 return i;-
670 }-
671 }-
672 m = m->d.superdata;-
673 }-
674-
675 ((!(priv(this->d.data)->revision >= 3)) ? qt_assert("priv(this->d.data)->revision >= 3",__FILE__,9951006) : qt_noop());-
676 if (priv(this->d.data)->flags & DynamicMetaObject) {-
677 QAbstractDynamicMetaObject *me =-
678 const_cast<QAbstractDynamicMetaObject *>(static_cast<const QAbstractDynamicMetaObject *>(this));-
679-
680 return me->createProperty(name, 0);-
681 }-
682-
683 return -1;-
684}-
685-
686-
687-
688-
689-
690-
691-
692int QMetaObject::indexOfClassInfo(const char *name) const-
693{-
694 int i = -1;-
695 const QMetaObject *m = this;-
696 while (m && i < 0) {-
697 for (i = priv(m->d.data)->classInfoCount-1; i >= 0; --i)-
698 if (strcmp(name, rawStringData(m, m->d.data[priv(m->d.data)->classInfoData + 2*i])) == 0) {-
699 i += m->classInfoOffset();-
700 break;-
701 }-
702 m = m->d.superdata;-
703 }-
704 return i;-
705}-
706QMetaMethod QMetaObject::constructor(int index) const-
707{-
708 int i = index;-
709 QMetaMethod result;-
710 ((!(priv(d.data)->revision >= 2)) ? qt_assert("priv(d.data)->revision >= 2",__FILE__,10381049) : qt_noop());-
711 if (i >= 0 && i < priv(d.data)->constructorCount) {-
712 result.mobj = this;-
713 result.handle = priv(d.data)->constructorData + 5*i;-
714 }-
715 return result;-
716}-
717-
718-
719-
720-
721-
722-
723QMetaMethod QMetaObject::method(int index) const-
724{-
725 int i = index;-
726 i -= methodOffset();-
727 if (i < 0 && d.superdata)-
728 return d.superdata->method(index);-
729-
730 QMetaMethod result;-
731 if (i >= 0 && i < priv(d.data)->methodCount) {-
732 result.mobj = this;-
733 result.handle = priv(d.data)->methodData + 5*i;-
734 }-
735 return result;-
736}-
737-
738-
739-
740-
741-
742-
743QMetaEnum QMetaObject::enumerator(int index) const-
744{-
745 int i = index;-
746 i -= enumeratorOffset();-
747 if (i < 0 && d.superdata)-
748 return d.superdata->enumerator(index);-
749-
750 QMetaEnum result;-
751 if (i >= 0 && i < priv(d.data)->enumeratorCount) {-
752 result.mobj = this;-
753 result.handle = priv(d.data)->enumeratorData + 4*i;-
754 }-
755 return result;-
756}-
757-
758-
759-
760-
761-
762-
763-
764QMetaProperty QMetaObject::property(int index) const-
765{-
766 int i = index;-
767 i -= propertyOffset();-
768 if (i < 0 && d.superdata)-
769 return d.superdata->property(index);-
770-
771 QMetaProperty result;-
772 if (i >= 0 && i < priv(d.data)->propertyCount) {-
773 int handle = priv(d.data)->propertyData + 3*i;-
774 int flags = d.data[handle + 2];-
775 result.mobj = this;-
776 result.handle = handle;-
777 result.idx = i;-
778-
779 if (flags & EnumOrFlag) {-
780 const char *type = rawTypeNameFromTypeInfo(this, d.data[handle + 1]);-
781 result.menum = enumerator(indexOfEnumerator(type));-
782 if (!result.menum.isValid()) {-
783 const char *enum_name = type;-
784 const char *scope_name = objectClassName(this);-
785 char *scope_buffer = 0;-
786-
787 const char *colon = strrchr(enum_name, ':');-
788-
789 ((!(colon <= enum_name || *(colon-1) == ':')) ? qt_assert("colon <= enum_name || *(colon-1) == ':'",__FILE__,11171128) : qt_noop());-
790 if (colon > enum_name) {-
791 int len = colon-enum_name-1;-
792 scope_buffer = (char *)malloc(len+1);-
793 memcpy(scope_buffer, enum_name, len);-
794 scope_buffer[len] = '\0';-
795 scope_name = scope_buffer;-
796 enum_name = colon+1;-
797 }-
798-
799 const QMetaObject *scope = 0;-
800 if (qstrcmp(scope_name, "Qt") == 0)-
801 scope = &QObject::staticQtMetaObject;-
802 else-
803 scope = QMetaObject_findMetaObject(this, scope_name);-
804 if (scope)-
805 result.menum = scope->enumerator(scope->indexOfEnumerator(enum_name));-
806 if (scope_buffer)-
807 free(scope_buffer);-
808 }-
809 }-
810 }-
811 return result;-
812}-
813QMetaProperty QMetaObject::userProperty() const-
814{-
815 const int propCount = propertyCount();-
816 for (int i = propCount - 1; i >= 0; --i) {-
817 const QMetaProperty prop = property(i);-
818 if (prop.isUser())-
819 return prop;-
820 }-
821 return QMetaProperty();-
822}-
823QMetaClassInfo QMetaObject::classInfo(int index) const-
824{-
825 int i = index;-
826 i -= classInfoOffset();-
827 if (i < 0 && d.superdata)-
828 return d.superdata->classInfo(index);-
829-
830 QMetaClassInfo result;-
831 if (i >= 0 && i < priv(d.data)->classInfoCount) {-
832 result.mobj = this;-
833 result.handle = priv(d.data)->classInfoData + 2*i;-
834 }-
835 return result;-
836}-
837bool QMetaObject::checkConnectArgs(const char *signal, const char *method)-
838{-
839 const char *s1 = signal;-
840 const char *s2 = method;-
841 while (*s1++ != '(') { }-
842 while (*s2++ != '(') { }-
843 if (*s2 == ')' || qstrcmp(s1,s2) == 0)-
844 return true;-
845 int s1len = qstrlen(s1);-
846 int s2len = qstrlen(s2);-
847 if (s2len < s1len && strncmp(s1,s2,s2len-1)==0 && s1[s2len-1]==',')-
848 return true;-
849 return false;-
850}-
851bool QMetaObject::checkConnectArgs(const QMetaMethod &signal,-
852 const QMetaMethod &method)-
853{-
854 return QMetaObjectPrivate::checkConnectArgs(-
855 QMetaMethodPrivate::get(&signal),-
856 QMetaMethodPrivate::get(&method));-
857}-
858-
859static void qRemoveWhitespace(const char *s, char *d)-
860{-
861 char last = 0;-
862 while (*s && is_space(*s))-
863 s++;-
864 while (*s) {-
865 while (*s && !is_space(*s))-
866 last = *d++ = *s++;-
867 while (*s && is_space(*s))-
868 s++;-
869 if (*s && ((is_ident_char(*s) && is_ident_char(last))-
870 || ((*s == ':') && (last == '<')))) {-
871 last = *d++ = ' ';-
872 }-
873 }-
874 *d = '\0';-
875}-
876-
877static char *qNormalizeType(char *d, int &templdepth, QByteArray &result)-
878{-
879 const char *t = d;-
880 while (*d && (templdepth-
881 || (*d != ',' && *d != ')'))) {-
882 if (*d == '<')-
883 ++templdepth;-
884 if (*d == '>')-
885 --templdepth;-
886 ++d;-
887 }-
888-
889-
890 if (strncmp("void)", t, d - t + 1) != 0)-
891 result += normalizeTypeInternal(t, d);-
892-
893 return d;-
894}-
895QByteArray QMetaObject::normalizedType(const char *type)-
896{-
897 QByteArray result;-
898-
899 if (!type || !*type)-
900 return result;-
901-
902 QVarLengthArray<char> stackbuf(qstrlen(type) + 1);-
903 qRemoveWhitespace(type, stackbuf.data());-
904 int templdepth = 0;-
905 qNormalizeType(stackbuf.data(), templdepth, result);-
906-
907 return result;-
908}-
909QByteArray QMetaObject::normalizedSignature(const char *method)-
910{-
911 QByteArray result;-
912 if (!method || !*method)-
913 return result;-
914 int len = int(strlen(method));-
915 QVarLengthArray<char> stackbuf(len + 1);-
916 char *d = stackbuf.data();-
917 qRemoveWhitespace(method, d);-
918-
919 result.reserve(len);-
920-
921 int argdepth = 0;-
922 int templdepth = 0;-
923 while (*d) {-
924 if (argdepth == 1) {-
925 d = qNormalizeType(d, templdepth, result);-
926 if (!*d)-
927 break;-
928 }-
929 if (*d == '(')-
930 ++argdepth;-
931 if (*d == ')')-
932 --argdepth;-
933 result += *d++;-
934 }-
935-
936 return result;-
937}-
938-
939enum { MaximumParamCount = 11 };-
940-
941-
942-
943-
944-
945static inline QByteArray findMethodCandidates(const QMetaObject *metaObject, const char *nonExistentMember)-
946{-
947 QByteArray candidateMessage;-
948-
949 const QByteArray memberByteArray = nonExistentMember;-
950 for (int i = 0; i < metaObject->methodCount()
i < metaObject->methodCount()Description
TRUEevaluated 244 times by 2 tests
Evaluated by:
  • tst_QDBusInterface
  • tst_QMetaObject
FALSEevaluated 10 times by 2 tests
Evaluated by:
  • tst_QDBusInterface
  • tst_QMetaObject
; ++i) {
10-244
951 const QMetaMethod method = metaObject->method(i);-
952 if (method.name() == memberByteArray
method.name() ...emberByteArrayDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QMetaObject
FALSEevaluated 240 times by 2 tests
Evaluated by:
  • tst_QDBusInterface
  • tst_QMetaObject
)
4-240
953 candidateMessage .append(+= " " + method.methodSignature() + '\n');;
executed 4 times by 1 test: candidateMessage += " " + method.methodSignature() + '\n';
Executed by:
  • tst_QMetaObject
4
954 }
executed 244 times by 2 tests: end of block
Executed by:
  • tst_QDBusInterface
  • tst_QMetaObject
244
955 if (!candidateMessage.isEmpty()
!candidateMessage.isEmpty()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QMetaObject
FALSEevaluated 6 times by 2 tests
Evaluated by:
  • tst_QDBusInterface
  • tst_QMetaObject
) {
4-6
956 candidateMessage.prepend("\nCandidates are:\n");-
957 candidateMessage.chop(1);-
958 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_QMetaObject
4
959 return
executed 10 times by 2 tests: return candidateMessage;
Executed by:
  • tst_QDBusInterface
  • tst_QMetaObject
candidateMessage;
executed 10 times by 2 tests: return candidateMessage;
Executed by:
  • tst_QDBusInterface
  • tst_QMetaObject
10
960}-
961bool QMetaObject::invokeMethod(QObject *obj,-
962 const char *member,-
963 Qt::ConnectionType type,-
964 QGenericReturnArgument ret,-
965 QGenericArgument val0,-
966 QGenericArgument val1,-
967 QGenericArgument val2,-
968 QGenericArgument val3,-
969 QGenericArgument val4,-
970 QGenericArgument val5,-
971 QGenericArgument val6,-
972 QGenericArgument val7,-
973 QGenericArgument val8,-
974 QGenericArgument val9)-
975{-
976 if (!obj)-
977 return false;-
978-
979 QVarLengthArray<char, 512> sig;-
980 int len = qstrlen(member);-
981 if (len <= 0)-
982 return false;-
983 sig.append(member, len);-
984 sig.append('(');-
985-
986 const char *typeNames[] = {ret.name(), val0.name(), val1.name(), val2.name(), val3.name(),-
987 val4.name(), val5.name(), val6.name(), val7.name(), val8.name(),-
988 val9.name()};-
989-
990 int paramCount;-
991 for (paramCount = 1; paramCount < MaximumParamCount; ++paramCount) {-
992 len = qstrlen(typeNames[paramCount]);-
993 if (len <= 0)-
994 break;-
995 sig.append(typeNames[paramCount], len);-
996 sig.append(',');-
997 }-
998 if (paramCount == 1)-
999 sig.append(')');-
1000 else-
1001 sig[sig.size() - 1] = ')';-
1002 sig.append('\0');-
1003-
1004 const QMetaObject *meta = obj->metaObject();-
1005 int idx = meta->indexOfMethod(sig.constData());-
1006 if (idx < 0) {-
1007 QByteArray norm = QMetaObject::normalizedSignature(sig.constData());-
1008 idx = meta->indexOfMethod(norm.constData());-
1009 }-
1010-
1011 if (idx < 0 || idx >= meta->methodCount()) {-
1012-
1013 QMessageLogger(__FILE__, 14721483, __PRETTY_FUNCTION__).warning("QMetaObject::invokeMethod: No such method %s::%s%s",-
1014 meta->className(), sig.constData(), findMethodCandidates(meta, member).constData());-
1015 return false;-
1016 }-
1017 QMetaMethod method = meta->method(idx);-
1018 return method.invoke(obj, type, ret,-
1019 val0, val1, val2, val3, val4, val5, val6, val7, val8, val9);-
1020}-
1021QByteArray QMetaMethodPrivate::signature() const-
1022{-
1023 ((!(priv(mobj->d.data)->revision >= 7)) ? qt_assert("priv(mobj->d.data)->revision >= 7",__FILE__,16411652) : qt_noop());-
1024 QByteArray result;-
1025 result.reserve(256);-
1026 result += name();-
1027 result += '(';-
1028 QList<QByteArray> argTypes = parameterTypes();-
1029 for (int i = 0; i < argTypes.size(); ++i) {-
1030 if (i)-
1031 result += ',';-
1032 result += argTypes.at(i);-
1033 }-
1034 result += ')';-
1035 return result;-
1036}-
1037-
1038QByteArray QMetaMethodPrivate::name() const-
1039{-
1040 ((!(priv(mobj->d.data)->revision >= 7)) ? qt_assert("priv(mobj->d.data)->revision >= 7",__FILE__,16581669) : qt_noop());-
1041 return stringData(mobj, mobj->d.data[handle]);-
1042}-
1043-
1044int QMetaMethodPrivate::typesDataIndex() const-
1045{-
1046 ((!(priv(mobj->d.data)->revision >= 7)) ? qt_assert("priv(mobj->d.data)->revision >= 7",__FILE__,16641675) : qt_noop());-
1047 return mobj->d.data[handle + 2];-
1048}-
1049-
1050const char *QMetaMethodPrivate::rawReturnTypeName() const-
1051{-
1052 ((!(priv(mobj->d.data)->revision >= 7)) ? qt_assert("priv(mobj->d.data)->revision >= 7",__FILE__,16701681) : qt_noop());-
1053 uint typeInfo = mobj->d.data[typesDataIndex()];-
1054 if (typeInfo & IsUnresolvedType)-
1055 return rawStringData(mobj, typeInfo & TypeNameIndexMask);-
1056 else-
1057 return QMetaType::typeName(typeInfo);-
1058}-
1059-
1060int QMetaMethodPrivate::returnType() const-
1061{-
1062 return parameterType(-1);-
1063}-
1064-
1065int QMetaMethodPrivate::parameterCount() const-
1066{-
1067 ((!(priv(mobj->d.data)->revision >= 7)) ? qt_assert("priv(mobj->d.data)->revision >= 7",__FILE__,16851696) : qt_noop());-
1068 return mobj->d.data[handle + 1];-
1069}-
1070-
1071int QMetaMethodPrivate::parametersDataIndex() const-
1072{-
1073 ((!(priv(mobj->d.data)->revision >= 7)) ? qt_assert("priv(mobj->d.data)->revision >= 7",__FILE__,16911702) : qt_noop());-
1074 return typesDataIndex() + 1;-
1075}-
1076-
1077uint QMetaMethodPrivate::parameterTypeInfo(int index) const-
1078{-
1079 ((!(priv(mobj->d.data)->revision >= 7)) ? qt_assert("priv(mobj->d.data)->revision >= 7",__FILE__,16971708) : qt_noop());-
1080 return mobj->d.data[parametersDataIndex() + index];-
1081}-
1082-
1083int QMetaMethodPrivate::parameterType(int index) const-
1084{-
1085 ((!(priv(mobj->d.data)->revision >= 7)) ? qt_assert("priv(mobj->d.data)->revision >= 7",__FILE__,17031714) : qt_noop());-
1086 return typeFromTypeInfo(mobj, parameterTypeInfo(index));-
1087}-
1088-
1089void QMetaMethodPrivate::getParameterTypes(int *types) const-
1090{-
1091 ((!(priv(mobj->d.data)->revision >= 7)) ? qt_assert("priv(mobj->d.data)->revision >= 7",__FILE__,17091720) : qt_noop());-
1092 int dataIndex = parametersDataIndex();-
1093 int argc = parameterCount();-
1094 for (int i = 0; i < argc; ++i) {-
1095 int id = typeFromTypeInfo(mobj, mobj->d.data[dataIndex++]);-
1096 *(types++) = id;-
1097 }-
1098}-
1099-
1100QList<QByteArray> QMetaMethodPrivate::parameterTypes() const-
1101{-
1102 ((!(priv(mobj->d.data)->revision >= 7)) ? qt_assert("priv(mobj->d.data)->revision >= 7",__FILE__,17201731) : qt_noop());-
1103 int argc = parameterCount();-
1104 QList<QByteArray> list;-
1105 list.reserve(argc);-
1106 int paramsIndex = parametersDataIndex();-
1107 for (int i = 0; i < argc; ++i)-
1108 list += typeNameFromTypeInfo(mobj, mobj->d.data[paramsIndex + i]);-
1109 return list;-
1110}-
1111-
1112QList<QByteArray> QMetaMethodPrivate::parameterNames() const-
1113{-
1114 ((!(priv(mobj->d.data)->revision >= 7)) ? qt_assert("priv(mobj->d.data)->revision >= 7",__FILE__,17321743) : qt_noop());-
1115 int argc = parameterCount();-
1116 QList<QByteArray> list;-
1117 list.reserve(argc);-
1118 int namesIndex = parametersDataIndex() + argc;-
1119 for (int i = 0; i < argc; ++i)-
1120 list += stringData(mobj, mobj->d.data[namesIndex + i]);-
1121 return list;-
1122}-
1123-
1124QByteArray QMetaMethodPrivate::tag() const-
1125{-
1126 ((!(priv(mobj->d.data)->revision >= 7)) ? qt_assert("priv(mobj->d.data)->revision >= 7",__FILE__,17441755) : qt_noop());-
1127 return stringData(mobj, mobj->d.data[handle + 3]);-
1128}-
1129-
1130int QMetaMethodPrivate::ownMethodIndex() const-
1131{-
1132-
1133 return (handle - priv(mobj->d.data)->methodData) / 5;-
1134}-
1135QByteArray QMetaMethod::methodSignature() const-
1136{-
1137 if (!mobj)-
1138 return QByteArray();-
1139 return QMetaMethodPrivate::get(this)->signature();-
1140}-
1141QByteArray QMetaMethod::name() const-
1142{-
1143 if (!mobj)-
1144 return QByteArray();-
1145 return QMetaMethodPrivate::get(this)->name();-
1146}-
1147int QMetaMethod::returnType() const-
1148 {-
1149 if (!mobj)-
1150 return QMetaType::UnknownType;-
1151 return QMetaMethodPrivate::get(this)->returnType();-
1152}-
1153int QMetaMethod::parameterCount() const-
1154{-
1155 if (!mobj)-
1156 return 0;-
1157 return QMetaMethodPrivate::get(this)->parameterCount();-
1158}-
1159int QMetaMethod::parameterType(int index) const-
1160{-
1161 if (!mobj || index < 0)-
1162 return QMetaType::UnknownType;-
1163 if (index >= QMetaMethodPrivate::get(this)->parameterCount())-
1164 return QMetaType::UnknownType;-
1165-
1166 int type = QMetaMethodPrivate::get(this)->parameterType(index);-
1167 if (type != QMetaType::UnknownType)-
1168 return type;-
1169-
1170 void *argv[] = { &type, &index };-
1171 mobj->static_metacall(QMetaObject::RegisterMethodArgumentMetaType, QMetaMethodPrivate::get(this)->ownMethodIndex(), argv);-
1172 if (type != -1)-
1173 return type;-
1174 return QMetaType::UnknownType;-
1175}-
1176void QMetaMethod::getParameterTypes(int *types) const-
1177{-
1178 if (!mobj)-
1179 return;-
1180 QMetaMethodPrivate::get(this)->getParameterTypes(types);-
1181}-
1182-
1183-
1184-
1185-
1186-
1187-
1188QList<QByteArray> QMetaMethod::parameterTypes() const-
1189{-
1190 if (!mobj)-
1191 return QList<QByteArray>();-
1192 return QMetaMethodPrivate::get(this)->parameterTypes();-
1193}-
1194-
1195-
1196-
1197-
1198-
1199-
1200QList<QByteArray> QMetaMethod::parameterNames() const-
1201{-
1202 QList<QByteArray> list;-
1203 if (!mobj)-
1204 return list;-
1205 return QMetaMethodPrivate::get(this)->parameterNames();-
1206}-
1207-
1208-
1209-
1210-
1211-
1212-
1213-
1214const char *QMetaMethod::typeName() const-
1215{-
1216 if (!mobj)-
1217 return 0;-
1218 return QMetaMethodPrivate::get(this)->rawReturnTypeName();-
1219}-
1220const char *QMetaMethod::tag() const-
1221{-
1222 if (!mobj)-
1223 return 0;-
1224 return QMetaMethodPrivate::get(this)->tag().constData();-
1225}-
1226-
1227-
1228-
1229-
1230-
1231int QMetaMethod::attributes() const-
1232{-
1233 if (!mobj)-
1234 return false;-
1235 return ((mobj->d.data[handle + 4])>>4);-
1236}-
1237-
1238-
1239-
1240-
1241-
1242-
1243int QMetaMethod::methodIndex() const-
1244{-
1245 if (!mobj)-
1246 return -1;-
1247 return QMetaMethodPrivate::get(this)->ownMethodIndex() + mobj->methodOffset();-
1248}-
1249-
1250-
1251-
1252-
1253-
1254-
1255-
1256int QMetaMethod::revision() const-
1257{-
1258 if (!mobj)-
1259 return 0;-
1260 if ((QMetaMethod::Access)(mobj->d.data[handle + 4] & MethodRevisioned)) {-
1261 int offset = priv(mobj->d.data)->methodData-
1262 + priv(mobj->d.data)->methodCount * 5-
1263 + QMetaMethodPrivate::get(this)->ownMethodIndex();-
1264 return mobj->d.data[offset];-
1265 }-
1266 return 0;-
1267}-
1268QMetaMethod::Access QMetaMethod::access() const-
1269{-
1270 if (!mobj)-
1271 return Private;-
1272 return (QMetaMethod::Access)(mobj->d.data[handle + 4] & AccessMask);-
1273}-
1274-
1275-
1276-
1277-
1278-
1279-
1280QMetaMethod::MethodType QMetaMethod::methodType() const-
1281{-
1282 if (!mobj)-
1283 return QMetaMethod::Method;-
1284 return (QMetaMethod::MethodType)((mobj->d.data[handle + 4] & MethodTypeMask)>>2);-
1285}-
1286QMetaMethod QMetaMethod::fromSignalImpl(const QMetaObject *metaObject, void **signal)-
1287{-
1288 int i = -1;-
1289 void *args[] = { &i, signal };-
1290 QMetaMethod result;-
1291 for (const QMetaObject *m = metaObject; m; m = m->d.superdata) {-
1292 m->static_metacall(QMetaObject::IndexOfMethod, 0, args);-
1293 if (i >= 0) {-
1294 result.mobj = m;-
1295 result.handle = priv(m->d.data)->methodData + 5*i;-
1296 break;-
1297 }-
1298 }-
1299 return result;-
1300}-
1301bool QMetaMethod::invoke(QObject *object,-
1302 Qt::ConnectionType connectionType,-
1303 QGenericReturnArgument returnValue,-
1304 QGenericArgument val0,-
1305 QGenericArgument val1,-
1306 QGenericArgument val2,-
1307 QGenericArgument val3,-
1308 QGenericArgument val4,-
1309 QGenericArgument val5,-
1310 QGenericArgument val6,-
1311 QGenericArgument val7,-
1312 QGenericArgument val8,-
1313 QGenericArgument val9) const-
1314{-
1315 if (!object || !mobj)-
1316 return false;-
1317-
1318 ((!(mobj->cast(object))) ? qt_assert("mobj->cast(object)",__FILE__,21362147) : qt_noop());-
1319-
1320-
1321 if (returnValue.data()) {-
1322 const char *retType = typeName();-
1323 if (qstrcmp(returnValue.name(), retType) != 0) {-
1324-
1325 QByteArray normalized = QMetaObject::normalizedType(returnValue.name());-
1326 if (qstrcmp(normalized.constData(), retType) != 0) {-
1327-
1328 int t = returnType();-
1329 if (t == QMetaType::UnknownType || t != QMetaType::type(normalized))-
1330 return false;-
1331 }-
1332 }-
1333 }-
1334-
1335-
1336 const char *typeNames[] = {-
1337 returnValue.name(),-
1338 val0.name(),-
1339 val1.name(),-
1340 val2.name(),-
1341 val3.name(),-
1342 val4.name(),-
1343 val5.name(),-
1344 val6.name(),-
1345 val7.name(),-
1346 val8.name(),-
1347 val9.name()-
1348 };-
1349 int paramCount;-
1350 for (paramCount = 1; paramCount < MaximumParamCount; ++paramCount) {-
1351 if (qstrlen(typeNames[paramCount]) <= 0)-
1352 break;-
1353 }-
1354 if (paramCount <= QMetaMethodPrivate::get(this)->parameterCount())-
1355 return false;-
1356-
1357-
1358 QThread *currentThread = QThread::currentThread();-
1359 QThread *objectThread = object->thread();-
1360 if (connectionType == Qt::AutoConnection) {-
1361 connectionType = currentThread == objectThread-
1362 ? Qt::DirectConnection-
1363 : Qt::QueuedConnection;-
1364 }-
1365 void *param[] = {-
1366 returnValue.data(),-
1367 val0.data(),-
1368 val1.data(),-
1369 val2.data(),-
1370 val3.data(),-
1371 val4.data(),-
1372 val5.data(),-
1373 val6.data(),-
1374 val7.data(),-
1375 val8.data(),-
1376 val9.data()-
1377 };-
1378 int idx_relative = QMetaMethodPrivate::get(this)->ownMethodIndex();-
1379 int idx_offset = mobj->methodOffset();-
1380 ((!(QMetaObjectPrivate::get(mobj)->revision >= 6)) ? qt_assert("QMetaObjectPrivate::get(mobj)->revision >= 6",__FILE__,22062217) : qt_noop());-
1381 QObjectPrivate::StaticMetaCallFunction callFunction = mobj->d.static_metacall;-
1382-
1383 if (connectionType == Qt::DirectConnection) {-
1384 if (callFunction) {-
1385 callFunction(object, QMetaObject::InvokeMetaMethod, idx_relative, param);-
1386 return true;-
1387 } else {-
1388 return QMetaObject::metacall(object, QMetaObject::InvokeMetaMethod, idx_relative + idx_offset, param) < 0;-
1389 }-
1390 } else if (connectionType == Qt::QueuedConnection) {-
1391 if (returnValue.data()) {-
1392 QMessageLogger(__FILE__, 22182229, __PRETTY_FUNCTION__).warning("QMetaMethod::invoke: Unable to invoke methods with return values in "-
1393 "queued connections");-
1394 return false;-
1395 }-
1396-
1397 int nargs = 1;-
1398 void **args = (void **) malloc(paramCount * sizeof(void *));-
1399 do { if (!(args)) qBadAlloc(); } while (0);-
1400 int *types = (int *) malloc(paramCount * sizeof(int));-
1401 do { if (!(types)) qBadAlloc(); } while (0);-
1402 types[0] = 0;-
1403 args[0] = 0;-
1404-
1405 for (int i = 1; i < paramCount; ++i) {-
1406 types[i] = QMetaType::type(typeNames[i]);-
1407 if (types[i] != QMetaType::UnknownType) {-
1408 args[i] = QMetaType::create(types[i], param[i]);-
1409 ++nargs;-
1410 } else if (param[i]) {-
1411-
1412 void *argv[] = { &types[i], &i };-
1413 QMetaObject::metacall(object, QMetaObject::RegisterMethodArgumentMetaType,-
1414 idx_relative + idx_offset, argv);-
1415 if (types[i] == -1) {-
1416 QMessageLogger(__FILE__, 22422253, __PRETTY_FUNCTION__).warning("QMetaMethod::invoke: Unable to handle unregistered datatype '%s'",-
1417 typeNames[i]);-
1418 for (int x = 1; x < i; ++x) {-
1419 if (types[x] && args[x])-
1420 QMetaType::destroy(types[x], args[x]);-
1421 }-
1422 free(types);-
1423 free(args);-
1424 return false;-
1425 }-
1426 }-
1427 }-
1428-
1429 QCoreApplication::postEvent(object, new QMetaCallEvent(idx_offset, idx_relative, callFunction,-
1430 0, -1, nargs, types, args));-
1431 } else {-
1432-
1433 if (currentThread == objectThread) {-
1434 QMessageLogger(__FILE__, 22602271, __PRETTY_FUNCTION__).warning("QMetaMethod::invoke: Dead lock detected in "-
1435 "BlockingQueuedConnection: Receiver is %s(%p)",-
1436 mobj->className(), object);-
1437 }-
1438-
1439 QSemaphore semaphore;-
1440 QCoreApplication::postEvent(object, new QMetaCallEvent(idx_offset, idx_relative, callFunction,-
1441 0, -1, 0, 0, param, &semaphore));-
1442 semaphore.acquire();-
1443-
1444 }-
1445 return true;-
1446}-
1447bool QMetaMethod::invokeOnGadget(void* gadget, QGenericReturnArgument returnValue, QGenericArgument val0, QGenericArgument val1, QGenericArgument val2, QGenericArgument val3, QGenericArgument val4, QGenericArgument val5, QGenericArgument val6, QGenericArgument val7, QGenericArgument val8, QGenericArgument val9) const-
1448{-
1449 if (!gadget || !mobj)-
1450 return false;-
1451-
1452-
1453 if (returnValue.data()) {-
1454 const char *retType = typeName();-
1455 if (qstrcmp(returnValue.name(), retType) != 0) {-
1456-
1457 QByteArray normalized = QMetaObject::normalizedType(returnValue.name());-
1458 if (qstrcmp(normalized.constData(), retType) != 0) {-
1459-
1460 int t = returnType();-
1461 if (t == QMetaType::UnknownType || t != QMetaType::type(normalized))-
1462 return false;-
1463 }-
1464 }-
1465 }-
1466-
1467-
1468 const char *typeNames[] = {-
1469 returnValue.name(),-
1470 val0.name(),-
1471 val1.name(),-
1472 val2.name(),-
1473 val3.name(),-
1474 val4.name(),-
1475 val5.name(),-
1476 val6.name(),-
1477 val7.name(),-
1478 val8.name(),-
1479 val9.name()-
1480 };-
1481 int paramCount;-
1482 for (paramCount = 1; paramCount < MaximumParamCount; ++paramCount) {-
1483 if (qstrlen(typeNames[paramCount]) <= 0)-
1484 break;-
1485 }-
1486 if (paramCount <= QMetaMethodPrivate::get(this)->parameterCount())-
1487 return false;-
1488-
1489-
1490 void *param[] = {-
1491 returnValue.data(),-
1492 val0.data(),-
1493 val1.data(),-
1494 val2.data(),-
1495 val3.data(),-
1496 val4.data(),-
1497 val5.data(),-
1498 val6.data(),-
1499 val7.data(),-
1500 val8.data(),-
1501 val9.data()-
1502 };-
1503 int idx_relative = QMetaMethodPrivate::get(this)->ownMethodIndex();-
1504 ((!(QMetaObjectPrivate::get(mobj)->revision >= 6)) ? qt_assert("QMetaObjectPrivate::get(mobj)->revision >= 6",__FILE__,24072418) : qt_noop());-
1505 QObjectPrivate::StaticMetaCallFunction callFunction = mobj->d.static_metacall;-
1506 if (!callFunction)-
1507 return false;-
1508 callFunction(reinterpret_cast<QObject*>(gadget), QMetaObject::InvokeMetaMethod, idx_relative, param);-
1509 return true;-
1510}-
1511const char *QMetaEnum::name() const-
1512{-
1513 if (!mobj)-
1514 return 0;-
1515 return rawStringData(mobj, mobj->d.data[handle]);-
1516}-
1517-
1518-
1519-
1520-
1521-
1522-
1523int QMetaEnum::keyCount() const-
1524{-
1525 if (!mobj)-
1526 return 0;-
1527 return mobj->d.data[handle + 2];-
1528}-
1529-
1530-
1531-
1532-
1533-
1534-
1535-
1536const char *QMetaEnum::key(int index) const-
1537{-
1538 if (!mobj)-
1539 return 0;-
1540 int count = mobj->d.data[handle + 2];-
1541 int data = mobj->d.data[handle + 3];-
1542 if (index >= 0 && index < count)-
1543 return rawStringData(mobj, mobj->d.data[data + 2*index]);-
1544 return 0;-
1545}-
1546-
1547-
1548-
1549-
1550-
1551-
1552-
1553int QMetaEnum::value(int index) const-
1554{-
1555 if (!mobj)-
1556 return 0;-
1557 int count = mobj->d.data[handle + 2];-
1558 int data = mobj->d.data[handle + 3];-
1559 if (index >= 0 && index < count)-
1560 return mobj->d.data[data + 2*index + 1];-
1561 return -1;-
1562}-
1563bool QMetaEnum::isFlag() const-
1564{-
1565 return mobj && mobj->d.data[handle + 1];-
1566}-
1567const char *QMetaEnum::scope() const-
1568{-
1569 return mobj ? objectClassName(mobj) : 0;-
1570}-
1571int QMetaEnum::keyToValue(const char *key, bool *ok) const-
1572{-
1573 if (ok != 0)-
1574 *ok = false;-
1575 if (!mobj || !key)-
1576 return -1;-
1577 uint scope = 0;-
1578 const char *qualified_key = key;-
1579 const char *s = key + qstrlen(key);-
1580 while (s > key && *s != ':')-
1581 --s;-
1582 if (s > key && *(s-1)==':') {-
1583 scope = s - key - 1;-
1584 key += scope + 2;-
1585 }-
1586 int count = mobj->d.data[handle + 2];-
1587 int data = mobj->d.data[handle + 3];-
1588 for (int i = 0; i < count; ++i) {-
1589 const QByteArray className = stringData(mobj, priv(mobj->d.data)->className);-
1590 if ((!scope || (className.size() == int(scope) && strncmp(qualified_key, className.constData(), scope) == 0))-
1591 && strcmp(key, rawStringData(mobj, mobj->d.data[data + 2*i])) == 0) {-
1592 if (ok != 0)-
1593 *ok = true;-
1594 return mobj->d.data[data + 2*i + 1];-
1595 }-
1596 }-
1597 return -1;-
1598}-
1599const char* QMetaEnum::valueToKey(int value) const-
1600{-
1601 if (!mobj)-
1602 return 0;-
1603 int count = mobj->d.data[handle + 2];-
1604 int data = mobj->d.data[handle + 3];-
1605 for (int i = 0; i < count; ++i)-
1606 if (value == (int)mobj->d.data[data + 2*i + 1])-
1607 return rawStringData(mobj, mobj->d.data[data + 2*i]);-
1608 return 0;-
1609}-
1610int QMetaEnum::keysToValue(const char *keys, bool *ok) const-
1611{-
1612 if (ok != 0)-
1613 *ok = false;-
1614 if (!mobj || !keys)-
1615 return -1;-
1616 if (ok != 0)-
1617 *ok = true;-
1618 QStringList l = QString::fromLatin1(keys).split(QLatin1Char('|'));-
1619 if (l.isEmpty())-
1620 return 0;-
1621-
1622 int value = 0;-
1623 int count = mobj->d.data[handle + 2];-
1624 int data = mobj->d.data[handle + 3];-
1625 for (int li = 0; li < l.size(); ++li) {-
1626 QString trimmed = l.at(li).trimmed();-
1627 QByteArray qualified_key = trimmed.toLatin1();-
1628 const char *key = qualified_key.constData();-
1629 uint scope = 0;-
1630 const char *s = key + qstrlen(key);-
1631 while (s > key && *s != ':')-
1632 --s;-
1633 if (s > key && *(s-1)==':') {-
1634 scope = s - key - 1;-
1635 key += scope + 2;-
1636 }-
1637 int i;-
1638 for (i = count-1; i >= 0; --i) {-
1639 const QByteArray className = stringData(mobj, priv(mobj->d.data)->className);-
1640 if ((!scope || (className.size() == int(scope) && strncmp(qualified_key.constData(), className.constData(), scope) == 0))-
1641 && strcmp(key, rawStringData(mobj, mobj->d.data[data + 2*i])) == 0) {-
1642 value |= mobj->d.data[data + 2*i + 1];-
1643 break;-
1644 }-
1645 }-
1646 if (i < 0) {-
1647 if (ok != 0)-
1648 *ok = false;-
1649 value |= -1;-
1650 }-
1651 }-
1652 return value;-
1653}-
1654-
1655-
1656-
1657-
1658-
1659-
1660-
1661QByteArray QMetaEnum::valueToKeys(int value) const-
1662{-
1663 QByteArray keys;-
1664 if (!mobj)-
1665 return keys;-
1666 int count = mobj->d.data[handle + 2];-
1667 int data = mobj->d.data[handle + 3];-
1668 int v = value;-
1669-
1670 for (int i = count - 1; i >= 0; --i) {-
1671 int k = mobj->d.data[data + 2*i + 1];-
1672 if ((k != 0 && (v & k) == k ) || (k == value)) {-
1673 v = v & ~k;-
1674 if (!keys.isEmpty())-
1675 keys.prepend('|');-
1676 keys.prepend(stringData(mobj, mobj->d.data[data + 2*i]));-
1677 }-
1678 }-
1679 return keys;-
1680}-
1681static QByteArray qualifiedName(const QMetaEnum &e)-
1682{-
1683 return QByteArray(e.scope()) + "::" + e.name();-
1684}-
1685QMetaProperty::QMetaProperty()-
1686 : mobj(0), handle(0), idx(0)-
1687{-
1688}-
1689-
1690-
1691-
1692-
1693-
1694-
1695-
1696const char *QMetaProperty::name() const-
1697{-
1698 if (!mobj)-
1699 return 0;-
1700 int handle = priv(mobj->d.data)->propertyData + 3*idx;-
1701 return rawStringData(mobj, mobj->d.data[handle]);-
1702}-
1703-
1704-
1705-
1706-
1707-
1708-
1709const char *QMetaProperty::typeName() const-
1710{-
1711 if (!mobj)-
1712 return 0;-
1713 int handle = priv(mobj->d.data)->propertyData + 3*idx;-
1714 return rawTypeNameFromTypeInfo(mobj, mobj->d.data[handle + 1]);-
1715}-
1716-
1717-
1718-
1719-
1720-
1721-
1722-
1723QVariant::Type QMetaProperty::type() const-
1724{-
1725 if (!mobj)-
1726 return QVariant::Invalid;-
1727 int handle = priv(mobj->d.data)->propertyData + 3*idx;-
1728-
1729 ((!(priv(mobj->d.data)->revision >= 7)) ? qt_assert("priv(mobj->d.data)->revision >= 7",__FILE__,28182829) : qt_noop());-
1730 uint type = typeFromTypeInfo(mobj, mobj->d.data[handle + 1]);-
1731 if (type >= QMetaType::User)-
1732 return QVariant::UserType;-
1733 if (type != QMetaType::UnknownType)-
1734 return QVariant::Type(type);-
1735 if (isEnumType()) {-
1736 int enumMetaTypeId = QMetaType::type(qualifiedName(menum));-
1737 if (enumMetaTypeId == QMetaType::UnknownType)-
1738 return QVariant::Int;-
1739 }-
1740-
1741-
1742-
1743-
1744-
1745-
1746 return QVariant::UserType;-
1747}-
1748int QMetaProperty::userType() const-
1749{-
1750 if (!mobj)-
1751 return QMetaType::UnknownType;-
1752 ((!(priv(mobj->d.data)->revision >= 7)) ? qt_assert("priv(mobj->d.data)->revision >= 7",__FILE__,28512862) : qt_noop());-
1753 int handle = priv(mobj->d.data)->propertyData + 3*idx;-
1754 int type = typeFromTypeInfo(mobj, mobj->d.data[handle + 1]);-
1755 if (type != QMetaType::UnknownType)-
1756 return type;-
1757 if (isEnumType()) {-
1758 type = QMetaType::type(qualifiedName(menum));-
1759 if (type == QMetaType::UnknownType) {-
1760 type = registerPropertyType();-
1761 if (type == QMetaType::UnknownType)-
1762 return QVariant::Int;-
1763 }-
1764 return type;-
1765 }-
1766 type = QMetaType::type(typeName());-
1767 if (type != QMetaType::UnknownType)-
1768 return type;-
1769 return registerPropertyType();-
1770}-
1771-
1772-
1773-
1774-
1775-
1776-
1777int QMetaProperty::propertyIndex() const-
1778{-
1779 if (!mobj)-
1780 return -1;-
1781 return idx + mobj->propertyOffset();-
1782}-
1783bool QMetaProperty::isFlagType() const-
1784{-
1785 return isEnumType() && menum.isFlag();-
1786}-
1787-
1788-
1789-
1790-
1791-
1792-
1793-
1794bool QMetaProperty::isEnumType() const-
1795{-
1796 if (!mobj)-
1797 return false;-
1798 int handle = priv(mobj->d.data)->propertyData + 3*idx;-
1799 int flags = mobj->d.data[handle + 2];-
1800 return (flags & EnumOrFlag) && menum.name();-
1801}-
1802bool QMetaProperty::hasStdCppSet() const-
1803{-
1804 if (!mobj)-
1805 return false;-
1806 int handle = priv(mobj->d.data)->propertyData + 3*idx;-
1807 int flags = mobj->d.data[handle + 2];-
1808 return (flags & StdCppSet);-
1809}-
1810-
1811-
1812-
1813-
1814-
1815-
1816-
1817int QMetaProperty::registerPropertyType() const-
1818{-
1819 int registerResult = -1;-
1820 void *argv[] = { &registerResult };-
1821 mobj->static_metacall(QMetaObject::RegisterPropertyMetaType, idx, argv);-
1822 return registerResult == -1 ? QMetaType::UnknownType : registerResult;-
1823}-
1824-
1825-
1826-
1827-
1828-
1829-
1830-
1831QMetaEnum QMetaProperty::enumerator() const-
1832{-
1833 return menum;-
1834}-
1835-
1836-
1837-
1838-
1839-
1840-
1841-
1842QVariant QMetaProperty::read(const QObject *object) const-
1843{-
1844 if (!object || !mobj)-
1845 return QVariant();-
1846-
1847 uint t = QVariant::Int;-
1848 if (isEnumType()) {-
1849-
1850-
1851-
1852-
1853-
1854 int enumMetaTypeId = QMetaType::type(qualifiedName(menum));-
1855 if (enumMetaTypeId != QMetaType::UnknownType)-
1856 t = enumMetaTypeId;-
1857 } else {-
1858 int handle = priv(mobj->d.data)->propertyData + 3*idx;-
1859 const char *typeName = 0;-
1860 ((!(priv(mobj->d.data)->revision >= 7)) ? qt_assert("priv(mobj->d.data)->revision >= 7",__FILE__,29802991) : qt_noop());-
1861 uint typeInfo = mobj->d.data[handle + 1];-
1862 if (!(typeInfo & IsUnresolvedType))-
1863 t = typeInfo;-
1864 else {-
1865 typeName = rawStringData(mobj, typeInfo & TypeNameIndexMask);-
1866 t = QMetaType::type(typeName);-
1867 }-
1868 if (t == QMetaType::UnknownType) {-
1869-
1870 t = registerPropertyType();-
1871 if (t == QMetaType::UnknownType) {-
1872 QMessageLogger(__FILE__, 29923003, __PRETTY_FUNCTION__).warning("QMetaProperty::read: Unable to handle unregistered datatype '%s' for property '%s::%s'", typeName, mobj->className(), name());-
1873 return QVariant();-
1874 }-
1875 }-
1876 }-
1877-
1878-
1879-
1880-
1881-
1882-
1883 int status = -1;-
1884 QVariant value;-
1885 void *argv[] = { 0, &value, &status };-
1886 if (t == QMetaType::QVariant) {-
1887 argv[0] = &value;-
1888 } else {-
1889 value = QVariant(t, (void*)0);-
1890 argv[0] = value.data();-
1891 }-
1892 if (priv(mobj->d.data)->flags & PropertyAccessInStaticMetaCall && mobj->d.static_metacall) {-
1893 mobj->d.static_metacall(const_cast<QObject*>(object), QMetaObject::ReadProperty, idx, argv);-
1894 } else {-
1895 QMetaObject::metacall(const_cast<QObject*>(object), QMetaObject::ReadProperty,-
1896 idx + mobj->propertyOffset(), argv);-
1897 }-
1898-
1899 if (status != -1)-
1900 return value;-
1901 if (t != QMetaType::QVariant && argv[0] != value.data())-
1902-
1903 return QVariant((QVariant::Type)t, argv[0]);-
1904 return value;-
1905}-
1906bool QMetaProperty::write(QObject *object, const QVariant &value) const-
1907{-
1908 if (!object || !isWritable())-
1909 return false;-
1910-
1911 QVariant v = value;-
1912 uint t = QVariant::Invalid;-
1913 if (isEnumType()) {-
1914 if (v.type() == QVariant::String) {-
1915 bool ok;-
1916 if (isFlagType())-
1917 v = QVariant(menum.keysToValue(value.toByteArray(), &ok));-
1918 else-
1919 v = QVariant(menum.keyToValue(value.toByteArray(), &ok));-
1920 if (!ok)-
1921 return false;-
1922 } else if (v.type() != QVariant::Int && v.type() != QVariant::UInt) {-
1923 int enumMetaTypeId = QMetaType::type(qualifiedName(menum));-
1924 if ((enumMetaTypeId == QMetaType::UnknownType) || (v.userType() != enumMetaTypeId) || !v.constData())-
1925 return false;-
1926 v = QVariant(*reinterpret_cast<const int *>(v.constData()));-
1927 }-
1928 v.convert(QVariant::Int);-
1929 } else {-
1930 int handle = priv(mobj->d.data)->propertyData + 3*idx;-
1931 const char *typeName = 0;-
1932 ((!(priv(mobj->d.data)->revision >= 7)) ? qt_assert("priv(mobj->d.data)->revision >= 7",__FILE__,30643075) : qt_noop());-
1933 uint typeInfo = mobj->d.data[handle + 1];-
1934 if (!(typeInfo & IsUnresolvedType))-
1935 t = typeInfo;-
1936 else {-
1937 typeName = rawStringData(mobj, typeInfo & TypeNameIndexMask);-
1938 t = QMetaType::type(typeName);-
1939 if (t == QMetaType::UnknownType)-
1940 t = registerPropertyType();-
1941 if (t == QMetaType::UnknownType)-
1942 return false;-
1943 }-
1944 if (t != QMetaType::QVariant && int(t) != value.userType()) {-
1945 if (!value.isValid()) {-
1946 if (isResettable())-
1947 return reset(object);-
1948 v = QVariant(t, 0);-
1949 } else if (!v.convert(t)) {-
1950 return false;-
1951 }-
1952 }-
1953 }-
1954-
1955-
1956-
1957-
1958-
1959-
1960 int status = -1;-
1961-
1962-
1963 int flags = 0;-
1964 void *argv[] = { 0, &v, &status, &flags };-
1965 if (t == QMetaType::QVariant)-
1966 argv[0] = &v;-
1967 else-
1968 argv[0] = v.data();-
1969 if (priv(mobj->d.data)->flags & PropertyAccessInStaticMetaCall && mobj->d.static_metacall)-
1970 mobj->d.static_metacall(object, QMetaObject::WriteProperty, idx, argv);-
1971 else-
1972 QMetaObject::metacall(object, QMetaObject::WriteProperty, idx + mobj->propertyOffset(), argv);-
1973-
1974 return status;-
1975}-
1976bool QMetaProperty::reset(QObject *object) const-
1977{-
1978 if (!object || !mobj || !isResettable())-
1979 return false;-
1980 void *argv[] = { 0 };-
1981 if (priv(mobj->d.data)->flags & PropertyAccessInStaticMetaCall && mobj->d.static_metacall)-
1982 mobj->d.static_metacall(object, QMetaObject::ResetProperty, idx, argv);-
1983 else-
1984 QMetaObject::metacall(object, QMetaObject::ResetProperty, idx + mobj->propertyOffset(), argv);-
1985 return true;-
1986}-
1987QVariant QMetaProperty::readOnGadget(const void *gadget) const-
1988{-
1989 ((!(priv(mobj->d.data)->flags & PropertyAccessInStaticMetaCall && mobj->d.static_metacall)) ? qt_assert("priv(mobj->d.data)->flags & PropertyAccessInStaticMetaCall && mobj->d.static_metacall",__FILE__,31383149) : qt_noop());-
1990 return read(reinterpret_cast<const QObject*>(gadget));-
1991}-
1992bool QMetaProperty::writeOnGadget(void *gadget, const QVariant &value) const-
1993{-
1994 ((!(priv(mobj->d.data)->flags & PropertyAccessInStaticMetaCall && mobj->d.static_metacall)) ? qt_assert("priv(mobj->d.data)->flags & PropertyAccessInStaticMetaCall && mobj->d.static_metacall",__FILE__,31523163) : qt_noop());-
1995 return write(reinterpret_cast<QObject*>(gadget), value);-
1996}-
1997bool QMetaProperty::resetOnGadget(void *gadget) const-
1998{-
1999 ((!(priv(mobj->d.data)->flags & PropertyAccessInStaticMetaCall && mobj->d.static_metacall)) ? qt_assert("priv(mobj->d.data)->flags & PropertyAccessInStaticMetaCall && mobj->d.static_metacall",__FILE__,31683179) : qt_noop());-
2000 return reset(reinterpret_cast<QObject*>(gadget));-
2001}-
2002-
2003-
2004-
2005-
2006-
2007-
2008-
2009bool QMetaProperty::isResettable() const-
2010{-
2011 if (!mobj)-
2012 return false;-
2013 int flags = mobj->d.data[handle + 2];-
2014 return flags & Resettable;-
2015}-
2016-
2017-
2018-
2019-
2020-
2021-
2022bool QMetaProperty::isReadable() const-
2023{-
2024 if (!mobj)-
2025 return false;-
2026 int flags = mobj->d.data[handle + 2];-
2027 return flags & Readable;-
2028}-
2029-
2030-
2031-
2032-
2033-
2034-
2035-
2036bool QMetaProperty::hasNotifySignal() const-
2037{-
2038 if (!mobj)-
2039 return false;-
2040 int flags = mobj->d.data[handle + 2];-
2041 return flags & Notify;-
2042}-
2043QMetaMethod QMetaProperty::notifySignal() const-
2044{-
2045 int id = notifySignalIndex();-
2046 if (id != -1)-
2047 return mobj->method(id);-
2048 else-
2049 return QMetaMethod();-
2050}-
2051int QMetaProperty::notifySignalIndex() const-
2052{-
2053 if (hasNotifySignal()) {-
2054 int offset = priv(mobj->d.data)->propertyData +-
2055 priv(mobj->d.data)->propertyCount * 3 + idx;-
2056 return mobj->d.data[offset] + mobj->methodOffset();-
2057 } else {-
2058 return -1;-
2059 }-
2060}-
2061int QMetaProperty::revision() const-
2062{-
2063 if (!mobj)-
2064 return 0;-
2065 int flags = mobj->d.data[handle + 2];-
2066 if (flags & Revisioned) {-
2067 int offset = priv(mobj->d.data)->propertyData +-
2068 priv(mobj->d.data)->propertyCount * 3 + idx;-
2069-
2070-
2071 for (int i = 0; i < priv(mobj->d.data)->propertyCount; ++i) {-
2072 int handle = priv(mobj->d.data)->propertyData + 3*i;-
2073 if (mobj->d.data[handle + 2] & Notify) {-
2074 offset += priv(mobj->d.data)->propertyCount;-
2075 break;-
2076 }-
2077 }-
2078 return mobj->d.data[offset];-
2079 } else {-
2080 return 0;-
2081 }-
2082}-
2083-
2084-
2085-
2086-
2087-
2088-
2089-
2090bool QMetaProperty::isWritable() const-
2091{-
2092 if (!mobj)-
2093 return false;-
2094 int flags = mobj->d.data[handle + 2];-
2095 return flags & Writable;-
2096}-
2097bool QMetaProperty::isDesignable(const QObject *object) const-
2098{-
2099 if (!mobj)-
2100 return false;-
2101 int flags = mobj->d.data[handle + 2];-
2102 bool b = flags & Designable;-
2103 if (object) {-
2104 void *argv[] = { &b };-
2105 QMetaObject::metacall(const_cast<QObject*>(object), QMetaObject::QueryPropertyDesignable,-
2106 idx + mobj->propertyOffset(), argv);-
2107 }-
2108 return b;-
2109-
2110-
2111}-
2112bool QMetaProperty::isScriptable(const QObject *object) const-
2113{-
2114 if (!mobj)-
2115 return false;-
2116 int flags = mobj->d.data[handle + 2];-
2117 bool b = flags & Scriptable;-
2118 if (object) {-
2119 void *argv[] = { &b };-
2120 QMetaObject::metacall(const_cast<QObject*>(object), QMetaObject::QueryPropertyScriptable,-
2121 idx + mobj->propertyOffset(), argv);-
2122 }-
2123 return b;-
2124}-
2125bool QMetaProperty::isStored(const QObject *object) const-
2126{-
2127 if (!mobj)-
2128 return false;-
2129 int flags = mobj->d.data[handle + 2];-
2130 bool b = flags & Stored;-
2131 if (object) {-
2132 void *argv[] = { &b };-
2133 QMetaObject::metacall(const_cast<QObject*>(object), QMetaObject::QueryPropertyStored,-
2134 idx + mobj->propertyOffset(), argv);-
2135 }-
2136 return b;-
2137}-
2138bool QMetaProperty::isUser(const QObject *object) const-
2139{-
2140 if (!mobj)-
2141 return false;-
2142 int flags = mobj->d.data[handle + 2];-
2143 bool b = flags & User;-
2144 if (object) {-
2145 void *argv[] = { &b };-
2146 QMetaObject::metacall(const_cast<QObject*>(object), QMetaObject::QueryPropertyUser,-
2147 idx + mobj->propertyOffset(), argv);-
2148 }-
2149 return b;-
2150}-
2151bool QMetaProperty::isConstant() const-
2152{-
2153 if (!mobj)-
2154 return false;-
2155 int flags = mobj->d.data[handle + 2];-
2156 return flags & Constant;-
2157}-
2158bool QMetaProperty::isFinal() const-
2159{-
2160 if (!mobj)-
2161 return false;-
2162 int flags = mobj->d.data[handle + 2];-
2163 return flags & Final;-
2164}-
2165bool QMetaProperty::isEditable(const QObject *object) const-
2166{-
2167 if (!mobj)-
2168 return false;-
2169 int flags = mobj->d.data[handle + 2];-
2170 bool b = flags & Editable;-
2171 if (object) {-
2172 void *argv[] = { &b };-
2173 QMetaObject::metacall(const_cast<QObject*>(object), QMetaObject::QueryPropertyEditable,-
2174 idx + mobj->propertyOffset(), argv);-
2175 }-
2176 return b;-
2177}-
2178const char *QMetaClassInfo::name() const-
2179{-
2180 if (!mobj)-
2181 return 0;-
2182 return rawStringData(mobj, mobj->d.data[handle]);-
2183}-
2184-
2185-
2186-
2187-
2188-
2189-
2190const char* QMetaClassInfo::value() const-
2191{-
2192 if (!mobj)-
2193 return 0;-
2194 return rawStringData(mobj, mobj->d.data[handle + 1]);-
2195}-
2196int QMetaObjectPrivate::originalClone(const QMetaObject *mobj, int local_method_index)-
2197{-
2198 ((!(local_method_index < get(mobj)->methodCount)) ? qt_assert("local_method_index < get(mobj)->methodCount",__FILE__,35883599) : qt_noop());-
2199 int handle = get(mobj)->methodData + 5 * local_method_index;-
2200 while (mobj->d.data[handle + 4] & MethodCloned) {-
2201 ((!(local_method_index > 0)) ? qt_assert("local_method_index > 0",__FILE__,35913602) : qt_noop());-
2202 handle -= 5;-
2203 local_method_index--;-
2204 }-
2205 return local_method_index;-
2206}-
2207-
2208-
2209-
2210-
2211-
2212-
2213QList<QByteArray> QMetaObjectPrivate::parameterTypeNamesFromSignature(const char *signature)-
2214{-
2215 QList<QByteArray> list;-
2216 while (*signature && *signature != '(')-
2217 ++signature;-
2218 while (*signature && *signature != ')' && *++signature != ')') {-
2219 const char *begin = signature;-
2220 int level = 0;-
2221 while (*signature && (level > 0 || *signature != ',') && *signature != ')') {-
2222 if (*signature == '<')-
2223 ++level;-
2224 else if (*signature == '>')-
2225 --level;-
2226 ++signature;-
2227 }-
2228 list += QByteArray(begin, signature - begin);-
2229 }-
2230 return list;-
2231}-
2232-
2233-
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9