MCPcopy Create free account
hub / github.com/FreesmTeam/FreesmLauncher / setData

Method setData

launcher/InstanceList.cpp:203–218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

201}
202
203bool InstanceList::setData(const QModelIndex& index, const QVariant& value, int role)
204{
205 if (!index.isValid()) {
206 return false;
207 }
208 if (role != Qt::EditRole) {
209 return false;
210 }
211 BaseInstance* pdata = static_cast<BaseInstance*>(index.internalPointer());
212 auto newName = value.toString();
213 if (pdata->name() == newName) {
214 return true;
215 }
216 pdata->setName(newName);
217 return true;
218}
219
220Qt::ItemFlags InstanceList::flags(const QModelIndex& index) const
221{

Callers 1

mimeDataMethod · 0.45

Calls 4

isValidMethod · 0.45
toStringMethod · 0.45
nameMethod · 0.45
setNameMethod · 0.45

Tested by

no test coverage detected