OpenCurves
0.9
|
A special plotting view which can contain multiple splits, each with its own PlotView
.
More...
#include <splitplotview.h>
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... | |
PlotView * | activeView () 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... | |
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.
SplitPlotView::SplitPlotView | ( | Curves * | curves, |
QWidget * | parent = nullptr |
||
) |
Create a split view containing exactly one PlotView
.
curves | The curves model to visualise in the child views. |
parent | The parent widgets. |
|
inline |
Access the active view.
This is the (last) focused view.
There is always an active view.
Raised when the activeView()
changes.
newView | The newly active view. |
oldView | The previously active view. |
void SplitPlotView::collate | ( | QVector< PlotView * > & | views | ) |
Collate all contained views.
[in,out] | views | Collated 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.
[in,out] | sourceNames | Sources are collated in this list. Does not get cleared first. |
[in,out] | curveNames | Curves are collated in this list. Does not get cleared first. |
exclude | Optionally exclude this view from the collation process. |
bool SplitPlotView::hasSplits | ( | ) | const |
Does the view have any splits?
void SplitPlotView::loadSettings | ( | QSettings & | settings | ) |
Load settings for the split view, as saved by saveSettings()
.
settings | The settings object to load from. |
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() |
settings | The settings object to save to. |
|
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.
x | The pan change in X. |
y | The pan change in Y. |
|
signal |
Raised when a new view is created due to a new split.
view | The new view. |