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

Method SaveEditor

qrenderdoc/Windows/ShaderViewer.cpp:1586–1627  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1584}
1585
1586QVariantMap ShaderViewer::SaveEditor()
1587{
1588 QVariantMap ret;
1589
1590 if(m_EditingShader != ResourceId())
1591 {
1592 ret[lit("id")] = m_EditingShader;
1593 ret[lit("stage")] = (uint32_t)m_Stage;
1594 ret[lit("entryPoint")] = ui->entryFunc->text();
1595 ret[lit("encoding")] = (uint32_t)currentEncoding();
1596 ret[lit("commandLine")] = ui->toolCommandLine->toPlainText();
1597 ret[lit("tool")] = ui->compileTool->currentText();
1598
1599 {
1600 QVariantMap v;
1601
1602 for(const ShaderCompileFlag &flag : m_Flags.flags)
1603 v[flag.name] = QString(flag.value);
1604
1605 ret[lit("flags")] = v;
1606 }
1607
1608 {
1609 QVariantList v;
1610
1611 for(ScintillaEdit *edit : m_Scintillas)
1612 {
1613 QWidget *w = (QWidget *)edit;
1614
1615 QVariantMap f;
1616 f[lit("name")] = w->property("filename").toString();
1617 f[lit("contents")] = QString::fromUtf8(edit->getText(edit->textLength() + 1));
1618
1619 v.push_back(f);
1620 }
1621
1622 ret[lit("files")] = v;
1623 }
1624 }
1625
1626 return ret;
1627}
1628
1629ShaderViewer::~ShaderViewer()
1630{

Callers 1

SaveEditsMethod · 0.80

Calls 9

propertyMethod · 0.80
getTextMethod · 0.80
textLengthMethod · 0.80
ResourceIdFunction · 0.50
QStringFunction · 0.50
fromUtf8Function · 0.50
textMethod · 0.45
toStringMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected