/src/qtbase/src/corelib/kernel/qmetatype.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | /**************************************************************************** |
2 | | ** |
3 | | ** Copyright (C) 2016 The Qt Company Ltd. |
4 | | ** Contact: https://www.qt.io/licensing/ |
5 | | ** |
6 | | ** This file is part of the QtCore module of the Qt Toolkit. |
7 | | ** |
8 | | ** $QT_BEGIN_LICENSE:LGPL$ |
9 | | ** Commercial License Usage |
10 | | ** Licensees holding valid commercial Qt licenses may use this file in |
11 | | ** accordance with the commercial license agreement provided with the |
12 | | ** Software or, alternatively, in accordance with the terms contained in |
13 | | ** a written agreement between you and The Qt Company. For licensing terms |
14 | | ** and conditions see https://www.qt.io/terms-conditions. For further |
15 | | ** information use the contact form at https://www.qt.io/contact-us. |
16 | | ** |
17 | | ** GNU Lesser General Public License Usage |
18 | | ** Alternatively, this file may be used under the terms of the GNU Lesser |
19 | | ** General Public License version 3 as published by the Free Software |
20 | | ** Foundation and appearing in the file LICENSE.LGPL3 included in the |
21 | | ** packaging of this file. Please review the following information to |
22 | | ** ensure the GNU Lesser General Public License version 3 requirements |
23 | | ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. |
24 | | ** |
25 | | ** GNU General Public License Usage |
26 | | ** Alternatively, this file may be used under the terms of the GNU |
27 | | ** General Public License version 2.0 or (at your option) the GNU General |
28 | | ** Public license version 3 or any later version approved by the KDE Free |
29 | | ** Qt Foundation. The licenses are as published by the Free Software |
30 | | ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 |
31 | | ** included in the packaging of this file. Please review the following |
32 | | ** information to ensure the GNU General Public License requirements will |
33 | | ** be met: https://www.gnu.org/licenses/gpl-2.0.html and |
34 | | ** https://www.gnu.org/licenses/gpl-3.0.html. |
35 | | ** |
36 | | ** $QT_END_LICENSE$ |
37 | | ** |
38 | | ****************************************************************************/ |
39 | | |
40 | | #include "qmetatype.h" |
41 | | #include "qmetatype_p.h" |
42 | | #include "qobjectdefs.h" |
43 | | #include "qdatetime.h" |
44 | | #include "qbytearray.h" |
45 | | #include "qreadwritelock.h" |
46 | | #include "qstring.h" |
47 | | #include "qstringlist.h" |
48 | | #include "qvector.h" |
49 | | #include "qlocale.h" |
50 | | #if QT_CONFIG(easingcurve) |
51 | | #include "qeasingcurve.h" |
52 | | #endif |
53 | | #include "quuid.h" |
54 | | #include "qvariant.h" |
55 | | #include "qdatastream.h" |
56 | | #include "qregexp.h" |
57 | | #include "qmetatypeswitcher_p.h" |
58 | | |
59 | | #if QT_CONFIG(regularexpression) |
60 | | # include "qregularexpression.h" |
61 | | #endif |
62 | | |
63 | | #ifndef QT_BOOTSTRAPPED |
64 | | # include "qbitarray.h" |
65 | | # include "qurl.h" |
66 | | # include "qvariant.h" |
67 | | # include "qjsonvalue.h" |
68 | | # include "qjsonobject.h" |
69 | | # include "qjsonarray.h" |
70 | | # include "qjsondocument.h" |
71 | | # include "qcborvalue.h" |
72 | | # include "qcborarray.h" |
73 | | # include "qcbormap.h" |
74 | | # include "qbytearraylist.h" |
75 | | #endif |
76 | | |
77 | | #if QT_CONFIG(itemmodel) |
78 | | # include "qabstractitemmodel.h" |
79 | | #endif |
80 | | |
81 | | #ifndef QT_NO_GEOM_VARIANT |
82 | | # include "qsize.h" |
83 | | # include "qpoint.h" |
84 | | # include "qrect.h" |
85 | | # include "qline.h" |
86 | | #endif |
87 | | |
88 | | QT_BEGIN_NAMESPACE |
89 | | |
90 | 0 | #define NS(x) QT_PREPEND_NAMESPACE(x) |
91 | | |
92 | | |
93 | | namespace { |
94 | | struct DefinedTypesFilter { |
95 | | template<typename T> |
96 | | struct Acceptor { |
97 | | static const bool IsAccepted = QtMetaTypePrivate::TypeDefinition<T>::IsAvailable && QModulesPrivate::QTypeModuleInfo<T>::IsCore; |
98 | | }; |
99 | | }; |
100 | | } // namespace |
101 | | |
102 | | /*! |
103 | | \macro Q_DECLARE_OPAQUE_POINTER(PointerType) |
104 | | \relates QMetaType |
105 | | \since 5.0 |
106 | | |
107 | | This macro enables pointers to forward-declared types (\a PointerType) |
108 | | to be registered with QMetaType using either Q_DECLARE_METATYPE() |
109 | | or qRegisterMetaType(). |
110 | | |
111 | | \sa Q_DECLARE_METATYPE(), qRegisterMetaType() |
112 | | */ |
113 | | |
114 | | /*! |
115 | | \macro Q_DECLARE_METATYPE(Type) |
116 | | \relates QMetaType |
117 | | |
118 | | This macro makes the type \a Type known to QMetaType as long as it |
119 | | provides a public default constructor, a public copy constructor and |
120 | | a public destructor. |
121 | | It is needed to use the type \a Type as a custom type in QVariant. |
122 | | |
123 | | This macro requires that \a Type is a fully defined type at the point where |
124 | | it is used. For pointer types, it also requires that the pointed to type is |
125 | | fully defined. Use in conjunction with Q_DECLARE_OPAQUE_POINTER() to |
126 | | register pointers to forward declared types. |
127 | | |
128 | | Ideally, this macro should be placed below the declaration of |
129 | | the class or struct. If that is not possible, it can be put in |
130 | | a private header file which has to be included every time that |
131 | | type is used in a QVariant. |
132 | | |
133 | | Adding a Q_DECLARE_METATYPE() makes the type known to all template |
134 | | based functions, including QVariant. Note that if you intend to |
135 | | use the type in \e queued signal and slot connections or in |
136 | | QObject's property system, you also have to call |
137 | | qRegisterMetaType() since the names are resolved at runtime. |
138 | | |
139 | | This example shows a typical use case of Q_DECLARE_METATYPE(): |
140 | | |
141 | | \snippet code/src_corelib_kernel_qmetatype.cpp 0 |
142 | | |
143 | | If \c MyStruct is in a namespace, the Q_DECLARE_METATYPE() macro |
144 | | has to be outside the namespace: |
145 | | |
146 | | \snippet code/src_corelib_kernel_qmetatype.cpp 1 |
147 | | |
148 | | Since \c{MyStruct} is now known to QMetaType, it can be used in QVariant: |
149 | | |
150 | | \snippet code/src_corelib_kernel_qmetatype.cpp 2 |
151 | | |
152 | | Some types are registered automatically and do not need this macro: |
153 | | |
154 | | \list |
155 | | \li Pointers to classes derived from QObject |
156 | | \li QList<T>, QVector<T>, QQueue<T>, QStack<T>, QSet<T> or QLinkedList<T> |
157 | | where T is a registered meta type |
158 | | \li QHash<T1, T2>, QMap<T1, T2> or QPair<T1, T2> where T1 and T2 are |
159 | | registered meta types |
160 | | \li QPointer<T>, QSharedPointer<T>, QWeakPointer<T>, where T is a class that derives from QObject |
161 | | \li Enumerations registered with Q_ENUM or Q_FLAG |
162 | | \li Classes that have a Q_GADGET macro |
163 | | \endlist |
164 | | |
165 | | \sa qRegisterMetaType() |
166 | | */ |
167 | | |
168 | | /*! |
169 | | \macro Q_DECLARE_SEQUENTIAL_CONTAINER_METATYPE(Container) |
170 | | \relates QMetaType |
171 | | |
172 | | This macro makes the container \a Container known to QMetaType as a sequential |
173 | | container. This makes it possible to put an instance of Container<T> into |
174 | | a QVariant, if T itself is known to QMetaType. |
175 | | |
176 | | Note that all of the Qt sequential containers already have built-in |
177 | | support, and it is not necessary to use this macro with them. The |
178 | | std::vector and std::list containers also have built-in support. |
179 | | |
180 | | This example shows a typical use of Q_DECLARE_SEQUENTIAL_CONTAINER_METATYPE(): |
181 | | |
182 | | \snippet code/src_corelib_kernel_qmetatype.cpp 10 |
183 | | */ |
184 | | |
185 | | /*! |
186 | | \macro Q_DECLARE_ASSOCIATIVE_CONTAINER_METATYPE(Container) |
187 | | \relates QMetaType |
188 | | |
189 | | This macro makes the container \a Container known to QMetaType as an associative |
190 | | container. This makes it possible to put an instance of Container<T, U> into |
191 | | a QVariant, if T and U are themselves known to QMetaType. |
192 | | |
193 | | Note that all of the Qt associative containers already have built-in |
194 | | support, and it is not necessary to use this macro with them. The |
195 | | std::map container also has built-in support. |
196 | | |
197 | | This example shows a typical use of Q_DECLARE_ASSOCIATIVE_CONTAINER_METATYPE(): |
198 | | |
199 | | \snippet code/src_corelib_kernel_qmetatype.cpp 11 |
200 | | */ |
201 | | |
202 | | /*! |
203 | | \macro Q_DECLARE_SMART_POINTER_METATYPE(SmartPointer) |
204 | | \relates QMetaType |
205 | | |
206 | | This macro makes the smart pointer \a SmartPointer known to QMetaType as a |
207 | | smart pointer. This makes it possible to put an instance of SmartPointer<T> into |
208 | | a QVariant, if T is a type which inherits QObject. |
209 | | |
210 | | Note that the QWeakPointer, QSharedPointer and QPointer already have built-in |
211 | | support, and it is not necessary to use this macro with them. |
212 | | |
213 | | This example shows a typical use of Q_DECLARE_SMART_POINTER_METATYPE(): |
214 | | |
215 | | \snippet code/src_corelib_kernel_qmetatype.cpp 13 |
216 | | */ |
217 | | |
218 | | /*! |
219 | | \enum QMetaType::Type |
220 | | |
221 | | These are the built-in types supported by QMetaType: |
222 | | |
223 | | \value Void \c void |
224 | | \value Bool \c bool |
225 | | \value Int \c int |
226 | | \value UInt \c{unsigned int} |
227 | | \value Double \c double |
228 | | \value QChar QChar |
229 | | \value QString QString |
230 | | \value QByteArray QByteArray |
231 | | \value Nullptr \c{std::nullptr_t} |
232 | | |
233 | | \value VoidStar \c{void *} |
234 | | \value Long \c{long} |
235 | | \value LongLong LongLong |
236 | | \value Short \c{short} |
237 | | \value Char \c{char} |
238 | | \value ULong \c{unsigned long} |
239 | | \value ULongLong ULongLong |
240 | | \value UShort \c{unsigned short} |
241 | | \value SChar \c{signed char} |
242 | | \value UChar \c{unsigned char} |
243 | | \value Float \c float |
244 | | \value QObjectStar QObject * |
245 | | \value QVariant QVariant |
246 | | |
247 | | \value QCursor QCursor |
248 | | \value QDate QDate |
249 | | \value QSize QSize |
250 | | \value QTime QTime |
251 | | \value QVariantList QVariantList |
252 | | \value QPolygon QPolygon |
253 | | \value QPolygonF QPolygonF |
254 | | \value QColor QColor |
255 | | \value QColorSpace QColorSpace (introduced in Qt 5.15) |
256 | | \value QSizeF QSizeF |
257 | | \value QRectF QRectF |
258 | | \value QLine QLine |
259 | | \value QTextLength QTextLength |
260 | | \value QStringList QStringList |
261 | | \value QVariantMap QVariantMap |
262 | | \value QVariantHash QVariantHash |
263 | | \value QIcon QIcon |
264 | | \value QPen QPen |
265 | | \value QLineF QLineF |
266 | | \value QTextFormat QTextFormat |
267 | | \value QRect QRect |
268 | | \value QPoint QPoint |
269 | | \value QUrl QUrl |
270 | | \value QRegExp QRegExp |
271 | | \value QRegularExpression QRegularExpression |
272 | | \value QDateTime QDateTime |
273 | | \value QPointF QPointF |
274 | | \value QPalette QPalette |
275 | | \value QFont QFont |
276 | | \value QBrush QBrush |
277 | | \value QRegion QRegion |
278 | | \value QBitArray QBitArray |
279 | | \value QImage QImage |
280 | | \value QKeySequence QKeySequence |
281 | | \value QSizePolicy QSizePolicy |
282 | | \value QPixmap QPixmap |
283 | | \value QLocale QLocale |
284 | | \value QBitmap QBitmap |
285 | | \value QMatrix QMatrix |
286 | | \value QTransform QTransform |
287 | | \value QMatrix4x4 QMatrix4x4 |
288 | | \value QVector2D QVector2D |
289 | | \value QVector3D QVector3D |
290 | | \value QVector4D QVector4D |
291 | | \value QQuaternion QQuaternion |
292 | | \value QEasingCurve QEasingCurve |
293 | | \value QJsonValue QJsonValue |
294 | | \value QJsonObject QJsonObject |
295 | | \value QJsonArray QJsonArray |
296 | | \value QJsonDocument QJsonDocument |
297 | | \value QCborValue QCborValue |
298 | | \value QCborArray QCborArray |
299 | | \value QCborMap QCborMap |
300 | | \value QCborSimpleType QCborSimpleType |
301 | | \value QModelIndex QModelIndex |
302 | | \value QPersistentModelIndex QPersistentModelIndex (introduced in Qt 5.5) |
303 | | \value QUuid QUuid |
304 | | \value QByteArrayList QByteArrayList |
305 | | |
306 | | \value User Base value for user types |
307 | | \value UnknownType This is an invalid type id. It is returned from QMetaType for types that are not registered |
308 | | \omitvalue LastCoreType |
309 | | \omitvalue LastGuiType |
310 | | |
311 | | Additional types can be registered using Q_DECLARE_METATYPE(). |
312 | | |
313 | | \sa type(), typeName() |
314 | | */ |
315 | | |
316 | | /*! |
317 | | \enum QMetaType::TypeFlag |
318 | | |
319 | | The enum describes attributes of a type supported by QMetaType. |
320 | | |
321 | | \value NeedsConstruction This type has non-trivial constructors. If the flag is not set instances can be safely initialized with memset to 0. |
322 | | \value NeedsDestruction This type has a non-trivial destructor. If the flag is not set calls to the destructor are not necessary before discarding objects. |
323 | | \value MovableType An instance of a type having this attribute can be safely moved by memcpy. |
324 | | \omitvalue SharedPointerToQObject |
325 | | \value IsEnumeration This type is an enumeration |
326 | | \value PointerToQObject This type is a pointer to a derived of QObject |
327 | | \omitvalue WeakPointerToQObject |
328 | | \omitvalue TrackingPointerToQObject |
329 | | \omitvalue WasDeclaredAsMetaType |
330 | | \omitvalue IsGadget \omit This type is a Q_GADGET and it's corresponding QMetaObject can be accessed with QMetaType::metaObject Since 5.5. \endomit |
331 | | \omitvalue PointerToGadget |
332 | | */ |
333 | | |
334 | | /*! |
335 | | \class QMetaType |
336 | | \inmodule QtCore |
337 | | \brief The QMetaType class manages named types in the meta-object system. |
338 | | |
339 | | \ingroup objectmodel |
340 | | \threadsafe |
341 | | |
342 | | The class is used as a helper to marshall types in QVariant and |
343 | | in queued signals and slots connections. It associates a type |
344 | | name to a type so that it can be created and destructed |
345 | | dynamically at run-time. Declare new types with Q_DECLARE_METATYPE() |
346 | | to make them available to QVariant and other template-based functions. |
347 | | Call qRegisterMetaType() to make types available to non-template based |
348 | | functions, such as the queued signal and slot connections. |
349 | | |
350 | | Any class or struct that has a public default |
351 | | constructor, a public copy constructor, and a public destructor |
352 | | can be registered. |
353 | | |
354 | | The following code allocates and destructs an instance of |
355 | | \c{MyClass}: |
356 | | |
357 | | \snippet code/src_corelib_kernel_qmetatype.cpp 3 |
358 | | |
359 | | If we want the stream operators \c operator<<() and \c |
360 | | operator>>() to work on QVariant objects that store custom types, |
361 | | the custom type must provide \c operator<<() and \c operator>>() |
362 | | operators. |
363 | | |
364 | | \sa Q_DECLARE_METATYPE(), QVariant::setValue(), QVariant::value(), QVariant::fromValue() |
365 | | */ |
366 | | |
367 | | /*! |
368 | | \fn bool QMetaType::isValid() const |
369 | | \since 5.0 |
370 | | |
371 | | Returns \c true if this QMetaType object contains valid |
372 | | information about a type, false otherwise. |
373 | | */ |
374 | | |
375 | | /*! |
376 | | \fn bool QMetaType::isRegistered() const |
377 | | \since 5.0 |
378 | | |
379 | | Returns \c true if this QMetaType object contains valid |
380 | | information about a type, false otherwise. |
381 | | */ |
382 | | |
383 | | /*! |
384 | | \fn int QMetaType::id() const |
385 | | \since 5.13 |
386 | | |
387 | | Returns id type hold by this QMetatype instance. |
388 | | */ |
389 | | |
390 | | /*! |
391 | | \fn bool QMetaType::sizeOf() const |
392 | | \since 5.0 |
393 | | |
394 | | Returns the size of the type in bytes (i.e. sizeof(T), |
395 | | where T is the actual type for which this QMetaType instance |
396 | | was constructed for). |
397 | | |
398 | | This function is typically used together with construct() |
399 | | to perform low-level management of the memory used by a type. |
400 | | |
401 | | \sa QMetaType::construct(), QMetaType::sizeOf() |
402 | | */ |
403 | | |
404 | | /*! |
405 | | \fn TypeFlags QMetaType::flags() const |
406 | | \since 5.0 |
407 | | |
408 | | Returns flags of the type for which this QMetaType instance was constructed. |
409 | | |
410 | | \sa QMetaType::TypeFlags, QMetaType::typeFlags() |
411 | | */ |
412 | | |
413 | | /*! |
414 | | \fn const QMetaObject *QMetaType::metaObject() const |
415 | | \since 5.5 |
416 | | |
417 | | Returns a QMetaObject relative to this type. |
418 | | |
419 | | If the type is a pointer type to a subclass of QObject, flags() contains |
420 | | QMetaType::PointerToQObject and this function returns the corresponding QMetaObject. |
421 | | This can be used in combination with QMetaObject::newInstance() to create QObjects of this type. |
422 | | |
423 | | If the type is a Q_GADGET, flags() contains QMetaType::IsGadget. |
424 | | If the type is a pointer to a Q_GADGET, flags() contains QMetaType::PointerToGadget. |
425 | | In both cases, this function returns its QMetaObject. |
426 | | This can be used to retrieve QMetaMethod and QMetaProperty and use them on a |
427 | | pointer of this type for example, as given by QVariant::data(). |
428 | | |
429 | | If the type is an enumeration, flags() contains QMetaType::IsEnumeration. |
430 | | In this case, this function returns the QMetaObject of the enclosing |
431 | | object if the enum was registered as a Q_ENUM or \nullptr otherwise. |
432 | | |
433 | | \sa QMetaType::metaObjectForType(), QMetaType::flags() |
434 | | */ |
435 | | |
436 | | /*! |
437 | | \fn void *QMetaType::create(const void *copy = 0) const |
438 | | \since 5.0 |
439 | | |
440 | | Returns a copy of \a copy, assuming it is of the type that this |
441 | | QMetaType instance was created for. If \a copy is \nullptr, creates |
442 | | a default constructed instance. |
443 | | |
444 | | \sa QMetaType::destroy() |
445 | | */ |
446 | | |
447 | | /*! |
448 | | \fn void QMetaType::destroy(void *data) const |
449 | | \since 5.0 |
450 | | |
451 | | Destroys the \a data, assuming it is of the type that this |
452 | | QMetaType instance was created for. |
453 | | |
454 | | \sa QMetaType::create() |
455 | | */ |
456 | | |
457 | | /*! |
458 | | \fn void *QMetaType::construct(int type, const void *copy) |
459 | | \deprecated |
460 | | |
461 | | Constructs a value of the given type which is a copy of \a copy. |
462 | | The default value for \a copy is \nullptr. |
463 | | |
464 | | Deprecated, use the static function QMetaType::create(int type, |
465 | | const void *copy) instead. |
466 | | */ |
467 | | /*! |
468 | | \fn void *QMetaType::construct(void *where, const void *copy = 0) const |
469 | | \since 5.0 |
470 | | |
471 | | Constructs a value of the type that this QMetaType instance |
472 | | was constructed for in the existing memory addressed by \a where, |
473 | | that is a copy of \a copy, and returns \a where. If \a copy is |
474 | | zero, the value is default constructed. |
475 | | |
476 | | This is a low-level function for explicitly managing the memory |
477 | | used to store the type. Consider calling create() if you don't |
478 | | need this level of control (that is, use "new" rather than |
479 | | "placement new"). |
480 | | |
481 | | You must ensure that \a where points to a location where the new |
482 | | value can be stored and that \a where is suitably aligned. |
483 | | The type's size can be queried by calling sizeOf(). |
484 | | |
485 | | The rule of thumb for alignment is that a type is aligned to its |
486 | | natural boundary, which is the smallest power of 2 that is bigger |
487 | | than the type, unless that alignment is larger than the maximum |
488 | | useful alignment for the platform. For practical purposes, |
489 | | alignment larger than 2 * sizeof(void*) is only necessary for |
490 | | special hardware instructions (e.g., aligned SSE loads and stores |
491 | | on x86). |
492 | | */ |
493 | | |
494 | | /*! |
495 | | \fn void QMetaType::destruct(void *data) const |
496 | | \since 5.0 |
497 | | |
498 | | Destructs the value, located at \a data, assuming that it is |
499 | | of the type for which this QMetaType instance was constructed for. |
500 | | |
501 | | Unlike destroy(), this function only invokes the type's |
502 | | destructor, it doesn't invoke the delete operator. |
503 | | \sa QMetaType::construct() |
504 | | */ |
505 | | |
506 | | /*! |
507 | | \fn QMetaType::~QMetaType() |
508 | | |
509 | | Destructs this object. |
510 | | */ |
511 | | |
512 | | /*! |
513 | | \fn template<typename T> QMetaType QMetaType::fromType() |
514 | | \since 5.15 |
515 | | |
516 | | Returns the QMetaType corresponding to the type in the template parameter. |
517 | | */ |
518 | | |
519 | | /*! \fn bool operator==(const QMetaType &a, const QMetaType &b) |
520 | | \since 5.15 |
521 | | \relates QMetaType |
522 | | \overload |
523 | | |
524 | | Returns \c true if the QMetaType \a a represents the same type |
525 | | as the QMetaType \a b, otherwise returns \c false. |
526 | | */ |
527 | | |
528 | | /*! \fn bool operator!=(const QMetaType &a, const QMetaType &b) |
529 | | \since 5.15 |
530 | | \relates QMetaType |
531 | | \overload |
532 | | |
533 | | Returns \c true if the QMetaType \a a represents a different type |
534 | | than the QMetaType \a b, otherwise returns \c false. |
535 | | */ |
536 | | |
537 | | #define QT_ADD_STATIC_METATYPE(MetaTypeName, MetaTypeId, RealName) \ |
538 | | { #RealName, sizeof(#RealName) - 1, MetaTypeId }, |
539 | | |
540 | | #define QT_ADD_STATIC_METATYPE_ALIASES_ITER(MetaTypeName, MetaTypeId, AliasingName, RealNameStr) \ |
541 | | { RealNameStr, sizeof(RealNameStr) - 1, QMetaType::MetaTypeName }, |
542 | | |
543 | | #define QT_ADD_STATIC_METATYPE_HACKS_ITER(MetaTypeName, TypeId, Name) \ |
544 | | QT_ADD_STATIC_METATYPE(MetaTypeName, MetaTypeName, Name) |
545 | | |
546 | | static const struct { const char * typeName; int typeNameLength; int type; } types[] = { |
547 | | QT_FOR_EACH_STATIC_TYPE(QT_ADD_STATIC_METATYPE) |
548 | | QT_FOR_EACH_STATIC_ALIAS_TYPE(QT_ADD_STATIC_METATYPE_ALIASES_ITER) |
549 | | QT_FOR_EACH_STATIC_HACKS_TYPE(QT_ADD_STATIC_METATYPE_HACKS_ITER) |
550 | | {nullptr, 0, QMetaType::UnknownType} |
551 | | }; |
552 | | |
553 | | Q_CORE_EXPORT const QMetaTypeInterface *qMetaTypeGuiHelper = nullptr; |
554 | | Q_CORE_EXPORT const QMetaTypeInterface *qMetaTypeWidgetsHelper = nullptr; |
555 | | Q_CORE_EXPORT const QMetaObject *qMetaObjectWidgetsHelper = nullptr; |
556 | | |
557 | | class QCustomTypeInfo : public QMetaTypeInterface |
558 | | { |
559 | | public: |
560 | | QCustomTypeInfo() |
561 | | : alias(-1) |
562 | 0 | { |
563 | 0 | QMetaTypeInterface empty = QT_METATYPE_INTERFACE_INIT(void); |
564 | 0 | *static_cast<QMetaTypeInterface*>(this) = empty; |
565 | 0 | } |
566 | | QByteArray typeName; |
567 | | int alias; |
568 | | }; |
569 | | |
570 | | template<typename T, typename Key> |
571 | | class QMetaTypeFunctionRegistry |
572 | | { |
573 | | public: |
574 | | ~QMetaTypeFunctionRegistry() |
575 | 0 | { |
576 | 0 | const QWriteLocker locker(&lock); |
577 | 0 | map.clear(); |
578 | 0 | } Unexecuted instantiation: QMetaTypeFunctionRegistry<QtPrivate::AbstractConverterFunction, QPair<int, int> >::~QMetaTypeFunctionRegistry() Unexecuted instantiation: QMetaTypeFunctionRegistry<QtPrivate::AbstractComparatorFunction, int>::~QMetaTypeFunctionRegistry() Unexecuted instantiation: QMetaTypeFunctionRegistry<QtPrivate::AbstractDebugStreamFunction, int>::~QMetaTypeFunctionRegistry() |
579 | | |
580 | | bool contains(Key k) const |
581 | 0 | { |
582 | 0 | const QReadLocker locker(&lock); |
583 | 0 | return map.contains(k); |
584 | 0 | } Unexecuted instantiation: QMetaTypeFunctionRegistry<QtPrivate::AbstractComparatorFunction, int>::contains(int) const Unexecuted instantiation: QMetaTypeFunctionRegistry<QtPrivate::AbstractDebugStreamFunction, int>::contains(int) const Unexecuted instantiation: QMetaTypeFunctionRegistry<QtPrivate::AbstractConverterFunction, QPair<int, int> >::contains(QPair<int, int>) const |
585 | | |
586 | | bool insertIfNotContains(Key k, const T *f) |
587 | 0 | { |
588 | 0 | const QWriteLocker locker(&lock); |
589 | 0 | const T* &fun = map[k]; |
590 | 0 | if (fun) |
591 | 0 | return false; |
592 | 0 | fun = f; |
593 | 0 | return true; |
594 | 0 | } Unexecuted instantiation: QMetaTypeFunctionRegistry<QtPrivate::AbstractConverterFunction, QPair<int, int> >::insertIfNotContains(QPair<int, int>, QtPrivate::AbstractConverterFunction const*) Unexecuted instantiation: QMetaTypeFunctionRegistry<QtPrivate::AbstractComparatorFunction, int>::insertIfNotContains(int, QtPrivate::AbstractComparatorFunction const*) Unexecuted instantiation: QMetaTypeFunctionRegistry<QtPrivate::AbstractDebugStreamFunction, int>::insertIfNotContains(int, QtPrivate::AbstractDebugStreamFunction const*) |
595 | | |
596 | | const T *function(Key k) const |
597 | 0 | { |
598 | 0 | const QReadLocker locker(&lock); |
599 | 0 | return map.value(k, nullptr); |
600 | 0 | } Unexecuted instantiation: QMetaTypeFunctionRegistry<QtPrivate::AbstractConverterFunction, QPair<int, int> >::function(QPair<int, int>) const Unexecuted instantiation: QMetaTypeFunctionRegistry<QtPrivate::AbstractComparatorFunction, int>::function(int) const Unexecuted instantiation: QMetaTypeFunctionRegistry<QtPrivate::AbstractDebugStreamFunction, int>::function(int) const |
601 | | |
602 | | void remove(int from, int to) |
603 | 0 | { |
604 | 0 | const Key k(from, to); |
605 | 0 | const QWriteLocker locker(&lock); |
606 | 0 | map.remove(k); |
607 | 0 | } |
608 | | private: |
609 | | mutable QReadWriteLock lock; |
610 | | QHash<Key, const T *> map; |
611 | | }; |
612 | | |
613 | | typedef QMetaTypeFunctionRegistry<QtPrivate::AbstractConverterFunction,QPair<int,int> > |
614 | | QMetaTypeConverterRegistry; |
615 | | typedef QMetaTypeFunctionRegistry<QtPrivate::AbstractComparatorFunction,int> |
616 | | QMetaTypeComparatorRegistry; |
617 | | typedef QMetaTypeFunctionRegistry<QtPrivate::AbstractDebugStreamFunction,int> |
618 | | QMetaTypeDebugStreamRegistry; |
619 | | |
620 | | Q_STATIC_ASSERT(std::is_trivial<QMetaTypeInterface>::value); |
621 | | Q_STATIC_ASSERT(std::is_standard_layout<QMetaTypeInterface>::value); |
622 | | |
623 | | Q_DECLARE_TYPEINFO(QCustomTypeInfo, Q_MOVABLE_TYPE); |
624 | | Q_GLOBAL_STATIC(QVector<QCustomTypeInfo>, customTypes) |
625 | | Q_GLOBAL_STATIC(QReadWriteLock, customTypesLock) |
626 | | Q_GLOBAL_STATIC(QMetaTypeConverterRegistry, customTypesConversionRegistry) |
627 | | Q_GLOBAL_STATIC(QMetaTypeComparatorRegistry, customTypesComparatorRegistry) |
628 | | Q_GLOBAL_STATIC(QMetaTypeDebugStreamRegistry, customTypesDebugStreamRegistry) |
629 | | |
630 | | /*! |
631 | | \fn bool QMetaType::registerConverter() |
632 | | \since 5.2 |
633 | | Registers the possibility of an implicit conversion from type From to type To in the meta |
634 | | type system. Returns \c true if the registration succeeded, otherwise false. |
635 | | */ |
636 | | |
637 | | /*! |
638 | | \fn template<typename MemberFunction, int> bool QMetaType::registerConverter(MemberFunction function) |
639 | | \since 5.2 |
640 | | \overload |
641 | | Registers a method \a function like To From::function() const as converter from type From |
642 | | to type To in the meta type system. Returns \c true if the registration succeeded, otherwise false. |
643 | | */ |
644 | | |
645 | | /*! |
646 | | \fn template<typename MemberFunctionOk, char> bool QMetaType::registerConverter(MemberFunctionOk function) |
647 | | \since 5.2 |
648 | | \overload |
649 | | Registers a method \a function like To From::function(bool *ok) const as converter from type From |
650 | | to type To in the meta type system. Returns \c true if the registration succeeded, otherwise false. |
651 | | */ |
652 | | |
653 | | /*! |
654 | | \fn template<typename UnaryFunction> bool QMetaType::registerConverter(UnaryFunction function) |
655 | | \since 5.2 |
656 | | \overload |
657 | | Registers a unary function object \a function as converter from type From |
658 | | to type To in the meta type system. Returns \c true if the registration succeeded, otherwise false. |
659 | | */ |
660 | | |
661 | | /*! |
662 | | \fn bool QMetaType::registerComparators() |
663 | | \since 5.2 |
664 | | Registers comparison operators for the user-registered type T. This requires T to have |
665 | | both an operator== and an operator<. |
666 | | Returns \c true if the registration succeeded, otherwise false. |
667 | | */ |
668 | | |
669 | | /*! |
670 | | \fn bool QMetaType::registerEqualsComparator() |
671 | | \since 5.5 |
672 | | Registers equals operator for the user-registered type T. This requires T to have |
673 | | an operator==. |
674 | | Returns \c true if the registration succeeded, otherwise false. |
675 | | */ |
676 | | |
677 | | #ifndef QT_NO_DEBUG_STREAM |
678 | | /*! |
679 | | \fn bool QMetaType::registerDebugStreamOperator() |
680 | | Registers the debug stream operator for the user-registered type T. This requires T to have |
681 | | an operator<<(QDebug dbg, T). |
682 | | Returns \c true if the registration succeeded, otherwise false. |
683 | | */ |
684 | | #endif |
685 | | |
686 | | /*! |
687 | | Registers function \a f as converter function from type id \a from to \a to. |
688 | | If there's already a conversion registered, this does nothing but deleting \a f. |
689 | | Returns \c true if the registration succeeded, otherwise false. |
690 | | \since 5.2 |
691 | | \internal |
692 | | */ |
693 | | bool QMetaType::registerConverterFunction(const QtPrivate::AbstractConverterFunction *f, int from, int to) |
694 | 0 | { |
695 | 0 | if (!customTypesConversionRegistry()->insertIfNotContains(qMakePair(from, to), f)) { |
696 | 0 | qWarning("Type conversion already registered from type %s to type %s", |
697 | 0 | QMetaType::typeName(from), QMetaType::typeName(to)); |
698 | 0 | return false; |
699 | 0 | } |
700 | 0 | return true; |
701 | 0 | } |
702 | | |
703 | | /*! |
704 | | \internal |
705 | | |
706 | | Invoked automatically when a converter function object is destroyed. |
707 | | */ |
708 | | void QMetaType::unregisterConverterFunction(int from, int to) |
709 | 0 | { |
710 | 0 | if (customTypesConversionRegistry.isDestroyed()) |
711 | 0 | return; |
712 | 0 | customTypesConversionRegistry()->remove(from, to); |
713 | 0 | } |
714 | | |
715 | | bool QMetaType::registerComparatorFunction(const QtPrivate::AbstractComparatorFunction *f, int type) |
716 | 0 | { |
717 | 0 | if (!customTypesComparatorRegistry()->insertIfNotContains(type, f)) { |
718 | 0 | qWarning("Comparators already registered for type %s", QMetaType::typeName(type)); |
719 | 0 | return false; |
720 | 0 | } |
721 | 0 | return true; |
722 | 0 | } |
723 | | |
724 | | /*! |
725 | | \fn bool QMetaType::hasRegisteredComparators() |
726 | | Returns \c true, if the meta type system has registered comparators for type T. |
727 | | \since 5.2 |
728 | | */ |
729 | | |
730 | | /*! |
731 | | Returns \c true, if the meta type system has registered comparators for type id \a typeId. |
732 | | \since 5.2 |
733 | | */ |
734 | | bool QMetaType::hasRegisteredComparators(int typeId) |
735 | 0 | { |
736 | 0 | return customTypesComparatorRegistry()->contains(typeId); |
737 | 0 | } |
738 | | |
739 | | #ifndef QT_NO_DEBUG_STREAM |
740 | | bool QMetaType::registerDebugStreamOperatorFunction(const QtPrivate::AbstractDebugStreamFunction *f, |
741 | | int type) |
742 | 0 | { |
743 | 0 | if (!customTypesDebugStreamRegistry()->insertIfNotContains(type, f)) { |
744 | 0 | qWarning("Debug stream operator already registered for type %s", QMetaType::typeName(type)); |
745 | 0 | return false; |
746 | 0 | } |
747 | 0 | return true; |
748 | 0 | } |
749 | | |
750 | | /*! |
751 | | \fn bool QMetaType::hasRegisteredDebugStreamOperator() |
752 | | Returns \c true, if the meta type system has a registered debug stream operator for type T. |
753 | | \since 5.2 |
754 | | */ |
755 | | |
756 | | /*! |
757 | | Returns \c true, if the meta type system has a registered debug stream operator for type |
758 | | id \a typeId. |
759 | | \since 5.2 |
760 | | */ |
761 | | bool QMetaType::hasRegisteredDebugStreamOperator(int typeId) |
762 | 0 | { |
763 | 0 | return customTypesDebugStreamRegistry()->contains(typeId); |
764 | 0 | } |
765 | | #endif |
766 | | |
767 | | /*! |
768 | | Converts the object at \a from from \a fromTypeId to the preallocated space at \a to |
769 | | typed \a toTypeId. Returns \c true, if the conversion succeeded, otherwise false. |
770 | | \since 5.2 |
771 | | */ |
772 | | bool QMetaType::convert(const void *from, int fromTypeId, void *to, int toTypeId) |
773 | 0 | { |
774 | 0 | const QtPrivate::AbstractConverterFunction * const f = |
775 | 0 | customTypesConversionRegistry()->function(qMakePair(fromTypeId, toTypeId)); |
776 | 0 | return f && f->convert(f, from, to); |
777 | 0 | } |
778 | | |
779 | | /*! |
780 | | Compares the objects at \a lhs and \a rhs. Both objects need to be of type \a typeId. |
781 | | \a result is set to less than, equal to or greater than zero, if \a lhs is less than, equal to |
782 | | or greater than \a rhs. Returns \c true, if the comparison succeeded, otherwise \c false. |
783 | | \since 5.2 |
784 | | */ |
785 | | bool QMetaType::compare(const void *lhs, const void *rhs, int typeId, int* result) |
786 | 0 | { |
787 | 0 | const QtPrivate::AbstractComparatorFunction * const f = |
788 | 0 | customTypesComparatorRegistry()->function(typeId); |
789 | 0 | if (!f) |
790 | 0 | return false; |
791 | 0 | if (f->equals(f, lhs, rhs)) |
792 | 0 | *result = 0; |
793 | 0 | else if (f->lessThan) |
794 | 0 | *result = f->lessThan(f, lhs, rhs) ? -1 : 1; |
795 | 0 | else |
796 | 0 | return false; |
797 | 0 | return true; |
798 | 0 | } |
799 | | |
800 | | /*! |
801 | | Compares the objects at \a lhs and \a rhs. Both objects need to be of type \a typeId. |
802 | | \a result is set to zero, if \a lhs equals to rhs. Returns \c true, if the comparison |
803 | | succeeded, otherwise \c false. |
804 | | \since 5.5 |
805 | | */ |
806 | | bool QMetaType::equals(const void *lhs, const void *rhs, int typeId, int *result) |
807 | 0 | { |
808 | 0 | const QtPrivate::AbstractComparatorFunction * const f |
809 | 0 | = customTypesComparatorRegistry()->function(typeId); |
810 | 0 | if (!f) |
811 | 0 | return false; |
812 | 0 | if (f->equals(f, lhs, rhs)) |
813 | 0 | *result = 0; |
814 | 0 | else |
815 | 0 | *result = -1; |
816 | 0 | return true; |
817 | 0 | } |
818 | | |
819 | | /*! |
820 | | Streams the object at \a rhs of type \a typeId to the debug stream \a dbg. Returns \c true |
821 | | on success, otherwise false. |
822 | | \since 5.2 |
823 | | */ |
824 | | bool QMetaType::debugStream(QDebug& dbg, const void *rhs, int typeId) |
825 | 0 | { |
826 | 0 | const QtPrivate::AbstractDebugStreamFunction * const f = customTypesDebugStreamRegistry()->function(typeId); |
827 | 0 | if (!f) |
828 | 0 | return false; |
829 | 0 | f->stream(f, dbg, rhs); |
830 | 0 | return true; |
831 | 0 | } |
832 | | |
833 | | /*! |
834 | | \fn bool QMetaType::hasRegisteredConverterFunction() |
835 | | Returns \c true, if the meta type system has a registered conversion from type From to type To. |
836 | | \since 5.2 |
837 | | \overload |
838 | | */ |
839 | | |
840 | | /*! |
841 | | Returns \c true, if the meta type system has a registered conversion from meta type id \a fromTypeId |
842 | | to \a toTypeId |
843 | | \since 5.2 |
844 | | */ |
845 | | bool QMetaType::hasRegisteredConverterFunction(int fromTypeId, int toTypeId) |
846 | 0 | { |
847 | 0 | return customTypesConversionRegistry()->contains(qMakePair(fromTypeId, toTypeId)); |
848 | 0 | } |
849 | | |
850 | | #ifndef QT_NO_DATASTREAM |
851 | | /*! |
852 | | \internal |
853 | | */ |
854 | | void QMetaType::registerStreamOperators(const char *typeName, SaveOperator saveOp, |
855 | | LoadOperator loadOp) |
856 | 0 | { |
857 | 0 | registerStreamOperators(type(typeName), saveOp, loadOp); |
858 | 0 | } |
859 | | |
860 | | /*! |
861 | | \internal |
862 | | */ |
863 | | void QMetaType::registerStreamOperators(int idx, SaveOperator saveOp, |
864 | | LoadOperator loadOp) |
865 | 0 | { |
866 | 0 | if (idx < User) |
867 | 0 | return; //builtin types should not be registered; |
868 | 0 | QVector<QCustomTypeInfo> *ct = customTypes(); |
869 | 0 | if (!ct) |
870 | 0 | return; |
871 | 0 | QWriteLocker locker(customTypesLock()); |
872 | 0 | QCustomTypeInfo &inf = (*ct)[idx - User]; |
873 | 0 | inf.saveOp = saveOp; |
874 | 0 | inf.loadOp = loadOp; |
875 | 0 | } |
876 | | #endif // QT_NO_DATASTREAM |
877 | | |
878 | | // We don't officially support constexpr in MSVC 2015, but the limited support it |
879 | | // has is enough for the code below. |
880 | | |
881 | | #define STRINGIFY_TYPE_NAME(MetaTypeName, TypeId, RealName) \ |
882 | | #RealName "\0" |
883 | | #define CALCULATE_TYPE_LEN(MetaTypeName, TypeId, RealName) \ |
884 | | short(sizeof(#RealName)), |
885 | | #define MAP_TYPE_ID_TO_IDX(MetaTypeName, TypeId, RealName) \ |
886 | | TypeId, |
887 | | |
888 | | namespace { |
889 | | // All type names in one long string. |
890 | | constexpr char metaTypeStrings[] = QT_FOR_EACH_STATIC_TYPE(STRINGIFY_TYPE_NAME); |
891 | | |
892 | | // The sizes of the strings in the metaTypeStrings string (including terminating null) |
893 | | constexpr short metaTypeNameSizes[] = { |
894 | | QT_FOR_EACH_STATIC_TYPE(CALCULATE_TYPE_LEN) |
895 | | }; |
896 | | |
897 | | // The type IDs, in the order of the metaTypeStrings data |
898 | | constexpr short metaTypeIds[] = { |
899 | | QT_FOR_EACH_STATIC_TYPE(MAP_TYPE_ID_TO_IDX) |
900 | | }; |
901 | | |
902 | | constexpr int MetaTypeNameCount = sizeof(metaTypeNameSizes) / sizeof(metaTypeNameSizes[0]); |
903 | | |
904 | | template <typename IntegerSequence> struct MetaTypeOffsets; |
905 | | template <int... TypeIds> struct MetaTypeOffsets<QtPrivate::IndexesList<TypeIds...>> |
906 | | { |
907 | | // This would have been a lot easier if the meta types that the macro |
908 | | // QT_FOR_EACH_STATIC_TYPE declared were in sorted, ascending order, but |
909 | | // they're not (i.e., the first one declared is QMetaType::Void == 43, |
910 | | // followed by QMetaType::Bool == 1)... As a consequence, we need to use |
911 | | // the C++11 constexpr function calculateOffsetForTypeId below in order to |
912 | | // create the offset array. |
913 | | |
914 | | static constexpr int findTypeId(int typeId, int i = 0) |
915 | 0 | { |
916 | 0 | return i >= MetaTypeNameCount ? -1 : |
917 | 0 | metaTypeIds[i] == typeId ? i : findTypeId(typeId, i + 1); |
918 | 0 | } |
919 | | |
920 | | static constexpr short calculateOffsetForIdx(int i) |
921 | 0 | { |
922 | 0 | return i < 0 ? -1 : |
923 | 0 | i == 0 ? 0 : metaTypeNameSizes[i - 1] + calculateOffsetForIdx(i - 1); |
924 | 0 | } |
925 | | |
926 | | static constexpr short calculateOffsetForTypeId(int typeId) |
927 | 0 | { |
928 | 0 | return calculateOffsetForIdx(findTypeId(typeId)); |
929 | 0 | #if 0 |
930 | 0 | // same as, but this is only valid in C++14: |
931 | 0 | short offset = 0; |
932 | 0 | for (int i = 0; i < MetaTypeNameCount; ++i) { |
933 | 0 | if (metaTypeIds[i] == typeId) |
934 | 0 | return offset; |
935 | 0 | offset += metaTypeNameSizes[i]; |
936 | 0 | } |
937 | 0 | return -1; |
938 | 0 | #endif |
939 | 0 | } |
940 | | |
941 | | short offsets[sizeof...(TypeIds)]; |
942 | | constexpr MetaTypeOffsets() : offsets{calculateOffsetForTypeId(TypeIds)...} {} |
943 | | |
944 | | const char *operator[](int typeId) const noexcept |
945 | 0 | { |
946 | 0 | short o = offsets[typeId]; |
947 | 0 | return o < 0 ? nullptr : metaTypeStrings + o; |
948 | 0 | } |
949 | | }; |
950 | | } // anonymous namespace |
951 | | |
952 | | constexpr MetaTypeOffsets<QtPrivate::Indexes<QMetaType::HighestInternalId + 1>::Value> metaTypeNames {}; |
953 | | #undef STRINGIFY_TYPE_NAME |
954 | | #undef CALCULATE_TYPE_LEN |
955 | | #undef MAP_TYPE_ID_TO_IDX |
956 | | |
957 | | /*! |
958 | | Returns the type name associated with the given \a typeId, or a null |
959 | | pointer if no matching type was found. The returned pointer must not be |
960 | | deleted. |
961 | | |
962 | | \sa type(), isRegistered(), Type, name() |
963 | | */ |
964 | | const char *QMetaType::typeName(int typeId) |
965 | 0 | { |
966 | 0 | const uint type = typeId; |
967 | 0 | if (Q_LIKELY(type <= QMetaType::HighestInternalId)) { |
968 | 0 | return metaTypeNames[typeId]; |
969 | 0 | } else if (Q_UNLIKELY(type < QMetaType::User)) { |
970 | 0 | return nullptr; // It can happen when someone cast int to QVariant::Type, we should not crash... |
971 | 0 | } |
972 | | |
973 | 0 | const QVector<QCustomTypeInfo> * const ct = customTypes(); |
974 | 0 | QReadLocker locker(customTypesLock()); |
975 | 0 | return ct && uint(ct->count()) > type - QMetaType::User && !ct->at(type - QMetaType::User).typeName.isEmpty() |
976 | 0 | ? ct->at(type - QMetaType::User).typeName.constData() |
977 | 0 | : nullptr; |
978 | |
|
979 | 0 | #undef QT_METATYPE_TYPEID_TYPENAME_CONVERTER |
980 | 0 | } |
981 | | |
982 | | /*! |
983 | | \since 5.15 |
984 | | |
985 | | Returns the type name associated with this QMetaType, or a null |
986 | | pointer if no matching type was found. The returned pointer must not be |
987 | | deleted. |
988 | | |
989 | | \sa typeName() |
990 | | */ |
991 | | QByteArray QMetaType::name() const |
992 | 0 | { |
993 | 0 | return QMetaType::typeName(m_typeId); |
994 | 0 | } |
995 | | |
996 | | /* |
997 | | Similar to QMetaType::type(), but only looks in the static set of types. |
998 | | */ |
999 | | static inline int qMetaTypeStaticType(const char *typeName, int length) |
1000 | 0 | { |
1001 | 0 | int i = 0; |
1002 | 0 | while (types[i].typeName && ((length != types[i].typeNameLength) |
1003 | 0 | || memcmp(typeName, types[i].typeName, length))) { |
1004 | 0 | ++i; |
1005 | 0 | } |
1006 | 0 | return types[i].type; |
1007 | 0 | } |
1008 | | |
1009 | | /* |
1010 | | Similar to QMetaType::type(), but only looks in the custom set of |
1011 | | types, and doesn't lock the mutex. |
1012 | | The extra \a firstInvalidIndex parameter is an easy way to avoid |
1013 | | iterating over customTypes() a second time in registerNormalizedType(). |
1014 | | */ |
1015 | | static int qMetaTypeCustomType_unlocked(const char *typeName, int length, int *firstInvalidIndex = nullptr) |
1016 | 0 | { |
1017 | 0 | const QVector<QCustomTypeInfo> * const ct = customTypes(); |
1018 | 0 | if (!ct) |
1019 | 0 | return QMetaType::UnknownType; |
1020 | | |
1021 | 0 | if (firstInvalidIndex) |
1022 | 0 | *firstInvalidIndex = -1; |
1023 | 0 | for (int v = 0; v < ct->count(); ++v) { |
1024 | 0 | const QCustomTypeInfo &customInfo = ct->at(v); |
1025 | 0 | if ((length == customInfo.typeName.size()) |
1026 | 0 | && !memcmp(typeName, customInfo.typeName.constData(), length)) { |
1027 | 0 | if (customInfo.alias >= 0) |
1028 | 0 | return customInfo.alias; |
1029 | 0 | return v + QMetaType::User; |
1030 | 0 | } |
1031 | 0 | if (firstInvalidIndex && (*firstInvalidIndex < 0) && customInfo.typeName.isEmpty()) |
1032 | 0 | *firstInvalidIndex = v; |
1033 | 0 | } |
1034 | 0 | return QMetaType::UnknownType; |
1035 | 0 | } |
1036 | | |
1037 | | /*! |
1038 | | \internal |
1039 | | |
1040 | | This function is needed until existing code outside of qtbase |
1041 | | has been changed to call the new version of registerType(). |
1042 | | */ |
1043 | | int QMetaType::registerType(const char *typeName, Deleter deleter, |
1044 | | Creator creator) |
1045 | 0 | { |
1046 | 0 | return registerType(typeName, deleter, creator, |
1047 | 0 | QtMetaTypePrivate::QMetaTypeFunctionHelper<void>::Destruct, |
1048 | 0 | QtMetaTypePrivate::QMetaTypeFunctionHelper<void>::Construct, 0, TypeFlags(), nullptr); |
1049 | 0 | } |
1050 | | |
1051 | | /*! |
1052 | | \internal |
1053 | | \since 5.5 |
1054 | | |
1055 | | Unregisters the user type with the given \a typeId and all its aliases. |
1056 | | Returns \c true if the type was unregistered or \c false otherwise. |
1057 | | |
1058 | | This function was added for QML to be able to deregister types after |
1059 | | they are unloaded to prevent an infinite increase in custom types for |
1060 | | applications that are unloading/reloading components often. |
1061 | | */ |
1062 | | bool QMetaType::unregisterType(int type) |
1063 | 0 | { |
1064 | 0 | QWriteLocker locker(customTypesLock()); |
1065 | 0 | QVector<QCustomTypeInfo> *ct = customTypes(); |
1066 | | |
1067 | | // check if user type |
1068 | 0 | if ((type < User) || ((type - User) >= ct->size())) |
1069 | 0 | return false; |
1070 | | |
1071 | | // only types without Q_DECLARE_METATYPE can be unregistered |
1072 | 0 | if (ct->data()[type - User].flags & WasDeclaredAsMetaType) |
1073 | 0 | return false; |
1074 | | |
1075 | | // invalidate type and all its alias entries |
1076 | 0 | for (int v = 0; v < ct->count(); ++v) { |
1077 | 0 | if (((v + User) == type) || (ct->at(v).alias == type)) |
1078 | 0 | ct->data()[v].typeName.clear(); |
1079 | 0 | } |
1080 | 0 | return true; |
1081 | 0 | } |
1082 | | |
1083 | | |
1084 | | /*! |
1085 | | \internal |
1086 | | \since 5.0 |
1087 | | |
1088 | | Registers a user type for marshalling, with \a typeName, a \a |
1089 | | deleter, a \a creator, a \a destructor, a \a constructor, and |
1090 | | a \a size. Returns the type's handle, or -1 if the type could |
1091 | | not be registered. |
1092 | | */ |
1093 | | int QMetaType::registerType(const char *typeName, Deleter deleter, |
1094 | | Creator creator, |
1095 | | Destructor destructor, |
1096 | | Constructor constructor, |
1097 | | int size, TypeFlags flags, const QMetaObject *metaObject) |
1098 | 0 | { |
1099 | | #ifdef QT_NO_QOBJECT |
1100 | | NS(QByteArray) normalizedTypeName = typeName; |
1101 | | #else |
1102 | 0 | NS(QByteArray) normalizedTypeName = QMetaObject::normalizedType(typeName); |
1103 | 0 | #endif |
1104 | |
|
1105 | 0 | return registerNormalizedType(normalizedTypeName, deleter, creator, destructor, constructor, size, flags, metaObject); |
1106 | 0 | } |
1107 | | |
1108 | | /*! |
1109 | | \internal |
1110 | | \since 5.12 |
1111 | | |
1112 | | Registers a user type for marshalling, with \a typeName, a |
1113 | | \a destructor, a \a constructor, and a \a size. Returns the |
1114 | | type's handle, or -1 if the type could not be registered. |
1115 | | */ |
1116 | | int QMetaType::registerType(const char *typeName, |
1117 | | TypedDestructor destructor, |
1118 | | TypedConstructor constructor, |
1119 | | int size, |
1120 | | TypeFlags flags, |
1121 | | const QMetaObject *metaObject) |
1122 | 0 | { |
1123 | | #ifdef QT_NO_QOBJECT |
1124 | | NS(QByteArray) normalizedTypeName = typeName; |
1125 | | #else |
1126 | 0 | NS(QByteArray) normalizedTypeName = QMetaObject::normalizedType(typeName); |
1127 | 0 | #endif |
1128 | |
|
1129 | 0 | return registerNormalizedType(normalizedTypeName, destructor, constructor, size, flags, metaObject); |
1130 | 0 | } |
1131 | | |
1132 | | |
1133 | | static int registerNormalizedType(const NS(QByteArray) &normalizedTypeName, |
1134 | | QMetaType::Destructor destructor, |
1135 | | QMetaType::Constructor constructor, |
1136 | | QMetaType::TypedDestructor typedDestructor, |
1137 | | QMetaType::TypedConstructor typedConstructor, |
1138 | | int size, QMetaType::TypeFlags flags, const QMetaObject *metaObject) |
1139 | 0 | { |
1140 | 0 | QVector<QCustomTypeInfo> *ct = customTypes(); |
1141 | 0 | if (!ct || normalizedTypeName.isEmpty() || (!destructor && !typedDestructor) || (!constructor && !typedConstructor)) |
1142 | 0 | return -1; |
1143 | | |
1144 | 0 | int idx = qMetaTypeStaticType(normalizedTypeName.constData(), |
1145 | 0 | normalizedTypeName.size()); |
1146 | |
|
1147 | 0 | int previousSize = 0; |
1148 | 0 | QMetaType::TypeFlags::Int previousFlags = 0; |
1149 | 0 | if (idx == QMetaType::UnknownType) { |
1150 | 0 | QWriteLocker locker(customTypesLock()); |
1151 | 0 | int posInVector = -1; |
1152 | 0 | idx = qMetaTypeCustomType_unlocked(normalizedTypeName.constData(), |
1153 | 0 | normalizedTypeName.size(), |
1154 | 0 | &posInVector); |
1155 | 0 | if (idx == QMetaType::UnknownType) { |
1156 | 0 | QCustomTypeInfo inf; |
1157 | 0 | inf.typeName = normalizedTypeName; |
1158 | 0 | #ifndef QT_NO_DATASTREAM |
1159 | 0 | inf.loadOp = nullptr; |
1160 | 0 | inf.saveOp = nullptr; |
1161 | 0 | #endif |
1162 | 0 | inf.alias = -1; |
1163 | 0 | inf.typedConstructor = typedConstructor; |
1164 | 0 | inf.typedDestructor = typedDestructor; |
1165 | 0 | inf.constructor = constructor; |
1166 | 0 | inf.destructor = destructor; |
1167 | 0 | inf.size = size; |
1168 | 0 | inf.flags = flags; |
1169 | 0 | inf.metaObject = metaObject; |
1170 | 0 | if (posInVector == -1) { |
1171 | 0 | idx = ct->size() + QMetaType::User; |
1172 | 0 | ct->append(inf); |
1173 | 0 | } else { |
1174 | 0 | idx = posInVector + QMetaType::User; |
1175 | 0 | ct->data()[posInVector] = inf; |
1176 | 0 | } |
1177 | 0 | return idx; |
1178 | 0 | } |
1179 | | |
1180 | 0 | if (idx >= QMetaType::User) { |
1181 | 0 | previousSize = ct->at(idx - QMetaType::User).size; |
1182 | 0 | previousFlags = ct->at(idx - QMetaType::User).flags; |
1183 | | |
1184 | | // Set new/additional flags in case of old library/app. |
1185 | | // Ensures that older code works in conjunction with new Qt releases |
1186 | | // requiring the new flags. |
1187 | 0 | if (flags != previousFlags) { |
1188 | 0 | QCustomTypeInfo &inf = ct->data()[idx - QMetaType::User]; |
1189 | 0 | inf.flags |= flags; |
1190 | 0 | if (metaObject) |
1191 | 0 | inf.metaObject = metaObject; |
1192 | 0 | } |
1193 | 0 | } |
1194 | 0 | } |
1195 | | |
1196 | 0 | if (idx < QMetaType::User) { |
1197 | 0 | previousSize = QMetaType::sizeOf(idx); |
1198 | 0 | previousFlags = QMetaType::typeFlags(idx); |
1199 | 0 | } |
1200 | |
|
1201 | 0 | if (Q_UNLIKELY(previousSize != size)) { |
1202 | 0 | qFatal("QMetaType::registerType: Binary compatibility break " |
1203 | 0 | "-- Size mismatch for type '%s' [%i]. Previously registered " |
1204 | 0 | "size %i, now registering size %i.", |
1205 | 0 | normalizedTypeName.constData(), idx, previousSize, size); |
1206 | 0 | } |
1207 | | |
1208 | | // these flags cannot change in a binary compatible way: |
1209 | 0 | const int binaryCompatibilityFlag = QMetaType::PointerToQObject | QMetaType::IsEnumeration | QMetaType::SharedPointerToQObject |
1210 | 0 | | QMetaType::WeakPointerToQObject | QMetaType::TrackingPointerToQObject; |
1211 | 0 | if (Q_UNLIKELY((previousFlags ^ flags) & binaryCompatibilityFlag)) { |
1212 | |
|
1213 | 0 | const char *msg = "QMetaType::registerType: Binary compatibility break. " |
1214 | 0 | "\nType flags for type '%s' [%i] don't match. Previously " |
1215 | 0 | "registered TypeFlags(0x%x), now registering TypeFlags(0x%x). "; |
1216 | |
|
1217 | 0 | qFatal(msg, normalizedTypeName.constData(), idx, previousFlags, int(flags)); |
1218 | 0 | } |
1219 | |
|
1220 | 0 | return idx; |
1221 | 0 | } |
1222 | | |
1223 | | /*! |
1224 | | \internal |
1225 | | \since 5.0 |
1226 | | \overload |
1227 | | Don't use, kept for binary compatibility |
1228 | | |
1229 | | ### TODO Qt6: remove me |
1230 | | */ |
1231 | | int QMetaType::registerNormalizedType(const NS(QByteArray) &normalizedTypeName, Deleter deleter, |
1232 | | Creator creator, |
1233 | | Destructor destructor, |
1234 | | Constructor constructor, |
1235 | | int size, TypeFlags flags, const QMetaObject *metaObject) |
1236 | 0 | { |
1237 | 0 | Q_UNUSED(deleter); |
1238 | 0 | Q_UNUSED(creator); |
1239 | 0 | return registerNormalizedType(normalizedTypeName, destructor, constructor, size, flags, metaObject); |
1240 | 0 | } |
1241 | | |
1242 | | |
1243 | | /*! |
1244 | | \internal |
1245 | | \since 5.5 |
1246 | | |
1247 | | Registers a user type for marshalling, with \a normalizedTypeName, |
1248 | | a \a destructor, a \a constructor, and a \a size. Returns the type's |
1249 | | handle, or -1 if the type could not be registered. |
1250 | | |
1251 | | \note normalizedTypeName is not checked for conformance with |
1252 | | Qt's normalized format, so it must already conform. |
1253 | | |
1254 | | ### TODO Qt6: remove me |
1255 | | */ |
1256 | | int QMetaType::registerNormalizedType(const NS(QByteArray) &normalizedTypeName, |
1257 | | Destructor destructor, |
1258 | | Constructor constructor, |
1259 | | int size, TypeFlags flags, const QMetaObject *metaObject) |
1260 | 0 | { |
1261 | 0 | return NS(registerNormalizedType)(normalizedTypeName, destructor, constructor, nullptr, nullptr, size, flags, metaObject); |
1262 | 0 | } |
1263 | | |
1264 | | /*! |
1265 | | \internal |
1266 | | \since 5.12 |
1267 | | |
1268 | | Registers a user type for marshalling, with \a normalizedTypeName, |
1269 | | a \a destructor, a \a constructor, and a \a size. Returns the type's |
1270 | | handle, or -1 if the type could not be registered. |
1271 | | |
1272 | | \note normalizedTypeName is not checked for conformance with |
1273 | | Qt's normalized format, so it must already conform. |
1274 | | */ |
1275 | | int QMetaType::registerNormalizedType(const NS(QByteArray) &normalizedTypeName, |
1276 | | TypedDestructor destructor, |
1277 | | TypedConstructor constructor, |
1278 | | int size, TypeFlags flags, const QMetaObject *metaObject) |
1279 | 0 | { |
1280 | 0 | return NS(registerNormalizedType)(normalizedTypeName, nullptr, nullptr, destructor, constructor, size, flags, metaObject); |
1281 | 0 | } |
1282 | | |
1283 | | /*! |
1284 | | \internal |
1285 | | \since 4.7 |
1286 | | |
1287 | | Registers a user type for marshalling, as an alias of another type (typedef) |
1288 | | */ |
1289 | | int QMetaType::registerTypedef(const char* typeName, int aliasId) |
1290 | 0 | { |
1291 | | #ifdef QT_NO_QOBJECT |
1292 | | NS(QByteArray) normalizedTypeName = typeName; |
1293 | | #else |
1294 | 0 | NS(QByteArray) normalizedTypeName = QMetaObject::normalizedType(typeName); |
1295 | 0 | #endif |
1296 | |
|
1297 | 0 | return registerNormalizedTypedef(normalizedTypeName, aliasId); |
1298 | 0 | } |
1299 | | |
1300 | | /*! |
1301 | | \internal |
1302 | | \since 5.0 |
1303 | | |
1304 | | Registers a user type for marshalling, as an alias of another type (typedef). |
1305 | | Note that normalizedTypeName is not checked for conformance with Qt's normalized format, |
1306 | | so it must already conform. |
1307 | | */ |
1308 | | int QMetaType::registerNormalizedTypedef(const NS(QByteArray) &normalizedTypeName, int aliasId) |
1309 | 0 | { |
1310 | 0 | QVector<QCustomTypeInfo> *ct = customTypes(); |
1311 | 0 | if (!ct || normalizedTypeName.isEmpty()) |
1312 | 0 | return -1; |
1313 | | |
1314 | 0 | int idx = qMetaTypeStaticType(normalizedTypeName.constData(), |
1315 | 0 | normalizedTypeName.size()); |
1316 | |
|
1317 | 0 | if (idx == UnknownType) { |
1318 | 0 | QWriteLocker locker(customTypesLock()); |
1319 | 0 | int posInVector = -1; |
1320 | 0 | idx = qMetaTypeCustomType_unlocked(normalizedTypeName.constData(), |
1321 | 0 | normalizedTypeName.size(), |
1322 | 0 | &posInVector); |
1323 | |
|
1324 | 0 | if (idx == UnknownType) { |
1325 | 0 | QCustomTypeInfo inf; |
1326 | 0 | inf.typeName = normalizedTypeName; |
1327 | 0 | inf.alias = aliasId; |
1328 | 0 | if (posInVector == -1) |
1329 | 0 | ct->append(inf); |
1330 | 0 | else |
1331 | 0 | ct->data()[posInVector] = inf; |
1332 | 0 | return aliasId; |
1333 | 0 | } |
1334 | 0 | } |
1335 | | |
1336 | 0 | if (idx != aliasId) { |
1337 | 0 | qWarning("QMetaType::registerTypedef: " |
1338 | 0 | "-- Type name '%s' previously registered as typedef of '%s' [%i], " |
1339 | 0 | "now registering as typedef of '%s' [%i].", |
1340 | 0 | normalizedTypeName.constData(), QMetaType::typeName(idx), idx, |
1341 | 0 | QMetaType::typeName(aliasId), aliasId); |
1342 | 0 | } |
1343 | 0 | return idx; |
1344 | 0 | } |
1345 | | |
1346 | | /*! |
1347 | | Returns \c true if the datatype with ID \a type is registered; |
1348 | | otherwise returns \c false. |
1349 | | |
1350 | | \sa type(), typeName(), Type |
1351 | | */ |
1352 | | bool QMetaType::isRegistered(int type) |
1353 | 0 | { |
1354 | | // predefined type |
1355 | 0 | if ((type >= FirstCoreType && type <= LastCoreType) |
1356 | 0 | || (type >= FirstGuiType && type <= LastGuiType) |
1357 | 0 | || (type >= FirstWidgetsType && type <= LastWidgetsType)) { |
1358 | 0 | return true; |
1359 | 0 | } |
1360 | | |
1361 | 0 | QReadLocker locker(customTypesLock()); |
1362 | 0 | const QVector<QCustomTypeInfo> * const ct = customTypes(); |
1363 | 0 | return ((type >= User) && (ct && ct->count() > type - User) && !ct->at(type - User).typeName.isEmpty()); |
1364 | 0 | } |
1365 | | |
1366 | | template <bool tryNormalizedType> |
1367 | | static inline int qMetaTypeTypeImpl(const char *typeName, int length) |
1368 | 0 | { |
1369 | 0 | if (!length) |
1370 | 0 | return QMetaType::UnknownType; |
1371 | 0 | int type = qMetaTypeStaticType(typeName, length); |
1372 | 0 | if (type == QMetaType::UnknownType) { |
1373 | 0 | QReadLocker locker(customTypesLock()); |
1374 | 0 | type = qMetaTypeCustomType_unlocked(typeName, length); |
1375 | 0 | #ifndef QT_NO_QOBJECT |
1376 | 0 | if ((type == QMetaType::UnknownType) && tryNormalizedType) { |
1377 | 0 | const NS(QByteArray) normalizedTypeName = QMetaObject::normalizedType(typeName); |
1378 | 0 | type = qMetaTypeStaticType(normalizedTypeName.constData(), |
1379 | 0 | normalizedTypeName.size()); |
1380 | 0 | if (type == QMetaType::UnknownType) { |
1381 | 0 | type = qMetaTypeCustomType_unlocked(normalizedTypeName.constData(), |
1382 | 0 | normalizedTypeName.size()); |
1383 | 0 | } |
1384 | 0 | } |
1385 | 0 | #endif |
1386 | 0 | } |
1387 | 0 | return type; |
1388 | 0 | } Unexecuted instantiation: qmetatype.cpp:int qMetaTypeTypeImpl<true>(char const*, int) Unexecuted instantiation: qmetatype.cpp:int qMetaTypeTypeImpl<false>(char const*, int) |
1389 | | |
1390 | | /*! |
1391 | | Returns a handle to the type called \a typeName, or QMetaType::UnknownType if there is |
1392 | | no such type. |
1393 | | |
1394 | | \sa isRegistered(), typeName(), Type |
1395 | | */ |
1396 | | int QMetaType::type(const char *typeName) |
1397 | 0 | { |
1398 | 0 | return qMetaTypeTypeImpl</*tryNormalizedType=*/true>(typeName, qstrlen(typeName)); |
1399 | 0 | } |
1400 | | |
1401 | | /*! |
1402 | | \a internal |
1403 | | |
1404 | | Similar to QMetaType::type(); the only difference is that this function |
1405 | | doesn't attempt to normalize the type name (i.e., the lookup will fail |
1406 | | for type names in non-normalized form). |
1407 | | */ |
1408 | | int qMetaTypeTypeInternal(const char *typeName) |
1409 | 0 | { |
1410 | 0 | return qMetaTypeTypeImpl</*tryNormalizedType=*/false>(typeName, qstrlen(typeName)); |
1411 | 0 | } |
1412 | | |
1413 | | /*! |
1414 | | \since 5.5 |
1415 | | \overload |
1416 | | |
1417 | | Returns a handle to the type called \a typeName, or 0 if there is |
1418 | | no such type. |
1419 | | |
1420 | | \sa isRegistered(), typeName() |
1421 | | */ |
1422 | | int QMetaType::type(const QT_PREPEND_NAMESPACE(QByteArray) &typeName) |
1423 | 0 | { |
1424 | 0 | return qMetaTypeTypeImpl</*tryNormalizedType=*/true>(typeName.constData(), typeName.size()); |
1425 | 0 | } |
1426 | | |
1427 | | #ifndef QT_NO_DATASTREAM |
1428 | | |
1429 | | namespace |
1430 | | { |
1431 | | |
1432 | | template<typename T> |
1433 | | class HasStreamOperator |
1434 | | { |
1435 | | struct Yes { char unused[1]; }; |
1436 | | struct No { char unused[2]; }; |
1437 | | Q_STATIC_ASSERT(sizeof(Yes) != sizeof(No)); |
1438 | | |
1439 | | template<class C> static decltype(std::declval<QDataStream&>().operator>>(std::declval<C&>()), Yes()) load(int); |
1440 | | template<class C> static decltype(operator>>(std::declval<QDataStream&>(), std::declval<C&>()), Yes()) load(int); |
1441 | | template<class C> static No load(...); |
1442 | | template<class C> static decltype(operator<<(std::declval<QDataStream&>(), std::declval<const C&>()), Yes()) saveFunction(int); |
1443 | | template<class C> static decltype(std::declval<QDataStream&>().operator<<(std::declval<const C&>()), Yes()) saveMethod(int); |
1444 | | template<class C> static No saveMethod(...); |
1445 | | template<class C> static No saveFunction(...); |
1446 | | static constexpr bool LoadValue = QtMetaTypePrivate::TypeDefinition<T>::IsAvailable && (sizeof(load<T>(0)) == sizeof(Yes)); |
1447 | | static constexpr bool SaveValue = QtMetaTypePrivate::TypeDefinition<T>::IsAvailable && |
1448 | | ((sizeof(saveMethod<T>(0)) == sizeof(Yes)) || (sizeof(saveFunction<T>(0)) == sizeof(Yes))); |
1449 | | public: |
1450 | | static constexpr bool Value = LoadValue && SaveValue; |
1451 | | }; |
1452 | | |
1453 | | // Quick sanity checks |
1454 | | Q_STATIC_ASSERT(HasStreamOperator<NS(QJsonDocument)>::Value); |
1455 | | Q_STATIC_ASSERT(!HasStreamOperator<void*>::Value); |
1456 | | Q_STATIC_ASSERT(HasStreamOperator<qint8>::Value); |
1457 | | |
1458 | | template<typename T, bool IsAcceptedType = DefinedTypesFilter::Acceptor<T>::IsAccepted && HasStreamOperator<T>::Value> |
1459 | | struct FilteredOperatorSwitch |
1460 | | { |
1461 | | static bool load(QDataStream &stream, T *data, int) |
1462 | 0 | { |
1463 | 0 | stream >> *data; |
1464 | 0 | return true; |
1465 | 0 | } Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<bool, true>::load(QDataStream&, bool*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<int, true>::load(QDataStream&, int*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<unsigned int, true>::load(QDataStream&, unsigned int*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<long long, true>::load(QDataStream&, long long*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<unsigned long long, true>::load(QDataStream&, unsigned long long*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<double, true>::load(QDataStream&, double*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<short, true>::load(QDataStream&, short*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<unsigned short, true>::load(QDataStream&, unsigned short*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<unsigned char, true>::load(QDataStream&, unsigned char*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<float, true>::load(QDataStream&, float*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<signed char, true>::load(QDataStream&, signed char*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<decltype(nullptr), true>::load(QDataStream&, decltype(nullptr)*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QCborSimpleType, true>::load(QDataStream&, QCborSimpleType*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QChar, true>::load(QDataStream&, QChar*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QString, true>::load(QDataStream&, QString*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QStringList, true>::load(QDataStream&, QStringList*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QByteArray, true>::load(QDataStream&, QByteArray*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QBitArray, true>::load(QDataStream&, QBitArray*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QDate, true>::load(QDataStream&, QDate*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QTime, true>::load(QDataStream&, QTime*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QDateTime, true>::load(QDataStream&, QDateTime*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QUrl, true>::load(QDataStream&, QUrl*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QLocale, true>::load(QDataStream&, QLocale*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QRect, true>::load(QDataStream&, QRect*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QRectF, true>::load(QDataStream&, QRectF*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QSize, true>::load(QDataStream&, QSize*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QSizeF, true>::load(QDataStream&, QSizeF*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QLine, true>::load(QDataStream&, QLine*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QLineF, true>::load(QDataStream&, QLineF*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QPoint, true>::load(QDataStream&, QPoint*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QPointF, true>::load(QDataStream&, QPointF*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QRegExp, true>::load(QDataStream&, QRegExp*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QEasingCurve, true>::load(QDataStream&, QEasingCurve*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QUuid, true>::load(QDataStream&, QUuid*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QVariant, true>::load(QDataStream&, QVariant*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QRegularExpression, true>::load(QDataStream&, QRegularExpression*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QJsonValue, true>::load(QDataStream&, QJsonValue*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QJsonObject, true>::load(QDataStream&, QJsonObject*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QJsonArray, true>::load(QDataStream&, QJsonArray*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QJsonDocument, true>::load(QDataStream&, QJsonDocument*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QCborValue, true>::load(QDataStream&, QCborValue*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QCborArray, true>::load(QDataStream&, QCborArray*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QCborMap, true>::load(QDataStream&, QCborMap*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QMap<QString, QVariant>, true>::load(QDataStream&, QMap<QString, QVariant>*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QList<QVariant>, true>::load(QDataStream&, QList<QVariant>*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QHash<QString, QVariant>, true>::load(QDataStream&, QHash<QString, QVariant>*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QList<QByteArray>, true>::load(QDataStream&, QList<QByteArray>*, int) |
1466 | | static bool save(QDataStream &stream, const T *data, int) |
1467 | 0 | { |
1468 | 0 | stream << *data; |
1469 | 0 | return true; |
1470 | 0 | } Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<bool, true>::save(QDataStream&, bool const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<int, true>::save(QDataStream&, int const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<unsigned int, true>::save(QDataStream&, unsigned int const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<long long, true>::save(QDataStream&, long long const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<unsigned long long, true>::save(QDataStream&, unsigned long long const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<double, true>::save(QDataStream&, double const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<short, true>::save(QDataStream&, short const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<unsigned short, true>::save(QDataStream&, unsigned short const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<unsigned char, true>::save(QDataStream&, unsigned char const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<float, true>::save(QDataStream&, float const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<signed char, true>::save(QDataStream&, signed char const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<decltype(nullptr), true>::save(QDataStream&, decltype(nullptr) const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QCborSimpleType, true>::save(QDataStream&, QCborSimpleType const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QChar, true>::save(QDataStream&, QChar const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QString, true>::save(QDataStream&, QString const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QStringList, true>::save(QDataStream&, QStringList const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QByteArray, true>::save(QDataStream&, QByteArray const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QBitArray, true>::save(QDataStream&, QBitArray const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QDate, true>::save(QDataStream&, QDate const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QTime, true>::save(QDataStream&, QTime const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QDateTime, true>::save(QDataStream&, QDateTime const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QUrl, true>::save(QDataStream&, QUrl const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QLocale, true>::save(QDataStream&, QLocale const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QRect, true>::save(QDataStream&, QRect const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QRectF, true>::save(QDataStream&, QRectF const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QSize, true>::save(QDataStream&, QSize const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QSizeF, true>::save(QDataStream&, QSizeF const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QLine, true>::save(QDataStream&, QLine const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QLineF, true>::save(QDataStream&, QLineF const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QPoint, true>::save(QDataStream&, QPoint const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QPointF, true>::save(QDataStream&, QPointF const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QRegExp, true>::save(QDataStream&, QRegExp const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QEasingCurve, true>::save(QDataStream&, QEasingCurve const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QUuid, true>::save(QDataStream&, QUuid const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QVariant, true>::save(QDataStream&, QVariant const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QRegularExpression, true>::save(QDataStream&, QRegularExpression const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QJsonValue, true>::save(QDataStream&, QJsonValue const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QJsonObject, true>::save(QDataStream&, QJsonObject const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QJsonArray, true>::save(QDataStream&, QJsonArray const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QJsonDocument, true>::save(QDataStream&, QJsonDocument const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QCborValue, true>::save(QDataStream&, QCborValue const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QCborArray, true>::save(QDataStream&, QCborArray const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QCborMap, true>::save(QDataStream&, QCborMap const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QMap<QString, QVariant>, true>::save(QDataStream&, QMap<QString, QVariant> const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QList<QVariant>, true>::save(QDataStream&, QList<QVariant> const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QHash<QString, QVariant>, true>::save(QDataStream&, QHash<QString, QVariant> const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QList<QByteArray>, true>::save(QDataStream&, QList<QByteArray> const*, int) |
1471 | | }; |
1472 | | template<typename T> |
1473 | | struct FilteredOperatorSwitch<T, /* IsAcceptedType = */ false> |
1474 | | { |
1475 | | static const QMetaTypeInterface* getMetaTypeInterface(int type) |
1476 | 0 | { |
1477 | 0 | if (QModulesPrivate::QTypeModuleInfo<T>::IsGui && qMetaTypeGuiHelper) |
1478 | 0 | return &qMetaTypeGuiHelper[type - QMetaType::FirstGuiType]; |
1479 | 0 | else if (QModulesPrivate::QTypeModuleInfo<T>::IsWidget && qMetaTypeWidgetsHelper) |
1480 | 0 | return &qMetaTypeWidgetsHelper[type - QMetaType::FirstWidgetsType]; |
1481 | 0 | return nullptr; |
1482 | 0 | } Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<void*, false>::getMetaTypeInterface(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QModelIndex, false>::getMetaTypeInterface(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QPersistentModelIndex, false>::getMetaTypeInterface(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QObject*, false>::getMetaTypeInterface(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QFont, false>::getMetaTypeInterface(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QPixmap, false>::getMetaTypeInterface(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QBrush, false>::getMetaTypeInterface(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QColor, false>::getMetaTypeInterface(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QPalette, false>::getMetaTypeInterface(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QIcon, false>::getMetaTypeInterface(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QImage, false>::getMetaTypeInterface(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QPolygon, false>::getMetaTypeInterface(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QRegion, false>::getMetaTypeInterface(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QBitmap, false>::getMetaTypeInterface(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QCursor, false>::getMetaTypeInterface(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QKeySequence, false>::getMetaTypeInterface(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QPen, false>::getMetaTypeInterface(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QTextLength, false>::getMetaTypeInterface(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QTextFormat, false>::getMetaTypeInterface(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QMatrix, false>::getMetaTypeInterface(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QTransform, false>::getMetaTypeInterface(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QMatrix4x4, false>::getMetaTypeInterface(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QVector2D, false>::getMetaTypeInterface(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QVector3D, false>::getMetaTypeInterface(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QVector4D, false>::getMetaTypeInterface(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QQuaternion, false>::getMetaTypeInterface(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QPolygonF, false>::getMetaTypeInterface(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QColorSpace, false>::getMetaTypeInterface(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QSizePolicy, false>::getMetaTypeInterface(int) |
1483 | | static bool save(QDataStream &stream, const T *data, int type) |
1484 | 0 | { |
1485 | 0 | if (auto interface = getMetaTypeInterface(type)) { |
1486 | 0 | interface->saveOp(stream, data); |
1487 | 0 | return true; |
1488 | 0 | } |
1489 | 0 | return false; |
1490 | 0 | } Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<void*, false>::save(QDataStream&, void* const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QModelIndex, false>::save(QDataStream&, QModelIndex const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QPersistentModelIndex, false>::save(QDataStream&, QPersistentModelIndex const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QObject*, false>::save(QDataStream&, QObject* const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QFont, false>::save(QDataStream&, QFont const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QPixmap, false>::save(QDataStream&, QPixmap const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QBrush, false>::save(QDataStream&, QBrush const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QColor, false>::save(QDataStream&, QColor const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QPalette, false>::save(QDataStream&, QPalette const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QIcon, false>::save(QDataStream&, QIcon const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QImage, false>::save(QDataStream&, QImage const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QPolygon, false>::save(QDataStream&, QPolygon const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QRegion, false>::save(QDataStream&, QRegion const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QBitmap, false>::save(QDataStream&, QBitmap const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QCursor, false>::save(QDataStream&, QCursor const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QKeySequence, false>::save(QDataStream&, QKeySequence const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QPen, false>::save(QDataStream&, QPen const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QTextLength, false>::save(QDataStream&, QTextLength const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QTextFormat, false>::save(QDataStream&, QTextFormat const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QMatrix, false>::save(QDataStream&, QMatrix const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QTransform, false>::save(QDataStream&, QTransform const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QMatrix4x4, false>::save(QDataStream&, QMatrix4x4 const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QVector2D, false>::save(QDataStream&, QVector2D const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QVector3D, false>::save(QDataStream&, QVector3D const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QVector4D, false>::save(QDataStream&, QVector4D const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QQuaternion, false>::save(QDataStream&, QQuaternion const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QPolygonF, false>::save(QDataStream&, QPolygonF const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QColorSpace, false>::save(QDataStream&, QColorSpace const*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QSizePolicy, false>::save(QDataStream&, QSizePolicy const*, int) |
1491 | | static bool load(QDataStream &stream, T *data, int type) |
1492 | 0 | { |
1493 | 0 | if (auto interface = getMetaTypeInterface(type)) { |
1494 | 0 | interface->loadOp(stream, data); |
1495 | 0 | return true; |
1496 | 0 | } |
1497 | 0 | return false; |
1498 | 0 | } Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<void*, false>::load(QDataStream&, void**, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QModelIndex, false>::load(QDataStream&, QModelIndex*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QPersistentModelIndex, false>::load(QDataStream&, QPersistentModelIndex*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QObject*, false>::load(QDataStream&, QObject**, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QFont, false>::load(QDataStream&, QFont*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QPixmap, false>::load(QDataStream&, QPixmap*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QBrush, false>::load(QDataStream&, QBrush*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QColor, false>::load(QDataStream&, QColor*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QPalette, false>::load(QDataStream&, QPalette*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QIcon, false>::load(QDataStream&, QIcon*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QImage, false>::load(QDataStream&, QImage*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QPolygon, false>::load(QDataStream&, QPolygon*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QRegion, false>::load(QDataStream&, QRegion*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QBitmap, false>::load(QDataStream&, QBitmap*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QCursor, false>::load(QDataStream&, QCursor*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QKeySequence, false>::load(QDataStream&, QKeySequence*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QPen, false>::load(QDataStream&, QPen*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QTextLength, false>::load(QDataStream&, QTextLength*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QTextFormat, false>::load(QDataStream&, QTextFormat*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QMatrix, false>::load(QDataStream&, QMatrix*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QTransform, false>::load(QDataStream&, QTransform*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QMatrix4x4, false>::load(QDataStream&, QMatrix4x4*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QVector2D, false>::load(QDataStream&, QVector2D*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QVector3D, false>::load(QDataStream&, QVector3D*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QVector4D, false>::load(QDataStream&, QVector4D*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QQuaternion, false>::load(QDataStream&, QQuaternion*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QPolygonF, false>::load(QDataStream&, QPolygonF*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QColorSpace, false>::load(QDataStream&, QColorSpace*, int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::FilteredOperatorSwitch<QSizePolicy, false>::load(QDataStream&, QSizePolicy*, int) |
1499 | | }; |
1500 | | |
1501 | | class SaveOperatorSwitch |
1502 | | { |
1503 | | public: |
1504 | | QDataStream &stream; |
1505 | | int m_type; |
1506 | | |
1507 | | template<typename T> |
1508 | | bool delegate(const T *data) |
1509 | 0 | { |
1510 | 0 | return FilteredOperatorSwitch<T>::save(stream, data, m_type); |
1511 | 0 | } Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<bool>(bool const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<int>(int const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<unsigned int>(unsigned int const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<long long>(long long const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<unsigned long long>(unsigned long long const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<double>(double const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<short>(short const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<unsigned short>(unsigned short const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<unsigned char>(unsigned char const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<float>(float const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<signed char>(signed char const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<decltype(nullptr)>(decltype(nullptr) const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QCborSimpleType>(QCborSimpleType const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<void*>(void* const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QChar>(QChar const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QString>(QString const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QStringList>(QStringList const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QByteArray>(QByteArray const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QBitArray>(QBitArray const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QDate>(QDate const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QTime>(QTime const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QDateTime>(QDateTime const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QUrl>(QUrl const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QLocale>(QLocale const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QRect>(QRect const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QRectF>(QRectF const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QSize>(QSize const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QSizeF>(QSizeF const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QLine>(QLine const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QLineF>(QLineF const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QPoint>(QPoint const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QPointF>(QPointF const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QRegExp>(QRegExp const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QEasingCurve>(QEasingCurve const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QUuid>(QUuid const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QVariant>(QVariant const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QRegularExpression>(QRegularExpression const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QJsonValue>(QJsonValue const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QJsonObject>(QJsonObject const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QJsonArray>(QJsonArray const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QJsonDocument>(QJsonDocument const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QCborValue>(QCborValue const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QCborArray>(QCborArray const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QCborMap>(QCborMap const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QModelIndex>(QModelIndex const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QPersistentModelIndex>(QPersistentModelIndex const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QObject*>(QObject* const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QMap<QString, QVariant> >(QMap<QString, QVariant> const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QList<QVariant> >(QList<QVariant> const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QHash<QString, QVariant> >(QHash<QString, QVariant> const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QList<QByteArray> >(QList<QByteArray> const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QFont>(QFont const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QPixmap>(QPixmap const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QBrush>(QBrush const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QColor>(QColor const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QPalette>(QPalette const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QIcon>(QIcon const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QImage>(QImage const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QPolygon>(QPolygon const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QRegion>(QRegion const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QBitmap>(QBitmap const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QCursor>(QCursor const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QKeySequence>(QKeySequence const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QPen>(QPen const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QTextLength>(QTextLength const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QTextFormat>(QTextFormat const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QMatrix>(QMatrix const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QTransform>(QTransform const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QMatrix4x4>(QMatrix4x4 const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QVector2D>(QVector2D const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QVector3D>(QVector3D const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QVector4D>(QVector4D const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QQuaternion>(QQuaternion const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QPolygonF>(QPolygonF const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QColorSpace>(QColorSpace const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::SaveOperatorSwitch::delegate<QSizePolicy>(QSizePolicy const*) |
1512 | | bool delegate(const char *data) |
1513 | 0 | { |
1514 | | // force a char to be signed |
1515 | 0 | stream << qint8(*data); |
1516 | 0 | return true; |
1517 | 0 | } |
1518 | | bool delegate(const long *data) |
1519 | 0 | { |
1520 | 0 | stream << qlonglong(*data); |
1521 | 0 | return true; |
1522 | 0 | } |
1523 | | bool delegate(const unsigned long *data) |
1524 | 0 | { |
1525 | 0 | stream << qulonglong(*data); |
1526 | 0 | return true; |
1527 | 0 | } |
1528 | | bool delegate(const QMetaTypeSwitcher::NotBuiltinType *data) |
1529 | 0 | { |
1530 | 0 | const QVector<QCustomTypeInfo> * const ct = customTypes(); |
1531 | 0 | if (!ct) |
1532 | 0 | return false; |
1533 | 0 | QMetaType::SaveOperator saveOp = nullptr; |
1534 | 0 | { |
1535 | 0 | QReadLocker locker(customTypesLock()); |
1536 | 0 | saveOp = ct->at(m_type - QMetaType::User).saveOp; |
1537 | 0 | } |
1538 | 0 | if (!saveOp) |
1539 | 0 | return false; |
1540 | 0 | saveOp(stream, data); |
1541 | 0 | return true; |
1542 | 0 | } |
1543 | 0 | bool delegate(const void*) { return false; } |
1544 | 0 | bool delegate(const QMetaTypeSwitcher::UnknownType*) { return false; } |
1545 | | }; |
1546 | | class LoadOperatorSwitch |
1547 | | { |
1548 | | public: |
1549 | | QDataStream &stream; |
1550 | | int m_type; |
1551 | | |
1552 | | template<typename T> |
1553 | | bool delegate(const T *data) |
1554 | 0 | { |
1555 | 0 | return FilteredOperatorSwitch<T>::load(stream, const_cast<T*>(data), m_type); |
1556 | 0 | } Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<bool>(bool const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<int>(int const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<unsigned int>(unsigned int const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<long long>(long long const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<unsigned long long>(unsigned long long const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<double>(double const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<short>(short const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<unsigned short>(unsigned short const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<unsigned char>(unsigned char const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<float>(float const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<signed char>(signed char const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<decltype(nullptr)>(decltype(nullptr) const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QCborSimpleType>(QCborSimpleType const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<void*>(void* const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QChar>(QChar const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QString>(QString const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QStringList>(QStringList const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QByteArray>(QByteArray const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QBitArray>(QBitArray const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QDate>(QDate const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QTime>(QTime const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QDateTime>(QDateTime const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QUrl>(QUrl const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QLocale>(QLocale const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QRect>(QRect const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QRectF>(QRectF const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QSize>(QSize const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QSizeF>(QSizeF const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QLine>(QLine const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QLineF>(QLineF const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QPoint>(QPoint const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QPointF>(QPointF const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QRegExp>(QRegExp const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QEasingCurve>(QEasingCurve const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QUuid>(QUuid const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QVariant>(QVariant const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QRegularExpression>(QRegularExpression const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QJsonValue>(QJsonValue const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QJsonObject>(QJsonObject const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QJsonArray>(QJsonArray const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QJsonDocument>(QJsonDocument const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QCborValue>(QCborValue const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QCborArray>(QCborArray const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QCborMap>(QCborMap const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QModelIndex>(QModelIndex const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QPersistentModelIndex>(QPersistentModelIndex const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QObject*>(QObject* const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QMap<QString, QVariant> >(QMap<QString, QVariant> const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QList<QVariant> >(QList<QVariant> const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QHash<QString, QVariant> >(QHash<QString, QVariant> const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QList<QByteArray> >(QList<QByteArray> const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QFont>(QFont const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QPixmap>(QPixmap const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QBrush>(QBrush const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QColor>(QColor const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QPalette>(QPalette const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QIcon>(QIcon const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QImage>(QImage const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QPolygon>(QPolygon const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QRegion>(QRegion const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QBitmap>(QBitmap const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QCursor>(QCursor const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QKeySequence>(QKeySequence const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QPen>(QPen const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QTextLength>(QTextLength const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QTextFormat>(QTextFormat const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QMatrix>(QMatrix const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QTransform>(QTransform const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QMatrix4x4>(QMatrix4x4 const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QVector2D>(QVector2D const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QVector3D>(QVector3D const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QVector4D>(QVector4D const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QQuaternion>(QQuaternion const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QPolygonF>(QPolygonF const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QColorSpace>(QColorSpace const*) Unexecuted instantiation: qmetatype.cpp:bool (anonymous namespace)::LoadOperatorSwitch::delegate<QSizePolicy>(QSizePolicy const*) |
1557 | | bool delegate(const char *data) |
1558 | 0 | { |
1559 | | // force a char to be signed |
1560 | 0 | qint8 c; |
1561 | 0 | stream >> c; |
1562 | 0 | *const_cast<char*>(data) = c; |
1563 | 0 | return true; |
1564 | 0 | } |
1565 | | bool delegate(const long *data) |
1566 | 0 | { |
1567 | 0 | qlonglong l; |
1568 | 0 | stream >> l; |
1569 | 0 | *const_cast<long*>(data) = l; |
1570 | 0 | return true; |
1571 | 0 | } |
1572 | | bool delegate(const unsigned long *data) |
1573 | 0 | { |
1574 | 0 | qlonglong l; |
1575 | 0 | stream >> l; |
1576 | 0 | *const_cast<unsigned long*>(data) = l; |
1577 | 0 | return true; |
1578 | 0 | } |
1579 | | bool delegate(const QMetaTypeSwitcher::NotBuiltinType *data) |
1580 | 0 | { |
1581 | 0 | const QVector<QCustomTypeInfo> * const ct = customTypes(); |
1582 | 0 | if (!ct) |
1583 | 0 | return false; |
1584 | 0 | QMetaType::LoadOperator loadOp = nullptr; |
1585 | 0 | { |
1586 | 0 | QReadLocker locker(customTypesLock()); |
1587 | 0 | loadOp = ct->at(m_type - QMetaType::User).loadOp; |
1588 | 0 | } |
1589 | 0 | if (!loadOp) |
1590 | 0 | return false; |
1591 | 0 | loadOp(stream, const_cast<QMetaTypeSwitcher::NotBuiltinType*>(data)); |
1592 | 0 | return true; |
1593 | 0 | } |
1594 | 0 | bool delegate(const void*) { return false; } |
1595 | 0 | bool delegate(const QMetaTypeSwitcher::UnknownType*) { return false; } |
1596 | | }; |
1597 | | } // namespace |
1598 | | |
1599 | | /*! |
1600 | | Writes the object pointed to by \a data with the ID \a type to |
1601 | | the given \a stream. Returns \c true if the object is saved |
1602 | | successfully; otherwise returns \c false. |
1603 | | |
1604 | | The type must have been registered with qRegisterMetaType() and |
1605 | | qRegisterMetaTypeStreamOperators() beforehand. |
1606 | | |
1607 | | Normally, you should not need to call this function directly. |
1608 | | Instead, use QVariant's \c operator<<(), which relies on save() |
1609 | | to stream custom types. |
1610 | | |
1611 | | \sa load(), qRegisterMetaTypeStreamOperators() |
1612 | | */ |
1613 | | bool QMetaType::save(QDataStream &stream, int type, const void *data) |
1614 | 0 | { |
1615 | 0 | if (!data) |
1616 | 0 | return false; |
1617 | 0 | SaveOperatorSwitch saveOp{stream, type}; |
1618 | 0 | return QMetaTypeSwitcher::switcher<bool>(saveOp, type, data); |
1619 | 0 | } |
1620 | | |
1621 | | /*! |
1622 | | Reads the object of the specified \a type from the given \a |
1623 | | stream into \a data. Returns \c true if the object is loaded |
1624 | | successfully; otherwise returns \c false. |
1625 | | |
1626 | | The type must have been registered with qRegisterMetaType() and |
1627 | | qRegisterMetaTypeStreamOperators() beforehand. |
1628 | | |
1629 | | Normally, you should not need to call this function directly. |
1630 | | Instead, use QVariant's \c operator>>(), which relies on load() |
1631 | | to stream custom types. |
1632 | | |
1633 | | \sa save(), qRegisterMetaTypeStreamOperators() |
1634 | | */ |
1635 | | bool QMetaType::load(QDataStream &stream, int type, void *data) |
1636 | 0 | { |
1637 | 0 | if (!data) |
1638 | 0 | return false; |
1639 | 0 | LoadOperatorSwitch loadOp{stream, type}; |
1640 | 0 | return QMetaTypeSwitcher::switcher<bool>(loadOp, type, data); |
1641 | 0 | } |
1642 | | #endif // QT_NO_DATASTREAM |
1643 | | |
1644 | | /*! |
1645 | | Returns a copy of \a copy, assuming it is of type \a type. If \a |
1646 | | copy is zero, creates a default constructed instance. |
1647 | | |
1648 | | \sa destroy(), isRegistered(), Type |
1649 | | */ |
1650 | | void *QMetaType::create(int type, const void *copy) |
1651 | 0 | { |
1652 | 0 | QMetaType info(type); |
1653 | 0 | if (int size = info.sizeOf()) |
1654 | 0 | return info.construct(operator new(size), copy); |
1655 | 0 | return nullptr; |
1656 | 0 | } |
1657 | | |
1658 | | /*! |
1659 | | Destroys the \a data, assuming it is of the \a type given. |
1660 | | |
1661 | | \sa create(), isRegistered(), Type |
1662 | | */ |
1663 | | void QMetaType::destroy(int type, void *data) |
1664 | 0 | { |
1665 | 0 | QMetaType info(type); |
1666 | 0 | info.destruct(data); |
1667 | 0 | operator delete(data); |
1668 | 0 | } |
1669 | | |
1670 | | namespace { |
1671 | | class TypeConstructor { |
1672 | | template<typename T, bool IsAcceptedType = DefinedTypesFilter::Acceptor<T>::IsAccepted> |
1673 | | struct ConstructorImpl { |
1674 | 0 | static void *Construct(const int /*type*/, void *where, const void *copy) { return QtMetaTypePrivate::QMetaTypeFunctionHelper<T>::Construct(where, copy); } Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<bool, true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<int, true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<unsigned int, true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<long long, true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<unsigned long long, true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<double, true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<long, true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<short, true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<char, true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<unsigned long, true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<unsigned short, true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<unsigned char, true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<float, true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<signed char, true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<decltype(nullptr), true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QCborSimpleType, true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<void*, true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QChar, true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QString, true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QStringList, true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QByteArray, true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QBitArray, true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QDate, true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QTime, true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QDateTime, true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QUrl, true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QLocale, true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QRect, true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QRectF, true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QSize, true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QSizeF, true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QLine, true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QLineF, true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QPoint, true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QPointF, true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QRegExp, true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QEasingCurve, true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QUuid, true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QVariant, true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QRegularExpression, true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QJsonValue, true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QJsonObject, true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QJsonArray, true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QJsonDocument, true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QCborValue, true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QCborArray, true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QCborMap, true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QModelIndex, true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QPersistentModelIndex, true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QObject*, true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QMap<QString, QVariant>, true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QList<QVariant>, true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QHash<QString, QVariant>, true>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QList<QByteArray>, true>::Construct(int, void*, void const*) |
1675 | | }; |
1676 | | template<typename T> |
1677 | | struct ConstructorImpl<T, /* IsAcceptedType = */ false> { |
1678 | | static void *Construct(const int type, void *where, const void *copy) |
1679 | 0 | { |
1680 | 0 | if (QModulesPrivate::QTypeModuleInfo<T>::IsGui) |
1681 | 0 | return Q_LIKELY(qMetaTypeGuiHelper) |
1682 | 0 | ? qMetaTypeGuiHelper[type - QMetaType::FirstGuiType].constructor(where, copy) |
1683 | 0 | : nullptr; |
1684 | | |
1685 | 0 | if (QModulesPrivate::QTypeModuleInfo<T>::IsWidget) |
1686 | 0 | return Q_LIKELY(qMetaTypeWidgetsHelper) |
1687 | 0 | ? qMetaTypeWidgetsHelper[type - QMetaType::FirstWidgetsType].constructor(where, copy) |
1688 | 0 | : nullptr; |
1689 | | |
1690 | | // This point can be reached only for known types that definition is not available, for example |
1691 | | // in bootstrap mode. We have no other choice then ignore it. |
1692 | 0 | return nullptr; |
1693 | 0 | } Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QFont, false>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QPixmap, false>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QBrush, false>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QColor, false>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QPalette, false>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QIcon, false>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QImage, false>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QPolygon, false>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QRegion, false>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QBitmap, false>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QCursor, false>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QKeySequence, false>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QPen, false>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QTextLength, false>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QTextFormat, false>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QMatrix, false>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QTransform, false>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QMatrix4x4, false>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QVector2D, false>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QVector3D, false>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QVector4D, false>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QQuaternion, false>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QPolygonF, false>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QColorSpace, false>::Construct(int, void*, void const*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeConstructor::ConstructorImpl<QSizePolicy, false>::Construct(int, void*, void const*) |
1694 | | }; |
1695 | | public: |
1696 | | TypeConstructor(const int type, void *where) |
1697 | | : m_type(type) |
1698 | | , m_where(where) |
1699 | 0 | {} |
1700 | | |
1701 | | template<typename T> |
1702 | 0 | void *delegate(const T *copy) { return ConstructorImpl<T>::Construct(m_type, m_where, copy); } Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<bool>(bool const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<int>(int const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<unsigned int>(unsigned int const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<long long>(long long const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<unsigned long long>(unsigned long long const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<double>(double const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<long>(long const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<short>(short const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<char>(char const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<unsigned long>(unsigned long const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<unsigned short>(unsigned short const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<unsigned char>(unsigned char const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<float>(float const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<signed char>(signed char const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<decltype(nullptr)>(decltype(nullptr) const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QCborSimpleType>(QCborSimpleType const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<void*>(void* const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QChar>(QChar const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QString>(QString const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QStringList>(QStringList const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QByteArray>(QByteArray const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QBitArray>(QBitArray const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QDate>(QDate const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QTime>(QTime const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QDateTime>(QDateTime const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QUrl>(QUrl const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QLocale>(QLocale const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QRect>(QRect const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QRectF>(QRectF const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QSize>(QSize const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QSizeF>(QSizeF const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QLine>(QLine const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QLineF>(QLineF const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QPoint>(QPoint const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QPointF>(QPointF const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QRegExp>(QRegExp const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QEasingCurve>(QEasingCurve const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QUuid>(QUuid const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QVariant>(QVariant const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QRegularExpression>(QRegularExpression const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QJsonValue>(QJsonValue const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QJsonObject>(QJsonObject const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QJsonArray>(QJsonArray const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QJsonDocument>(QJsonDocument const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QCborValue>(QCborValue const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QCborArray>(QCborArray const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QCborMap>(QCborMap const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QModelIndex>(QModelIndex const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QPersistentModelIndex>(QPersistentModelIndex const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QObject*>(QObject* const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QMap<QString, QVariant> >(QMap<QString, QVariant> const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QList<QVariant> >(QList<QVariant> const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QHash<QString, QVariant> >(QHash<QString, QVariant> const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QList<QByteArray> >(QList<QByteArray> const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QFont>(QFont const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QPixmap>(QPixmap const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QBrush>(QBrush const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QColor>(QColor const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QPalette>(QPalette const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QIcon>(QIcon const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QImage>(QImage const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QPolygon>(QPolygon const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QRegion>(QRegion const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QBitmap>(QBitmap const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QCursor>(QCursor const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QKeySequence>(QKeySequence const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QPen>(QPen const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QTextLength>(QTextLength const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QTextFormat>(QTextFormat const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QMatrix>(QMatrix const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QTransform>(QTransform const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QMatrix4x4>(QMatrix4x4 const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QVector2D>(QVector2D const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QVector3D>(QVector3D const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QVector4D>(QVector4D const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QQuaternion>(QQuaternion const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QPolygonF>(QPolygonF const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QColorSpace>(QColorSpace const*) Unexecuted instantiation: qmetatype.cpp:void* (anonymous namespace)::TypeConstructor::delegate<QSizePolicy>(QSizePolicy const*) |
1703 | 0 | void *delegate(const void *) { return m_where; } |
1704 | 0 | void *delegate(const QMetaTypeSwitcher::UnknownType*) { return m_where; } |
1705 | 0 | void *delegate(const QMetaTypeSwitcher::NotBuiltinType *copy) { return customTypeConstructor(m_type, m_where, copy); } |
1706 | | |
1707 | | private: |
1708 | | static void *customTypeConstructor(const int type, void *where, const void *copy) |
1709 | 0 | { |
1710 | 0 | QMetaType::Constructor ctor; |
1711 | 0 | QMetaType::TypedConstructor tctor; |
1712 | 0 | const QVector<QCustomTypeInfo> * const ct = customTypes(); |
1713 | 0 | { |
1714 | 0 | QReadLocker locker(customTypesLock()); |
1715 | 0 | if (Q_UNLIKELY(type < QMetaType::User || !ct || ct->count() <= type - QMetaType::User)) |
1716 | 0 | return nullptr; |
1717 | 0 | const auto &typeInfo = ct->at(type - QMetaType::User); |
1718 | 0 | ctor = typeInfo.constructor; |
1719 | 0 | tctor = typeInfo.typedConstructor; |
1720 | 0 | } |
1721 | 0 | Q_ASSERT_X((ctor || tctor) , "void *QMetaType::construct(int type, void *where, const void *copy)", "The type was not properly registered"); |
1722 | 0 | if (Q_UNLIKELY(tctor)) |
1723 | 0 | return tctor(type, where, copy); |
1724 | 0 | return ctor(where, copy); |
1725 | 0 | } |
1726 | | |
1727 | | const int m_type; |
1728 | | void *m_where; |
1729 | | }; |
1730 | | } // namespace |
1731 | | |
1732 | | /*! |
1733 | | \since 5.0 |
1734 | | |
1735 | | Constructs a value of the given \a type in the existing memory |
1736 | | addressed by \a where, that is a copy of \a copy, and returns |
1737 | | \a where. If \a copy is zero, the value is default constructed. |
1738 | | |
1739 | | This is a low-level function for explicitly managing the memory |
1740 | | used to store the type. Consider calling create() if you don't |
1741 | | need this level of control (that is, use "new" rather than |
1742 | | "placement new"). |
1743 | | |
1744 | | You must ensure that \a where points to a location that can store |
1745 | | a value of type \a type, and that \a where is suitably aligned. |
1746 | | The type's size can be queried by calling sizeOf(). |
1747 | | |
1748 | | The rule of thumb for alignment is that a type is aligned to its |
1749 | | natural boundary, which is the smallest power of 2 that is bigger |
1750 | | than the type, unless that alignment is larger than the maximum |
1751 | | useful alignment for the platform. For practical purposes, |
1752 | | alignment larger than 2 * sizeof(void*) is only necessary for |
1753 | | special hardware instructions (e.g., aligned SSE loads and stores |
1754 | | on x86). |
1755 | | |
1756 | | \sa destruct(), sizeOf() |
1757 | | */ |
1758 | | void *QMetaType::construct(int type, void *where, const void *copy) |
1759 | 0 | { |
1760 | 0 | if (!where) |
1761 | 0 | return nullptr; |
1762 | 0 | TypeConstructor constructor(type, where); |
1763 | 0 | return QMetaTypeSwitcher::switcher<void*>(constructor, type, copy); |
1764 | 0 | } |
1765 | | |
1766 | | |
1767 | | namespace { |
1768 | | class TypeDestructor { |
1769 | | template<typename T, bool IsAcceptedType = DefinedTypesFilter::Acceptor<T>::IsAccepted> |
1770 | | struct DestructorImpl { |
1771 | 0 | static void Destruct(const int /* type */, void *where) { QtMetaTypePrivate::QMetaTypeFunctionHelper<T>::Destruct(where); } Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<bool, true>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<int, true>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<unsigned int, true>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<long long, true>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<unsigned long long, true>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<double, true>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<long, true>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<short, true>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<char, true>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<unsigned long, true>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<unsigned short, true>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<unsigned char, true>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<float, true>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<signed char, true>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QCborSimpleType, true>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<void*, true>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QChar, true>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QString, true>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QStringList, true>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QByteArray, true>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QBitArray, true>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QDate, true>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QTime, true>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QDateTime, true>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QUrl, true>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QLocale, true>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QRect, true>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QRectF, true>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QSize, true>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QSizeF, true>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QLine, true>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QLineF, true>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QPoint, true>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QPointF, true>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QRegExp, true>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QEasingCurve, true>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QUuid, true>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QVariant, true>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QRegularExpression, true>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QJsonValue, true>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QJsonObject, true>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QJsonArray, true>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QJsonDocument, true>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QCborValue, true>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QCborArray, true>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QCborMap, true>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QModelIndex, true>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QPersistentModelIndex, true>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QObject*, true>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QMap<QString, QVariant>, true>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QList<QVariant>, true>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QHash<QString, QVariant>, true>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QList<QByteArray>, true>::Destruct(int, void*) |
1772 | | }; |
1773 | | template<typename T> |
1774 | | struct DestructorImpl<T, /* IsAcceptedType = */ false> { |
1775 | | static void Destruct(const int type, void *where) |
1776 | 0 | { |
1777 | 0 | if (QModulesPrivate::QTypeModuleInfo<T>::IsGui) { |
1778 | 0 | if (Q_LIKELY(qMetaTypeGuiHelper)) |
1779 | 0 | qMetaTypeGuiHelper[type - QMetaType::FirstGuiType].destructor(where); |
1780 | 0 | return; |
1781 | 0 | } |
1782 | 0 | if (QModulesPrivate::QTypeModuleInfo<T>::IsWidget) { |
1783 | 0 | if (Q_LIKELY(qMetaTypeWidgetsHelper)) |
1784 | 0 | qMetaTypeWidgetsHelper[type - QMetaType::FirstWidgetsType].destructor(where); |
1785 | 0 | return; |
1786 | 0 | } |
1787 | | // This point can be reached only for known types that definition is not available, for example |
1788 | | // in bootstrap mode. We have no other choice then ignore it. |
1789 | 0 | } Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QFont, false>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QPixmap, false>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QBrush, false>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QColor, false>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QPalette, false>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QIcon, false>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QImage, false>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QPolygon, false>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QRegion, false>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QBitmap, false>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QCursor, false>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QKeySequence, false>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QPen, false>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QTextLength, false>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QTextFormat, false>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QMatrix, false>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QTransform, false>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QMatrix4x4, false>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QVector2D, false>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QVector3D, false>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QVector4D, false>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QQuaternion, false>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QPolygonF, false>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QColorSpace, false>::Destruct(int, void*) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeDestructor::DestructorImpl<QSizePolicy, false>::Destruct(int, void*) |
1790 | | }; |
1791 | | public: |
1792 | | TypeDestructor(const int type) |
1793 | | : m_type(type) |
1794 | 0 | {} |
1795 | | |
1796 | | template<typename T> |
1797 | 0 | void delegate(const T *where) { DestructorImpl<T>::Destruct(m_type, const_cast<T*>(where)); } Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<bool>(bool const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<int>(int const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<unsigned int>(unsigned int const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<long long>(long long const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<unsigned long long>(unsigned long long const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<double>(double const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<long>(long const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<short>(short const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<char>(char const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<unsigned long>(unsigned long const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<unsigned short>(unsigned short const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<unsigned char>(unsigned char const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<float>(float const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<signed char>(signed char const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QCborSimpleType>(QCborSimpleType const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<void*>(void* const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QChar>(QChar const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QString>(QString const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QStringList>(QStringList const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QByteArray>(QByteArray const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QBitArray>(QBitArray const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QDate>(QDate const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QTime>(QTime const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QDateTime>(QDateTime const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QUrl>(QUrl const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QLocale>(QLocale const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QRect>(QRect const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QRectF>(QRectF const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QSize>(QSize const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QSizeF>(QSizeF const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QLine>(QLine const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QLineF>(QLineF const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QPoint>(QPoint const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QPointF>(QPointF const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QRegExp>(QRegExp const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QEasingCurve>(QEasingCurve const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QUuid>(QUuid const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QVariant>(QVariant const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QRegularExpression>(QRegularExpression const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QJsonValue>(QJsonValue const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QJsonObject>(QJsonObject const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QJsonArray>(QJsonArray const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QJsonDocument>(QJsonDocument const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QCborValue>(QCborValue const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QCborArray>(QCborArray const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QCborMap>(QCborMap const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QModelIndex>(QModelIndex const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QPersistentModelIndex>(QPersistentModelIndex const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QObject*>(QObject* const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QMap<QString, QVariant> >(QMap<QString, QVariant> const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QList<QVariant> >(QList<QVariant> const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QHash<QString, QVariant> >(QHash<QString, QVariant> const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QList<QByteArray> >(QList<QByteArray> const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QFont>(QFont const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QPixmap>(QPixmap const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QBrush>(QBrush const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QColor>(QColor const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QPalette>(QPalette const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QIcon>(QIcon const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QImage>(QImage const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QPolygon>(QPolygon const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QRegion>(QRegion const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QBitmap>(QBitmap const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QCursor>(QCursor const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QKeySequence>(QKeySequence const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QPen>(QPen const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QTextLength>(QTextLength const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QTextFormat>(QTextFormat const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QMatrix>(QMatrix const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QTransform>(QTransform const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QMatrix4x4>(QMatrix4x4 const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QVector2D>(QVector2D const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QVector3D>(QVector3D const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QVector4D>(QVector4D const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QQuaternion>(QQuaternion const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QPolygonF>(QPolygonF const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QColorSpace>(QColorSpace const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeDestructor::delegate<QSizePolicy>(QSizePolicy const*) |
1798 | | // MSVC2013 and earlier can not const_cast a std::nullptr_t pointer. |
1799 | 0 | void delegate(const std::nullptr_t *) {} |
1800 | 0 | void delegate(const void *) {} |
1801 | 0 | void delegate(const QMetaTypeSwitcher::UnknownType*) {} |
1802 | | void delegate(const QMetaTypeSwitcher::NotBuiltinType *where) |
1803 | 0 | { customTypeDestructor(m_type, const_cast<void *>(static_cast<const void *>(where))); } |
1804 | | |
1805 | | private: |
1806 | | static void customTypeDestructor(const int type, void *where) |
1807 | 0 | { |
1808 | 0 | QMetaType::Destructor dtor; |
1809 | 0 | QMetaType::TypedDestructor tdtor; |
1810 | 0 | const QVector<QCustomTypeInfo> * const ct = customTypes(); |
1811 | 0 | { |
1812 | 0 | QReadLocker locker(customTypesLock()); |
1813 | 0 | if (Q_UNLIKELY(type < QMetaType::User || !ct || ct->count() <= type - QMetaType::User)) |
1814 | 0 | return; |
1815 | 0 | const auto &typeInfo = ct->at(type - QMetaType::User); |
1816 | 0 | dtor = typeInfo.destructor; |
1817 | 0 | tdtor = typeInfo.typedDestructor; |
1818 | 0 | } |
1819 | 0 | Q_ASSERT_X((dtor || tdtor), "void QMetaType::destruct(int type, void *where)", "The type was not properly registered"); |
1820 | 0 | if (Q_UNLIKELY(tdtor)) |
1821 | 0 | return tdtor(type, where); |
1822 | 0 | dtor(where); |
1823 | 0 | } |
1824 | | |
1825 | | const int m_type; |
1826 | | }; |
1827 | | } // namespace |
1828 | | |
1829 | | /*! |
1830 | | \since 5.0 |
1831 | | |
1832 | | Destructs the value of the given \a type, located at \a where. |
1833 | | |
1834 | | Unlike destroy(), this function only invokes the type's |
1835 | | destructor, it doesn't invoke the delete operator. |
1836 | | |
1837 | | \sa construct() |
1838 | | */ |
1839 | | void QMetaType::destruct(int type, void *where) |
1840 | 0 | { |
1841 | 0 | if (!where) |
1842 | 0 | return; |
1843 | 0 | TypeDestructor destructor(type); |
1844 | 0 | QMetaTypeSwitcher::switcher<void>(destructor, type, where); |
1845 | 0 | } |
1846 | | |
1847 | | |
1848 | | namespace { |
1849 | | class SizeOf { |
1850 | | template<typename T, bool IsAcceptedType = DefinedTypesFilter::Acceptor<T>::IsAccepted> |
1851 | | struct SizeOfImpl { |
1852 | 0 | static int Size(const int) { return QTypeInfo<T>::sizeOf; } Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<void, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<bool, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<int, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<unsigned int, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<long long, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<unsigned long long, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<double, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<long, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<short, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<char, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<unsigned long, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<unsigned short, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<unsigned char, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<float, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<signed char, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<decltype(nullptr), true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QCborSimpleType, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<void*, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QChar, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QString, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QStringList, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QByteArray, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QBitArray, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QDate, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QTime, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QDateTime, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QUrl, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QLocale, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QRect, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QRectF, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QSize, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QSizeF, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QLine, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QLineF, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QPoint, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QPointF, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QRegExp, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QEasingCurve, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QUuid, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QVariant, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QRegularExpression, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QJsonValue, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QJsonObject, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QJsonArray, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QJsonDocument, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QCborValue, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QCborArray, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QCborMap, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QModelIndex, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QPersistentModelIndex, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QObject*, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QMap<QString, QVariant>, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QList<QVariant>, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QHash<QString, QVariant>, true>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QList<QByteArray>, true>::Size(int) |
1853 | | }; |
1854 | | template<typename T> |
1855 | | struct SizeOfImpl<T, /* IsAcceptedType = */ false> { |
1856 | | static int Size(const int type) |
1857 | 0 | { |
1858 | 0 | if (QModulesPrivate::QTypeModuleInfo<T>::IsGui) |
1859 | 0 | return Q_LIKELY(qMetaTypeGuiHelper) ? qMetaTypeGuiHelper[type - QMetaType::FirstGuiType].size : 0; |
1860 | | |
1861 | 0 | if (QModulesPrivate::QTypeModuleInfo<T>::IsWidget) |
1862 | 0 | return Q_LIKELY(qMetaTypeWidgetsHelper) ? qMetaTypeWidgetsHelper[type - QMetaType::FirstWidgetsType].size : 0; |
1863 | | |
1864 | | // This point can be reached only for known types that definition is not available, for example |
1865 | | // in bootstrap mode. We have no other choice then ignore it. |
1866 | 0 | return 0; |
1867 | 0 | } Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QFont, false>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QPixmap, false>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QBrush, false>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QColor, false>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QPalette, false>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QIcon, false>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QImage, false>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QPolygon, false>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QRegion, false>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QBitmap, false>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QCursor, false>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QKeySequence, false>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QPen, false>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QTextLength, false>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QTextFormat, false>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QMatrix, false>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QTransform, false>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QMatrix4x4, false>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QVector2D, false>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QVector3D, false>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QVector4D, false>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QQuaternion, false>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QPolygonF, false>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QColorSpace, false>::Size(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::SizeOf::SizeOfImpl<QSizePolicy, false>::Size(int) |
1868 | | }; |
1869 | | |
1870 | | public: |
1871 | | SizeOf(int type) |
1872 | | : m_type(type) |
1873 | 0 | {} |
1874 | | |
1875 | | template<typename T> |
1876 | 0 | int delegate(const T*) { return SizeOfImpl<T>::Size(m_type); } Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<void>(void const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<bool>(bool const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<int>(int const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<unsigned int>(unsigned int const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<long long>(long long const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<unsigned long long>(unsigned long long const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<double>(double const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<long>(long const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<short>(short const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<char>(char const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<unsigned long>(unsigned long const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<unsigned short>(unsigned short const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<unsigned char>(unsigned char const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<float>(float const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<signed char>(signed char const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<decltype(nullptr)>(decltype(nullptr) const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QCborSimpleType>(QCborSimpleType const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<void*>(void* const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QChar>(QChar const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QString>(QString const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QStringList>(QStringList const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QByteArray>(QByteArray const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QBitArray>(QBitArray const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QDate>(QDate const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QTime>(QTime const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QDateTime>(QDateTime const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QUrl>(QUrl const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QLocale>(QLocale const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QRect>(QRect const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QRectF>(QRectF const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QSize>(QSize const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QSizeF>(QSizeF const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QLine>(QLine const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QLineF>(QLineF const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QPoint>(QPoint const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QPointF>(QPointF const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QRegExp>(QRegExp const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QEasingCurve>(QEasingCurve const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QUuid>(QUuid const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QVariant>(QVariant const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QRegularExpression>(QRegularExpression const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QJsonValue>(QJsonValue const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QJsonObject>(QJsonObject const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QJsonArray>(QJsonArray const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QJsonDocument>(QJsonDocument const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QCborValue>(QCborValue const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QCborArray>(QCborArray const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QCborMap>(QCborMap const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QModelIndex>(QModelIndex const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QPersistentModelIndex>(QPersistentModelIndex const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QObject*>(QObject* const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QMap<QString, QVariant> >(QMap<QString, QVariant> const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QList<QVariant> >(QList<QVariant> const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QHash<QString, QVariant> >(QHash<QString, QVariant> const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QList<QByteArray> >(QList<QByteArray> const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QFont>(QFont const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QPixmap>(QPixmap const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QBrush>(QBrush const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QColor>(QColor const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QPalette>(QPalette const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QIcon>(QIcon const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QImage>(QImage const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QPolygon>(QPolygon const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QRegion>(QRegion const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QBitmap>(QBitmap const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QCursor>(QCursor const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QKeySequence>(QKeySequence const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QPen>(QPen const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QTextLength>(QTextLength const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QTextFormat>(QTextFormat const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QMatrix>(QMatrix const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QTransform>(QTransform const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QMatrix4x4>(QMatrix4x4 const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QVector2D>(QVector2D const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QVector3D>(QVector3D const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QVector4D>(QVector4D const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QQuaternion>(QQuaternion const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QPolygonF>(QPolygonF const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QColorSpace>(QColorSpace const*) Unexecuted instantiation: qmetatype.cpp:int (anonymous namespace)::SizeOf::delegate<QSizePolicy>(QSizePolicy const*) |
1877 | 0 | int delegate(const QMetaTypeSwitcher::UnknownType*) { return 0; } |
1878 | 0 | int delegate(const QMetaTypeSwitcher::NotBuiltinType*) { return customTypeSizeOf(m_type); } |
1879 | | private: |
1880 | | static int customTypeSizeOf(const int type) |
1881 | 0 | { |
1882 | 0 | const QVector<QCustomTypeInfo> * const ct = customTypes(); |
1883 | 0 | QReadLocker locker(customTypesLock()); |
1884 | 0 | if (Q_UNLIKELY(type < QMetaType::User || !ct || ct->count() <= type - QMetaType::User)) |
1885 | 0 | return 0; |
1886 | 0 | return ct->at(type - QMetaType::User).size; |
1887 | 0 | } |
1888 | | |
1889 | | const int m_type; |
1890 | | }; |
1891 | | } // namespace |
1892 | | |
1893 | | /*! |
1894 | | \since 5.0 |
1895 | | |
1896 | | Returns the size of the given \a type in bytes (i.e. sizeof(T), |
1897 | | where T is the actual type identified by the \a type argument). |
1898 | | |
1899 | | This function is typically used together with construct() |
1900 | | to perform low-level management of the memory used by a type. |
1901 | | |
1902 | | \sa construct() |
1903 | | */ |
1904 | | int QMetaType::sizeOf(int type) |
1905 | 0 | { |
1906 | 0 | SizeOf sizeOf(type); |
1907 | 0 | return QMetaTypeSwitcher::switcher<int>(sizeOf, type); |
1908 | 0 | } |
1909 | | |
1910 | | namespace { |
1911 | | class Flags |
1912 | | { |
1913 | | template<typename T, bool IsAcceptedType = DefinedTypesFilter::Acceptor<T>::IsAccepted> |
1914 | | struct FlagsImpl |
1915 | | { |
1916 | | static quint32 Flags(const int /* type */) |
1917 | 0 | { |
1918 | 0 | return QtPrivate::QMetaTypeTypeFlags<T>::Flags; |
1919 | 0 | } Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<bool, true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<int, true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<unsigned int, true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<long long, true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<unsigned long long, true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<double, true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<long, true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<short, true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<char, true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<unsigned long, true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<unsigned short, true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<unsigned char, true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<float, true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<signed char, true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<decltype(nullptr), true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QCborSimpleType, true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<void*, true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QChar, true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QString, true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QStringList, true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QByteArray, true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QBitArray, true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QDate, true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QTime, true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QDateTime, true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QUrl, true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QLocale, true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QRect, true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QRectF, true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QSize, true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QSizeF, true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QLine, true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QLineF, true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QPoint, true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QPointF, true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QRegExp, true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QEasingCurve, true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QUuid, true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QVariant, true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QRegularExpression, true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QJsonValue, true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QJsonObject, true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QJsonArray, true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QJsonDocument, true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QCborValue, true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QCborArray, true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QCborMap, true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QModelIndex, true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QPersistentModelIndex, true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QObject*, true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QMap<QString, QVariant>, true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QList<QVariant>, true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QHash<QString, QVariant>, true>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QList<QByteArray>, true>::Flags(int) |
1920 | | }; |
1921 | | template<typename T> |
1922 | | struct FlagsImpl<T, /* IsAcceptedType = */ false> |
1923 | | { |
1924 | | static quint32 Flags(const int type) |
1925 | 0 | { |
1926 | 0 | if (QModulesPrivate::QTypeModuleInfo<T>::IsGui) |
1927 | 0 | return Q_LIKELY(qMetaTypeGuiHelper) ? qMetaTypeGuiHelper[type - QMetaType::FirstGuiType].flags : 0; |
1928 | | |
1929 | 0 | if (QModulesPrivate::QTypeModuleInfo<T>::IsWidget) |
1930 | 0 | return Q_LIKELY(qMetaTypeWidgetsHelper) ? qMetaTypeWidgetsHelper[type - QMetaType::FirstWidgetsType].flags : 0; |
1931 | | |
1932 | | // This point can be reached only for known types that definition is not available, for example |
1933 | | // in bootstrap mode. We have no other choice then ignore it. |
1934 | 0 | return 0; |
1935 | 0 | } Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QFont, false>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QPixmap, false>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QBrush, false>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QColor, false>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QPalette, false>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QIcon, false>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QImage, false>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QPolygon, false>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QRegion, false>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QBitmap, false>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QCursor, false>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QKeySequence, false>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QPen, false>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QTextLength, false>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QTextFormat, false>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QMatrix, false>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QTransform, false>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QMatrix4x4, false>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QVector2D, false>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QVector3D, false>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QVector4D, false>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QQuaternion, false>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QPolygonF, false>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QColorSpace, false>::Flags(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::Flags::FlagsImpl<QSizePolicy, false>::Flags(int) |
1936 | | }; |
1937 | | public: |
1938 | | Flags(const int type) |
1939 | | : m_type(type) |
1940 | 0 | {} |
1941 | | template<typename T> |
1942 | 0 | quint32 delegate(const T*) { return FlagsImpl<T>::Flags(m_type); } Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<bool>(bool const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<int>(int const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<unsigned int>(unsigned int const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<long long>(long long const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<unsigned long long>(unsigned long long const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<double>(double const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<long>(long const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<short>(short const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<char>(char const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<unsigned long>(unsigned long const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<unsigned short>(unsigned short const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<unsigned char>(unsigned char const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<float>(float const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<signed char>(signed char const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<decltype(nullptr)>(decltype(nullptr) const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QCborSimpleType>(QCborSimpleType const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<void*>(void* const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QChar>(QChar const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QString>(QString const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QStringList>(QStringList const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QByteArray>(QByteArray const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QBitArray>(QBitArray const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QDate>(QDate const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QTime>(QTime const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QDateTime>(QDateTime const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QUrl>(QUrl const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QLocale>(QLocale const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QRect>(QRect const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QRectF>(QRectF const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QSize>(QSize const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QSizeF>(QSizeF const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QLine>(QLine const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QLineF>(QLineF const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QPoint>(QPoint const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QPointF>(QPointF const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QRegExp>(QRegExp const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QEasingCurve>(QEasingCurve const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QUuid>(QUuid const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QVariant>(QVariant const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QRegularExpression>(QRegularExpression const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QJsonValue>(QJsonValue const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QJsonObject>(QJsonObject const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QJsonArray>(QJsonArray const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QJsonDocument>(QJsonDocument const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QCborValue>(QCborValue const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QCborArray>(QCborArray const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QCborMap>(QCborMap const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QModelIndex>(QModelIndex const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QPersistentModelIndex>(QPersistentModelIndex const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QObject*>(QObject* const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QMap<QString, QVariant> >(QMap<QString, QVariant> const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QList<QVariant> >(QList<QVariant> const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QHash<QString, QVariant> >(QHash<QString, QVariant> const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QList<QByteArray> >(QList<QByteArray> const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QFont>(QFont const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QPixmap>(QPixmap const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QBrush>(QBrush const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QColor>(QColor const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QPalette>(QPalette const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QIcon>(QIcon const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QImage>(QImage const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QPolygon>(QPolygon const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QRegion>(QRegion const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QBitmap>(QBitmap const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QCursor>(QCursor const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QKeySequence>(QKeySequence const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QPen>(QPen const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QTextLength>(QTextLength const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QTextFormat>(QTextFormat const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QMatrix>(QMatrix const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QTransform>(QTransform const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QMatrix4x4>(QMatrix4x4 const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QVector2D>(QVector2D const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QVector3D>(QVector3D const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QVector4D>(QVector4D const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QQuaternion>(QQuaternion const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QPolygonF>(QPolygonF const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QColorSpace>(QColorSpace const*) Unexecuted instantiation: qmetatype.cpp:unsigned int (anonymous namespace)::Flags::delegate<QSizePolicy>(QSizePolicy const*) |
1943 | 0 | quint32 delegate(const void*) { return 0; } |
1944 | 0 | quint32 delegate(const QMetaTypeSwitcher::UnknownType*) { return 0; } |
1945 | 0 | quint32 delegate(const QMetaTypeSwitcher::NotBuiltinType*) { return customTypeFlags(m_type); } |
1946 | | private: |
1947 | | const int m_type; |
1948 | | static quint32 customTypeFlags(const int type) |
1949 | 0 | { |
1950 | 0 | const QVector<QCustomTypeInfo> * const ct = customTypes(); |
1951 | 0 | if (Q_UNLIKELY(!ct || type < QMetaType::User)) |
1952 | 0 | return 0; |
1953 | 0 | QReadLocker locker(customTypesLock()); |
1954 | 0 | if (Q_UNLIKELY(ct->count() <= type - QMetaType::User)) |
1955 | 0 | return 0; |
1956 | 0 | return ct->at(type - QMetaType::User).flags; |
1957 | 0 | } |
1958 | | }; |
1959 | | } // namespace |
1960 | | |
1961 | | /*! |
1962 | | \since 5.0 |
1963 | | |
1964 | | Returns flags of the given \a type. |
1965 | | |
1966 | | \sa QMetaType::TypeFlags |
1967 | | */ |
1968 | | QMetaType::TypeFlags QMetaType::typeFlags(int type) |
1969 | 0 | { |
1970 | 0 | Flags flags(type); |
1971 | 0 | return static_cast<QMetaType::TypeFlags>(QMetaTypeSwitcher::switcher<quint32>(flags, type)); |
1972 | 0 | } |
1973 | | |
1974 | | #ifndef QT_BOOTSTRAPPED |
1975 | | namespace { |
1976 | | class MetaObject |
1977 | | { |
1978 | | public: |
1979 | | MetaObject(const int type) |
1980 | | : m_type(type) |
1981 | 0 | {} |
1982 | | |
1983 | | template<typename T, bool IsAcceptedType = DefinedTypesFilter::Acceptor<T>::IsAccepted> |
1984 | | struct MetaObjectImpl |
1985 | | { |
1986 | | static const QMetaObject *MetaObject(int /*type*/) |
1987 | 0 | { return QtPrivate::MetaObjectForType<T>::value(); } Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<bool, true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<int, true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<unsigned int, true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<long long, true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<unsigned long long, true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<double, true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<long, true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<short, true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<char, true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<unsigned long, true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<unsigned short, true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<unsigned char, true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<float, true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<signed char, true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<decltype(nullptr), true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QCborSimpleType, true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<void*, true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QChar, true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QString, true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QStringList, true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QByteArray, true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QBitArray, true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QDate, true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QTime, true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QDateTime, true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QUrl, true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QLocale, true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QRect, true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QRectF, true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QSize, true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QSizeF, true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QLine, true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QLineF, true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QPoint, true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QPointF, true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QRegExp, true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QEasingCurve, true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QUuid, true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QVariant, true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QRegularExpression, true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QJsonValue, true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QJsonObject, true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QJsonArray, true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QJsonDocument, true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QCborValue, true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QCborArray, true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QCborMap, true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QModelIndex, true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QPersistentModelIndex, true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QObject*, true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QMap<QString, QVariant>, true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QList<QVariant>, true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QHash<QString, QVariant>, true>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QList<QByteArray>, true>::MetaObject(int) |
1988 | | }; |
1989 | | template<typename T> |
1990 | | struct MetaObjectImpl<T, /* IsAcceptedType = */ false> |
1991 | | { |
1992 | 0 | static const QMetaObject *MetaObject(int type) { |
1993 | 0 | if (QModulesPrivate::QTypeModuleInfo<T>::IsGui) |
1994 | 0 | return Q_LIKELY(qMetaTypeGuiHelper) |
1995 | 0 | ? qMetaTypeGuiHelper[type - QMetaType::FirstGuiType].metaObject |
1996 | 0 | : nullptr; |
1997 | 0 | if (QModulesPrivate::QTypeModuleInfo<T>::IsWidget) |
1998 | 0 | return Q_LIKELY(qMetaTypeWidgetsHelper) |
1999 | 0 | ? qMetaTypeWidgetsHelper[type - QMetaType::FirstWidgetsType].metaObject |
2000 | 0 | : nullptr; |
2001 | 0 | return nullptr; |
2002 | 0 | } Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QFont, false>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QPixmap, false>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QBrush, false>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QColor, false>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QPalette, false>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QIcon, false>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QImage, false>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QPolygon, false>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QRegion, false>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QBitmap, false>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QCursor, false>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QKeySequence, false>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QPen, false>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QTextLength, false>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QTextFormat, false>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QMatrix, false>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QTransform, false>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QMatrix4x4, false>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QVector2D, false>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QVector3D, false>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QVector4D, false>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QQuaternion, false>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QPolygonF, false>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QColorSpace, false>::MetaObject(int) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::MetaObject::MetaObjectImpl<QSizePolicy, false>::MetaObject(int) |
2003 | | }; |
2004 | | |
2005 | | template <typename T> |
2006 | 0 | const QMetaObject *delegate(const T *) { return MetaObjectImpl<T>::MetaObject(m_type); } Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<bool>(bool const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<int>(int const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<unsigned int>(unsigned int const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<long long>(long long const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<unsigned long long>(unsigned long long const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<double>(double const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<long>(long const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<short>(short const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<char>(char const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<unsigned long>(unsigned long const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<unsigned short>(unsigned short const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<unsigned char>(unsigned char const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<float>(float const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<signed char>(signed char const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<decltype(nullptr)>(decltype(nullptr) const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QCborSimpleType>(QCborSimpleType const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<void*>(void* const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QChar>(QChar const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QString>(QString const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QStringList>(QStringList const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QByteArray>(QByteArray const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QBitArray>(QBitArray const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QDate>(QDate const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QTime>(QTime const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QDateTime>(QDateTime const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QUrl>(QUrl const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QLocale>(QLocale const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QRect>(QRect const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QRectF>(QRectF const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QSize>(QSize const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QSizeF>(QSizeF const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QLine>(QLine const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QLineF>(QLineF const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QPoint>(QPoint const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QPointF>(QPointF const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QRegExp>(QRegExp const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QEasingCurve>(QEasingCurve const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QUuid>(QUuid const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QVariant>(QVariant const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QRegularExpression>(QRegularExpression const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QJsonValue>(QJsonValue const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QJsonObject>(QJsonObject const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QJsonArray>(QJsonArray const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QJsonDocument>(QJsonDocument const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QCborValue>(QCborValue const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QCborArray>(QCborArray const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QCborMap>(QCborMap const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QModelIndex>(QModelIndex const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QPersistentModelIndex>(QPersistentModelIndex const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QObject*>(QObject* const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QMap<QString, QVariant> >(QMap<QString, QVariant> const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QList<QVariant> >(QList<QVariant> const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QHash<QString, QVariant> >(QHash<QString, QVariant> const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QList<QByteArray> >(QList<QByteArray> const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QFont>(QFont const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QPixmap>(QPixmap const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QBrush>(QBrush const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QColor>(QColor const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QPalette>(QPalette const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QIcon>(QIcon const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QImage>(QImage const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QPolygon>(QPolygon const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QRegion>(QRegion const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QBitmap>(QBitmap const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QCursor>(QCursor const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QKeySequence>(QKeySequence const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QPen>(QPen const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QTextLength>(QTextLength const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QTextFormat>(QTextFormat const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QMatrix>(QMatrix const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QTransform>(QTransform const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QMatrix4x4>(QMatrix4x4 const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QVector2D>(QVector2D const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QVector3D>(QVector3D const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QVector4D>(QVector4D const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QQuaternion>(QQuaternion const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QPolygonF>(QPolygonF const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QColorSpace>(QColorSpace const*) Unexecuted instantiation: qmetatype.cpp:QMetaObject const* (anonymous namespace)::MetaObject::delegate<QSizePolicy>(QSizePolicy const*) |
2007 | 0 | const QMetaObject *delegate(const void*) { return nullptr; } |
2008 | 0 | const QMetaObject *delegate(const QMetaTypeSwitcher::UnknownType*) { return nullptr; } |
2009 | 0 | const QMetaObject *delegate(const QMetaTypeSwitcher::NotBuiltinType*) { return customMetaObject(m_type); } |
2010 | | private: |
2011 | | const int m_type; |
2012 | | static const QMetaObject *customMetaObject(const int type) |
2013 | 0 | { |
2014 | 0 | const QVector<QCustomTypeInfo> * const ct = customTypes(); |
2015 | 0 | if (Q_UNLIKELY(!ct || type < QMetaType::User)) |
2016 | 0 | return nullptr; |
2017 | 0 | QReadLocker locker(customTypesLock()); |
2018 | 0 | if (Q_UNLIKELY(ct->count() <= type - QMetaType::User)) |
2019 | 0 | return nullptr; |
2020 | 0 | return ct->at(type - QMetaType::User).metaObject; |
2021 | 0 | } |
2022 | | }; |
2023 | | } // namespace |
2024 | | #endif |
2025 | | |
2026 | | /*! |
2027 | | \since 5.0 |
2028 | | |
2029 | | returns QMetaType::metaObject for \a type |
2030 | | |
2031 | | \sa metaObject() |
2032 | | */ |
2033 | | const QMetaObject *QMetaType::metaObjectForType(int type) |
2034 | 0 | { |
2035 | 0 | #ifndef QT_BOOTSTRAPPED |
2036 | 0 | MetaObject mo(type); |
2037 | 0 | return QMetaTypeSwitcher::switcher<const QMetaObject*>(mo, type); |
2038 | | #else |
2039 | | Q_UNUSED(type); |
2040 | | return nullptr; |
2041 | | #endif |
2042 | 0 | } |
2043 | | |
2044 | | /*! |
2045 | | \fn int qRegisterMetaType(const char *typeName) |
2046 | | \relates QMetaType |
2047 | | \threadsafe |
2048 | | |
2049 | | Registers the type name \a typeName for the type \c{T}. Returns |
2050 | | the internal ID used by QMetaType. Any class or struct that has a |
2051 | | public default constructor, a public copy constructor and a public |
2052 | | destructor can be registered. |
2053 | | |
2054 | | This function requires that \c{T} is a fully defined type at the point |
2055 | | where the function is called. For pointer types, it also requires that the |
2056 | | pointed to type is fully defined. Use Q_DECLARE_OPAQUE_POINTER() to be able |
2057 | | to register pointers to forward declared types. |
2058 | | |
2059 | | After a type has been registered, you can create and destroy |
2060 | | objects of that type dynamically at run-time. |
2061 | | |
2062 | | This example registers the class \c{MyClass}: |
2063 | | |
2064 | | \snippet code/src_corelib_kernel_qmetatype.cpp 4 |
2065 | | |
2066 | | This function is useful to register typedefs so they can be used |
2067 | | by QMetaProperty, or in QueuedConnections |
2068 | | |
2069 | | \snippet code/src_corelib_kernel_qmetatype.cpp 9 |
2070 | | |
2071 | | \warning This function is useful only for registering an alias (typedef) |
2072 | | for every other use case Q_DECLARE_METATYPE and qMetaTypeId() should be used instead. |
2073 | | |
2074 | | \sa {QMetaType::}{qRegisterMetaTypeStreamOperators()}, {QMetaType::}{isRegistered()}, |
2075 | | Q_DECLARE_METATYPE() |
2076 | | */ |
2077 | | |
2078 | | /*! |
2079 | | \fn void qRegisterMetaTypeStreamOperators(const char *typeName) |
2080 | | \relates QMetaType |
2081 | | \threadsafe |
2082 | | |
2083 | | Registers the stream operators for the type \c{T} called \a |
2084 | | typeName. |
2085 | | |
2086 | | Afterward, the type can be streamed using QMetaType::load() and |
2087 | | QMetaType::save(). These functions are used when streaming a |
2088 | | QVariant. |
2089 | | |
2090 | | \snippet code/src_corelib_kernel_qmetatype.cpp 5 |
2091 | | |
2092 | | The stream operators should have the following signatures: |
2093 | | |
2094 | | \snippet code/src_corelib_kernel_qmetatype.cpp 6 |
2095 | | |
2096 | | \sa qRegisterMetaType(), QMetaType::isRegistered(), Q_DECLARE_METATYPE() |
2097 | | */ |
2098 | | |
2099 | | /*! \typedef QMetaType::Deleter |
2100 | | \internal |
2101 | | */ |
2102 | | /*! \typedef QMetaType::Creator |
2103 | | \internal |
2104 | | */ |
2105 | | /*! \typedef QMetaType::SaveOperator |
2106 | | \internal |
2107 | | */ |
2108 | | /*! \typedef QMetaType::LoadOperator |
2109 | | \internal |
2110 | | */ |
2111 | | /*! \typedef QMetaType::Destructor |
2112 | | \internal |
2113 | | */ |
2114 | | /*! \typedef QMetaType::Constructor |
2115 | | \internal |
2116 | | */ |
2117 | | |
2118 | | /*! |
2119 | | \fn int qRegisterMetaType() |
2120 | | \relates QMetaType |
2121 | | \threadsafe |
2122 | | \since 4.2 |
2123 | | |
2124 | | Call this function to register the type \c T. \c T must be declared with |
2125 | | Q_DECLARE_METATYPE(). Returns the meta type Id. |
2126 | | |
2127 | | Example: |
2128 | | |
2129 | | \snippet code/src_corelib_kernel_qmetatype.cpp 7 |
2130 | | |
2131 | | This function requires that \c{T} is a fully defined type at the point |
2132 | | where the function is called. For pointer types, it also requires that the |
2133 | | pointed to type is fully defined. Use Q_DECLARE_OPAQUE_POINTER() to be able |
2134 | | to register pointers to forward declared types. |
2135 | | |
2136 | | After a type has been registered, you can create and destroy |
2137 | | objects of that type dynamically at run-time. |
2138 | | |
2139 | | To use the type \c T in QVariant, using Q_DECLARE_METATYPE() is |
2140 | | sufficient. To use the type \c T in queued signal and slot connections, |
2141 | | \c{qRegisterMetaType<T>()} must be called before the first connection |
2142 | | is established. |
2143 | | |
2144 | | Also, to use type \c T with the QObject::property() API, |
2145 | | \c{qRegisterMetaType<T>()} must be called before it is used, typically |
2146 | | in the constructor of the class that uses \c T, or in the \c{main()} |
2147 | | function. |
2148 | | |
2149 | | \sa Q_DECLARE_METATYPE() |
2150 | | */ |
2151 | | |
2152 | | /*! |
2153 | | \fn int qMetaTypeId() |
2154 | | \relates QMetaType |
2155 | | \threadsafe |
2156 | | \since 4.1 |
2157 | | |
2158 | | Returns the meta type id of type \c T at compile time. If the |
2159 | | type was not declared with Q_DECLARE_METATYPE(), compilation will |
2160 | | fail. |
2161 | | |
2162 | | Typical usage: |
2163 | | |
2164 | | \snippet code/src_corelib_kernel_qmetatype.cpp 8 |
2165 | | |
2166 | | QMetaType::type() returns the same ID as qMetaTypeId(), but does |
2167 | | a lookup at runtime based on the name of the type. |
2168 | | QMetaType::type() is a bit slower, but compilation succeeds if a |
2169 | | type is not registered. |
2170 | | |
2171 | | \sa Q_DECLARE_METATYPE(), QMetaType::type() |
2172 | | */ |
2173 | | |
2174 | | namespace { |
2175 | | class TypeInfo { |
2176 | | template<typename T, bool IsAcceptedType = DefinedTypesFilter::Acceptor<T>::IsAccepted> |
2177 | | struct TypeInfoImpl |
2178 | | { |
2179 | | TypeInfoImpl(const uint /* type */, QMetaTypeInterface &info) |
2180 | 0 | { |
2181 | 0 | QMetaTypeInterface tmp = QT_METATYPE_INTERFACE_INIT_NO_DATASTREAM(T); |
2182 | 0 | info = tmp; |
2183 | 0 | } Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<void, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<bool, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<int, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<unsigned int, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<long long, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<unsigned long long, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<double, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<long, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<short, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<char, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<unsigned long, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<unsigned short, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<unsigned char, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<float, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<signed char, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<decltype(nullptr), true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QCborSimpleType, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<void*, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QChar, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QString, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QStringList, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QByteArray, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QBitArray, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QDate, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QTime, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QDateTime, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QUrl, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QLocale, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QRect, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QRectF, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QSize, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QSizeF, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QLine, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QLineF, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QPoint, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QPointF, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QRegExp, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QEasingCurve, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QUuid, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QVariant, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QRegularExpression, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QJsonValue, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QJsonObject, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QJsonArray, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QJsonDocument, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QCborValue, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QCborArray, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QCborMap, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QModelIndex, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QPersistentModelIndex, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QObject*, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QMap<QString, QVariant>, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QList<QVariant>, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QHash<QString, QVariant>, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QList<QByteArray>, true>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) |
2184 | | }; |
2185 | | |
2186 | | template<typename T> |
2187 | | struct TypeInfoImpl<T, /* IsAcceptedType = */ false> |
2188 | | { |
2189 | | TypeInfoImpl(const uint type, QMetaTypeInterface &info) |
2190 | 0 | { |
2191 | 0 | if (QModulesPrivate::QTypeModuleInfo<T>::IsGui) { |
2192 | 0 | if (Q_LIKELY(qMetaTypeGuiHelper)) |
2193 | 0 | info = qMetaTypeGuiHelper[type - QMetaType::FirstGuiType]; |
2194 | 0 | return; |
2195 | 0 | } |
2196 | 0 | if (QModulesPrivate::QTypeModuleInfo<T>::IsWidget) { |
2197 | 0 | if (Q_LIKELY(qMetaTypeWidgetsHelper)) |
2198 | 0 | info = qMetaTypeWidgetsHelper[type - QMetaType::FirstWidgetsType]; |
2199 | 0 | return; |
2200 | 0 | } |
2201 | 0 | } Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QFont, false>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QPixmap, false>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QBrush, false>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QColor, false>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QPalette, false>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QIcon, false>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QImage, false>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QPolygon, false>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QRegion, false>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QBitmap, false>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QCursor, false>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QKeySequence, false>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QPen, false>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QTextLength, false>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QTextFormat, false>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QMatrix, false>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QTransform, false>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QMatrix4x4, false>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QVector2D, false>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QVector3D, false>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QVector4D, false>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QQuaternion, false>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QPolygonF, false>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QColorSpace, false>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) Unexecuted instantiation: qmetatype.cpp:(anonymous namespace)::TypeInfo::TypeInfoImpl<QSizePolicy, false>::TypeInfoImpl(unsigned int, QMetaTypeInterface&) |
2202 | | }; |
2203 | | public: |
2204 | | QMetaTypeInterface info; |
2205 | | TypeInfo(const uint type) |
2206 | | : m_type(type) |
2207 | 0 | { |
2208 | 0 | QMetaTypeInterface tmp = QT_METATYPE_INTERFACE_INIT_EMPTY(); |
2209 | 0 | info = tmp; |
2210 | 0 | } |
2211 | | template<typename T> |
2212 | 0 | void delegate(const T*) { TypeInfoImpl<T>(m_type, info); } Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<void>(void const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<bool>(bool const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<int>(int const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<unsigned int>(unsigned int const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<long long>(long long const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<unsigned long long>(unsigned long long const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<double>(double const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<long>(long const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<short>(short const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<char>(char const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<unsigned long>(unsigned long const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<unsigned short>(unsigned short const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<unsigned char>(unsigned char const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<float>(float const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<signed char>(signed char const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<decltype(nullptr)>(decltype(nullptr) const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QCborSimpleType>(QCborSimpleType const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<void*>(void* const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QChar>(QChar const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QString>(QString const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QStringList>(QStringList const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QByteArray>(QByteArray const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QBitArray>(QBitArray const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QDate>(QDate const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QTime>(QTime const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QDateTime>(QDateTime const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QUrl>(QUrl const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QLocale>(QLocale const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QRect>(QRect const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QRectF>(QRectF const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QSize>(QSize const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QSizeF>(QSizeF const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QLine>(QLine const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QLineF>(QLineF const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QPoint>(QPoint const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QPointF>(QPointF const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QRegExp>(QRegExp const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QEasingCurve>(QEasingCurve const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QUuid>(QUuid const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QVariant>(QVariant const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QRegularExpression>(QRegularExpression const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QJsonValue>(QJsonValue const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QJsonObject>(QJsonObject const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QJsonArray>(QJsonArray const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QJsonDocument>(QJsonDocument const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QCborValue>(QCborValue const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QCborArray>(QCborArray const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QCborMap>(QCborMap const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QModelIndex>(QModelIndex const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QPersistentModelIndex>(QPersistentModelIndex const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QObject*>(QObject* const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QMap<QString, QVariant> >(QMap<QString, QVariant> const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QList<QVariant> >(QList<QVariant> const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QHash<QString, QVariant> >(QHash<QString, QVariant> const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QList<QByteArray> >(QList<QByteArray> const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QFont>(QFont const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QPixmap>(QPixmap const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QBrush>(QBrush const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QColor>(QColor const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QPalette>(QPalette const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QIcon>(QIcon const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QImage>(QImage const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QPolygon>(QPolygon const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QRegion>(QRegion const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QBitmap>(QBitmap const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QCursor>(QCursor const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QKeySequence>(QKeySequence const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QPen>(QPen const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QTextLength>(QTextLength const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QTextFormat>(QTextFormat const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QMatrix>(QMatrix const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QTransform>(QTransform const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QMatrix4x4>(QMatrix4x4 const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QVector2D>(QVector2D const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QVector3D>(QVector3D const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QVector4D>(QVector4D const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QQuaternion>(QQuaternion const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QPolygonF>(QPolygonF const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QColorSpace>(QColorSpace const*) Unexecuted instantiation: qmetatype.cpp:void (anonymous namespace)::TypeInfo::delegate<QSizePolicy>(QSizePolicy const*) |
2213 | 0 | void delegate(const QMetaTypeSwitcher::UnknownType*) {} |
2214 | 0 | void delegate(const QMetaTypeSwitcher::NotBuiltinType*) { customTypeInfo(m_type); } |
2215 | | private: |
2216 | | void customTypeInfo(const uint type) |
2217 | 0 | { |
2218 | 0 | const QVector<QCustomTypeInfo> * const ct = customTypes(); |
2219 | 0 | if (Q_UNLIKELY(!ct)) |
2220 | 0 | return; |
2221 | 0 | QReadLocker locker(customTypesLock()); |
2222 | 0 | if (Q_LIKELY(uint(ct->count()) > type - QMetaType::User)) |
2223 | 0 | info = ct->at(type - QMetaType::User); |
2224 | 0 | } |
2225 | | |
2226 | | const uint m_type; |
2227 | | }; |
2228 | | } // namespace |
2229 | | |
2230 | | /*! |
2231 | | \fn QMetaType QMetaType::typeInfo(const int type) |
2232 | | \internal |
2233 | | */ |
2234 | | QMetaType QMetaType::typeInfo(const int type) |
2235 | 0 | { |
2236 | 0 | TypeInfo typeInfo(type); |
2237 | 0 | QMetaTypeSwitcher::switcher<void>(typeInfo, type); |
2238 | 0 | return (typeInfo.info.constructor || typeInfo.info.typedConstructor) |
2239 | 0 | ? QMetaType(static_cast<ExtensionFlag>(QMetaType::CreateEx | QMetaType::DestroyEx | |
2240 | 0 | (typeInfo.info.typedConstructor ? QMetaType::ConstructEx | QMetaType::DestructEx : 0)) |
2241 | 0 | , static_cast<const QMetaTypeInterface *>(nullptr) // typeInfo::info is a temporary variable, we can't return address of it. |
2242 | 0 | , typeInfo.info.typedConstructor |
2243 | 0 | , typeInfo.info.typedDestructor |
2244 | 0 | , typeInfo.info.saveOp |
2245 | 0 | , typeInfo.info.loadOp |
2246 | 0 | , typeInfo.info.constructor |
2247 | 0 | , typeInfo.info.destructor |
2248 | 0 | , typeInfo.info.size |
2249 | 0 | , typeInfo.info.flags |
2250 | 0 | , type |
2251 | 0 | , typeInfo.info.metaObject) |
2252 | 0 | : QMetaType(UnknownType); |
2253 | 0 | } |
2254 | | |
2255 | | /*! |
2256 | | \fn QMetaType::QMetaType(const int typeId) |
2257 | | \since 5.0 |
2258 | | |
2259 | | Constructs a QMetaType object that contains all information about type \a typeId. |
2260 | | |
2261 | | \note The default parameter was added in Qt 5.15. |
2262 | | */ |
2263 | | QMetaType::QMetaType(const int typeId) |
2264 | | : m_typeId(typeId) |
2265 | 0 | { |
2266 | 0 | if (Q_UNLIKELY(typeId == UnknownType)) { |
2267 | | // Constructs invalid QMetaType instance. |
2268 | 0 | m_extensionFlags = 0xffffffff; |
2269 | 0 | Q_ASSERT(!isValid()); |
2270 | 0 | } else { |
2271 | | // TODO it can be better. |
2272 | 0 | *this = QMetaType::typeInfo(typeId); |
2273 | 0 | if (m_typeId == UnknownType) |
2274 | 0 | m_extensionFlags = 0xffffffff; |
2275 | 0 | else if (m_typeId == QMetaType::Void) |
2276 | 0 | m_extensionFlags = CreateEx | DestroyEx | ConstructEx | DestructEx; |
2277 | 0 | } |
2278 | 0 | } |
2279 | | |
2280 | | /*! |
2281 | | \fn QMetaType::QMetaType(const QMetaType &other) |
2282 | | \since 5.0 |
2283 | | |
2284 | | Copy constructs a QMetaType object. |
2285 | | */ |
2286 | | QMetaType::QMetaType(const QMetaType &other) |
2287 | | : m_typedConstructor(other.m_typedConstructor) |
2288 | | , m_typedDestructor(other.m_typedDestructor) |
2289 | | , m_saveOp(other.m_saveOp) |
2290 | | , m_loadOp(other.m_loadOp) |
2291 | | , m_constructor(other.m_constructor) |
2292 | | , m_destructor(other.m_destructor) |
2293 | | , m_extension(other.m_extension) // space reserved for future use |
2294 | | , m_size(other.m_size) |
2295 | | , m_typeFlags(other.m_typeFlags) |
2296 | | , m_extensionFlags(other.m_extensionFlags) |
2297 | | , m_typeId(other.m_typeId) |
2298 | | , m_metaObject(other.m_metaObject) |
2299 | 0 | {} |
2300 | | |
2301 | | QMetaType &QMetaType::operator =(const QMetaType &other) |
2302 | 0 | { |
2303 | 0 | m_typedConstructor = other.m_typedConstructor; |
2304 | 0 | m_typedDestructor = other.m_typedDestructor; |
2305 | 0 | m_saveOp = other.m_saveOp; |
2306 | 0 | m_loadOp = other.m_loadOp; |
2307 | 0 | m_constructor = other.m_constructor; |
2308 | 0 | m_destructor = other.m_destructor; |
2309 | 0 | m_size = other.m_size; |
2310 | 0 | m_typeFlags = other.m_typeFlags; |
2311 | 0 | m_extensionFlags = other.m_extensionFlags; |
2312 | 0 | m_extension = other.m_extension; // space reserved for future use |
2313 | 0 | m_typeId = other.m_typeId; |
2314 | 0 | m_metaObject = other.m_metaObject; |
2315 | 0 | return *this; |
2316 | 0 | } |
2317 | | |
2318 | | /*! |
2319 | | \fn void QMetaType::ctor(const QMetaTypeInterface *info) |
2320 | | \internal |
2321 | | |
2322 | | Method used for future binary compatible extensions. The function may be |
2323 | | called from within QMetaType's constructor to force a library call from |
2324 | | inlined code. |
2325 | | */ |
2326 | | void QMetaType::ctor(const QMetaTypeInterface *info) |
2327 | 0 | { |
2328 | | // Special case for Void type, the type is valid but not constructible. |
2329 | | // In future we may consider to remove this assert and extend this function to initialize |
2330 | | // differently m_extensionFlags for different types. Currently it is not needed. |
2331 | 0 | Q_ASSERT(m_typeId == QMetaType::Void); |
2332 | 0 | Q_UNUSED(info); |
2333 | 0 | m_extensionFlags = CreateEx | DestroyEx | ConstructEx | DestructEx; |
2334 | 0 | } |
2335 | | |
2336 | | /*! |
2337 | | \fn void QMetaType::dtor() |
2338 | | \internal |
2339 | | |
2340 | | Method used for future binary compatible extensions. The function may be |
2341 | | called from within QMetaType's destructor to force a library call from |
2342 | | inlined code. |
2343 | | */ |
2344 | | void QMetaType::dtor() |
2345 | 0 | {} |
2346 | | |
2347 | | /*! |
2348 | | \fn void *QMetaType::createExtended(const void *copy) const |
2349 | | \internal |
2350 | | |
2351 | | Method used for future binary compatible extensions. The function may be called |
2352 | | during QMetaType::create to force library call from inlined code. |
2353 | | |
2354 | | ### TODO Qt6 remove the extension |
2355 | | */ |
2356 | | void *QMetaType::createExtended(const void *copy) const |
2357 | 0 | { |
2358 | 0 | if (m_typeId == QMetaType::UnknownType) |
2359 | 0 | return nullptr; |
2360 | 0 | if (Q_UNLIKELY(m_typedConstructor && !m_constructor)) |
2361 | 0 | return m_typedConstructor(m_typeId, operator new(m_size), copy); |
2362 | 0 | return m_constructor(operator new(m_size), copy); |
2363 | 0 | } |
2364 | | |
2365 | | /*! |
2366 | | \fn void QMetaType::destroyExtended(void *data) const |
2367 | | \internal |
2368 | | |
2369 | | Method used for future binary compatible extensions. The function may be called |
2370 | | during QMetaType::destroy to force library call from inlined code. |
2371 | | |
2372 | | ### TODO Qt6 remove the extension |
2373 | | */ |
2374 | | void QMetaType::destroyExtended(void *data) const |
2375 | 0 | { |
2376 | 0 | if (m_typeId == QMetaType::UnknownType) |
2377 | 0 | return; |
2378 | 0 | if (Q_UNLIKELY(m_typedDestructor && !m_destructor)) |
2379 | 0 | m_typedDestructor(m_typeId, data); |
2380 | 0 | else |
2381 | 0 | m_destructor(data); |
2382 | 0 | operator delete(data); |
2383 | 0 | } |
2384 | | |
2385 | | /*! |
2386 | | \fn void *QMetaType::constructExtended(void *where, const void *copy) const |
2387 | | \internal |
2388 | | |
2389 | | Method used for future binary compatible extensions. The function may be called |
2390 | | during QMetaType::construct to force library call from inlined code. |
2391 | | */ |
2392 | | void *QMetaType::constructExtended(void *where, const void *copy) const |
2393 | 0 | { |
2394 | 0 | if (m_typeId == QMetaType::UnknownType) |
2395 | 0 | return nullptr; |
2396 | 0 | if (m_typedConstructor && !m_constructor) |
2397 | 0 | return m_typedConstructor(m_typeId, where, copy); |
2398 | 0 | return nullptr; |
2399 | 0 | } |
2400 | | |
2401 | | /*! |
2402 | | \fn void QMetaType::destructExtended(void *data) const |
2403 | | \internal |
2404 | | |
2405 | | Method used for future binary compatible extensions. The function may be called |
2406 | | during QMetaType::destruct to force library call from inlined code. |
2407 | | */ |
2408 | | void QMetaType::destructExtended(void *data) const |
2409 | 0 | { |
2410 | 0 | if (m_typeId == QMetaType::UnknownType) |
2411 | 0 | return; |
2412 | 0 | if (m_typedDestructor && !m_destructor) |
2413 | 0 | m_typedDestructor(m_typeId, data); |
2414 | 0 | } |
2415 | | |
2416 | | /*! |
2417 | | \fn uint QMetaType::sizeExtended() const |
2418 | | \internal |
2419 | | |
2420 | | Method used for future binary compatible extensions. The function may be |
2421 | | called from within QMetaType::size to force a library call from |
2422 | | inlined code. |
2423 | | */ |
2424 | | uint QMetaType::sizeExtended() const |
2425 | 0 | { |
2426 | 0 | return 0; |
2427 | 0 | } |
2428 | | |
2429 | | /*! |
2430 | | \fn QMetaType::TypeFlags QMetaType::flagsExtended() const |
2431 | | \internal |
2432 | | |
2433 | | Method used for future binary compatible extensions. The function may be |
2434 | | called from within QMetaType::flags to force a library call from |
2435 | | inlined code. |
2436 | | */ |
2437 | | QMetaType::TypeFlags QMetaType::flagsExtended() const |
2438 | 0 | { |
2439 | 0 | return { }; |
2440 | 0 | } |
2441 | | |
2442 | | /*! |
2443 | | \brief QMetaType::metaObjectExtended |
2444 | | \internal |
2445 | | |
2446 | | Method used for future binary compatible extensions. The function may be |
2447 | | called from within QMetaType::metaObject to force a library call from |
2448 | | inlined code. |
2449 | | */ |
2450 | | const QMetaObject *QMetaType::metaObjectExtended() const |
2451 | 0 | { |
2452 | 0 | return nullptr; |
2453 | 0 | } |
2454 | | |
2455 | | |
2456 | | namespace QtPrivate |
2457 | | { |
2458 | | const QMetaObject *metaObjectForQWidget() |
2459 | 0 | { |
2460 | 0 | if (!qMetaTypeWidgetsHelper) |
2461 | 0 | return nullptr; |
2462 | 0 | return qMetaObjectWidgetsHelper; |
2463 | 0 | } |
2464 | | } |
2465 | | |
2466 | | namespace QtMetaTypePrivate { |
2467 | | const bool VectorBoolElements::true_element = true; |
2468 | | const bool VectorBoolElements::false_element = false; |
2469 | | } |
2470 | | |
2471 | | QT_END_NAMESPACE |