diff --git a/src/Core/Crawl/guiobject.h b/src/Core/Crawl/guiobject.h index 2e4f8a7..fe88eb6 100644 --- a/src/Core/Crawl/guiobject.h +++ b/src/Core/Crawl/guiobject.h @@ -19,6 +19,38 @@ /** * @brief The GuiObject class This base model for gui objects. + * + * # Overriding Own gui objects. + * + * The gui objct contains base properties for drow objects on scane + * * position + * * ratation + * * mash + * * and map textures + * + * All properies implemented on the GraphicItem.qml file. + * + * If you want to change view for your own object then you need to ooverride the GuiObject::viewTemplate property and create a own qml file for view your changes. + * + * ### Example: + * + * Create a new qml file **OwnView.qml** + * ```qml + * import CrawlModule 1.0 + * + * GraphicItem { + * // your own implementation + * } + * ``` + * + * Override property in cpp object. + * + * ```cpp + * class MyObject: public IWorldItem { + * MyObject(): IWorldItem("name", "qrc:/path/to/OwnView.qml") { + * } + * } + * ``` */ class CRAWL_EXPORT GuiObject: public QObject, public IRender { Q_OBJECT @@ -126,6 +158,7 @@ signals: void mashChanged(); protected: + int _guiId = -1; QString _color = "#ff1111"; diff --git a/src/Core/CrawlModule/qmldir b/src/Core/CrawlModule/qmldir index 25f4294..f6b0a25 100644 --- a/src/Core/CrawlModule/qmldir +++ b/src/Core/CrawlModule/qmldir @@ -1,3 +1,4 @@ module CrawlModule Crawl 1.0 Crawl.qml DefaultMenu 1.0 DefaultMenu.qml +GraphicItem 1.0 GraphicItem.qml