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

Method data

launcher/minecraft/gameoptions/GameOptions.cpp:90–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88}
89
90QVariant GameOptions::data(const QModelIndex& index, int role) const
91{
92 if (!index.isValid())
93 return QVariant();
94
95 int row = index.row();
96 int column = index.column();
97
98 if (row < 0 || row >= int(contents.size()))
99 return QVariant();
100
101 switch (role)
102 {
103 case Qt::DisplayRole:
104 if(column == 0)
105 {
106 return contents[row].key;
107 }
108 else
109 {
110 return contents[row].value;
111 }
112 default:
113 return QVariant();
114 }
115 return QVariant();
116}
117
118int GameOptions::rowCount(const QModelIndex&) const
119{

Callers 1

loadFunction · 0.45

Calls 2

isValidMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected