| 139 | } |
| 140 | |
| 141 | void GammaRay::ProblemReporterWidget::updateFilter(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles) |
| 142 | { |
| 143 | if (!roles.empty() && !roles.contains(Qt::CheckStateRole)) |
| 144 | return; |
| 145 | |
| 146 | for (int i = topLeft.row(); i <= bottomRight.row(); ++i) { |
| 147 | auto index = topLeft.sibling(i, 0); |
| 148 | auto checkState = index.data(Qt::CheckStateRole); |
| 149 | auto id = index.data(Qt::EditRole).toString(); |
| 150 | if (!checkState.canConvert<Qt::CheckState>()) |
| 151 | continue; |
| 152 | |
| 153 | if (index.data(Qt::CheckStateRole).value<Qt::CheckState>() == Qt::Checked) { |
| 154 | m_problemsModel->enableChecker(id); |
| 155 | } else { |
| 156 | m_problemsModel->disableChecker(id); |
| 157 | } |
| 158 | } |
| 159 | } |
nothing calls this directly
no test coverage detected