MCPcopy Create free account
hub / github.com/KDAB/GammaRay / update

Method update

plugins/timertop/timerinfo.cpp:127–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125}
126
127void TimerIdInfo::update(const TimerId &id, QObject *receiver)
128{
129 QObject *object = receiver ? receiver : id.address();
130
131 type = id.type();
132 state = InvalidState;
133
134 // The timer became invalid
135 if (!object || (lastReceiverAddress == object && !lastReceiverObject)) {
136 type = TimerId::InvalidType;
137 return;
138 }
139
140 interval = 0;
141
142 switch (id.type()) {
143 case TimerId::InvalidType: {
144 Q_UNREACHABLE();
145 break;
146 }
147
148 case TimerId::QQmlTimerType: {
149 timerId = -1;
150 interval = object->property("interval").toInt();
151 lastReceiverAddress = id.address();
152 lastReceiverObject = object;
153 objectName = Util::displayString(object);
154
155 if (!object->property("running").toBool())
156 state = InactiveState;
157 else if (!object->property("repeat").toBool())
158 state = SingleShotState;
159 else
160 state = RepeatState;
161
162 break;
163 }
164
165 case TimerId::QTimerType: {
166 const QTimer *const timer = qobject_cast<QTimer *>(object);
167 timerId = timer->timerId();
168 interval = timer->interval();
169 lastReceiverAddress = id.address();
170 lastReceiverObject = object;
171 objectName = Util::displayString(object);
172
173 if (!timer->isActive())
174 state = InactiveState;
175 else if (timer->isSingleShot())
176 state = SingleShotState;
177 else
178 state = RepeatState;
179
180 break;
181 }
182
183 case TimerId::QObjectType: {
184 timerId = id.timerId();

Callers 15

showSourceMethod · 0.45
showSourceFunction · 0.45
setBackgroundWindowMethod · 0.45
updateSidebarAreaMethod · 0.45
updateSizeMethod · 0.45
setLoggingClientMethod · 0.45
preFinishedMethod · 0.45
selectWindowMethod · 0.45
placeOnMethod · 0.45
updateOverlayMethod · 0.45
setTextColorMethod · 0.45

Calls 8

displayStringFunction · 0.85
timerIdMethod · 0.80
addressMethod · 0.45
typeMethod · 0.45
propertyMethod · 0.45
isActiveMethod · 0.45
constBeginMethod · 0.45
constEndMethod · 0.45

Tested by 5

showSourceMethod · 0.36
showSourceFunction · 0.36
preFinishedMethod · 0.36
selectWindowMethod · 0.36