#include "GraphicsItemDesignerItemBase.h"
Public Types | |
enum class | DesignerItemFlag { NoDesignerItemFlags = 0x00 , DesignerItemIgnoreEvents = 0x01 } |
typedef ot::Flags< DesignerItemFlag > | DesignerItemFlags |
Public Member Functions | |
GraphicsItemDesignerItemBase () | |
virtual | ~GraphicsItemDesignerItemBase () |
void | addControlPoint (const QPointF &_pt) |
\breif Adds the provided control point and calls controlPointsChanged(). | |
void | setControlPoints (const QList< QPointF > &_points) |
Sets the current list of control points and calls controlPointsChanged(). | |
void | updateControlPoints (const QList< QPointF > &_points) |
Replaces the current list of control points. This method does not call controlPointsChanged(). | |
const QList< QPointF > & | getControlPoints (void) const |
Returns a list containing the currently set control points. | |
void | setLastPos (const QPointF &_pos) |
Sets the last position. | |
const QPointF & | getLastPos (void) const |
Returns the last position. The last position ist the last position of this graphics item. The position is used to adjust the control points. | |
void | setDesignerItemFlag (DesignerItemFlag _flag, bool _active=true) |
void | setDesignerItemFlags (const DesignerItemFlags &_flags) |
const DesignerItemFlags & | getDesignerItemFlags (void) const |
void | graphicsItemWasMoved (const QPointF &_newPos) |
Will move all control points by the move delta (lastPos - newPos). The method will set the last pos after moving. | |
virtual bool | isDesignedItemCompleted (void) const =0 |
Returns true if the current item is completed. A completed item has all required control points set (e.g. Line start and Line end) and no more points may be set. | |
virtual bool | isDesignedItemValid (void) const =0 |
Returns true if the current item is valid. A valid item has all required control points set (e.g. Line start and Line end). More points may be added (e.g. Polygon). | |
virtual ot::GraphicsItem * | getGraphicsItem (void)=0 |
Returns the actual GraphicsItem. | |
virtual QString | getDefaultItemName (void) const =0 |
Returns the default item name. | |
virtual ot::TreeWidgetItemInfo | createNavigationInformation (void)=0 |
Creates the navigation information for this item and its childs. | |
virtual void | makeItemTransparent (void) |
Will make the item transparent. | |
virtual void | setupDesignerItemFromConfig (const ot::GraphicsItemCfg *_config)=0 |
Public Member Functions inherited from GraphicsItemDesignerPropertyHandler | |
GraphicsItemDesignerPropertyHandler () | |
virtual | ~GraphicsItemDesignerPropertyHandler () |
void | setNavigation (GraphicsItemDesignerNavigation *_navigation) |
GraphicsItemDesignerNavigation * | getNavigation (void) const |
void | setNavigationItem (QTreeWidgetItem *_item) |
QTreeWidgetItem * | getNavigationItem (void) const |
void | setPropertyGrid (ot::PropertyGrid *_grid) |
void | unsetPropertyGrid (void) |
ot::PropertyGrid * | getPropertyGrid (void) const |
virtual void | itemAboutToBeDestroyed (void) |
Protected Member Functions | |
virtual void | controlPointsChanged (void)=0 |
Is called whenever the control points have changed (except when calling updateControlPoints()). | |
virtual void | fillPropertyGrid (void) override=0 |
Is called when the property grid needs to be filled. | |
virtual void | propertyChanged (const ot::Property *_property) override=0 |
virtual void | propertyDeleteRequested (const ot::Property *_property) override=0 |
void | initializeBaseData (const QList< QPointF > &_controlPoints, const QPointF &_pos) |
void | fillBasePropertyGrid (ot::PropertyGridCfg &_config) |
Adds the default properties. Creates the "General" and "Transform" groups. | |
bool | basePropertyChanged (const ot::Property *_property) |
Handles base properties. Returns true if the changed property was handled. | |
bool | basePropertyDeleteRequested (const ot::Property *_property) |
Handles base properties. Returns true if the requested property was handled. | |
|
strong |
GraphicsItemDesignerItemBase::GraphicsItemDesignerItemBase | ( | ) |
|
virtual |
void GraphicsItemDesignerItemBase::addControlPoint | ( | const QPointF & | _pt | ) |
\breif Adds the provided control point and calls controlPointsChanged().
|
protected |
Handles base properties. Returns true if the changed property was handled.
|
protected |
Handles base properties. Returns true if the requested property was handled.
|
protectedpure virtual |
Is called whenever the control points have changed (except when calling updateControlPoints()).
Implemented in WrappedArcItem, WrappedCircleItem, WrappedEllipseItem, WrappedLineItem, WrappedPolygonItem, WrappedRectItem, WrappedSquareItem, WrappedTextItem, and WrappedTriangleItem.
|
pure virtual |
Creates the navigation information for this item and its childs.
Implemented in WrappedArcItem, WrappedCircleItem, WrappedEllipseItem, WrappedLineItem, WrappedPolygonItem, WrappedRectItem, WrappedSquareItem, WrappedTextItem, and WrappedTriangleItem.
|
protected |
Adds the default properties. Creates the "General" and "Transform" groups.
|
overrideprotectedpure virtual |
Is called when the property grid needs to be filled.
Implements GraphicsItemDesignerPropertyHandler.
Implemented in WrappedArcItem, WrappedCircleItem, WrappedEllipseItem, WrappedLineItem, WrappedPolygonItem, WrappedRectItem, WrappedSquareItem, WrappedTextItem, and WrappedTriangleItem.
|
inline |
Returns a list containing the currently set control points.
|
pure virtual |
Returns the default item name.
Implemented in WrappedArcItem, WrappedCircleItem, WrappedEllipseItem, WrappedLineItem, WrappedPolygonItem, WrappedRectItem, WrappedSquareItem, WrappedTextItem, and WrappedTriangleItem.
|
inline |
|
pure virtual |
Returns the actual GraphicsItem.
Implemented in WrappedArcItem, WrappedCircleItem, WrappedEllipseItem, WrappedLineItem, WrappedPolygonItem, WrappedRectItem, WrappedSquareItem, WrappedTextItem, and WrappedTriangleItem.
|
inline |
Returns the last position. The last position ist the last position of this graphics item. The position is used to adjust the control points.
void GraphicsItemDesignerItemBase::graphicsItemWasMoved | ( | const QPointF & | _newPos | ) |
Will move all control points by the move delta (lastPos - newPos). The method will set the last pos after moving.
_newPos | The position the item was moved to. |
|
protected |
|
pure virtual |
Returns true if the current item is completed. A completed item has all required control points set (e.g. Line start and Line end) and no more points may be set.
Implemented in WrappedArcItem, WrappedCircleItem, WrappedEllipseItem, WrappedLineItem, WrappedPolygonItem, WrappedRectItem, WrappedSquareItem, WrappedTextItem, and WrappedTriangleItem.
|
pure virtual |
Returns true if the current item is valid. A valid item has all required control points set (e.g. Line start and Line end). More points may be added (e.g. Polygon).
Implemented in WrappedArcItem, WrappedCircleItem, WrappedEllipseItem, WrappedLineItem, WrappedPolygonItem, WrappedRectItem, WrappedSquareItem, WrappedTextItem, and WrappedTriangleItem.
|
inlinevirtual |
Will make the item transparent.
Reimplemented in WrappedCircleItem, WrappedEllipseItem, WrappedPolygonItem, WrappedRectItem, WrappedSquareItem, and WrappedTriangleItem.
|
overrideprotectedpure virtual |
Implements GraphicsItemDesignerPropertyHandler.
Implemented in WrappedArcItem, WrappedCircleItem, WrappedEllipseItem, WrappedLineItem, WrappedPolygonItem, WrappedRectItem, WrappedSquareItem, WrappedTextItem, and WrappedTriangleItem.
|
overrideprotectedpure virtual |
Implements GraphicsItemDesignerPropertyHandler.
Implemented in WrappedArcItem, WrappedCircleItem, WrappedEllipseItem, WrappedLineItem, WrappedPolygonItem, WrappedRectItem, WrappedSquareItem, WrappedTextItem, and WrappedTriangleItem.
void GraphicsItemDesignerItemBase::setControlPoints | ( | const QList< QPointF > & | _points | ) |
Sets the current list of control points and calls controlPointsChanged().
|
inline |
|
inline |
|
inline |
Sets the last position.
|
pure virtual |
|
inline |
Replaces the current list of control points. This method does not call controlPointsChanged().