Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/widgets/kernel/qwidgetsvariant.cpp |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | - | |||||||
2 | - | |||||||
3 | - | |||||||
4 | - | |||||||
5 | - | |||||||
6 | namespace { | - | ||||||
7 | static void construct(QVariant::Private *x, const void *copy) | - | ||||||
8 | { | - | ||||||
9 | switch (x->type) { | - | ||||||
10 | case never executed: QVariant::SizePolicy:case QVariant::SizePolicy: never executed: case QVariant::SizePolicy: | 0 | ||||||
11 | v_construct<QSizePolicy>(x, copy); | - | ||||||
12 | break; never executed: break; | 0 | ||||||
13 | default never executed: :default: never executed: default: | 0 | ||||||
14 | QMessageLogger(__FILE__, 58, __PRETTY_FUNCTION__).warning("Trying to construct an instance of an invalid type, type id: %i", x->type); | - | ||||||
15 | x->type = QVariant::Invalid; | - | ||||||
16 | return; never executed: return; | 0 | ||||||
17 | } | - | ||||||
18 | x->is_null = !copy; | - | ||||||
19 | } never executed: end of block | 0 | ||||||
20 | - | |||||||
21 | static void clear(QVariant::Private *d) | - | ||||||
22 | { | - | ||||||
23 | switch (d->type) { | - | ||||||
24 | case never executed: QVariant::SizePolicy:case QVariant::SizePolicy: never executed: case QVariant::SizePolicy: | 0 | ||||||
25 | v_clear<QSizePolicy>(d); | - | ||||||
26 | break; never executed: break; | 0 | ||||||
27 | default never executed: :default: never executed: default: | 0 | ||||||
28 | ((!(false)) ? qt_assert("false",__FILE__,72) : qt_noop()); | - | ||||||
29 | return; never executed: return; | 0 | ||||||
30 | } | - | ||||||
31 | - | |||||||
32 | d->type = QVariant::Invalid; | - | ||||||
33 | d->is_null = true; | - | ||||||
34 | d->is_shared = false; | - | ||||||
35 | } never executed: end of block | 0 | ||||||
36 | - | |||||||
37 | - | |||||||
38 | static bool isNull(const QVariant::Private *) | - | ||||||
39 | { | - | ||||||
40 | return never executed: false;return false; never executed: return false; | 0 | ||||||
41 | } | - | ||||||
42 | - | |||||||
43 | static bool compare(const QVariant::Private *a, const QVariant::Private *b) | - | ||||||
44 | { | - | ||||||
45 | ((!(a->type == b->type)) ? qt_assert("a->type == b->type",__FILE__,89) : qt_noop()); | - | ||||||
46 | switch(a->type) { | - | ||||||
47 | case never executed: QVariant::SizePolicy:case QVariant::SizePolicy: never executed: case QVariant::SizePolicy: | 0 | ||||||
48 | return never executed: *v_cast<QSizePolicy>(a) == *v_cast<QSizePolicy>(b);return *v_cast<QSizePolicy>(a) == *v_cast<QSizePolicy>(b); never executed: return *v_cast<QSizePolicy>(a) == *v_cast<QSizePolicy>(b); | 0 | ||||||
49 | default never executed: :default: never executed: default: | 0 | ||||||
50 | ((!(false)) ? qt_assert("false",__FILE__,94) : qt_noop()); | - | ||||||
51 | } never executed: end of block | 0 | ||||||
52 | return never executed: false;return false; never executed: return false; | 0 | ||||||
53 | } | - | ||||||
54 | - | |||||||
55 | static bool convert(const QVariant::Private *d, int type, void *result, bool *ok) | - | ||||||
56 | { | - | ||||||
57 | (void)d;; | - | ||||||
58 | (void)type;; | - | ||||||
59 | (void)result;; | - | ||||||
60 | if (ok
| 0 | ||||||
61 | * never executed: ok = false;*ok = false; never executed: *ok = false; | 0 | ||||||
62 | return never executed: false;return false; never executed: return false; | 0 | ||||||
63 | } | - | ||||||
64 | - | |||||||
65 | - | |||||||
66 | static void streamDebug(QDebug dbg, const QVariant &v) | - | ||||||
67 | { | - | ||||||
68 | QVariant::Private *d = const_cast<QVariant::Private *>(&v.data_ptr()); | - | ||||||
69 | switch (d->type) { | - | ||||||
70 | case never executed: QVariant::SizePolicy:case QVariant::SizePolicy: never executed: case QVariant::SizePolicy: | 0 | ||||||
71 | dbg.nospace() << *v_cast<QSizePolicy>(d); | - | ||||||
72 | break; never executed: break; | 0 | ||||||
73 | default never executed: :default: never executed: default: | 0 | ||||||
74 | dbg.nospace() << "QMetaType::Type(" << d->type << ')'; | - | ||||||
75 | } never executed: end of block | 0 | ||||||
76 | } | - | ||||||
77 | - | |||||||
78 | - | |||||||
79 | static const QVariant::Handler widgets_handler = { | - | ||||||
80 | construct, | - | ||||||
81 | clear, | - | ||||||
82 | isNull, | - | ||||||
83 | - | |||||||
84 | 0, | - | ||||||
85 | 0, | - | ||||||
86 | - | |||||||
87 | compare, | - | ||||||
88 | convert, | - | ||||||
89 | 0, | - | ||||||
90 | - | |||||||
91 | streamDebug | - | ||||||
92 | - | |||||||
93 | - | |||||||
94 | - | |||||||
95 | }; | - | ||||||
96 | - | |||||||
97 | - | |||||||
98 | - | |||||||
99 | - | |||||||
100 | static const QMetaTypeInterface qVariantWidgetsHelper[] = { | - | ||||||
101 | { (QtMetaTypePrivate::QMetaTypeFunctionHelper<QSizePolicy, QtMetaTypePrivate::TypeDefinition<QSizePolicy>::IsAvailable>::Save), (QtMetaTypePrivate::QMetaTypeFunctionHelper<QSizePolicy, QtMetaTypePrivate::TypeDefinition<QSizePolicy>::IsAvailable>::Load), (QtMetaTypePrivate::QMetaTypeFunctionHelper<QSizePolicy, QtMetaTypePrivate::TypeDefinition<QSizePolicy>::IsAvailable>::Construct), (QtMetaTypePrivate::QMetaTypeFunctionHelper<QSizePolicy, QtMetaTypePrivate::TypeDefinition<QSizePolicy>::IsAvailable>::Destruct), (QTypeInfo<QSizePolicy>::sizeOf), QtPrivate::QMetaTypeTypeFlags<QSizePolicy>::Flags, (QtPrivate::MetaObjectForType<QSizePolicy>::value()) }, | - | ||||||
102 | }; | - | ||||||
103 | - | |||||||
104 | - | |||||||
105 | - | |||||||
106 | } | - | ||||||
107 | - | |||||||
108 | extern __attribute__((visibility("default"))) const QMetaTypeInterface *qMetaTypeWidgetsHelper; | - | ||||||
109 | - | |||||||
110 | void qRegisterWidgetsVariant() | - | ||||||
111 | { | - | ||||||
112 | qRegisterMetaType<QWidget*>(); | - | ||||||
113 | qMetaTypeWidgetsHelper = qVariantWidgetsHelper; | - | ||||||
114 | QVariantPrivate::registerHandler(QModulesPrivate::Widgets, &widgets_handler); | - | ||||||
115 | } never executed: end of block | 0 | ||||||
116 | namespace { static const struct qRegisterWidgetsVariant_ctor_class_ { inline qRegisterWidgetsVariant_ctor_class_() { qRegisterWidgetsVariant(); } never executed: } qRegisterWidgetsVariant_ctor_instance_; }end of block | 0 | ||||||
117 | - | |||||||
118 | - | |||||||
Switch to Source code | Preprocessed file |