| 244 | } |
| 245 | |
| 246 | QVector<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 | |
| 269 | void WidgetInspectorServer::requestElementsAt(const QPoint &pos, GammaRay::RemoteViewInterface::RequestMode mode) |
| 270 | { |