| 48 | } |
| 49 | |
| 50 | void 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 | |
| 82 | QString MainWindow::loadCode(QString path) |
| 83 | { |
nothing calls this directly
no test coverage detected