WorksheetElement
A description for WorksheetElement.
-
class WorksheetElement : public AbstractAspect
Base class for all Worksheet children.
Subclassed by Axis, CartesianPlotLegend, CustomPoint, Image, InfoElement, Plot, PlotArea, ReferenceLine, ReferenceRange, TextLabel, WorksheetElementContainer
Public Functions
-
void setPosition(QPointF)
WorksheetElement::setPosition sets the position without undo/redo-stuff.
- Parameters:
point – point in scene coordinates
-
void setPositionInvalid(bool)
position is set to invalid if the parent item is not drawn on the scene (e.g. axis is not drawn because it’s outside plot ranges -> don’t draw axis’ title label)
-
virtual QGraphicsItem *graphicsItem() const
Return the graphics item representing this element.
-
virtual void setParentGraphicsItem(QGraphicsItem *item)
WorksheetElement::setParentGraphicsItem Sets the parent graphicsitem, needed for binding to coord.
- Parameters:
item – parent graphicsitem
-
virtual void setVisible(bool on)
Show/hide the element.
-
virtual bool isVisible() const
Return whether the element is (at least) partially visible.
-
virtual bool isFullyVisible() const
Return whether the element is fully visible (i.e., including all child elements).
The standard implementation returns isVisible().
-
virtual void setPrinting(bool)
Switches the printing mode on/off.
-
QPointF parentPosToRelativePos(QPointF parentPos, PositionWrapper) const
parentPosToRelativePos Converts the absolute position of the element in parent coordinates into the distance between the alignment point of the parent and the element
- Parameters:
parentPos – Element position in parent coordinates
parentRect – Parent data rect
rect – element’s rect
position – contains the alignment of the element to the parent
- Returns:
distance between the parent position to the element
-
QPointF relativePosToParentPos(PositionWrapper) const
relativePosToParentPos
- Parameters:
parentRect –
rect – element’s rect
position – contains the alignment of the element to the parent
- Returns:
parent position
-
virtual QMenu *createContextMenu() override
Return a new context menu.
The caller takes ownership of the menu.
-
virtual void save(QXmlStreamWriter*) const override
Save as XML.
-
virtual bool load(XmlStreamReader*, bool) override
Load from XML.
XmlStreamReader supports errors as well as warnings. If only warnings (non-critical errors) occur, this function must return the reader at the end element corresponding to the current element at the time the function was called.
This function is normally intended to be called directly after the ctor. If you want to call load on an aspect that has been altered, you must make sure beforehand that it is in the same state as after creation, e.g., remove all its child aspects.
- Returns:
false on error
Public Static Functions
-
static QPainterPath shapeFromPath(const QPainterPath&, const QPen&)
This does exactly what Qt internally does to creates a shape from a painter path.
-
struct PositionWrapper
-
void setPosition(QPointF)