ui: gui wrapper extension
- added classes for qt layout abstraction. review id = 18
This commit is contained in:
@@ -81,6 +81,8 @@ add_files(
|
||||
gui/GuiElement.h
|
||||
gui/GuiElementFactory.cpp
|
||||
gui/GuiElementFactory.h
|
||||
gui/GuiLayout.cpp
|
||||
gui/GuiLayout.h
|
||||
gui/GuiWindow.cpp
|
||||
gui/GuiWindow.h
|
||||
gui/WidgetWrapper.cpp
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
class GuiArea;
|
||||
class GuiCanvas;
|
||||
class GuiLayout;
|
||||
class GuiWindow;
|
||||
|
||||
class GuiElementFactory
|
||||
@@ -14,6 +15,7 @@ public:
|
||||
|
||||
virtual std::shared_ptr<GuiArea> createArea() const = 0;
|
||||
virtual std::shared_ptr<GuiCanvas> createCanvas(std::shared_ptr<GuiWindow> window) const = 0;
|
||||
virtual std::shared_ptr<GuiLayout> createLayout() const = 0;
|
||||
};
|
||||
|
||||
#endif // GUI_ELEMENT_FACTORY_H
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
#include "gui/GuiLayout.h"
|
||||
|
||||
GuiLayout::GuiLayout(std::shared_ptr<WidgetWrapper> widgetWrapper)
|
||||
: GuiContainer(widgetWrapper)
|
||||
{
|
||||
}
|
||||
|
||||
GuiLayout::~GuiLayout()
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
#ifndef GUI_LAYOUT_H
|
||||
#define GUI_LAYOUT_H
|
||||
|
||||
#include "gui/GuiContainer.h"
|
||||
|
||||
class GuiLayout: public GuiContainer
|
||||
{
|
||||
public:
|
||||
enum LayoutDirectionType
|
||||
{
|
||||
LAYOUT_DIRECTION_HORIZONTAL,
|
||||
LAYOUT_DIRECTION_VERTICAL
|
||||
};
|
||||
|
||||
GuiLayout(std::shared_ptr<WidgetWrapper> widgetWrapper);
|
||||
virtual ~GuiLayout();
|
||||
|
||||
virtual void setDirection(LayoutDirectionType direction) = 0;
|
||||
|
||||
virtual void addChild(std::shared_ptr<GuiElement> element) = 0;
|
||||
virtual void removeChild(std::shared_ptr<GuiElement> element) = 0;
|
||||
};
|
||||
|
||||
#endif // GUI_LAYOUT_H
|
||||
Reference in New Issue
Block a user