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

Method data

launcher/ui/dialogs/ExportInstanceDialog.cpp:127–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125 }
126
127 virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const
128 {
129 QModelIndex sourceIndex = mapToSource(index);
130
131 if (index.column() == 0 && role == Qt::CheckStateRole)
132 {
133 QFileSystemModel *fsm = qobject_cast<QFileSystemModel *>(sourceModel());
134 auto blockedPath = relPath(fsm->filePath(sourceIndex));
135 auto cover = blocked.cover(blockedPath);
136 if (!cover.isNull())
137 {
138 return QVariant(Qt::Unchecked);
139 }
140 else if (blocked.exists(blockedPath))
141 {
142 return QVariant(Qt::PartiallyChecked);
143 }
144 else
145 {
146 return QVariant(Qt::Checked);
147 }
148 }
149
150 return sourceIndex.data(role);
151 }
152
153 virtual bool setData(const QModelIndex &index, const QVariant &value,
154 int role = Qt::EditRole)

Callers 3

activatedMethod · 0.45
selectionChangedMethod · 0.45
on_buttonBox_acceptedMethod · 0.45

Calls 3

filePathMethod · 0.80
coverMethod · 0.80
existsMethod · 0.80

Tested by

no test coverage detected