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

Method initData

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

Source from the content-addressed store, hash-verified

48}
49
50void MainWindow::initData()
51{
52 m_codeSamples = {{"C++", loadCode(":/code_samples/cxx.cpp")},
53 {"GLSL", loadCode(":/code_samples/shader.glsl")},
54 {"XML", loadCode(":/code_samples/xml.xml")},
55 {"JSON", loadCode(":/code_samples/json.json")},
56 {"LUA", loadCode(":/code_samples/lua.lua")},
57 {"Python", loadCode(":/code_samples/python.py")}};
58
59 m_completers = {
60 {"None", nullptr},
61 {"GLSL", new QGLSLCompleter(this)},
62 {"LUA", new QLuaCompleter(this)},
63 {"Python", new QPythonCompleter(this)},
64 };
65
66 m_highlighters = {
67 {"None", nullptr},
68 {"C++", new QCXXHighlighter},
69 {"GLSL", new QGLSLHighlighter},
70 {"XML", new QXMLHighlighter},
71 {"JSON", new QJSONHighlighter},
72 {"LUA", new QLuaHighlighter},
73 {"Python", new QPythonHighlighter},
74 };
75
76 m_styles = {{"Default", QSyntaxStyle::defaultStyle()}};
77
78 // Loading styles
79 loadStyle(":/styles/drakula.xml");
80}
81
82QString MainWindow::loadCode(QString path)
83{

Callers

nothing calls this directly

Calls 1

loadCodeFunction · 0.85

Tested by

no test coverage detected