qwidgetsvariant.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/widgets/kernel/qwidgetsvariant.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6namespace {-
7static void construct(QVariant::Private *x, const void *copy)-
8{-
9 switch (x->type) {-
10 case
never executed: case QVariant::SizePolicy:
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-
21static void clear(QVariant::Private *d)-
22{-
23 switch (d->type) {-
24 case
never executed: case QVariant::SizePolicy:
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-
38static bool isNull(const QVariant::Private *)-
39{-
40 return
never executed: return false;
false;
never executed: return false;
0
41}-
42-
43static 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: case QVariant::SizePolicy:
QVariant::SizePolicy:
never executed: case QVariant::SizePolicy:
0
48 return
never executed: return *v_cast<QSizePolicy>(a) == *v_cast<QSizePolicy>(b);
*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: return false;
false;
never executed: return false;
0
53}-
54-
55static 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
okDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
61 *
never executed: *ok = false;
ok = false;
never executed: *ok = false;
0
62 return
never executed: return false;
false;
never executed: return false;
0
63}-
64-
65-
66static 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: case QVariant::SizePolicy:
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-
79static 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-
100static 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-
108extern __attribute__((visibility("default"))) const QMetaTypeInterface *qMetaTypeWidgetsHelper;-
109-
110void qRegisterWidgetsVariant()-
111{-
112 qRegisterMetaType<QWidget*>();-
113 qMetaTypeWidgetsHelper = qVariantWidgetsHelper;-
114 QVariantPrivate::registerHandler(QModulesPrivate::Widgets, &widgets_handler);-
115}
never executed: end of block
0
116namespace { static const struct qRegisterWidgetsVariant_ctor_class_ { inline qRegisterWidgetsVariant_ctor_class_() { qRegisterWidgetsVariant(); }
never executed: end of block
} qRegisterWidgetsVariant_ctor_instance_; }
0
117-
118-
Switch to Source codePreprocessed file

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