OpenCoverage

qtouchdevice.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/gui/kernel/qtouchdevice.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4QTouchDevice::QTouchDevice()-
5 : d(new QTouchDevicePrivate)-
6{-
7}
never executed: end of block
0
8-
9-
10-
11-
12QTouchDevice::~QTouchDevice()-
13{-
14 delete d;-
15}
never executed: end of block
0
16-
17-
18-
19-
20QTouchDevice::DeviceType QTouchDevice::type() const-
21{-
22 return
never executed: return d->type;
d->type;
never executed: return d->type;
0
23}-
24-
25-
26-
27-
28QTouchDevice::Capabilities QTouchDevice::capabilities() const-
29{-
30 return
never executed: return d->caps;
d->caps;
never executed: return d->caps;
0
31}-
32-
33-
34-
35-
36-
37-
38int QTouchDevice::maximumTouchPoints() const-
39{-
40 return
never executed: return d->maxTouchPoints;
d->maxTouchPoints;
never executed: return d->maxTouchPoints;
0
41}-
42QString QTouchDevice::name() const-
43{-
44 return
never executed: return d->name;
d->name;
never executed: return d->name;
0
45}-
46-
47-
48-
49-
50void QTouchDevice::setType(DeviceType devType)-
51{-
52 d->type = devType;-
53}
never executed: end of block
0
54-
55-
56-
57-
58void QTouchDevice::setCapabilities(Capabilities caps)-
59{-
60 d->caps = caps;-
61}
never executed: end of block
0
62-
63-
64-
65-
66-
67void QTouchDevice::setMaximumTouchPoints(int max)-
68{-
69 d->maxTouchPoints = max;-
70}
never executed: end of block
0
71-
72-
73-
74-
75-
76-
77-
78void QTouchDevice::setName(const QString &name)-
79{-
80 d->name = name;-
81}
never executed: end of block
0
82-
83typedef QList<const QTouchDevice *> TouchDevices;-
84namespace { namespace Q_QGS_deviceList { typedef TouchDevices Type; QBasicAtomicInt guard = { QtGlobalStatic::Uninitialized }; __attribute__((visibility("hidden"))) inline Type *innerFunction() { struct HolderBase { ~HolderBase() noexcept { if (guard.load() == QtGlobalStatic::Initialized
guard.load() =...c::InitializedDescription
TRUEnever evaluated
FALSEnever evaluated
) guard.store(QtGlobalStatic::Destroyed);
never executed: guard.store(QtGlobalStatic::Destroyed);
}
never executed: end of block
}; static struct Holder : public HolderBase { Type value; Holder() noexcept(noexcept(Type ())) : value () { guard.store(QtGlobalStatic::Initialized); } } holder; return
never executed: return &holder.value;
&holder.value;
never executed: return &holder.value;
} } } static QGlobalStatic<TouchDevices, Q_QGS_deviceList::innerFunction, Q_QGS_deviceList::guard> deviceList;
0
85static QBasicMutex devicesMutex;-
86-
87static void cleanupDevicesList()-
88{-
89 QMutexLocker lock(&devicesMutex);-
90 qDeleteAll(*deviceList());-
91 deviceList()->clear();-
92}
never executed: end of block
0
93-
94-
95-
96-
97-
98-
99QList<const QTouchDevice *> QTouchDevice::devices()-
100{-
101 QMutexLocker lock(&devicesMutex);-
102 return
never executed: return *deviceList();
*deviceList();
never executed: return *deviceList();
0
103}-
104-
105-
106-
107-
108bool QTouchDevicePrivate::isRegistered(const QTouchDevice *dev)-
109{-
110 QMutexLocker locker(&devicesMutex);-
111 return
never executed: return deviceList()->contains(dev);
deviceList()->contains(dev);
never executed: return deviceList()->contains(dev);
0
112}-
113-
114-
115-
116-
117void QTouchDevicePrivate::registerDevice(const QTouchDevice *dev)-
118{-
119 QMutexLocker lock(&devicesMutex);-
120 if (deviceList()->isEmpty()
deviceList()->isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
121 qAddPostRoutine(cleanupDevicesList);
never executed: qAddPostRoutine(cleanupDevicesList);
0
122 deviceList()->append(dev);-
123}
never executed: end of block
0
124-
125-
126-
127-
128void QTouchDevicePrivate::unregisterDevice(const QTouchDevice *dev)-
129{-
130 QMutexLocker lock(&devicesMutex);-
131 bool wasRemoved = deviceList()->removeOne(dev);-
132 if (wasRemoved
wasRemovedDescription
TRUEnever evaluated
FALSEnever evaluated
&& deviceList()->isEmpty()
deviceList()->isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
133 qRemovePostRoutine(cleanupDevicesList);
never executed: qRemovePostRoutine(cleanupDevicesList);
0
134}
never executed: end of block
0
135-
136-
137QDebug operator<<(QDebug debug, const QTouchDevice *device)-
138{-
139 QDebugStateSaver saver(debug);-
140 debug.nospace();-
141 debug.noquote();-
142 debug << "QTouchDevice(";-
143 if (device
deviceDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
144 debug << '"' << device->name() << "\", type=";-
145 QtDebugUtils::formatQEnum(debug, device->type());-
146 debug << ", capabilities=";-
147 QtDebugUtils::formatQFlags(debug, device->capabilities());-
148 debug << ", maximumTouchPoints=" << device->maximumTouchPoints();-
149 }
never executed: end of block
else {
0
150 debug << '0';-
151 }
never executed: end of block
0
152 debug << ')';-
153 return
never executed: return debug;
debug;
never executed: return debug;
0
154}-
155-
156-
157-
Switch to Source codePreprocessed file

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