MCPcopy Create free account
hub / github.com/baldurk/renderdoc / data

Method data

qrenderdoc/Windows/Dialogs/VirtualFileDialog.cpp:303–374  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

301 }
302
303 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override
304 {
305 if(index.isValid())
306 {
307 FSNode *node = getNode(index);
308
309 switch(role)
310 {
311 case Qt::DisplayRole:
312 {
313 switch(index.column())
314 {
315 case 0:
316 {
317 return node->file.filename;
318 }
319 case 1:
320 {
321 if(node->file.flags & PathProperty::Directory)
322 return QVariant();
323 return qulonglong(node->file.size);
324 }
325 case 2:
326 {
327 if(node->file.flags & PathProperty::Directory)
328 return tr("Directory");
329 else if(node->file.flags & PathProperty::Executable)
330 return tr("Executable file");
331 else
332 return tr("File");
333 }
334 case 3:
335 {
336 if(node->file.lastmod == 0)
337 return QVariant();
338 return QDateTime(QDate(1970, 1, 1), QTime(0, 0, 0), Qt::UTC).addSecs(node->file.lastmod);
339 }
340 default: break;
341 }
342 break;
343 }
344 case Qt::DecorationRole:
345 if(index.column() == 0)
346 {
347 int hideIndex = (node->file.flags & PathProperty::Hidden) ? 1 : 0;
348
349 if(node->file.flags & PathProperty::Directory)
350 return dirIcon[hideIndex];
351 else if(node->file.flags & PathProperty::Executable)
352 return exeIcon[hideIndex];
353 else
354 return fileIcon[hideIndex];
355 }
356 break;
357 case Qt::TextAlignmentRole:
358 if(index.column() == 1)
359 return Qt::AlignRight;
360 break;

Callers 8

filterAcceptsRowMethod · 0.45
lessThanMethod · 0.45
VirtualFileDialogMethod · 0.45
changeCurrentDirMethod · 0.45
on_fileList_clickedMethod · 0.45
on_filename_keyPressMethod · 0.45
on_buttonBox_acceptedMethod · 0.45

Calls 8

QVariantClass · 0.50
trFunction · 0.50
QDateTimeClass · 0.50
QDateClass · 0.50
QTimeClass · 0.50
isValidMethod · 0.45
columnMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected