ui: basic CodeView with syntax highlighting

Added CodeView interface and QtCodeView implementation for showing syntax highlighted code snippets. This change avoids
using the GuiElement hierarchy by using directly using QtClasses and creating QtCodeView in the QtElementFactory.
This commit is contained in:
Eberhard Graether
2014-06-30 13:50:19 +02:00
parent 1045ce4ab9
commit 73b74cb618
17 changed files with 325 additions and 17 deletions
+10
View File
@@ -1,5 +1,7 @@
#include "component/ComponentManager.h"
#include "component/view/CodeView.h"
std::shared_ptr<ComponentManager> ComponentManager::create(
std::shared_ptr<ViewManager> viewManager,
std::shared_ptr<GuiElementFactory> guiElementFactory,
@@ -14,6 +16,14 @@ std::shared_ptr<ComponentManager> ComponentManager::create(
void ComponentManager::setup()
{
m_components.push_back(m_componentFactory->createDummyComponent());
std::shared_ptr<Component> codeComponent = m_componentFactory->createCodeComponent();
m_components.push_back(codeComponent);
CodeView* codeView = dynamic_cast<CodeView*>(codeComponent->getView());
codeView->addCodeSnippet("class HelloWorld;");
codeView->addCodeSnippet("static int n = 42; // the answer.");
// codeView->clearCodeSnippets();
}
ComponentManager::ComponentManager()