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

Method setData

core/tools/messagehandler/loggingcategorymodel.cpp:143–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141}
142
143bool 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
157QVariant LoggingCategoryModel::headerData(int section, Qt::Orientation orientation, int role) const
158{

Callers 1

newRequestMethod · 0.45

Calls 4

columnMethod · 0.80
rowMethod · 0.80
isValidMethod · 0.45
setEnabledMethod · 0.45

Tested by

no test coverage detected