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

Method objectSelected

plugins/timertop/timertop.cpp:114–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112}
113
114void 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
131TimerTopFactory::TimerTopFactory(QObject *parent)
132 : QObject(parent)

Callers

nothing calls this directly

Calls 6

ObjectIdClass · 0.50
modelMethod · 0.45
matchMethod · 0.45
indexMethod · 0.45
isEmptyMethod · 0.45
selectMethod · 0.45

Tested by

no test coverage detected