MCPcopy Create free account
hub / github.com/GilesBathgate/RapCAD / loadFile

Method loadFile

src/ui/codeeditor.cpp:120–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

118}
119
120bool CodeEditor::loadFile(const QString& f)
121{
122 if(!QFile::exists(f))
123 return false;
124 QFile file(f);
125 if(!file.open(QFile::ReadOnly))
126 return false;
127
128 QByteArray data=file.readAll();
129 QString str=QString::fromLocal8Bit(data);
130 setPlainText(str);
131
132 setFileName(f);
133 return true;
134}
135
136bool CodeEditor::openFile()
137{

Callers 1

loadFilesMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected