qcoreevent.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/corelib/kernel/qcoreevent.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6QEvent::QEvent(Type type)-
7 : d(0), t(type), posted(false), spont(false), m_accept(true)-
8{}
executed 2174144 times by 536 tests: end of block
Executed by:
  • tst_Gestures
  • tst_Lancelot
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • ...
2174144
9QEvent::QEvent(const QEvent &other)-
10 : d(other.d), t(other.t), posted(other.posted), spont(other.spont),-
11 m_accept(other.m_accept)-
12{-
13-
14-
15 ((!(!d)) ? qt_assert_x("QEvent", "Impossible, this can't happen: QEventPrivate isn't defined anywhere",__FILE__,305) : qt_noop());-
16}
executed 24 times by 1 test: end of block
Executed by:
  • tst_QStateMachine
24
17QEvent &QEvent::operator=(const QEvent &other)-
18{-
19-
20-
21 ((!(!other.d)) ? qt_assert_x("QEvent", "Impossible, this can't happen: QEventPrivate isn't defined anywhere",__FILE__,319) : qt_noop());-
22-
23 t = other.t;-
24 posted = other.posted;-
25 spont = other.spont;-
26 m_accept = other.m_accept;-
27 return
executed 6692 times by 47 tests: return *this;
Executed by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractSlider
  • tst_QAccessibility
  • tst_QApplication
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QGraphicsItem
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGraphicsView
  • tst_QGraphicsWidget
  • tst_QGroupBox
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemView
  • tst_QLabel
  • ...
*this;
executed 6692 times by 47 tests: return *this;
Executed by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractSlider
  • tst_QAccessibility
  • tst_QApplication
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QGraphicsItem
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGraphicsView
  • tst_QGraphicsWidget
  • tst_QGroupBox
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemView
  • tst_QLabel
  • ...
6692
28}-
29-
30-
31-
32-
33-
34-
35QEvent::~QEvent()-
36{-
37 if (posted
postedDescription
TRUEnever evaluated
FALSEevaluated 2174105 times by 540 tests
Evaluated by:
  • tst_Gestures
  • tst_Lancelot
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • ...
&& QCoreApplication::instance()
QCoreApplication::instance()Description
TRUEnever evaluated
FALSEnever evaluated
)
0-2174105
38 QCoreApplicationPrivate::removePostedEvent(this);
never executed: QCoreApplicationPrivate::removePostedEvent(this);
0
39 ((!(!d)) ? qt_assert_x("QEvent", "Impossible, this can't happen: QEventPrivate isn't defined anywhere",__FILE__,337) : qt_noop());-
40}
executed 2176394 times by 540 tests: end of block
Executed by:
  • tst_Gestures
  • tst_Lancelot
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • ...
2176394
41namespace {-
42template <size_t N>-
43struct QBasicAtomicBitField {-
44 enum {-
45 BitsPerInt = std::numeric_limits<uint>::digits,-
46 NumInts = (N + BitsPerInt - 1) / BitsPerInt,-
47 NumBits = N-
48 };-
49-
50-
51-
52 QBasicAtomicInteger<uint> next;-
53 QBasicAtomicInteger<uint> data[NumInts];-
54-
55 bool allocateSpecific(int which) noexcept-
56 {-
57 QBasicAtomicInteger<uint> &entry = data[which / BitsPerInt];-
58 const uint old = entry.load();-
59 const uint bit = 1U << (which % BitsPerInt);-
60 return
executed 129072 times by 3 tests: return !(old & bit) && entry.testAndSetRelaxed(old, old | bit);
Executed by:
  • tst_Gestures
  • tst_QEvent
  • tst_QWidget_window
!(old & bit)
executed 129072 times by 3 tests: return !(old & bit) && entry.testAndSetRelaxed(old, old | bit);
Executed by:
  • tst_Gestures
  • tst_QEvent
  • tst_QWidget_window
129072
61 && entry.testAndSetRelaxed(old, old | bit);
executed 129072 times by 3 tests: return !(old & bit) && entry.testAndSetRelaxed(old, old | bit);
Executed by:
  • tst_Gestures
  • tst_QEvent
  • tst_QWidget_window
129072
62-
63-
64-
65-
66-
67-
68-
69 }-
70-
71 int allocateNext() noexcept-
72 {-
73-
74-
75-
76-
77-
78-
79 for (uint i = next.load(); i < NumBits
i < NumBitsDescription
TRUEevaluated 64538 times by 3 tests
Evaluated by:
  • tst_Gestures
  • tst_QEvent
  • tst_QWidget_window
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QEvent
; ++i) {
1-64538
80 if (allocateSpecific(i)
allocateSpecific(i)Description
TRUEevaluated 7 times by 3 tests
Evaluated by:
  • tst_Gestures
  • tst_QEvent
  • tst_QWidget_window
FALSEevaluated 64531 times by 1 test
Evaluated by:
  • tst_QEvent
) {
7-64531
81-
82 const uint oldNext = next.load();-
83 next.testAndSetRelaxed(oldNext, qMax(i + 1, oldNext));-
84 return
executed 7 times by 3 tests: return i;
Executed by:
  • tst_Gestures
  • tst_QEvent
  • tst_QWidget_window
i;
executed 7 times by 3 tests: return i;
Executed by:
  • tst_Gestures
  • tst_QEvent
  • tst_QWidget_window
7
85 }-
86 }
executed 64531 times by 1 test: end of block
Executed by:
  • tst_QEvent
64531
87 return
executed 1 time by 1 test: return -1;
Executed by:
  • tst_QEvent
-1;
executed 1 time by 1 test: return -1;
Executed by:
  • tst_QEvent
1
88 }-
89};-
90-
91}-
92-
93typedef QBasicAtomicBitField<QEvent::MaxUser - QEvent::User + 1> UserEventTypeRegistry;-
94-
95static UserEventTypeRegistry userEventTypeRegistry;-
96-
97static inline int registerEventTypeZeroBased(int id) noexcept-
98{-
99-
100 if (id < UserEventTypeRegistry::NumBits
id < UserEvent...istry::NumBitsDescription
TRUEevaluated 64535 times by 1 test
Evaluated by:
  • tst_QEvent
FALSEevaluated 4 times by 3 tests
Evaluated by:
  • tst_Gestures
  • tst_QEvent
  • tst_QWidget_window
&& id >= 0
id >= 0Description
TRUEevaluated 64534 times by 1 test
Evaluated by:
  • tst_QEvent
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QEvent
&& userEventTypeRegistry.allocateSpecific(id)
userEventTypeR...teSpecific(id)Description
TRUEevaluated 64531 times by 1 test
Evaluated by:
  • tst_QEvent
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QEvent
)
1-64535
101 return
executed 64531 times by 1 test: return id;
Executed by:
  • tst_QEvent
id;
executed 64531 times by 1 test: return id;
Executed by:
  • tst_QEvent
64531
102-
103-
104 return
executed 8 times by 3 tests: return userEventTypeRegistry.allocateNext();
Executed by:
  • tst_Gestures
  • tst_QEvent
  • tst_QWidget_window
userEventTypeRegistry.allocateNext();
executed 8 times by 3 tests: return userEventTypeRegistry.allocateNext();
Executed by:
  • tst_Gestures
  • tst_QEvent
  • tst_QWidget_window
8
105}-
106int QEvent::registerEventType(int hint) noexcept-
107{-
108 const int result = registerEventTypeZeroBased(QEvent::MaxUser - hint);-
109 return
executed 64539 times by 3 tests: return result < 0 ? -1 : QEvent::MaxUser - result ;
Executed by:
  • tst_Gestures
  • tst_QEvent
  • tst_QWidget_window
result < 0 ? -1 : QEvent::MaxUser - result ;
executed 64539 times by 3 tests: return result < 0 ? -1 : QEvent::MaxUser - result ;
Executed by:
  • tst_Gestures
  • tst_QEvent
  • tst_QWidget_window
64539
110}-
111QTimerEvent::QTimerEvent(int timerId)-
112 : QEvent(Timer), id(timerId)-
113{}
executed 49574 times by 115 tests: end of block
Executed by:
  • tst_Gestures
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAccessibility
  • tst_QApplication
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QDBusAbstractInterface
  • tst_QDBusMarshall
  • tst_QDialog
  • tst_QDialogButtonBox
  • tst_QEventDispatcher
  • tst_QEventLoop
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • ...
49574
114-
115-
116-
117-
118QTimerEvent::~QTimerEvent()-
119{-
120}-
121QChildEvent::QChildEvent(Type type, QObject *child)-
122 : QEvent(type), c(child)-
123{}
executed 325287 times by 510 tests: end of block
Executed by:
  • tst_Gestures
  • tst_Lancelot
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • ...
325287
124-
125-
126-
127-
128QChildEvent::~QChildEvent()-
129{-
130}-
131QDynamicPropertyChangeEvent::QDynamicPropertyChangeEvent(const QByteArray &name)-
132 : QEvent(QEvent::DynamicPropertyChange), n(name)-
133{-
134}
executed 10046 times by 68 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_Delayed
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusLocalCalls
  • tst_QDBusMarshall
  • tst_QDBusPendingCall
  • tst_QDBusPendingReply
  • tst_QDBusReply
  • tst_QDBusThreading
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFocusEvent
  • tst_QFontDialog
  • ...
10046
135-
136-
137-
138-
139QDynamicPropertyChangeEvent::~QDynamicPropertyChangeEvent()-
140{-
141}-
142QDeferredDeleteEvent::QDeferredDeleteEvent()-
143 : QEvent(QEvent::DeferredDelete)-
144 , level(0)-
145{ }
executed 11751 times by 213 tests: end of block
Executed by:
  • tst_Gestures
  • tst_Lancelot
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QDBusAbstractAdaptor
  • ...
11751
146-
147-
148-
149-
150QDeferredDeleteEvent::~QDeferredDeleteEvent()-
151{ }-
152-
Switch to Source codePreprocessed file

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