OpenCurves  0.9
SplitPlotView Class Reference

A special plotting view which can contain multiple splits, each with its own PlotView. More...

#include <splitplotview.h>

Inheritance diagram for SplitPlotView:

Public Slots

void splitVertical ()
 Split the active plot view vertically.
 
void splitHorizontal ()
 Split the active plot view horizontally.
 
void splitRemove ()
 Remove the current split.
 
void splitRemoveAll ()
 Remove all splits, keeping only the current plot view.
 
void setMultiTool ()
 Set the current tool to PlotView::MultiTool. Affects all child views.
 
void setPanTool ()
 Set the current tool to PlotView::PanTool. Affects all child views.
 
void setZoomTool ()
 Set the current tool to PlotView::ZoomTool. Affects all child views.
 
void setZoomX ()
 Set the current zoom mode to PlotZoomer::ZoomX. Affects all child views.
 
void setZoomY ()
 Set the current zoom mode to PlotZoomer::ZoomY. Affects all child views.
 
void setZoomXY ()
 Set the current zoom mode to PlotZoomer::ZoomBoth. Affects all child views.
 

Signals

void viewAdded (PlotView *view)
 Raised when a new view is created due to a new split. More...
 
void activeViewChanged (PlotView *newView, PlotView *oldView)
 Raised when the activeView() changes. More...
 
void syncPan (int x, int y)
 Signals panning from a child PlotView where PlotView::synchronised() is set. More...
 
void multiToolModeSet ()
 Raised when the PlotView::ToolMode is changed to PlotView::MultiTool.
 
void panToolModeSet ()
 Raised when the PlotView::ToolMode is changed to PlotView::PanTool.
 
void zoomToolModeSet ()
 Raised when the PlotView::ToolMode is changed to PlotView::ZoomTool.
 
void zoomXSet ()
 Raised when the PlotZoomer::ZoomMode is changed to PlotZoomer::ZoomX.
 
void zoomYSet ()
 Raised when the PlotZoomer::ZoomMode is changed to PlotZoomer::ZoomY.
 
void zoomXYSet ()
 Raised when the PlotZoomer::ZoomMode is changed to PlotZoomer::ZoomBoth.
 

Public Member Functions

 SplitPlotView (Curves *curves, QWidget *parent=nullptr)
 Create a split view containing exactly one PlotView. More...
 
void loadSettings (QSettings &settings)
 Load settings for the split view, as saved by saveSettings(). More...
 
void saveSettings (QSettings &settings)
 Saves settings for the split view supporting restoring to the same state. More...
 
PlotViewactiveView () const
 Access the active view. More...
 
bool hasSplits () const
 Does the view have any splits? More...
 
void replot ()
 Re-plot all views within the splitter tree.
 
void collate (QVector< PlotView * > &views)
 Collate all contained views. More...
 
void collateActive (QStringList &sourceNames, QStringList &curveNames, const PlotView *exclude=nullptr)
 Collates the list of source and curve names being viewed by any active view. More...
 

Detailed Description

A special plotting view which can contain multiple splits, each with its own PlotView.

The split view always contains at least one PlotView. It may also contain a tree of splitters branches with PlotView leaf nodes. This structure allows continued splitting and re-splitting of views. On split, the current PlotView is duplicated, then the original view and its duplicate are added to a QSplitter.

The SplitPlotView also manages event binding to synchronise panning and zooming between the views as required, as well as synchronising the PlotView::ToolMode and PlotZoomer::ZoomMode between child views.

This control can essentially be used as in place of a PlotView to support view splitting and synchronisation.

Constructor & Destructor Documentation

SplitPlotView::SplitPlotView ( Curves curves,
QWidget *  parent = nullptr 
)

Create a split view containing exactly one PlotView.

Parameters
curvesThe curves model to visualise in the child views.
parentThe parent widgets.

Member Function Documentation

PlotView* SplitPlotView::activeView ( ) const
inline

Access the active view.

This is the (last) focused view.

There is always an active view.

Returns
The currently active view.
void SplitPlotView::activeViewChanged ( PlotView newView,
PlotView oldView 
)
signal

Raised when the activeView() changes.

Parameters
newViewThe newly active view.
oldViewThe previously active view.
void SplitPlotView::collate ( QVector< PlotView * > &  views)

Collate all contained views.

Parameters
[in,out]viewsCollated into here.
void SplitPlotView::collateActive ( QStringList &  sourceNames,
QStringList &  curveNames,
const PlotView exclude = nullptr 
)

Collates the list of source and curve names being viewed by any active view.

Parameters
[in,out]sourceNamesSources are collated in this list. Does not get cleared first.
[in,out]curveNamesCurves are collated in this list. Does not get cleared first.
excludeOptionally exclude this view from the collation process.
bool SplitPlotView::hasSplits ( ) const

Does the view have any splits?

Returns
True if the split view has any splits (multiple views).
void SplitPlotView::loadSettings ( QSettings &  settings)

Load settings for the split view, as saved by saveSettings().

Parameters
settingsThe settings object to load from.
See also
saveSettings()
void SplitPlotView::saveSettings ( QSettings &  settings)

Saves settings for the split view supporting restoring to the same state.

This creates a settings group labelled "root", then saves the splitter/view tree within this group. Each branch in the tree is either a QSplitter (branch) or a PlotView (leaf).

A QSplitter stores the following:

Key Description
type "split"
orientation Splitter orientation. Qt::Orientation as an integer
left A new group, recursively storing the first child object.
right A new group, recursively storing the second child object.
geometry The splitter geometry.

A PlotView stores the following:

Key Description
type "view"
[View settings] Calls PlotView::saveSettings() to save view settings.
active "true" for the activeView()
Parameters
settingsThe settings object to save to.
void SplitPlotView::syncPan ( int  x,
int  y 
)
signal

Signals panning from a child PlotView where PlotView::synchronised() is set.

This is used to synchronise panning PlotView children. It is bound to the PlotPanner::syncPan() signal is bound to propagate to the PlotPanner::moveCanvas() slot.

Parameters
xThe pan change in X.
yThe pan change in Y.
void SplitPlotView::viewAdded ( PlotView view)
signal

Raised when a new view is created due to a new split.

Parameters
viewThe new view.

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