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

Method Save

qrenderdoc/Windows/Dialogs/PerformanceCounterSelection.cpp:376–411  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

374}
375
376void PerformanceCounterSelection::Save()
377{
378 QString filename = RDDialog::getSaveFileName(this, tr("Save File"), QDir::homePath(),
379 tr("Performance Counter Settings (*.json)"));
380
381 if(filename.isEmpty())
382 return;
383
384 QVariantList counterIds;
385 for(const GPUCounter v : m_SelectedCounters.keys())
386 {
387 const Uuid uuid = m_CounterToUuid[v];
388 QVariantList e;
389
390 for(const uint32_t b : uuid.words)
391 {
392 e.append(b);
393 }
394
395 counterIds.append(QVariant(e));
396 }
397
398 QVariantMap doc;
399 doc[lit("counters")] = counterIds;
400
401 QFile f(filename);
402 if(f.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text))
403 {
404 SaveToJSON(doc, f, JSON_ID, JSON_VER);
405 }
406 else
407 {
408 RDDialog::critical(this, tr("Error saving config"),
409 tr("Couldn't open path %1 for write.").arg(filename));
410 }
411}
412
413void PerformanceCounterSelection::Load()
414{

Callers 15

setFormatMethod · 0.45
MainWindowMethod · 0.45
LoadCaptureMethod · 0.45
PopulateReportedBugsMethod · 0.45
CheckUpdatesMethod · 0.45
sendErrorReportMethod · 0.45
on_send_clickedMethod · 0.45
on_buttonBox_acceptedMethod · 0.45
addNewHostMethod · 0.45

Calls 9

SaveToJSONFunction · 0.85
criticalFunction · 0.85
trFunction · 0.50
QVariantClass · 0.50
isEmptyMethod · 0.45
keysMethod · 0.45
appendMethod · 0.45
openMethod · 0.45
argMethod · 0.45

Tested by 2

setFormatMethod · 0.36