MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / data

Method data

launcher/minecraft/mod/ResourceFolderModel.cpp:394–424  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

392}
393
394QVariant ResourceFolderModel::data(const QModelIndex& index, int role) const
395{
396 if (!validateIndex(index))
397 return {};
398
399 int row = index.row();
400 int column = index.column();
401
402 switch (role) {
403 case Qt::DisplayRole:
404 switch (column) {
405 case NAME_COLUMN:
406 return m_resources[row]->name();
407 case DATE_COLUMN:
408 return m_resources[row]->dateTimeChanged();
409 default:
410 return {};
411 }
412 case Qt::ToolTipRole:
413 return m_resources[row]->internal_id();
414 case Qt::CheckStateRole:
415 switch (column) {
416 case ACTIVE_COLUMN:
417 return m_resources[row]->enabled() ? Qt::Checked : Qt::Unchecked;
418 default:
419 return {};
420 }
421 default:
422 return {};
423 }
424}
425
426bool ResourceFolderModel::setData(const QModelIndex& index, const QVariant& value, int role)
427{

Callers

nothing calls this directly

Calls 4

dateTimeChangedMethod · 0.80
internal_idMethod · 0.80
enabledMethod · 0.80
nameMethod · 0.45

Tested by

no test coverage detected