MCPcopy Create free account
hub / github.com/KDE/kdevelop / data

Method data

plugins/clangtidy/config/checksetselectionlistmodel.cpp:50–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48}
49
50QVariant CheckSetSelectionListModel::data(const QModelIndex& index, int role) const
51{
52 if (!index.isValid() ||
53 index.row() < 0 || index.row() >= rowCount() ||
54 index.column() != 0) {
55 return {};
56 }
57
58 if (role == Qt::DisplayRole) {
59 const int checkSetSelectionIndex = index.row();
60
61 const auto& checkSetSelection = m_checkSetSelections.at(checkSetSelectionIndex);
62 auto checkSetSelectionName = checkSetSelection.name();
63 if (m_defaultCheckSetSelectionId == checkSetSelection.id()) {
64 checkSetSelectionName = i18nc("@item:inlistbox", "%1 (default selection)", checkSetSelectionName);
65 }
66 return checkSetSelectionName;
67 }
68
69 return {};
70}
71
72QModelIndex CheckSetSelectionListModel::index(int row, int column, const QModelIndex& parent) const
73{

Callers

nothing calls this directly

Calls 6

isValidMethod · 0.45
rowMethod · 0.45
columnMethod · 0.45
atMethod · 0.45
nameMethod · 0.45
idMethod · 0.45

Tested by

no test coverage detected