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

Method widgetSelected

plugins/widgetinspector/widgetinspectorserver.cpp:317–334  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

315}
316
317void WidgetInspectorServer::widgetSelected(QWidget *widget)
318{
319 if (m_selectedWidget == widget)
320 return;
321
322 const QAbstractItemModel *model = m_widgetSelectionModel->model();
323 const QModelIndexList indexList = model->match(model->index(0, 0),
324 ObjectModel::ObjectRole,
325 QVariant::fromValue<QObject *>(widget), 1,
326 Qt::MatchExactly | Qt::MatchRecursive | Qt::MatchWrap);
327 if (indexList.isEmpty())
328 return;
329 const QModelIndex index = indexList.first();
330 m_widgetSelectionModel->select(
331 index,
332 QItemSelectionModel::Select | QItemSelectionModel::Clear
333 | QItemSelectionModel::Rows | QItemSelectionModel::Current);
334}
335
336void WidgetInspectorServer::objectSelected(QObject *obj)
337{

Callers

nothing calls this directly

Calls 5

modelMethod · 0.45
matchMethod · 0.45
indexMethod · 0.45
isEmptyMethod · 0.45
selectMethod · 0.45

Tested by

no test coverage detected