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:
@@ -1,7 +1,9 @@
|
||||
#include "component/ComponentFactory.h"
|
||||
|
||||
#include "component/view/DummyView.h"
|
||||
#include "component/controller/CodeController.h"
|
||||
#include "component/controller/DummyController.h"
|
||||
#include "component/view/CodeView.h"
|
||||
#include "component/view/DummyView.h"
|
||||
|
||||
std::shared_ptr<ComponentFactory> ComponentFactory::create(
|
||||
std::shared_ptr<ViewManager> viewManager,
|
||||
@@ -30,6 +32,15 @@ std::shared_ptr<Component> ComponentFactory::createDummyComponent()
|
||||
return component;
|
||||
}
|
||||
|
||||
std::shared_ptr<Component> ComponentFactory::createCodeComponent()
|
||||
{
|
||||
std::shared_ptr<View> view = m_guiElementFactory->createCodeView(m_viewManger);
|
||||
std::shared_ptr<Controller> controller = std::make_shared<CodeController>();
|
||||
|
||||
std::shared_ptr<Component> component = std::make_shared<Component>(view, controller);
|
||||
return component;
|
||||
}
|
||||
|
||||
ComponentFactory::ComponentFactory()
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user