| 112 | } |
| 113 | |
| 114 | void TimerTop::objectSelected(QObject *obj) |
| 115 | { |
| 116 | auto timer = qobject_cast<QTimer *>(obj); |
| 117 | if (!timer) |
| 118 | return; |
| 119 | |
| 120 | const auto model = m_selectionModel->model(); |
| 121 | const auto indexList = model->match(model->index(0, 0), ObjectModel::ObjectIdRole, |
| 122 | QVariant::fromValue(ObjectId(timer)), 1, |
| 123 | Qt::MatchExactly | Qt::MatchRecursive | Qt::MatchWrap); |
| 124 | if (indexList.isEmpty()) |
| 125 | return; |
| 126 | |
| 127 | const auto &index = indexList.first(); |
| 128 | m_selectionModel->select(index, QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows); |
| 129 | } |
| 130 | |
| 131 | TimerTopFactory::TimerTopFactory(QObject *parent) |
| 132 | : QObject(parent) |