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)  

CantorWorksheet Class Reference

#include <CantorWorksheet.h>

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

Signals

void requestProjectContextMenu (QMenu *)
 
void statusChanged (Cantor::Session::Status)
 
- Signals inherited from AbstractPart
void showRequested ()
 
void importFromFileRequested ()
 
void importFromSQLDatabaseRequested ()
 
void exportRequested ()
 
void printRequested ()
 
void printPreviewRequested ()
 
- 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 *)
 

Public Member Functions

 CantorWorksheet (const QString &name, bool loading=false)
 
bool init (QByteArray *content=nullptr)
 
QWidget * view () const override
 Construct a primary view on me. More...
 
QMenu * createContextMenu () override
 Return a new context menu. More...
 
QIcon icon () const override
 Return an icon to be used for decorating my views. More...
 
bool exportView () const override
 
bool printView () override
 
bool printPreview () const override
 
void save (QXmlStreamWriter *) const override
 Save as XML. More...
 
bool load (XmlStreamReader *, bool preview) override
 Load from XML. More...
 
QString backendName ()
 
KParts::ReadWritePart * part ()
 
QList< Cantor::PanelPlugin * > getPlugins ()
 
- Public Member Functions inherited from AbstractPart
 AbstractPart (const QString &name, AspectType type)
 
 ~AbstractPart () override
 
void deleteView () const
 
PartMdiViewmdiSubWindow () const
 Wrap the view() into a PartMdiView. More...
 
bool hasMdiSubWindow () const
 
QMenu * createContextMenu () override
 Return AbstractAspect::createContextMenu() plus operations on the primary view. More...
 
bool isDraggable () const override
 
QVector< AspectTypedropableOn () const override
 
virtual void registerShortcuts ()
 
virtual void unregisterShortcuts ()
 
- 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
 
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 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...
 

Private Slots

void dataChanged (const QModelIndex &)
 
void rowsInserted (const QModelIndex &parent, int first, int last)
 
void rowsAboutToBeRemoved (const QModelIndex &parent, int first, int last)
 
void modelReset ()
 
void modified ()
 

Private Attributes

CantorWorksheetViewm_view {nullptr}
 
QString m_backendName
 
Cantor::Session * m_session {nullptr}
 
KParts::ReadWritePart * m_part {nullptr}
 
QList< Cantor::PanelPlugin * > m_plugins
 
QAbstractItemModel * m_variableModel {nullptr}
 
Cantor::WorksheetAccessInterface * m_worksheetAccess {nullptr}
 

Additional Inherited Members

- Public Types inherited from AbstractAspect
enum class  ChildIndexFlag { IncludeHidden = 0x01 , Recursive = 0x02 , Compress = 0x04 }
 Flags which control numbering scheme of children. 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...
 
- 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 AbstractPart
QWidget * m_partView {nullptr}
 
- Protected Attributes inherited from AbstractAspect
const AspectType m_type
 

Detailed Description

Definition at line 48 of file CantorWorksheet.h.

Constructor & Destructor Documentation

◆ CantorWorksheet()

CantorWorksheet::CantorWorksheet ( const QString &  name,
bool  loading = false 
)
explicit

File : CantorWorksheet.cpp Project : LabPlot

Description : Aspect providing a Cantor Worksheets for Multiple backends

Copyright : (C) 2015 Garvit Khatri (garvi.nosp@m.tdel.nosp@m.hi@gm.nosp@m.ail..nosp@m.com) Copyright : (C) 2016 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 56 of file CantorWorksheet.cpp.

References init().

Member Function Documentation

◆ backendName()

QString CantorWorksheet::backendName ( )

Definition at line 236 of file CantorWorksheet.cpp.

References m_backendName.

Referenced by CantorWorksheetView::CantorWorksheetView().

◆ createContextMenu()

QMenu * CantorWorksheet::createContextMenu ( )
overridevirtual

Return a new context menu.

The caller takes ownership of the menu.

Reimplemented from AbstractAspect.

Definition at line 229 of file CantorWorksheet.cpp.

References AbstractPart::createContextMenu(), and requestProjectContextMenu().

◆ dataChanged

void CantorWorksheet::dataChanged ( const QModelIndex &  index)
privateslot

◆ exportView()

bool CantorWorksheet::exportView ( ) const
overridevirtual

Implements AbstractPart.

Definition at line 241 of file CantorWorksheet.cpp.

◆ getPlugins()

QList< Cantor::PanelPlugin * > CantorWorksheet::getPlugins ( )

Definition at line 193 of file CantorWorksheet.cpp.

References m_plugins.

◆ icon()

QIcon CantorWorksheet::icon ( ) const
overridevirtual

Return an icon to be used for decorating my views.

Reimplemented from AbstractAspect.

Definition at line 201 of file CantorWorksheet.cpp.

References m_session.

◆ init()

bool CantorWorksheet::init ( QByteArray *  content = nullptr)

◆ load()

◆ modelReset

void CantorWorksheet::modelReset ( )
privateslot

Definition at line 177 of file CantorWorksheet.cpp.

Referenced by init().

◆ modified

void CantorWorksheet::modified ( )
privateslot

Definition at line 173 of file CantorWorksheet.cpp.

References AbstractAspect::project(), and Project::setChanged().

Referenced by init().

◆ part()

◆ printPreview()

bool CantorWorksheet::printPreview ( ) const
overridevirtual

Implements AbstractPart.

Definition at line 250 of file CantorWorksheet.cpp.

References m_part.

◆ printView()

bool CantorWorksheet::printView ( )
overridevirtual

Implements AbstractPart.

Definition at line 245 of file CantorWorksheet.cpp.

References m_part.

◆ requestProjectContextMenu

void CantorWorksheet::requestProjectContextMenu ( QMenu *  )
signal

◆ rowsAboutToBeRemoved

void CantorWorksheet::rowsAboutToBeRemoved ( const QModelIndex &  parent,
int  first,
int  last 
)
privateslot

◆ rowsInserted

void CantorWorksheet::rowsInserted ( const QModelIndex &  parent,
int  first,
int  last 
)
privateslot

◆ save()

void CantorWorksheet::save ( QXmlStreamWriter *  writer) const
overridevirtual

◆ statusChanged

void CantorWorksheet::statusChanged ( Cantor::Session::Status  )
signal

◆ view()

QWidget * CantorWorksheet::view ( ) const
overridevirtual

Construct a primary view on me.

The caller receives ownership of the view.

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

Implements AbstractPart.

Definition at line 207 of file CantorWorksheet.cpp.

References AbstractPart::m_partView, m_session, m_view, and AbstractAspect::project().

Referenced by MainWin::updateGUI().

Member Data Documentation

◆ m_backendName

QString CantorWorksheet::m_backendName
private

Definition at line 73 of file CantorWorksheet.h.

Referenced by backendName(), dataChanged(), init(), load(), rowsInserted(), and save().

◆ m_part

KParts::ReadWritePart* CantorWorksheet::m_part {nullptr}
private

Definition at line 75 of file CantorWorksheet.h.

Referenced by init(), part(), printPreview(), and printView().

◆ m_plugins

QList<Cantor::PanelPlugin*> CantorWorksheet::m_plugins
private

Definition at line 76 of file CantorWorksheet.h.

Referenced by getPlugins(), and init().

◆ m_session

Cantor::Session* CantorWorksheet::m_session {nullptr}
private

Definition at line 74 of file CantorWorksheet.h.

Referenced by icon(), init(), and view().

◆ m_variableModel

QAbstractItemModel* CantorWorksheet::m_variableModel {nullptr}
private

Definition at line 77 of file CantorWorksheet.h.

Referenced by dataChanged(), init(), rowsAboutToBeRemoved(), and rowsInserted().

◆ m_view

CantorWorksheetView* CantorWorksheet::m_view {nullptr}
mutableprivate

Definition at line 72 of file CantorWorksheet.h.

Referenced by view().

◆ m_worksheetAccess

Cantor::WorksheetAccessInterface* CantorWorksheet::m_worksheetAccess {nullptr}
private

Definition at line 78 of file CantorWorksheet.h.

Referenced by init(), and save().


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