MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / loadStyle

Method loadStyle

lib/QCodeEditor/example/src/MainWindow.cpp:94–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92}
93
94void MainWindow::loadStyle(QString path)
95{
96 QFile fl(path);
97
98 if (!fl.open(QIODevice::ReadOnly))
99 {
100 return;
101 }
102
103 auto style = new QSyntaxStyle(this);
104
105 if (!style->load(fl.readAll()))
106 {
107 delete style;
108 return;
109 }
110
111 m_styles.append({style->name(), style});
112}
113
114void MainWindow::createWidgets()
115{

Callers

nothing calls this directly

Calls 4

openMethod · 0.45
loadMethod · 0.45
appendMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected