Aspect Containers

Aspect Containers are use to organize aspects.

class Folder : public AbstractAspect

Folder in a project.

Subclassed by MQTTClient, MQTTSubscription, Project

Public Functions

virtual QIcon icon() const override

Return an icon to be used for decorating my views.

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 preview) override

Load from XML.

virtual QVector<AspectType> pasteTypes() const override

return the list of all aspect types that can be copy&pasted into the current aspect. returns an empty list on default, needs to be re-implemented in all derived classes that want to allow other aspects to be pasted into.

class Project : public Folder

Represents a project.

Project represents the root node of all objects created during the runtime of the program. Manages also the undo stack.

Public Functions

inline virtual Project *project() override

Return the Project this Aspect belongs to, or 0 if it is currently not part of one.

virtual QUndoStack *undoStack() const override

Return the undo stack of the Project, or 0 if this Aspect is not part of a Project.

It’s also possible to construct undo-enabled Aspect trees without Project. The only requirement is that the root Aspect reimplements undoStack() to get the undo stack from somewhere (the default implementation just delegates to parentAspect()).

inline virtual QString path() const override

Return the path that leads from the top-most Aspect (usually a Project) to me.

virtual QMenu *createContextMenu() override

Return a new context menu.

The caller takes ownership of the menu.

virtual bool load(XmlStreamReader*, bool preview) override

Load from XML.

Public Slots

void descriptionChanged(const AbstractAspect*)

Project::descriptionChanged This function is called, when an object changes its name. When a column changed its name and wasn’t connected before to the curve/column(formula), this is updated in this function.

Example: curve needs “column1” An Existing column is called “column2”. This existing column will be renamed to “column1”. Now the column shall be connected to the curve

Parameters:

aspect

void aspectAddedSlot(const AbstractAspect*)

Project::aspectAddedSlot When adding new columns, these should be connected to the corresponding curves.

Parameters:

aspect

Public Static Functions

static void restorePointers(AbstractAspect*)

this function is used to restore the pointers to the columns in xy-curves etc. from the stored column paths. This function is called after the project was loaded and when an aspect is being pasted. In both cases we deserialized from XML and need to restore the pointers.

static bool isSupportedProject(const QString &fileName)

returns true if the project file \fileName has a supported format and can be openned in LabPlot directly, returns false otherwise.