Worksheet

C++ SDK API Documentation - Worksheet

class Worksheet : public AbstractPart

Top-level container for worksheet elements like plot, labels, etc.

The worksheet is, besides the data containers Spreadsheet and Matrix, another central part of the application and provides an area for showing and grouping together different kinds of worksheet objects - plots, labels &etc;

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 QWidget *view() const override

Construct a primary view on me.

This method may be called multiple times during the life time of an Aspect, or it might not get called at all. Aspects must not depend on the existence of a view for their operation.

virtual QVector<AbstractAspect*> dependsOn() const override

returns the list of all parent aspects (folders and sub-folders) together with all the data containers required to plot the data in the worksheet

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.

virtual void save(QXmlStreamWriter*) const override

Save as XML.

virtual bool load(XmlStreamReader*, bool preview) override

Load from XML.

void setItemSelectedInView(const QGraphicsItem*, const bool)

Emits the signal to select or to deselect the aspect corresponding to QGraphicsItem item in the project explorer, if selected=true or selected=false, respectively. The signal is handled in AspectTreeModel and forwarded to the tree view in ProjectExplorer. This function is called in WorksheetView upon selection changes.

void setSelectedInView(const bool)

Selects or deselects the worksheet in the project explorer. This function is called in WorksheetView. The worksheet gets deselected if there are selected items in the view, and selected if there are no selected items in the view.

int plotCount()

Worksheet::plotCount.

Returns:

number of CartesianPlot’s in the Worksheet

CartesianPlot *plot(int index)

Worksheet::plot.

Parameters:

index – Number of plot which should be returned

Returns:

Pointer to the CartesianPlot which was searched with index

Public Slots

void updateCurveBackground(QColor, const QString &curveName)

Updates the background of the cuves entry in the treeview

Parameters:
  • pen – Pen of the curve

  • curveName – Curve name to find in treemodel

void updateCompleteCursorTreeModel()

Worksheet::updateCompleteCursorTreeModel If the plot or the curve are not available, the plot/curve is not in the treemodel!

void cursorPosChanged(int cursorNumber, double xPos)

Worksheet::cursorPosChanged Updates the cursor treemodel with the new data.

Parameters:

xPos – new position of the cursor It is assumed, that the plots/curves are in the same order than receiving from the children() function. It’s not checked if the names are the same

Public Static Functions

static double convertToSceneUnits(const double value, const Worksheet::Unit unit)

converts from unit to the scene units. At the moment, 1 scene unit corresponds to 1/10 mm.

static double convertFromSceneUnits(const double value, const Worksheet::Unit unit)

converts from the scene units to unit . At the moment, 1 scene unit corresponds to 1/10 mm.