MCPcopy Create free account
hub / github.com/Schildkroet/Candle2 / saveProgramToFile

Method saveProgramToFile

src/frmmain.cpp:1557–1580  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1555}
1556
1557bool frmMain::saveProgramToFile(QString fileName, GCodeTableModel *model)
1558{
1559 QFile file(fileName);
1560 QDir dir;
1561
1562 qDebug() << "Saving program";
1563
1564 if (file.exists())
1565 dir.remove(file.fileName());
1566
1567 if (!file.open(QIODevice::WriteOnly))
1568 return false;
1569
1570 QTextStream textStream(&file);
1571
1572 for (int i = 0; i < model->rowCount() - 1; i++)
1573 {
1574 textStream << model->data(model->index(i, 1)).toString() << "\r\n";
1575 }
1576
1577 file.close();
1578
1579 return true;
1580}
1581
1582void frmMain::on_actFileSaveTransformedAs_triggered()
1583{

Callers

nothing calls this directly

Calls 2

rowCountMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected