labplot  2.8.2
About: LabPlot is an application for plotting and analysis of 2D and 3D functions and data. It is a complete rewrite of LabPlot1 and lacks in the first release a lot of features available in the predecessor. On the other hand, the GUI and the usability is more superior.
  Fossies Dox: labplot-2.8.2.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

WorksheetElement Class Referenceabstract

Base class for all Worksheet children. More...

#include <WorksheetElement.h>

Inheritance diagram for WorksheetElement:
[legend]
Collaboration diagram for WorksheetElement:
[legend]

Classes

struct  PositionWrapper
 

Public Types

enum class  Orientation { Horizontal , Vertical }
 
enum class  WorksheetElementName { NameCartesianPlot = 1 }
 
enum class  HorizontalPosition { Left , Center , Right , Custom }
 
enum class  VerticalPosition { Top , Center , Bottom , Custom }
 
enum class  HorizontalAlignment { Left , Center , Right }
 
enum class  VerticalAlignment { Top , Center , Bottom }
 
- Public Types inherited from AbstractAspect
enum class  ChildIndexFlag { IncludeHidden = 0x01 , Recursive = 0x02 , Compress = 0x04 }
 Flags which control numbering scheme of children. More...
 

Public Slots

virtual void retransform ()=0
 Tell the element to newly transform its graphics item into its coordinate system. More...
 
- Public Slots inherited from AbstractAspect
bool setName (const QString &, bool autoUnique=true)
 AbstractAspect::setName sets the name of the abstract aspect. More...
 
void setComment (const QString &)
 
void remove ()
 Remove me from my parent's list of children. More...
 

Public Member Functions

 WorksheetElement (const QString &, AspectType)
 
 ~WorksheetElement () override
 
virtual QGraphicsItem * graphicsItem () const =0
 Return the graphics item representing this element. More...
 
virtual void setZValue (qreal)
 
virtual void setVisible (bool on)=0
 Show/hide the element. More...
 
virtual bool isVisible () const =0
 Return whether the element is (at least) partially visible. More...
 
virtual bool isFullyVisible () const
 Return whether the element is fully visible (i.e., including all child elements). More...
 
virtual void setPrinting (bool)=0
 Switches the printing mode on/off. More...
 
QMenu * createContextMenu () override
 Return a new context menu. More...
 
virtual void loadThemeConfig (const KConfig &)
 
virtual void saveThemeConfig (const KConfig &)
 
virtual void handleResize (double horizontalRatio, double verticalRatio, bool pageResize=false)=0
 
void horizontalPaddingChanged (float)
 
void verticalPaddingChanged (float)
 
void rightPaddingChanged (double)
 
void bottomPaddingChanged (double)
 
void symmetricPaddingChanged (double)
 
void hovered ()
 
void unhovered ()
 
- Public Member Functions inherited from AbstractAspect
 AbstractAspect (const QString &name, AspectType type)
 
 ~AbstractAspect () override
 
QString name () const
 
QString comment () const
 
void setCreationTime (const QDateTime &)
 
QDateTime creationTime () const
 
virtual Projectproject ()
 Return the Project this Aspect belongs to, or 0 if it is currently not part of one. More...
 
virtual QString path () const
 Return the path that leads from the top-most Aspect (usually a Project) to me. More...
 
void setHidden (bool)
 Set "hidden" property, i.e. whether to exclude this aspect from being shown in the explorer. More...
 
bool hidden () const
 
void setIsLoading (bool)
 
bool isLoading () const
 
virtual QIcon icon () const
 Return an icon to be used for decorating my views. More...
 
AspectType type () const
 
bool inherits (AspectType type) const
 
AbstractAspectparentAspect () const
 Return my parent Aspect or 0 if I currently don't have one. More...
 
AbstractAspectparent (AspectType type) const
 In the parent-child hierarchy, return the first parent of type. More...
 
void setParentAspect (AbstractAspect *)
 
Folderfolder ()
 Return the folder the Aspect is contained in or 0 if there is none. More...
 
bool isDescendantOf (AbstractAspect *other)
 Return whether the there is a path upwards to the given aspect. More...
 
void addChild (AbstractAspect *)
 Add the given Aspect to my list of children. More...
 
void addChildFast (AbstractAspect *)
 Add the given Aspect to my list of children without any checks and without putting this step onto the undo-stack. More...
 
virtual void finalizeAdd ()
 
QVector< AbstractAspect * > children (AspectType type, ChildIndexFlags flags={}) const
 
void insertChildBefore (AbstractAspect *child, AbstractAspect *before)
 Insert the given Aspect at a specific position in my list of children. More...
 
void insertChildBeforeFast (AbstractAspect *child, AbstractAspect *before)
 Insert the given Aspect at a specific position in my list of children.without any checks and without putting this step onto the undo-stack. More...
 
void reparent (AbstractAspect *newParent, int newIndex=-1)
 Move a child to another parent aspect and transfer ownership. More...
 
void removeChild (AbstractAspect *)
 Remove the given Aspect from my list of children. More...
 
void removeAllChildren ()
 Remove all child Aspects. More...
 
virtual QVector< AbstractAspect * > dependsOn () const
 
virtual bool isDraggable () const
 
virtual QVector< AspectTypedropableOn () const
 
virtual void processDropEvent (const QVector< quintptr > &)
 
template<class T >
T * ancestor () const
 Return the closest ancestor of class T (or NULL if none found). More...
 
template<class T >
QVector< T * > children (ChildIndexFlags flags={}) const
 
template<class T >
T * child (int index, ChildIndexFlags flags={}) const
 
template<class T >
T * child (const QString &name) const
 Get child by name and class. More...
 
template<class T >
int childCount (ChildIndexFlags flags={}) const
 Return the number of child Aspects inheriting from given class. More...
 
template<class T >
int indexOfChild (const AbstractAspect *child, ChildIndexFlags flags={}) const
 Return (0 based) index of child in the list of children inheriting from class T. More...
 
void setSelected (bool)
 
void setUndoAware (bool)
 
virtual QUndoStack * undoStack () const
 Return the undo stack of the Project, or 0 if this Aspect is not part of a Project. More...
 
void exec (QUndoCommand *)
 Execute the given command, pushing it on the undoStack() if available. More...
 
void exec (QUndoCommand *command, const char *preChangeSignal, const char *postChangeSignal, QGenericArgument val0=QGenericArgument(), QGenericArgument val1=QGenericArgument(), QGenericArgument val2=QGenericArgument(), QGenericArgument val3=QGenericArgument())
 Execute command and arrange for signals to be sent before/after it is redone or undone. More...
 
void beginMacro (const QString &text)
 Begin an undo stack macro (series of commands) More...
 
void endMacro ()
 End the current undo stack macro. More...
 
virtual void save (QXmlStreamWriter *) const =0
 Save as XML. More...
 
virtual bool load (XmlStreamReader *, bool preview)=0
 Load from XML. More...
 

Static Public Member Functions

static QPainterPath shapeFromPath (const QPainterPath &, const QPen &)
 

Private Slots

void prepareMoveBehindMenu ()
 
void prepareMoveInFrontOfMenu ()
 
void execMoveBehind (QAction *)
 
void execMoveInFrontOf (QAction *)
 

Private Attributes

QMenu * m_drawingOrderMenu
 
QMenu * m_moveBehindMenu
 
QMenu * m_moveInFrontOfMenu
 

Friends

class AbstractPlotSetHorizontalPaddingCmd
 
class AbstractPlotSetVerticalPaddingCmd
 
class AbstractPlotSetRightPaddingCmd
 
class AbstractPlotSetBottomPaddingCmd
 
class AbstractPlotSetSymmetricPaddingCmd
 

Additional Inherited Members

- Signals inherited from AbstractAspect
void aspectDescriptionAboutToChange (const AbstractAspect *)
 Emitted before the name, comment or caption spec is changed. More...
 
void aspectDescriptionChanged (const AbstractAspect *)
 Emitted after the name, comment or caption spec have changed. More...
 
void aspectAboutToBeAdded (const AbstractAspect *parent, const AbstractAspect *before, const AbstractAspect *child)
 Emitted before a new child is inserted. More...
 
void aspectAdded (const AbstractAspect *)
 Emitted after a new Aspect has been added to the tree. More...
 
void aspectAboutToBeRemoved (const AbstractAspect *)
 Emitted before an aspect is removed from its parent. More...
 
void aspectRemoved (const AbstractAspect *parent, const AbstractAspect *before, const AbstractAspect *child)
 Emitted from the parent after removing a child. More...
 
void aspectHiddenAboutToChange (const AbstractAspect *)
 Emitted before the hidden attribute is changed. More...
 
void aspectHiddenChanged (const AbstractAspect *)
 Emitted after the hidden attribute has changed. More...
 
void statusInfo (const QString &)
 Emitted whenever some aspect in the tree wants to give status information to the user. More...
 
void renameRequested ()
 
void selected (const AbstractAspect *)
 
void deselected (const AbstractAspect *)
 
void childAspectSelectedInView (const AbstractAspect *)
 
void childAspectDeselectedInView (const AbstractAspect *)
 
- Protected Slots inherited from AbstractAspect
virtual void childSelected (const AbstractAspect *)
 
virtual void childDeselected (const AbstractAspect *)
 
- Protected Member Functions inherited from AbstractAspect
void info (const QString &text)
 Implementations should call this whenever status information should be given to the user. More...
 
bool readBasicAttributes (XmlStreamReader *)
 Load name and creation time from XML. More...
 
void writeBasicAttributes (QXmlStreamWriter *) const
 Save name and creation time to XML. More...
 
void writeCommentElement (QXmlStreamWriter *) const
 Save the comment to XML. More...
 
bool readCommentElement (XmlStreamReader *)
 Load comment from an XML element. More...
 
- Protected Attributes inherited from AbstractAspect
const AspectType m_type
 

Detailed Description

Base class for all Worksheet children.

File : WorksheetElement.cpp Project : LabPlot

Description : Base class for all Worksheet children.

Copyright : (C) 2009 Tilman Benkert (thzs@.nosp@m.gmx..nosp@m.net) Copyright : (C) 2012-2017 by Alexander Semke (alexa.nosp@m.nder.nosp@m..semk.nosp@m.e@we.nosp@m.b.de)

  • This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. *
  • This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. *
  • You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA *

Definition at line 41 of file WorksheetElement.h.

Member Enumeration Documentation

◆ HorizontalAlignment

Enumerator
Left 
Center 
Right 

Definition at line 54 of file WorksheetElement.h.

◆ HorizontalPosition

Enumerator
Left 
Center 
Right 
Custom 

Definition at line 51 of file WorksheetElement.h.

◆ Orientation

Enumerator
Horizontal 
Vertical 

Definition at line 45 of file WorksheetElement.h.

◆ VerticalAlignment

Enumerator
Top 
Center 
Bottom 

Definition at line 55 of file WorksheetElement.h.

◆ VerticalPosition

Enumerator
Top 
Center 
Bottom 
Custom 

Definition at line 52 of file WorksheetElement.h.

◆ WorksheetElementName

Enumerator
NameCartesianPlot 

Definition at line 49 of file WorksheetElement.h.

Constructor & Destructor Documentation

◆ WorksheetElement()

WorksheetElement::WorksheetElement ( const QString &  name,
AspectType  type 
)

◆ ~WorksheetElement()

WorksheetElement::~WorksheetElement ( )
override

Definition at line 62 of file WorksheetElement.cpp.

References m_drawingOrderMenu, m_moveBehindMenu, and m_moveInFrontOfMenu.

Member Function Documentation

◆ bottomPaddingChanged()

void WorksheetElement::bottomPaddingChanged ( double  )

◆ createContextMenu()

◆ execMoveBehind

◆ execMoveInFrontOf

◆ graphicsItem()

QGraphicsItem * WorksheetElement::graphicsItem ( ) const
pure virtual

◆ handleResize()

virtual void WorksheetElement::handleResize ( double  horizontalRatio,
double  verticalRatio,
bool  pageResize = false 
)
pure virtual

◆ horizontalPaddingChanged()

void WorksheetElement::horizontalPaddingChanged ( float  )

◆ hovered()

◆ isFullyVisible()

bool WorksheetElement::isFullyVisible ( ) const
virtual

Return whether the element is fully visible (i.e., including all child elements).

The standard implementation returns isVisible().

Reimplemented in WorksheetElementContainer.

Definition at line 91 of file WorksheetElement.cpp.

References isVisible().

◆ isVisible()

bool WorksheetElement::isVisible ( ) const
pure virtual

◆ loadThemeConfig()

void WorksheetElement::loadThemeConfig ( const KConfig &  )
virtual

Reimplemented in Image, Axis, CartesianPlot, Histogram, XYCurve, TextLabel, CartesianPlotLegend, and PlotArea.

Definition at line 248 of file WorksheetElement.cpp.

◆ prepareMoveBehindMenu

◆ prepareMoveInFrontOfMenu

◆ retransform

void WorksheetElement::retransform ( )
pure virtualslot

Tell the element to newly transform its graphics item into its coordinate system.

This method must not change the undo-aware data of the element, only the graphics item which represents the item is to be updated.

Implemented in Image, Axis, CartesianPlotLegend, CustomPoint, ReferenceLine, XYCurve, PlotArea, and TextLabel.

Referenced by WorksheetView::addNew().

◆ rightPaddingChanged()

void WorksheetElement::rightPaddingChanged ( double  )

◆ saveThemeConfig()

void WorksheetElement::saveThemeConfig ( const KConfig &  )
virtual

Reimplemented in Image, Axis, Histogram, XYCurve, TextLabel, and PlotArea.

Definition at line 251 of file WorksheetElement.cpp.

◆ setPrinting()

void WorksheetElement::setPrinting ( bool  on)
pure virtual

Switches the printing mode on/off.

Implemented in Histogram, XYCurve, Image, Axis, CartesianPlotLegend, CustomPoint, ReferenceLine, PlotArea, TextLabel, and WorksheetElementContainer.

◆ setVisible()

void WorksheetElement::setVisible ( bool  on)
pure virtual

◆ setZValue()

void WorksheetElement::setZValue ( qreal  value)
virtual

Reimplemented in Axis, and CartesianPlotLegend.

Definition at line 109 of file WorksheetElement.cpp.

References graphicsItem().

◆ shapeFromPath()

◆ symmetricPaddingChanged()

void WorksheetElement::symmetricPaddingChanged ( double  )

◆ unhovered()

◆ verticalPaddingChanged()

void WorksheetElement::verticalPaddingChanged ( float  )

Friends And Related Function Documentation

◆ AbstractPlotSetBottomPaddingCmd

friend class AbstractPlotSetBottomPaddingCmd
friend

Definition at line 96 of file WorksheetElement.h.

◆ AbstractPlotSetHorizontalPaddingCmd

friend class AbstractPlotSetHorizontalPaddingCmd
friend

Definition at line 93 of file WorksheetElement.h.

◆ AbstractPlotSetRightPaddingCmd

friend class AbstractPlotSetRightPaddingCmd
friend

Definition at line 95 of file WorksheetElement.h.

◆ AbstractPlotSetSymmetricPaddingCmd

friend class AbstractPlotSetSymmetricPaddingCmd
friend

Definition at line 97 of file WorksheetElement.h.

◆ AbstractPlotSetVerticalPaddingCmd

friend class AbstractPlotSetVerticalPaddingCmd
friend

Definition at line 94 of file WorksheetElement.h.

Member Data Documentation

◆ m_drawingOrderMenu

QMenu* WorksheetElement::m_drawingOrderMenu
private

Definition at line 82 of file WorksheetElement.h.

Referenced by createContextMenu(), WorksheetElement(), and ~WorksheetElement().

◆ m_moveBehindMenu

QMenu* WorksheetElement::m_moveBehindMenu
private

◆ m_moveInFrontOfMenu

QMenu* WorksheetElement::m_moveInFrontOfMenu
private

The documentation for this class was generated from the following files: