| 315 | } |
| 316 | |
| 317 | void 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 | |
| 336 | void WidgetInspectorServer::objectSelected(QObject *obj) |
| 337 | { |