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

Method tabFocusChain

plugins/widgetinspector/widgetinspectorserver.cpp:246–267  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

244}
245
246QVector<QRect> WidgetInspectorServer::tabFocusChain(QWidget *window)
247{
248 QVector<QRect> r;
249 QSet<QWidget *> widgets;
250 auto w = window;
251 while (w->nextInFocusChain()) {
252 w = w->nextInFocusChain();
253 if (widgets.contains(w))
254 break;
255 widgets.insert(w);
256 if (!w->isVisible() || !w->isEnabled())
257 continue;
258 if ((w->focusPolicy() & Qt::TabFocus) == 0)
259 continue;
260 const auto rect = QRect(w->mapTo(window, QPoint(0, 0)), w->size());
261 if (!window->rect().contains(rect)) // happens for example for inactive dock widgets
262 continue;
263 r.push_back(rect);
264 }
265
266 return r;
267}
268
269void WidgetInspectorServer::requestElementsAt(const QPoint &pos, GammaRay::RemoteViewInterface::RequestMode mode)
270{

Callers

nothing calls this directly

Calls 6

QRectClass · 0.85
QPointClass · 0.85
insertMethod · 0.45
isVisibleMethod · 0.45
isEnabledMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected