| 141 | } |
| 142 | |
| 143 | bool LoggingCategoryModel::setData(const QModelIndex &index, const QVariant &value, int role) |
| 144 | { |
| 145 | if (!index.isValid() || index.column() == 0 || role != Qt::CheckStateRole) |
| 146 | return false; |
| 147 | |
| 148 | static const QtMsgType type_map[] = { QtDebugMsg, QtDebugMsg, QtInfoMsg, QtWarningMsg, QtCriticalMsg }; |
| 149 | |
| 150 | const auto enabled = value.toInt() == Qt::Checked; |
| 151 | auto cat = m_categories.at(index.row()); |
| 152 | cat.category->setEnabled(type_map[index.column()], enabled); |
| 153 | emit dataChanged(index, index); |
| 154 | return true; |
| 155 | } |
| 156 | |
| 157 | QVariant LoggingCategoryModel::headerData(int section, Qt::Orientation orientation, int role) const |
| 158 | { |
no test coverage detected