MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / populateTreeViewRow

Method populateTreeViewRow

pcsx2-qt/Settings/GameCheatSettingsWidget.cpp:325–347  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

323}
324
325QList<QStandardItem*> GameCheatSettingsWidget::populateTreeViewRow(const Patch::PatchInfo& pi, bool enabled)
326{
327 QList<QStandardItem*> items;
328
329 QStandardItem* nameItem = new QStandardItem();
330 const std::string_view name_part = pi.GetNamePart();
331 nameItem->setFlags(Qt::ItemIsUserCheckable | Qt::ItemNeverHasChildren | Qt::ItemIsEnabled);
332 nameItem->setCheckState(enabled ? Qt::Checked : Qt::Unchecked);
333 nameItem->setData(QString::fromStdString(pi.name), NAME_ROLE);
334 if (pi.place.has_value())
335 nameItem->setData(static_cast<int>(*pi.place), PLACE_ROLE);
336 if (!name_part.empty())
337 nameItem->setText(QString::fromUtf8(name_part.data(), name_part.length()));
338
339 QStandardItem* authorItem = new QStandardItem(QString::fromStdString(pi.author));
340 QStandardItem* descriptionItem = new QStandardItem(QString::fromStdString(pi.description));
341 descriptionItem->setToolTip(QString::fromStdString(pi.description));
342
343 items.push_back(nameItem);
344 items.push_back(authorItem);
345 items.push_back(descriptionItem);
346 return items;
347}
348
349#include "moc_GameCheatSettingsWidget.cpp"

Callers

nothing calls this directly

Calls 6

GetNamePartMethod · 0.80
setDataMethod · 0.45
emptyMethod · 0.45
dataMethod · 0.45
lengthMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected