JKQTPlotter trunk/v5.0.0
an extensive Qt5+Qt6 Plotter framework (including a feature-richt plotter widget, a speed-optimized, but limited variant and a LaTeX equation renderer!), written fully in C/C++ and without external dependencies
|
plotter widget for scientific plots (uses JKQTBasePlotter to do the actual drawing) More...
#include <jkqtplotter.h>
Classes | |
struct | MouseDragAction |
ties a MouseActionMode to a mouse-button and a keyboard-modifier More... | |
struct | MouseDragMarker |
describes a marker to be drawn by paintUserAction() More... | |
Public Slots | |
void | copyData () |
copy the data used for the current plot to the clipboard | |
void | copyDataMatlab () |
copy the data used for the current plot to the clipboard as a Matlab script | |
void | openContextMenu () |
open the context menu at the mouse position of the last click | |
void | openContextMenu (int x, int y) |
open the context menu at the mouse position x and y | |
void | openSpecialContextMenu () |
open the special context menu at the mouse position of the last click | |
void | openSpecialContextMenu (int x, int y) |
open the special context menu at the mouse position x and y | |
void | openStandardAndSpecialContextMenu () |
open the standard context menu with the special context menu integrated at the mouse position of the last click | |
void | openStandardAndSpecialContextMenu (int x, int y) |
open the standard context menu with the special context menu integrated at the mouse position x and y | |
void | openStandardContextMenu () |
open the standard context menu at the mouse position of the last click | |
void | openStandardContextMenu (int x, int y) |
open the standard context menu at the mouse position x and y | |
void | populateToolbar (QToolBar *toolbar) const |
popuplate the given toolbar toolbar with all actions shown in a toolbar from this class ... | |
void | print (QPrinter *printer=nullptr) |
print the current plot, if printer is nullptr a printer selection dialog is displayed | |
void | redrawPlot () |
update the plot and the overlays | |
void | saveAsCSV (const QString &filename=QString("")) |
save the current plot data as a Comma Separated Values (CSV) file | |
void | saveAsDIF (const QString &filename=QString("")) |
save the current plot data as a Data Interchange Format file (see https://en.wikipedia.org/wiki/Data_Interchange_Format). | |
void | saveAsGerExcelCSV (const QString &filename=QString("")) |
save the current plot data as a Semicolon Separated Values (CSV) file for german Excel, i.e. with comma as decimal separator | |
void | saveAsMatlab (const QString &filename=QString("")) |
save the current plot data as a Matlab Script | |
bool | saveAsPDF (const QString &filename=QString(""), bool displayPreview=true) |
save the current plot as a PDF file, with the current widget aspect ratio, if filename is empty a file selection dialog is displayed | |
bool | saveAsPixelImage (const QString &filename=QString(""), bool displayPreview=true, const QByteArray &outputFormat=QByteArray(), const QSize &outputSizeIncrease=QSize(0, 0)) |
save the current plot as a pixel image image (PNG ...), if filename is empty a file selection dialog is displayed | |
void | saveAsSemicolonSV (const QString &filename=QString("")) |
save the current plot data as a Semicolon Separated Values (SSV) file | |
bool | saveAsSVG (const QString &filename=QString(""), bool displayPreview=true) |
save the current plot as a SVG file, with the current widget aspect ratio, if filename is empty a file selection dialog is displayed | |
void | saveAsSYLK (const QString &filename=QString("")) |
save the current plot data as a SYmbolik LinK (SYLK) spreadsheet file (see https://en.wikipedia.org/wiki/Symbolic_Link_(SYLK) ) | |
void | saveAsTabSV (const QString &filename=QString("")) |
save the current plot data as a Tabulator Separated Values (CSV) file | |
void | saveData (const QString &filename=QString(""), const QString &format=QString("")) |
save the data used for the current plot. The file format is extracted from the file extension (csv, ...) | |
bool | saveImage (const QString &filename=QString(""), bool displayPreview=true) |
save the current plot as an image file, with the current widget aspect ratio, if filename is empty a file selection dialog is displayed. The image format is extracted from the file extension (jpeg, tiff, png, pdf, ...) | |
void | setAbsoluteX (double xminn, double xmaxx) |
sets absolutely limiting x-range of the plot | |
void | setAbsoluteXY (double xminn, double xmaxx, double yminn, double ymaxx) |
sets absolutely limiting x- and y-range of the plot | |
void | setAbsoluteY (double yminn, double ymaxx) |
sets absolute minimum and maximum y-value to plot | |
void | setContextMenuMode (JKQTPContextMenuModes mode) |
sets the mode if the standard context menu | |
void | setGrid (bool val) |
sets whether the major grid lines of the major axes are shown | |
void | setGridColor (QColor color) |
sets the color of all major grid lines (of the major x- and y-axis) | |
void | setGridStyle (Qt::PenStyle __value) |
sets the style of all Major grid lines | |
void | setGridWidth (double __value) |
sets the width of all Major grid lines | |
void | setMagnification (double m) |
set the current plot magnification | |
void | setMaxTooltipDistance (int v) |
maximum distance at which a tooltip for a point is still displayed, when the user action jkqtpmdaToolTipForClosestDataPoint is executed | |
void | setMinorGridColor (QColor color) |
sets the color of all minor grid lines | |
void | setMinorGridStyle (Qt::PenStyle __value) |
sets the style of all minor grid lines | |
void | setMinorGridWidth (double __value) |
sets the width of all minor grid lines | |
void | setMouseActionToolbarActionsActive (bool __value) |
allows to activate/deactivate toolbar buttons that can activate certain mouse drag actions | |
void | setMousePositionShown (bool __value) |
specifies whether to display the current position of the mouse in the top border of the plot (this may automatically extent the top border, so the position fits in. The default widget font is used for the output. | |
void | setShowZeroAxes (bool showX, bool showY) |
switches the visibility of the zero-axes associated with the x- and y-axis | |
void | setShowZeroAxes (bool showXY) |
switches the visibility of the zero-axes associated with the major x- and y-axis | |
void | setToolbarAlwaysOn (bool __value) |
returns whether the toolbar is always visible or only when the mouse moves to the upper left area | |
void | setToolbarEnabled (bool __value) |
returns whether the toolbar is enabled | |
void | setUserActionCatchSensitivity (int v) |
sensitivity (i.e. max. distance to see as one point) for user actions | |
void | setUserActionMarkerBrush (const QBrush &__value) |
pen for location markers of user actions on the plot | |
void | setUserActionMarkerDiameter (int v) |
size (diameter) of markers drawn by user actions | |
void | setUserActionMarkerPen (const QPen &__value) |
pen for location markers of user actions on the plot | |
void | setUserActionMarkerType (JKQTPUserActionMarkerType v) |
type of the location markers of user actions on the plot | |
void | setUserActionOpaqueBrush (const QBrush &__value) |
pen for user actions that cover parts of the plot (typically opaque, like e.g. tooltips) | |
void | setUserActionOpaquePen (const QPen &__value) |
pen for user actions that cover parts of the plot (typically opaque, like e.g. tooltips) | |
void | setUserActionOverlayBrush (const QBrush &__value) |
pen for user actions that overlay the plot (typically semi-transparent, like e.g. zoom-rectangles) | |
void | setUserActionOverlayPen (const QPen &__value) |
pen for user actions that overlay the plot (typically semi-transparent, like e.g. zoom-rectangles) | |
void | setX (double xminn, double xmaxx) |
sets the x-range of the plot (minimum and maximum x-value on the x-axis) | |
void | setXY (double xminn, double xmaxx, double yminn, double ymaxx, bool affectsSecondaryAxes=false) |
sets the x- and y-range of the plot (minimum and maximum values on the x-/y-axis) | |
void | setY (double yminn, double ymaxx) |
sets the y-range of the plot (minimum and maximum y-value on the y-axis) | |
void | synchronizeXAxis (double newxmin, double newxmax, double newymin, double newymax, JKQTPlotter *sender) |
may be connected to zoomChangedLocally() of a different plot and synchronizes the local x-axis to the other x-axis | |
void | synchronizeXYAxis (double newxmin, double newxmax, double newymin, double newymax, JKQTPlotter *sender) |
may be connected to zoomChangedLocally() of a different plot and synchronizes the local x- and y-axis to the other x- and y-axis | |
void | synchronizeYAxis (double newxmin, double newxmax, double newymin, double newymax, JKQTPlotter *sender) |
may be connected to zoomChangedLocally() of a different plot and synchronizes the local y-axis to the other y-axis | |
void | zoom (double xminn, double xmaxn, double yminn, double ymaxn, bool affectsSecondaryAxes=false) |
sets the x- and y-range of the plot (minimum and maximum values on the x-/y-axis) | |
void | zoomIn (double factor=2.0) |
zooms into the graph (the same as turning the mouse wheel) by the given factor | |
void | zoomOut (double factor=2.0) |
zooms out of the graph (the same as turning the mouse wheel) by the given factor | |
void | zoomToFit (bool zoomX=true, bool zoomY=true, bool includeX0=false, bool includeY0=false, double scaleX=1.05, double scaleY=1.05) |
this method zooms the graph so that all plotted datapoints are visible. | |
Signals | |
void | beforePlotScalingRecalculate () |
emitted before the plot scaling has been recalculated | |
void | contextMenuOpened (double x, double y, QMenu *contextMenu) |
emitted whenever a context menu is opened. You can modify the menu via the parameter contextMenu! | |
void | plotMouseClicked (double x, double y, Qt::KeyboardModifiers modifiers, Qt::MouseButton button) |
emitted when a single-click event from the mouse occurs inside the plot | |
void | plotMouseDoubleClicked (double x, double y, Qt::KeyboardModifiers modifiers, Qt::MouseButton button) |
emitted when a double-click event from the mouse occurs inside the plot | |
void | plotMouseMove (double x, double y) |
emitted whenever the mouse moves | |
void | plotMouseWheelOperated (double x, double y, Qt::KeyboardModifiers modifiers, int deltaAngleX, int deltaAngleY) |
emitted when a single-click event from the mouse occurs inside the plot | |
void | plotNewZoomRectangle (double mouseDragRectXStart, double mouseDragRectXEnd, double mouseDragRectYStart, double mouseDragRectYEnd, Qt::KeyboardModifiers modifiers) |
emitted when the mouse action jkqtpmdaZoomByRectangle and the drawing of the new zoom rectangle is finished (=mouse key released) | |
void | plotScalingRecalculated () |
emitted when the plot scaling has been recalculated | |
void | rulerDisplayed (double x1, double y1, double x2, double y2, Qt::KeyboardModifiers modifiers) |
emitted when a new ruler between two points is displayed | |
void | tooltipDisplayed (double x, double y, const QStringList &entries, const QList< JKQTPPlotElement * > &graphs) |
emitted when a tooltip for a datapoint is displayed | |
void | userCircleFinished (double x, double y, double radius, Qt::KeyboardModifiers modifiers) |
emitted when the mouse action JKQTPlotter::CircleEvents and the drawing of the new circle is finished (=mouse key released) | |
void | userEllipseFinished (double x, double y, double radiusX, double radiusY, Qt::KeyboardModifiers modifiers) |
emitted when the mouse action JKQTPlotter::EllipseEvents and the drawing of the new ellipse is finished (=mouse key released) | |
void | userLineFinished (double x1, double y1, double x2, double y2, Qt::KeyboardModifiers modifiers) |
emitted when the mouse action JKQTPlotter::LineEvents and the drawing of the new line is finished (=mouse key released) | |
void | userRectangleFinished (double x, double y, double width, double height, Qt::KeyboardModifiers modifiers) |
emitted when the mouse action JKQTPlotter::RectangleEvents and the drawing of the new rectangle is finished (=mouse key released) | |
void | userScribbleClick (double x, double y, Qt::KeyboardModifiers modifiers, bool first, bool last) |
emitted when the mouse action JKQTPlotter::ScribbleEvents and a click event from the mouse occurs inside the plot, or the mouse moved while the left button is pressed down | |
void | widgetResized (int new_width, int new_height, JKQTPlotter *sender) |
signal: emitted whenever the widget is resized | |
void | zoomChangedLocally (double newxmin, double newxmax, double newymin, double newymax, JKQTPlotter *sender) |
signal: emitted whenever the user selects a new x-y zoom range (in the major axes, e.g. by mouse, setX(), setY(), setXY(), zoomToFit()... ) | |
Public Member Functions | |
JKQTPlotter (bool datastore_internal, QWidget *parent=nullptr, JKQTPDatastore *datast=nullptr) | |
class constructor | |
JKQTPlotter (JKQTPDatastore *datast, QWidget *parent=nullptr) | |
class constructor for a JKQTPlotter using an external JKQTPDatastore dataset | |
JKQTPlotter (QWidget *parent=nullptr) | |
class constructor | |
virtual | ~JKQTPlotter () |
class destructor | |
size_t | addGraph (JKQTPPlotElement *gr) |
size_t | addGraphAtBottom (JKQTPPlotElement *gr) |
add a new graph before all other graphs (i.e. at the top of the list of graphs), if the graph is already in the plot, it is moved to the top | |
size_t | addGraphOnTop (JKQTPPlotElement *gr) |
add a new graph at the end of the graphs, if the graph is already in the plot, it is moved to the end of the list | |
template<class TJKQTPGraphContainer > | |
void | addGraphs (const TJKQTPGraphContainer &gr, QVector< size_t > *graphIDsOut=nullptr) |
add a new graphs from a QVector<JKQTPPlotElement*>, QList<JKQTPPlotElement*>, std::vector<JKQTPPlotElement*> ... or any standard-iterateable container with JKQTPPlotElement*-items | |
void | addGridPrintingPlotter (size_t x, size_t y, JKQTPlotter *plotterOther) |
add a new plotter plotterOther for grid printing mode, at location x / y | |
JKQTBasePlotter::GraphsIterator | beginGraphs () |
returns an iterator to the first graph | |
JKQTBasePlotter::GraphsConstIterator | beginGraphs () const |
returns an iterator to the first graph | |
JKQTBasePlotter::GraphsConstIterator | cbeginGraphs () const |
returns an iterator to the first graph | |
JKQTBasePlotter::GraphsConstIterator | cendGraphs () const |
returns an iterator behind the last graph | |
void | clearAllMouseMoveActions () |
deletes all mouse-move actions | |
void | clearAllMouseWheelActions () |
deletes all mouse-wheel actions | |
void | clearAllRegisteredMouseDoubleClickActions () |
clear all registered mouse double-click actions | |
void | clearAllRegisteredMouseDragActions () |
clear all registeres mouse drag actions | |
void | clearGraphs (bool deleteGraphs=true) |
remove all plots | |
void | clearGridPrintingPlotters () |
clear all additional plotters for grid printing mode | |
bool | containsGraph (JKQTPPlotElement *gr) |
returns true , if the given graph is in this plot | |
void | copyPixelImage (bool showPreview=true) |
copy the current plot as a pixel+svg image to the clipboard | |
void | deleteGraph (JKQTPPlotElement *gr, bool deletegraph=true) |
remove the i-th graph | |
void | deleteGraph (size_t i, bool deletegraph=true) |
remove the i-th graph | |
void | deregisterMouseDoubleClickAction (Qt::MouseButton button, Qt::KeyboardModifiers modifier) |
deregisteres the mouse action action to be executed when a mouse double-click occurs with the given button and modifier | |
void | deregisterMouseDragAction (Qt::MouseButton button, Qt::KeyboardModifiers modifier) |
deregisteres the mouse drag action to be executed when a mouse drag operation is initialized with the given button and modifier | |
void | deregisterMouseMoveAction (Qt::KeyboardModifiers modifier) |
deletes all mouse-move actions registered for a given modifier | |
void | deregisterMouseWheelAction (Qt::KeyboardModifiers modifier) |
deletes all mouse-wheel actions registered for a given modifier | |
JKQTBasePlotter::GraphsIterator | endGraphs () |
returns an iterator behind the last graph | |
JKQTBasePlotter::GraphsConstIterator | endGraphs () const |
returns an iterator behind the last graph | |
void | forceInternalDatastore () |
tells the plotter object to use an internal datastore (just like useInternalDatastore() ), but forces the generation of a new datastore, even if the current one is already internal (the current one will be freed in the lather case | |
double | getAbsoluteXMax () const |
returns the absolute x-axis max of the primary x-axis This is the highest allowed value the the axis min/max. | |
double | getAbsoluteXMin () const |
returns the absolute x-axis min of the primary x-axis. This is the lowest allowed value the the axis min/max. | |
double | getAbsoluteYMax () const |
returns the absolute y-axis max of the primary y-axis This is the highest allowed value the the axis min/max. | |
double | getAbsoluteYMin () const |
returns the absolute y-axis min of the primary y-axis This is the lowest allowed value the the axis min/max. | |
QAction * | getActMouseLeftAsDefault () |
action that activates the default action, set in plotterStyle! | |
const QAction * | getActMouseLeftAsDefault () const |
action that activates the default action, set in plotterStyle! | |
QAction * | getActMouseLeftAsPanView () |
action that activates the pan view tool (override!) | |
const QAction * | getActMouseLeftAsPanView () const |
action that activates the pan view tool (override!) | |
QAction * | getActMouseLeftAsRuler () |
action that activates the ruler tool (override!) | |
const QAction * | getActMouseLeftAsRuler () const |
action that activates the ruler tool (override!) | |
QAction * | getActMouseLeftAsZoomRect () |
action that activates the zoom rectangle tool (override!) | |
const QAction * | getActMouseLeftAsZoomRect () const |
action that activates the zoom rectangle tool (override!) | |
QAction * | getActMouseMoveToolTip () |
action that activates the tooltip tool (override!) | |
const QAction * | getActMouseMoveToolTip () const |
action that activates the tooltip tool (override!) | |
const JKQTBasePlotter * | getConstplotter () const |
returns the JKQTBasePlotter object internally used for plotting | |
JKQTPContextMenuModes | getContextMenuMode () const |
returns the currently set mode for the context menu | |
const JKQTPlotterStyle & | getCurrentPlotterStyle () const |
current style properties for this JKQTPlotter | |
JKQTPDatastore * | getDatastore () |
returns a pointer to the datastore used by this object | |
const JKQTPDatastore * | getDatastore () const |
returns a pointer to the datastore used by this object | |
JKQTPPlotElement * | getGraph (size_t i) |
returns description of i'th graph | |
const JKQTPPlotElement * | getGraph (size_t i) const |
returns description of i'th graph | |
size_t | getGraphCount () |
returns the number of graphs | |
JKQTBasePlotter::GraphsList & | getGraphs () |
returns a list of all graphs | |
const JKQTBasePlotter::GraphsList & | getGraphs () const |
returns a list of all graphs | |
double | getMagnification () const |
returns the current magnification factor | |
JKQTPBaseKey * | getMainKey () |
retuns the main key object | |
const JKQTPBaseKey * | getMainKey () const |
retuns the main key object | |
int | getMaxTooltipDistance () const |
maximum distance at which a tooltip for a point is still displayed, when the user action jkqtpmdaToolTipForClosestDataPoint is executed | |
double | getMouseContextX () const |
x-position of the mouse (in plot coordinates) when a user mouse-action was started (e.g. drawing a rectangle) | |
double | getMouseContextY () const |
y-position of the mouse (in plot coordinates) when a user mouse-action was started (e.g. drawing a rectangle) | |
int | getMouseLastClickX () const |
x-position of the last mouse-click (in screen pixels) | |
int | getMouseLastClickY () const |
y-position of the last mouse-click (in screen pixels) | |
int | getNextStyle () |
gets the next unused style id, i.e. the smalles number >=0 which is not contained in usedStyles | |
JKQTBasePlotter::JKQTPPen | getPlotStyle (int i) const |
returns a QPen object for the i-th plot style | |
JKQTBasePlotter * | getPlotter () |
returns the JKQTBasePlotter object internally used for plotting | |
const JKQTBasePlotter * | getPlotter () const |
returns the JKQTBasePlotter object internally used for plotting | |
QMenu * | getSpecialContextMenu () const |
returns the currently set special context menu object | |
int | getToolbarIconSize () const |
get the width/height of the icons in the toolbar in pt | |
int | getUserActionCatchSensitivity () const |
sensitivity (i.e. max. distance to see as one point) for user actions | |
QBrush | getUserActionMarkerBrush () const |
brush for location markers of user actions on the plot | |
int | getUserActionMarkerDiameter () const |
size (diameter) of markers drawn by user actions | |
QPen | getUserActionMarkerPen () const |
pen for location markers of user actions on the plot | |
JKQTPUserActionMarkerType | getUserActionMarkerType () const |
type of the location markers of user actions on the plot | |
QBrush | getUserActionOpaqueBrush () const |
brush for user actions that cover parts of the plot (typically opaque, like e.g. tooltips) | |
QPen | getUserActionOpaquePen () const |
pen for user actions that cover parts of the plot (typically opaque, like e.g. tooltips) | |
QBrush | getUserActionOverlayBrush () const |
brush for user actions (typically semi-transparent, like e.g. zoom-rectangles) | |
QPen | getUserActionOverlayPen () const |
pen for user actions that overlay the plot (typically semi-transparent, like e.g. zoom-rectangles) | |
JKQTPHorizontalAxisBase * | getXAxis (JKQTPCoordinateAxisRef axis=JKQTPPrimaryAxis) |
returns the x-axis objet of the plot | |
const JKQTPHorizontalAxisBase * | getXAxis (JKQTPCoordinateAxisRef axis=JKQTPPrimaryAxis) const |
returns the x-axis objet of the plot | |
double | getXMax () const |
returns the current x-axis max of the primary x-axis | |
double | getXMin () const |
returns the current x-axis min of the primary x-axis | |
JKQTPVerticalAxisBase * | getYAxis (JKQTPCoordinateAxisRef axis=JKQTPPrimaryAxis) |
returns the y-axis objet of the plot | |
const JKQTPVerticalAxisBase * | getYAxis (JKQTPCoordinateAxisRef axis=JKQTPPrimaryAxis) const |
returns the y-axis objet of the plot | |
double | getYMax () const |
returns the current y-axis max of the primary y-axis | |
double | getYMin () const |
returns the current y-axis min of the primary y-axis | |
QImage | grabPixelImage (QSize size=QSize(), bool showPreview=false) |
returns a rendering of the current plot as a QImage (pixel image) with the given size | |
bool | isEmittingSignalsEnabled () const |
returns whether this class emits signals, like zoomChangedLocally() or beforePlotScalingRecaluclate() | |
bool | isMousePositionShown () const |
specifies whether to display the current position of the mouse in the top border of the plot (this may automatically extent the top border, so the position fits in. The default widget font is used for the output. | |
bool | isPlotUpdateEnabled () const |
returns, whether automatic redrawing the plot is currently activated (e.g. you can deactivate this with setPlotUpdateEnabled() while performing major updates on the plot) | |
bool | isResizeTimerRunning () const |
returns true , if the JKQTPlotter::resizeTimer is currently running and the widget is waiting for the resize-event to finish | |
bool | isToolbarAlwaysOn () const |
returns whether the toolbar is always visible or only when the mouse moves to the upper left area | |
bool | isToolbarEnabled () const |
returns whether the toolbar is enabled | |
void | loadCurrentPlotterStyle (const QSettings &settings, const QString &group="plots/", bool alsoLoadBaseStyle=true) |
replace the current style properties for this JKQTBasePlotter with properties loaded from settings | |
void | loadSettings (const QSettings &settings, const QString &group=QString("plots/")) |
loads the plot properties from a <a href="http://doc.qt.io/qt-5/qsettings.html")">QSettings object | |
QSize | minimumSizeHint () const override |
returns the minimum size of the widget | |
void | modifyGraphs (const std::function< void(JKQTPPlotElement *)> &func) |
apply functor func to all graphs in the plotter. After completing the operation, the graph is updated | |
void | moveGraphBottom (int idx) |
move the given graph gr to the bottom of all graphs | |
void | moveGraphBottom (JKQTPPlotElement *gr) |
move the given graph gr to the bottom of all graphs | |
void | moveGraphDown (int idx) |
move the given graph gr one item down (i.e. it is drawn earlier/lower in the z-stack) | |
void | moveGraphDown (JKQTPPlotElement *gr) |
move the given graph gr one item down (i.e. it is drawn earlier/lower in the z-stack) | |
void | moveGraphTop (int idx) |
move the given graph gr to the end of all graphs, so it is drawn | |
void | moveGraphTop (JKQTPPlotElement *gr) |
move the given graph gr to the end of all graphs, so it is drawn | |
void | moveGraphUp (int idx) |
move the given graph gr one item up (i.e. it is drawn later/higher in the z-stack) | |
void | moveGraphUp (JKQTPPlotElement *gr) |
move the given graph gr one item up (i.e. it is drawn later/higher in the z-stack) | |
void | registerMouseDoubleClickAction (Qt::MouseButton button, Qt::KeyboardModifiers modifier, JKQTPMouseDoubleClickActions action) |
registeres a certain mouse action action to be executed when a mouse double-click occurs with the given button and modifier | |
void | registerMouseDragAction (Qt::MouseButton button, Qt::KeyboardModifiers modifier, JKQTPMouseDragActions action) |
registeres a certain mouse drag action action to be executed when a mouse drag operation is initialized with the given button and modifier | |
void | registerMouseMoveAction (Qt::KeyboardModifiers modifier, JKQTPMouseMoveActions action) |
specifies the action to perform on a mouse move event when a given modifier is pressed | |
void | registerMouseWheelAction (Qt::KeyboardModifiers modifier, JKQTPMouseWheelActions action) |
specifies the action to perform on a mouse wheel event when a given modifier is pressed | |
void | resetMasterSynchronization (JKQTBasePlotter::SynchronizationDirection synchronizeDirection=JKQTBasePlotter::sdXYAxes) |
switches any synchronization off, that has been created by synchronizeToMaster() | |
void | saveCurrentPlotterStyle (QSettings &settings, const QString &group="plots/", bool alsoSaveBaseStyle=true) const |
store the current style properties for this JKQTBasePlotter with properties loaded from settings | |
void | saveSettings (QSettings &settings, const QString &group=QString("plots/")) const |
saves the plot properties into a <a href="http://doc.qt.io/qt-5/qsettings.html")">QSettings object. | |
void | setCurrentPlotterStyle (const JKQTPlotterStyle &style) |
replace the current style properties for this JKQTBasePlotter | |
void | setCurrentPlotterStyle (const JKQTPlotterStyle &style, const JKQTBasePlotterStyle &baseStyle) |
replace the current style properties for this JKQTBasePlotter | |
void | setEmittingSignalsEnabled (bool sig) |
specifies whether this class emits signals, like zoomChangedLocally() or beforePlotScalingRecaluclate() | |
void | setGridPrinting (bool enabled) |
enables grid-printing for this plot | |
void | setGridPrintingCurrentPos (size_t x, size_t y) |
set the x- and y-positions of this JKQTPlotter in the grid-printing grid | |
void | setGridPrintingCurrentX (size_t x) |
set the x-position of this JKQTPlotter in the grid-printing grid | |
void | setGridPrintingCurrentY (size_t y) |
set the y-position of this JKQTPlotter in the grid-printing grid | |
void | setPlotUpdateEnabled (bool enable) |
sets whether automatic redrawing the plot is currently activated (e.g. you can sett his to false while performing major updates on the plot) | |
void | setSpecialContextMenu (QMenu *menu) |
sets a QMenu object to be used as special context menu | |
void | setToolbarIconSize (int value) |
set the width/height of the icons in the toolbar in pt | |
QSize | sizeHint () const override |
returns the size of the widget | |
void | sortGraphs (const std::function< bool(const JKQTPPlotElement *, const JKQTPPlotElement *)> &compareLess) |
sort the graphs, using functor compareLess to find whether a first graph shall be before (i.e. less) than a second graph. After completing the operation, the graph is updated | |
void | synchronizeToMaster (JKQTPlotter *master, JKQTBasePlotter::SynchronizationDirection synchronizeDirection, bool synchronizeAxisLength=true, bool synchronizeZoomingMasterToSlave=true, bool synchronizeZoomingSlaveToMaster=true) |
synchronize the plot borders (and zooming) with a given plotter (master --> slave/this) | |
void | synchronizeXToMaster (JKQTPlotter *master, bool synchronizeAxisLength=true, bool synchronizeZoomingMasterToSlave=true, bool synchronizeZoomingSlaveToMaster=true) |
synchronize the plot x-axis width (and x-zooming) with a given master plotter (master --> slave/this) | |
void | synchronizeYToMaster (JKQTPlotter *master, bool synchronizeAxisLength=true, bool synchronizeZoomingMasterToSlave=true, bool synchronizeZoomingSlaveToMaster=true) |
synchronize the plot y-axis height (and y-zooming) with a given master plotter (master --> slave/this) | |
void | updateToolbarActions () |
void | useAsInternalDatastore (JKQTPDatastore *newStore) |
tells the plotter object to use the given external datastore and treat it as an internal one (i.e. free it when the plotter object ist destroyed. | |
void | useExternalDatastore (JKQTPDatastore *newStore) |
tells the plotter object to use the given external datastore. | |
void | useInternalDatastore () |
tells the plotter object to use an internal datastore. A new internal datastore object is generated only if the current datastore is not internal. | |
Static Public Member Functions | |
static int | getGlobalResizeDelay () |
returns the currently set global resize delay in milliseconds delayMS. This function is thread-safe! | |
static void | setGlobalResizeDelay (int delayMS) |
sets the global resize delay in milliseconds delayMS. After calling this function all plots will use the new delay. Setting the the delay to 0 disables the delayed resize feature. This function is thread-safe! | |
Protected Types | |
typedef QPixmap | InternalBufferImageType |
enum class | WheelActionType { Zoom , Pan , None } |
Protected Slots | |
void | delayedResizeEvent () |
while the window is resized, the plot is only redrawn after a restartable delay, implemented by this function and resizeTimer | |
void | intBeforePlotScalingRecalculate () |
emitted before the plot scaling has been recalculated | |
void | masterPlotScalingRecalculated () |
connected to plotScalingRecalculated() of the masterPlotter | |
void | pzoomChangedLocally (double newxmin, double newxmax, double newymin, double newymax, JKQTBasePlotter *sender) |
called whenever the zoom changes in plotter | |
void | reactGraphVisible (bool visible) |
called from a menu entry that encodes the graph ID | |
void | resetMouseLeftAction () |
resets any previously set override action for the left mouse-button, un-modified | |
void | setMouseLeftActionAsPanView () |
action that activates the pan viewport tool | |
void | setMouseLeftActionAsRuler () |
action that activates the ruler tool | |
void | setMouseLeftActionAsZoomRect () |
action that activates the zoom rectangle tool | |
void | setMouseLeftDragActionAsToolTip () |
action that activates the tooltip tool, when dragging the mouse with the left button pressed | |
void | setMouseMoveActionAsToolTip (bool enabled) |
action that (de)activates the tooltip tool, when moving the mouse without any button pressed | |
Protected Member Functions | |
void | correctZoomRectForPanning (QRectF &rect) const |
tool function, which corrects the given rectangle (in pixels!) during a panning action. The correction is necesary towards getAbsoluteXY() to prevent an unwanted zooming in. | |
InternalBufferImageType | createImageBuffer () const |
constructs a new image for the internal double-buffering | |
virtual bool | event (QEvent *event) override |
void | fillInternalStructForToolTipOfClosestDataPoint (double x0, double y0, bool emitEvent=true) |
fills the inertnal mouseDragMarkers structure with data to display tooltips close to (x0, y0) | |
JKQTPMouseDoubleClickActionsHashMapIterator | findMatchingMouseDoubleClickAction (Qt::MouseButton button, Qt::KeyboardModifiers modifiers, bool *found=nullptr) const |
searches JKQTPlotterStyle::registeredMouseDoubleClickActions for a matching action | |
JKQTPMouseDragActionsHashMapIterator | findMatchingMouseDragAction (Qt::MouseButton button, Qt::KeyboardModifiers modifiers, bool *found=nullptr) const |
searches JKQTPlotterStyle::registeredMouseActionModes for a matching action, returns in found whether an action was found | |
JKQTPMouseMoveActionsHashMapIterator | findMatchingMouseMoveAction (Qt::KeyboardModifiers modifiers, bool *found=nullptr) const |
searches JKQTPlotterStyle::registeredMouseMoveActions for a matching action | |
JKQTPMouseWheelActionsHashMapIterator | findMatchingMouseWheelAction (Qt::KeyboardModifiers modifiers, bool *found=nullptr) const |
searches JKQTPlotterStyle::registeredMouseWheelActions for a matching action | |
void | fixBasePlotterSettings () |
modifies the settings of plotter to match those of this object | |
QSize | getImageBufferSize (float *scale_out=nullptr) const |
returns the required size of an image for the internal double-buffering | |
int | getPlotYOffset () const |
calculate the y-axis shift of the plot, so there is space for the potentially displayed mouse position label | |
void | initContextMenu () |
fills the member contextMenu with all default and additionally registered actions, also calls modifyContextMenu() | |
void | keyReleaseEvent (QKeyEvent *event) override |
react on key presses. | |
void | leaveEvent (QEvent *event) override |
called, when the mouse leaves the widget, hides the toolbar (if visible) | |
void | modifyContextMenu (QMenu *menu) |
you may overwrite this method to modify the given context menu before it is displayed. | |
void | mouseDoubleClickEvent (QMouseEvent *event) override |
event handler for a double click | |
void | mouseMoveEvent (QMouseEvent *event) override |
event handler for a mouse move | |
void | mousePressEvent (QMouseEvent *event) override |
event handler for a mouse down event | |
void | mouseReleaseEvent (QMouseEvent *event) override |
event handler for a mouse release event | |
void | paintEvent (QPaintEvent *event) override |
this simply paints the stored image to the widget's surface | |
void | paintUserAction () |
paint the user action (rectangle, ellipse, ... | |
void | resetContextMenu (bool createnew=true) |
destroys the internal contextMenu and optionally creates a new one | |
void | resetCurrentMouseDragAction () |
resets the currently activated mouse drag action, e.g. called by mouseReleaseEvent() | |
void | resetOverrideMouseDragAction (Qt::MouseButton button, Qt::KeyboardModifiers modifiers) |
removes a previously set override mouse drag action for the given button/modifiers combination | |
void | resizeEvent (QResizeEvent *event) override |
resizes the internal representation (image) of the graphs | |
void | setOverrideMouseDragAction (Qt::MouseButton button, Qt::KeyboardModifiers modifiers, JKQTPMouseDragActions action) |
sets an override mouse drag action for the given button/modifiers combination | |
void | updateCursor () |
set the current mouse cursor shappe according to currentMouseDragAction | |
void | updateToolbar () |
update settings of the toolbar | |
void | wheelEvent (QWheelEvent *event) override |
event handler for a turn of the mouse wheel | |
Protected Attributes | |
QActionGroup * | actgrpMouseLeft |
action group, that groups the actMouseLeft... actions | |
QAction * | actMouseLeftAsDefault |
action that activates the default action, set in plotterStyle! | |
QAction * | actMouseLeftAsPanView |
action that activates the pan view tool (override!) | |
QAction * | actMouseLeftAsRuler |
action that activates the ruler tool (override!) | |
QAction * | actMouseLeftAsZoomRect |
action that activates the zoom rectangle tool (override!) | |
QAction * | actMouseMoveToolTip |
action that activates the tooltip tool (override!) | |
QMenu * | contextMenu |
the context menu object used by this JKQTPlotter | |
JKQTPContextMenuModes | contextMenuMode |
current mode for the default context menu (i.e. the right-click context menu) | |
QList< QMenu * > | contextSubMenus |
internal storage for sub-menu entries of the internal contextMenu object, based on the actions returned by JKQTBasePlotter::getLstAdditionalPlotterActions() | |
MouseDragAction | currentMouseDragAction |
the currently executed MouseDragAction | |
QSet< JKQTPMouseMoveActions > | currentMouseMoveAction |
the currently executed MouseMoveActions | |
bool | doDrawing |
indicates whether the plot is updated automatically at the moment | |
InternalBufferImageType | image |
this stores the currently displayed plot | |
quint64 | lastWheelActionTimestamp |
storage for timestammp of the last QWheelEvent (used in wheelAction() to distinguish trackpad-pan ations in mode jkqtpmwaZoomByWheelAndTrackpadPan) | |
WheelActionType | lastWheelActionType |
storage for last WheelActionType (used in wheelAction() to distinguish trackpad-pan ations in mode jkqtpmwaZoomByWheelAndTrackpadPan) | |
double | magnification |
magnification factor for the display of the plot | |
QPointer< JKQTPlotter > | masterPlotterX |
the master plotter, this plotter is connected to in x-direction. | |
QPointer< JKQTPlotter > | masterPlotterY |
the master plotter, this plotter is connected to in y-direction. | |
const quint64 | maxWheelEventSeriesTimestampDifference |
max. time between two QWheelEvents that are recognized as one series | |
QMenu * | menuSpecialContextMenu |
use this QMenu instance instead of the standard context menu of this widget | |
QSize | minSize |
current minimal size of the JKQTPlotter widget to properly display the plot | |
double | mouseContextX |
x-position of the mouse (in plot coordinates) when a user mouse-action was started (e.g. drawing a rectangle) | |
double | mouseContextY |
y-position of the mouse (in plot coordinates) when a user mouse-action was started (e.g. drawing a rectangle) | |
bool | mouseDragingRectangle |
this is set true if we are drawing a zoom rectangle | |
QList< MouseDragMarker > | mouseDragMarkers |
internal list of markers to be drawn by paintUserAction() | |
double | mouseDragRectXEnd |
when draging the mouse this contains the x-coordinate the mouse is currently pointing to | |
int | mouseDragRectXEndPixel |
when draging the mouse this contains the x-coordinate the mouse is currently pointing to (in pixels) | |
double | mouseDragRectXStart |
when draging the mouse this contains the x-coordinate the user clicked on (in plot coordinates) | |
int | mouseDragRectXStartPixel |
when draging the mouse this contains the x-coordinate the user clicked on (in pixels) | |
double | mouseDragRectYEnd |
when zooming by moving the mouse this contains the y-coordinate the mouse is currently pointing to | |
int | mouseDragRectYEndPixel |
when draging the mouse this contains the y-coordinate the mouse is currently pointing to (in pixels) | |
double | mouseDragRectYStart |
when draging the mouse this contains the y-coordinate the user clicked on (in plot coordinates) | |
int | mouseDragRectYStartPixel |
when zooming by moving the mouse this contains the y-coordinate the user clicked on (in pixels) | |
int | mouseLastClickX |
x-position of the last mouse-click (in screen pixels) | |
int | mouseLastClickY |
y-position of the last mouse-click (in screen pixels) | |
double | mousePosX |
x-position of the mouse during the last mouseMoveEvent() calls (in plot coordinates) | |
double | mousePosY |
y-position of the mouse during the last mouseMoveEvent() calls (in plot coordinates) | |
InternalBufferImageType | oldImage |
this can be used when drawing a zoom rectangle to store an unchanged copy of the currently displayed image. | |
JKQTBasePlotter * | plotter |
JKQTBasePlotter used to plot. | |
JKQTPlotterStyle | plotterStyle |
current style properties for this JKQTPlotter | |
JKQTPMouseDragActionsHashMap | registeredOverrideMouseDragActionModes |
list of override mouse drag action modes, that override the settings ing plotterStyle.registeredMouseDragActionModes | |
QTimer | resizeTimer |
timer used while the graph is resized to delay the redrawing with new size (in the meantime, an intermediate graphic is displayed) | |
JKVanishQToolBar * | toolbar |
toolbar class used for user input | |
Static Protected Attributes | |
static std::atomic< int > | jkqtp_RESIZE_DELAY |
delay for resizing in milliseconds. If set to 0, resize delay is disabled and resizeTimer is unused. | |
plotter widget for scientific plots (uses JKQTBasePlotter to do the actual drawing)
This class is a QWidget-wrapper around JKQTBasePlotter. It uses the tools from JKQTBasePlotter to display scientific plots. This class mostly adds the Widget for the output and adds different types of user interactions.
Please have a look at the documentation of JKQTBasePlotter for details on the management of graphs and the formating/styling of the plot and graphs!
The rest of this documentation ins split into sections that each treat a special topic, as outlines below:
JKQTPlotter is a plotter widget which wraps around a JKQTBasePlotter instanced that does the actual drawing. A basic usage of JKQTPlotter looks like this:
The result should look something like this:
Starting from this basic example, you can observe several important principles:
double
values). Often a single plot is not sufficient, but several plots need to be aligned with respect to each other:
In the Qt Window this is achieved by placing several JKQTPlotter objects into a QGridLayout. In order to support this alignment, also when exporting/printing a plot, and when the user interactions with the plot (e.g. zooming), JKQTPlotter offers an API which allows to :
JKQTPlotter offers a lot of user-interaction features out of the box. These are detailed below.
The class JKQTPlotter has a context menu that already offers a lot of functionality.
It allows to:
copy or save the plot to an image file (PNG, PDF, ...), includes a softisticated export-preview dialog:
print the plot (includes a softisticated print-preview dialog):
open a dialog with a table of the plot data:
You can activate this menu, by setting setContextMenuMode(jkqtpcmmStandardContextMenu)
; and binding a mouse-action (typically the right-click) to the context menu by calling deregisterMouseDragAction(Qt::RightButton,Qt::NoModifier)
which deregisters any user actions from the rhs single mouse click. In that case, the context menu is opened by default (see setContextMenuMode() to choose the mode of the context menu).
In addition JKQTPlotter provides several ways to customize this menu:
JKQTPlotter::addAction()
(i.e. using the default Qt mechanism) and/or by adding actions to the internal JKQTBasePlotter, using JKQTBasePlotter::registerAdditionalAction()
JKQTPlotter::contextMenuOPened(x,y,menu)
: In addition to the standard context menu, JKQTPlotter can also be configures to display a special, user-defined context menu. To do so, call `setContextMenuMode(jkqtpcmmSpecialContextMenu)
and set your menu, by calling setSpecialContextMenu()
You can also combine the special menu and the standard menu, by calling setContextMenuMode(jkqtpcmmStandardAndSpecialContextMenu)
.
You can also use the signal contextMenuOpened() to modify the special context menu, but note that alterations to this menu are permanently stored in the special menu object. See contextMenuOpened() for a detailed discussion and ways to circumvent this!
In addition to the context-menu, a JKQtPlotter also also provides a toolbar at its top that offers most of the functionality of the context menu. Usually this toolbar is enabled (see toolbarEnabled) and is in a mode where it is hidden, until the mouse moves over an area at the top of the plot (see toolbarAlwaysOn):
If toolbarAlwaysOn is set to true
(setToolbarAlwaysOn() ), the toolbar is always displayed:
Often you want to allow the suer to operate a plot from a user-defined QToolBar or a QMenu/QMenuBar in your application (e.g. provide zooming commands ...). there are generally two ways to achieve this:
getPlotter()->getActionPrint()
This section summarizes all user-interaction functions in JKQTPlotter that somehow relate to the mouse. These are:
JKQTPlotter offers several methods that allow to customize, how it reacts to mouse actions:
Pressing the ESC
key will stop the current JKQTPlotter::MouseActionMode.
If e.g. the mode JKQTPlotter::MouseActionMode::jkqtpmdaZoomByRectangle is selected, while you drag the mouse, the zoom rectangle is drawn over the plot. You can modify the style of drawing using these functions:
The right mouse button has a special role: If it is single-clicked and no JKQTPlotter::MouseActionMode is specified for the vent, it opens the context menu, unless you call setContextMenuMode(jkqtpcmmNoContextMenu)
. You can also use setContextMenuMode() to specify which type of context menu is shown. See JKQTPContextMenuModes for details on the available modes.
For any mouse-click, one of the following signals is emitted:
The reaction to double-clicks of the mouse buttons can be specified separately. The possible actions are listed in JKQTPMouseDoubleClickActions. You can bind one of these actions to a specific click with these functions:
The button to react to is specified as a parameter.
The actions to be performed when the mouse wheel is operated are specified in JKQTPMouseWheelActions. You can bind one of these actions to the mouse-wheel (under the condition that a specified Qt::KeyboardModifiers is pressed) by using these functions:
In addition the signal void plotMouseWheelOperated() is emitted whenever a mouse-wheel event occurs.
In addition the signal plotMouseMove() is called whenever the mouse moves over the plot. Additional signals may be emitted, depending on the currently active JKQTPlotter::MouseActionMode.
Also the current mouse position is shown above the graph by default (can be switched on or off using setMousePositionShown() ).
The actions to be performed when the mouse moves without a mouse-button pressed are specified in JKQTPMouseMoveActions. You can bind one of these actions to the mouse (under the condition that a specified Qt::KeyboardModifiers is pressed) by using these functions:
When the user resized the widget, the graph would in principle have to be readrawn for every intermediate step. As this is very timeconsuming, JKQTPlotter uses a different approach: Actual Redrawing is delayed a few 100ms and this delay is reset whenever the widget size changes. Only after the last delay expires, the plot is redrawn. In between an image of the last state of the plot is simple stretched/compressed to fill the new/current widget size. In sum this looks like this:
As JKQTPlotter is a standard Qt widget, you can also use it in Qt UI-files designed with the Qt From Designer (e.g. from within QTCreator). For this to work you have to use the Promote QWidget"-feature of the form designer. The steps you need to take are detailed below:
add a new UI-file to your project and open it in the Form Editor. Then right-click the form and select Promote Widgets ...
:
In the dialog that opens, you have to define JKQTPlotter
as a promotion to QWidget
as shown below. Finally store the settings by clicking Add
and closing the dialog with Close
.
Now you can add a QWidget
from the side-bar to the form and then promote it to JKQTPlotter
, by selecting and right-clicking the QWidget
and then selecting Promote To | JKQTPlotter
:
|
protected |
|
strongprotected |
|
explicit |
class constructor
If datastore_internal ==false
, you can supply an external JKQTPDatastore with the parameter datast
|
explicit |
class constructor for a JKQTPlotter using an external JKQTPDatastore dataset
|
explicit |
class constructor
generated a new internal JKQTPDatastore
|
virtual |
class destructor
|
inline |
|
inline |
add a new graph before all other graphs (i.e. at the top of the list of graphs), if the graph is already in the plot, it is moved to the top
gr | graph object (of type JKQTPPlotElement) to be added. Note: The JKQTPlotter takes ownership of graph gr . |
|
inline |
add a new graph at the end of the graphs, if the graph is already in the plot, it is moved to the end of the list
gr | graph object (of type JKQTPPlotElement) to be added. Note: The JKQTPlotter takes ownership of graph gr . |
|
inline |
add a new graphs from a QVector<JKQTPPlotElement*>, QList<JKQTPPlotElement*>, std::vector<JKQTPPlotElement*> ... or any standard-iterateable container with JKQTPPlotElement*-items
TJKQTPGraphContainer | a container type with default C++-sytle iterator interface (i.e. methods begin() and end() and an iterator, which may be moved to the next element with the operator ++ . |
gr | Container of type TJKQTPGraphContainer, which contains the graphs Note: The JKQTPlotter takes ownership of graphs in gr . | |
[out] | graphIDsOut | optional output parameter, the vector will contain the IDs of each graph added to theis plot |
void JKQTPlotter::addGridPrintingPlotter | ( | size_t | x, |
size_t | y, | ||
JKQTPlotter * | plotterOther | ||
) |
add a new plotter plotterOther for grid printing mode, at location x / y
|
signal |
emitted before the plot scaling has been recalculated
|
inline |
returns an iterator to the first graph
|
inline |
returns an iterator to the first graph
|
inline |
returns an iterator to the first graph
|
inline |
returns an iterator behind the last graph
void JKQTPlotter::clearAllMouseMoveActions | ( | ) |
deletes all mouse-move actions
void JKQTPlotter::clearAllMouseWheelActions | ( | ) |
deletes all mouse-wheel actions
void JKQTPlotter::clearAllRegisteredMouseDoubleClickActions | ( | ) |
clear all registered mouse double-click actions
void JKQTPlotter::clearAllRegisteredMouseDragActions | ( | ) |
clear all registeres mouse drag actions
|
inline |
remove all plots
deleteGraphs | if set true (default) the graph objects will also be deleted |
void JKQTPlotter::clearGridPrintingPlotters | ( | ) |
clear all additional plotters for grid printing mode
|
inline |
returns true
, if the given graph is in this plot
|
signal |
emitted whenever a context menu is opened. You can modify the menu via the parameter contextMenu!
x | x-position of the context-menu (in plot coordinates) |
y | y-position of the context-menu (in plot coordinates) |
contextMenu | QMenu-object of the context menu. This object may be altered to display additional items ... Here is an example: contextMenu->addSeparator();
QAction* act=contextMenu->addMenu(QString("contextMenuOpened(x=%1, y=%2)").arg(x).arg(y))->addAction("user-added action");
connect(act, &QAction::triggered, [x,y]() { QMessageBox::warning(nullptr, tr("Plot Context Menu"),
tr("Context Menu was opened at x/y=%1/%2!").arg(x).arg(y),
QMessageBox::Ok,
QMessageBox::Ok); });
|
|
inlineslot |
copy the data used for the current plot to the clipboard
copies data as tab separated data with the system-decimal point.
|
inlineslot |
copy the data used for the current plot to the clipboard as a Matlab script
example output:
|
inline |
copy the current plot as a pixel+svg image to the clipboard
|
protected |
tool function, which corrects the given rectangle (in pixels!) during a panning action. The correction is necesary towards getAbsoluteXY() to prevent an unwanted zooming in.
|
protected |
constructs a new image for the internal double-buffering
|
protectedslot |
while the window is resized, the plot is only redrawn after a restartable delay, implemented by this function and resizeTimer
|
inline |
remove the i-th graph
|
inline |
remove the i-th graph
void JKQTPlotter::deregisterMouseDoubleClickAction | ( | Qt::MouseButton | button, |
Qt::KeyboardModifiers | modifier | ||
) |
deregisteres the mouse action action to be executed when a mouse double-click occurs with the given button and modifier
void JKQTPlotter::deregisterMouseDragAction | ( | Qt::MouseButton | button, |
Qt::KeyboardModifiers | modifier | ||
) |
deregisteres the mouse drag action to be executed when a mouse drag operation is initialized with the given button and modifier
void JKQTPlotter::deregisterMouseMoveAction | ( | Qt::KeyboardModifiers | modifier | ) |
deletes all mouse-move actions registered for a given modifier
void JKQTPlotter::deregisterMouseWheelAction | ( | Qt::KeyboardModifiers | modifier | ) |
deletes all mouse-wheel actions registered for a given modifier
|
inline |
returns an iterator behind the last graph
|
inline |
returns an iterator behind the last graph
|
overrideprotectedvirtual |
|
protected |
fills the inertnal mouseDragMarkers structure with data to display tooltips close to (x0, y0)
if emitEvent is true
, the signal is emitted before the function returns
|
protected |
searches JKQTPlotterStyle::registeredMouseDoubleClickActions for a matching action
|
protected |
searches JKQTPlotterStyle::registeredMouseActionModes for a matching action, returns in found whether an action was found
|
protected |
searches JKQTPlotterStyle::registeredMouseMoveActions for a matching action
|
protected |
searches JKQTPlotterStyle::registeredMouseWheelActions for a matching action
|
protected |
modifies the settings of plotter to match those of this object
|
inline |
tells the plotter object to use an internal datastore (just like useInternalDatastore() ), but forces the generation of a new datastore, even if the current one is already internal (the current one will be freed in the lather case
|
inline |
returns the absolute x-axis max of the primary x-axis This is the highest allowed value the the axis min/max.
|
inline |
returns the absolute x-axis min of the primary x-axis. This is the lowest allowed value the the axis min/max.
|
inline |
returns the absolute y-axis max of the primary y-axis This is the highest allowed value the the axis min/max.
|
inline |
returns the absolute y-axis min of the primary y-axis This is the lowest allowed value the the axis min/max.
QAction * JKQTPlotter::getActMouseLeftAsDefault | ( | ) |
action that activates the default action, set in plotterStyle!
const QAction * JKQTPlotter::getActMouseLeftAsDefault | ( | ) | const |
action that activates the default action, set in plotterStyle!
QAction * JKQTPlotter::getActMouseLeftAsPanView | ( | ) |
action that activates the pan view tool (override!)
const QAction * JKQTPlotter::getActMouseLeftAsPanView | ( | ) | const |
action that activates the pan view tool (override!)
QAction * JKQTPlotter::getActMouseLeftAsRuler | ( | ) |
action that activates the ruler tool (override!)
const QAction * JKQTPlotter::getActMouseLeftAsRuler | ( | ) | const |
action that activates the ruler tool (override!)
QAction * JKQTPlotter::getActMouseLeftAsZoomRect | ( | ) |
action that activates the zoom rectangle tool (override!)
const QAction * JKQTPlotter::getActMouseLeftAsZoomRect | ( | ) | const |
action that activates the zoom rectangle tool (override!)
QAction * JKQTPlotter::getActMouseMoveToolTip | ( | ) |
action that activates the tooltip tool (override!)
const QAction * JKQTPlotter::getActMouseMoveToolTip | ( | ) | const |
action that activates the tooltip tool (override!)
|
inline |
returns the JKQTBasePlotter object internally used for plotting
JKQTPContextMenuModes JKQTPlotter::getContextMenuMode | ( | ) | const |
returns the currently set mode for the context menu
const JKQTPlotterStyle & JKQTPlotter::getCurrentPlotterStyle | ( | ) | const |
current style properties for this JKQTPlotter
|
inline |
returns a pointer to the datastore used by this object
|
inline |
returns a pointer to the datastore used by this object
|
static |
returns the currently set global resize delay in milliseconds delayMS. This function is thread-safe!
|
inline |
returns description of i'th graph
|
inline |
returns description of i'th graph
|
inline |
returns the number of graphs
|
inline |
returns a list of all graphs
|
inline |
returns a list of all graphs
|
protected |
returns the required size of an image for the internal double-buffering
|
inline |
returns the current magnification factor
|
inline |
retuns the main key object
|
inline |
retuns the main key object
int JKQTPlotter::getMaxTooltipDistance | ( | ) | const |
maximum distance at which a tooltip for a point is still displayed, when the user action jkqtpmdaToolTipForClosestDataPoint is executed
double JKQTPlotter::getMouseContextX | ( | ) | const |
x-position of the mouse (in plot coordinates) when a user mouse-action was started (e.g. drawing a rectangle)
double JKQTPlotter::getMouseContextY | ( | ) | const |
y-position of the mouse (in plot coordinates) when a user mouse-action was started (e.g. drawing a rectangle)
int JKQTPlotter::getMouseLastClickX | ( | ) | const |
x-position of the last mouse-click (in screen pixels)
int JKQTPlotter::getMouseLastClickY | ( | ) | const |
y-position of the last mouse-click (in screen pixels)
|
inline |
gets the next unused style id, i.e. the smalles number >=0 which is not contained in usedStyles
|
inline |
returns a QPen object for the i-th plot style
|
inline |
returns the JKQTBasePlotter object internally used for plotting
|
inline |
returns the JKQTBasePlotter object internally used for plotting
|
protected |
calculate the y-axis shift of the plot, so there is space for the potentially displayed mouse position label
QMenu * JKQTPlotter::getSpecialContextMenu | ( | ) | const |
returns the currently set special context menu object
int JKQTPlotter::getToolbarIconSize | ( | ) | const |
get the width/height of the icons in the toolbar in pt
int JKQTPlotter::getUserActionCatchSensitivity | ( | ) | const |
sensitivity (i.e. max. distance to see as one point) for user actions
QBrush JKQTPlotter::getUserActionMarkerBrush | ( | ) | const |
brush for location markers of user actions on the plot
int JKQTPlotter::getUserActionMarkerDiameter | ( | ) | const |
size (diameter) of markers drawn by user actions
QPen JKQTPlotter::getUserActionMarkerPen | ( | ) | const |
pen for location markers of user actions on the plot
JKQTPUserActionMarkerType JKQTPlotter::getUserActionMarkerType | ( | ) | const |
type of the location markers of user actions on the plot
QBrush JKQTPlotter::getUserActionOpaqueBrush | ( | ) | const |
brush for user actions that cover parts of the plot (typically opaque, like e.g. tooltips)
QPen JKQTPlotter::getUserActionOpaquePen | ( | ) | const |
pen for user actions that cover parts of the plot (typically opaque, like e.g. tooltips)
QBrush JKQTPlotter::getUserActionOverlayBrush | ( | ) | const |
brush for user actions (typically semi-transparent, like e.g. zoom-rectangles)
QPen JKQTPlotter::getUserActionOverlayPen | ( | ) | const |
pen for user actions that overlay the plot (typically semi-transparent, like e.g. zoom-rectangles)
|
inline |
returns the x-axis objet of the plot
|
inline |
returns the x-axis objet of the plot
|
inline |
returns the current x-axis max of the primary x-axis
|
inline |
returns the current x-axis min of the primary x-axis
|
inline |
returns the y-axis objet of the plot
|
inline |
returns the y-axis objet of the plot
|
inline |
returns the current y-axis max of the primary y-axis
|
inline |
returns the current y-axis min of the primary y-axis
|
inline |
returns a rendering of the current plot as a QImage (pixel image) with the given size
|
protected |
fills the member contextMenu with all default and additionally registered actions, also calls modifyContextMenu()
|
protectedslot |
emitted before the plot scaling has been recalculated
|
inline |
returns whether this class emits signals, like zoomChangedLocally() or beforePlotScalingRecaluclate()
bool JKQTPlotter::isMousePositionShown | ( | ) | const |
specifies whether to display the current position of the mouse in the top border of the plot (this may automatically extent the top border, so the position fits in. The default widget font is used for the output.
bool JKQTPlotter::isPlotUpdateEnabled | ( | ) | const |
returns, whether automatic redrawing the plot is currently activated (e.g. you can deactivate this with setPlotUpdateEnabled() while performing major updates on the plot)
bool JKQTPlotter::isResizeTimerRunning | ( | ) | const |
returns true
, if the JKQTPlotter::resizeTimer is currently running and the widget is waiting for the resize-event to finish
bool JKQTPlotter::isToolbarAlwaysOn | ( | ) | const |
returns whether the toolbar is always visible or only when the mouse moves to the upper left area
If toolbarAlwaysOn is set to true:
If toolbarAlwaysOn is set to false
, the toolbar only appears when the mouse is in the right location:
bool JKQTPlotter::isToolbarEnabled | ( | ) | const |
returns whether the toolbar is enabled
|
overrideprotected |
react on key presses.
These shortcuts are defined:
|
overrideprotected |
called, when the mouse leaves the widget, hides the toolbar (if visible)
void JKQTPlotter::loadCurrentPlotterStyle | ( | const QSettings & | settings, |
const QString & | group = "plots/" , |
||
bool | alsoLoadBaseStyle = true |
||
) |
replace the current style properties for this JKQTBasePlotter with properties loaded from settings
settings | the QSettings object to read from |
group | group in settings to read from |
alsoLoadBaseStyle | if true , then also JKQTBasePlotter::loadCurrentPlotterStyle() of the internal JKQTBasePlotter is called |
void JKQTPlotter::loadSettings | ( | const QSettings & | settings, |
const QString & | group = QString("plots/") |
||
) |
loads the plot properties from a <a href="http://doc.qt.io/qt-5/qsettings.html")">QSettings object
|
protectedslot |
connected to plotScalingRecalculated() of the masterPlotter
|
override |
returns the minimum size of the widget
|
protected |
you may overwrite this method to modify the given context menu before it is displayed.
The plotter will fill the menu with the default items and then call this method. The default implementation does NOTHING.
|
inline |
apply functor func to all graphs in the plotter. After completing the operation, the graph is updated
|
overrideprotected |
event handler for a double click
|
overrideprotected |
event handler for a mouse move
This implements two behaviours:
true
, stores the current mouse position in mousePosX, mousePosY
|
overrideprotected |
event handler for a mouse down event
This event determines the action to be performed from registeredMouseActionModes and then sets currentMouseDragAction accordingly and starts the mouse action.
|
overrideprotected |
event handler for a mouse release event
this finishes the action, started by mousePressEvent()
|
inline |
move the given graph gr to the bottom of all graphs
|
inline |
move the given graph gr to the bottom of all graphs
|
inline |
move the given graph gr one item down (i.e. it is drawn earlier/lower in the z-stack)
|
inline |
move the given graph gr one item down (i.e. it is drawn earlier/lower in the z-stack)
|
inline |
move the given graph gr to the end of all graphs, so it is drawn
|
inline |
move the given graph gr to the end of all graphs, so it is drawn
|
inline |
move the given graph gr one item up (i.e. it is drawn later/higher in the z-stack)
|
inline |
move the given graph gr one item up (i.e. it is drawn later/higher in the z-stack)
|
slot |
open the context menu at the mouse position of the last click
|
slot |
open the context menu at the mouse position x and y
|
slot |
open the special context menu at the mouse position of the last click
|
slot |
open the special context menu at the mouse position x and y
|
slot |
open the standard context menu with the special context menu integrated at the mouse position of the last click
|
slot |
open the standard context menu with the special context menu integrated at the mouse position x and y
|
slot |
open the standard context menu at the mouse position of the last click
|
slot |
open the standard context menu at the mouse position x and y
|
overrideprotected |
this simply paints the stored image to the widget's surface
|
protected |
paint the user action (rectangle, ellipse, ...
|
signal |
emitted when a single-click event from the mouse occurs inside the plot
x | x-position of the mouse (in plot coordinates) |
y | y-position of the mouse (in plot coordinates) |
modifiers | key-modifiers when the click occured |
button | mouse-button that was used for the click |
|
signal |
emitted when a double-click event from the mouse occurs inside the plot
x | x-position of the mouse (in plot coordinates) |
y | y-position of the mouse (in plot coordinates) |
modifiers | key-modifiers when the click occured |
button | mouse-button that was used for the click |
|
signal |
emitted whenever the mouse moves
x | x-position of the mouse (in plot coordinates) |
y | y-position of the mouse (in plot coordinates) |
|
signal |
emitted when a single-click event from the mouse occurs inside the plot
x | x-position of the mouse (in plot coordinates) |
y | y-position of the mouse (in plot coordinates) |
modifiers | key-modifiers when the click occured |
deltaAngleX | amount of rotation (in eighths of a degree) of the wheel in x-direction |
deltaAngleY | amount of rotation (in eighths of a degree) of the wheel in y-direction |
|
signal |
emitted when the mouse action jkqtpmdaZoomByRectangle and the drawing of the new zoom rectangle is finished (=mouse key released)
mouseDragRectXStart | start of the selected x-range (in plot coordinates) |
mouseDragRectXEnd | end of the selected x-range (in plot coordinates) |
mouseDragRectYStart | start of the selected x-range (in plot coordinates) |
mouseDragRectYEnd | end of the selected x-range (in plot coordinates) |
modifiers | key-modifiers when the click occured |
|
signal |
emitted when the plot scaling has been recalculated
|
slot |
popuplate the given toolbar toolbar with all actions shown in a toolbar from this class ...
This function can be used to populate an external toolbar with actions for this JKQTPlotter.
|
inlineslot |
print the current plot, if printer is nullptr
a printer selection dialog is displayed
|
protectedslot |
called whenever the zoom changes in plotter
|
protectedslot |
called from a menu entry that encodes the graph ID
|
slot |
update the plot and the overlays
void JKQTPlotter::registerMouseDoubleClickAction | ( | Qt::MouseButton | button, |
Qt::KeyboardModifiers | modifier, | ||
JKQTPMouseDoubleClickActions | action | ||
) |
registeres a certain mouse action action to be executed when a mouse double-click occurs with the given button and modifier
void JKQTPlotter::registerMouseDragAction | ( | Qt::MouseButton | button, |
Qt::KeyboardModifiers | modifier, | ||
JKQTPMouseDragActions | action | ||
) |
registeres a certain mouse drag action action to be executed when a mouse drag operation is initialized with the given button and modifier
void JKQTPlotter::registerMouseMoveAction | ( | Qt::KeyboardModifiers | modifier, |
JKQTPMouseMoveActions | action | ||
) |
specifies the action to perform on a mouse move event when a given modifier is pressed
void JKQTPlotter::registerMouseWheelAction | ( | Qt::KeyboardModifiers | modifier, |
JKQTPMouseWheelActions | action | ||
) |
specifies the action to perform on a mouse wheel event when a given modifier is pressed
|
protected |
destroys the internal contextMenu and optionally creates a new one
createnew | if ==true , contextMenu is reinitialized with a (shiny) new QMenu, otherwise it is set to nullptr after destroying the old menu. |
|
protected |
resets the currently activated mouse drag action, e.g. called by mouseReleaseEvent()
void JKQTPlotter::resetMasterSynchronization | ( | JKQTBasePlotter::SynchronizationDirection | synchronizeDirection = JKQTBasePlotter::sdXYAxes | ) |
switches any synchronization off, that has been created by synchronizeToMaster()
|
protectedslot |
resets any previously set override action for the left mouse-button, un-modified
|
protected |
removes a previously set override mouse drag action for the given button/modifiers combination
|
overrideprotected |
resizes the internal representation (image) of the graphs
|
signal |
emitted when a new ruler between two points is displayed
x1 | x-coordinate of the start of the line (in plot coordinates) |
y1 | y-coordinate of the start of the line (in plot coordinates) |
x2 | x-coordinate of the end of the line (in plot coordinates) |
y2 | y-coordinate of the end of the line (in plot coordinates) |
modifiers | key-modifiers when the rectangle was finished |
|
inlineslot |
save the current plot data as a Comma Separated Values (CSV) file
filename | the file to save to, if filename is empty, a file open dialog will be shown |
This method uses JKQTBasePlotterStyle::CSVdecimalSeparator as decimal separator and JKQTBasePlotterStyle::CSVcommentInitializer as comment initializer!
|
inlineslot |
save the current plot data as a Data Interchange Format file (see https://en.wikipedia.org/wiki/Data_Interchange_Format).
filename | the file to save to, if filename is empty, a file open dialog will be shown |
|
inlineslot |
save the current plot data as a Semicolon Separated Values (CSV) file for german Excel, i.e. with comma as decimal separator
filename | the file to save to, if filename is empty, a file open dialog will be shown |
example output:
|
inlineslot |
save the current plot data as a Matlab Script
filename | the file to save to, if filename is empty, a file open dialog will be shown |
example output:
|
inlineslot |
save the current plot as a PDF file, with the current widget aspect ratio, if filename is empty a file selection dialog is displayed
filename | the filename to save to, if empty a file save dialog is displayed |
displayPreview | if true , a save/print-preview dialog is displayed that allows to make some modifications to the generated image, otherwise the image is saved with default settings. |
true
if the file was save successfully
|
inlineslot |
save the current plot as a pixel image image (PNG ...), if filename is empty a file selection dialog is displayed
filename | name of the stored file, if no outputFormat is given, the file format is deduced by the file extension in filename |
displayPreview | if true a dialog is shown that allows to modify the generated output (zoo, scaling, ...) |
outputFormat | specify the file format for the generated file |
outputSizeIncrease | if given, the size of the generated pixel image is increased by this number of pixels in addition to the required space |
true
on successThis function may generate any pixel-graphics format, supported by Qt and listed in QImageWriter::supportedImageFormats()
. The parameters are comparable to the standard Qt functions like QImage::save()
, which is also used internally.
|
inlineslot |
save the current plot data as a Semicolon Separated Values (SSV) file
filename | the file to save to, if filename is empty, a file open dialog will be shown |
example output:
This method uses JKQTBasePlotterStyle::CSVdecimalSeparator as decimal separator and JKQTBasePlotterStyle::CSVcommentInitializer as comment initializer!
|
inlineslot |
save the current plot as a SVG file, with the current widget aspect ratio, if filename is empty a file selection dialog is displayed
filename | the filename to save to, if empty a file save dialog is displayed |
displayPreview | if true , a save/print-preview dialog is displayed that allows to make some modifications to the generated image, otherwise the image is saved with default settings. |
true
if the file was save successfully
|
inlineslot |
save the current plot data as a SYmbolik LinK (SYLK) spreadsheet file (see https://en.wikipedia.org/wiki/Symbolic_Link_(SYLK) )
filename | the file to save to, if filename is empty, a file open dialog will be shown |
|
inlineslot |
save the current plot data as a Tabulator Separated Values (CSV) file
filename | the file to save to, if filename is empty, a file open dialog will be shown |
example output:
This method uses JKQTBasePlotterStyle::CSVdecimalSeparator as decimal separator and JKQTBasePlotterStyle::CSVcommentInitializer as comment initializer!
void JKQTPlotter::saveCurrentPlotterStyle | ( | QSettings & | settings, |
const QString & | group = "plots/" , |
||
bool | alsoSaveBaseStyle = true |
||
) | const |
store the current style properties for this JKQTBasePlotter with properties loaded from settings
settings | the QSettings object to write to |
group | group in settings to write to |
alsoSaveBaseStyle | if true , then also JKQTBasePlotter::saveCurrentPlotterStyle() of the internal JKQTBasePlotter is called |
|
inlineslot |
save the data used for the current plot. The file format is extracted from the file extension (csv, ...)
filename | the filename to save to, if empty a file save dialog is displayed |
format | The parameter format specifies the export format. if it is empty the format will be choosen according to the file extension, or if filename is also empty the format will be choosen according to what is selected in the file selection dialog. See below for a listing of supported values. |
true
if the data was exported successfully.These values are supported for format (if format is not provided, the function tries to guess it from the file extensions liste below):
"csv"
, Comma Separated Values, dot as decimal separator (see also https://en.wikipedia.org/wiki/Comma-separated_values, extensions: *
.csv , *
.dat , see JKQTBasePlotter::saveAsCSV()"tab"
Tab Separated Values, dot as decimal separator, extensions: *
.txt , see JKQTBasePlotter::saveAsTabSV()"sem"
or "ssv"
, Semicolon Separated Values, dot as decimal separator, extensions: *
.sem , *
.ssv , see JKQTBasePlotter::saveAsSemicolonSV()"gex"
, Semicolon Separated Values for German Excel, i.e. comma as decimal separator, extensions: *
.gex , see JKQTBasePlotter::saveAsGerExcelCSV()"slk"
or "sylk"
, SYmbolik LinK (SYLK) spreadsheet (see https://en.wikipedia.org/wiki/Symbolic_Link_(SYLK) ), extensions: *
.slk , *
.sylk , see JKQTBasePlotter::saveAsSYLK()"dif"
, Data Interchange Format (see https://en.wikipedia.org/wiki/Data_Interchange_Format), extensions: *
.dif , see JKQTBasePlotter::saveAsDIF()"m"
, Matlab Script, extensions: *
.m , see JKQTBasePlotter::saveAsMatlab()In addition you can use the custom exporters implemented as JKQTPSaveDataAdapter and registered using JKQTBasePlotter::registerSaveDataAdapter(). For these you need to use format = "customN"
, where N is the index of the exporter in the list of registered exporters.
|
inlineslot |
save the current plot as an image file, with the current widget aspect ratio, if filename is empty a file selection dialog is displayed. The image format is extracted from the file extension (jpeg, tiff, png, pdf, ...)
filename | the filename to save to, if empty a file save dialog is displayed |
displayPreview | if true , a save/print-preview dialog is displayed that allows to make some modifications to the generated image, otherwise the image is saved with default settings. |
true
if the file was save successfullyThis function is comparable to saveAsPixelImage(), but it allows to save into any graphics format, including SVG and PF (if printer-support is compiled into the library). Also it may use the custom exporters implemented as JKQTPPaintDeviceAdapter and registered via JKQTBasePlotter::registerPaintDeviceAdapter().
void JKQTPlotter::saveSettings | ( | QSettings & | settings, |
const QString & | group = QString("plots/") |
||
) | const |
saves the plot properties into a <a href="http://doc.qt.io/qt-5/qsettings.html")">QSettings object.
This method only saves those properties that differ from their default value.
|
inlineslot |
sets absolutely limiting x-range of the plot
The user (or programmer) cannot zoom to a viewport that is larger than the range given to this function. This is implemented by calling JKQTPCoordinateAxis::setAbsoluteRange() for the major x-axes!
xminn | absolute minimum of x-axis |
xmaxx | absolute maximum of x-axis |
|
inlineslot |
sets absolutely limiting x- and y-range of the plot
The user (or programmer) cannot zoom to a viewport that is larger than the range given to this function. This is implemented by calling JKQTPCoordinateAxis::setAbsoluteRange() for the major axes!
xminn | absolute minimum of x-axis |
xmaxx | absolute maximum of x-axis |
yminn | absolute minimum of y-axis |
ymaxx | absolute maximum of y-axis |
|
inlineslot |
sets absolute minimum and maximum y-value to plot
The user (or programmer) cannot zoom to a viewport that is larger than the range given to this function. This is implemented by calling JKQTPCoordinateAxis::setAbsoluteRange() for the major y-axes!
yminn | absolute minimum of y-axis |
ymaxx | absolute maximum of y-axis |
|
slot |
sets the mode if the standard context menu
void JKQTPlotter::setCurrentPlotterStyle | ( | const JKQTPlotterStyle & | style | ) |
replace the current style properties for this JKQTBasePlotter
void JKQTPlotter::setCurrentPlotterStyle | ( | const JKQTPlotterStyle & | style, |
const JKQTBasePlotterStyle & | baseStyle | ||
) |
replace the current style properties for this JKQTBasePlotter
|
inline |
specifies whether this class emits signals, like zoomChangedLocally() or beforePlotScalingRecaluclate()
|
static |
sets the global resize delay in milliseconds delayMS. After calling this function all plots will use the new delay. Setting the the delay to 0 disables the delayed resize feature. This function is thread-safe!
|
inlineslot |
sets whether the major grid lines of the major axes are shown
|
inlineslot |
sets the color of all major grid lines (of the major x- and y-axis)
void JKQTPlotter::setGridPrinting | ( | bool | enabled | ) |
enables grid-printing for this plot
void JKQTPlotter::setGridPrintingCurrentPos | ( | size_t | x, |
size_t | y | ||
) |
set the x- and y-positions of this JKQTPlotter in the grid-printing grid
void JKQTPlotter::setGridPrintingCurrentX | ( | size_t | x | ) |
set the x-position of this JKQTPlotter in the grid-printing grid
void JKQTPlotter::setGridPrintingCurrentY | ( | size_t | y | ) |
set the y-position of this JKQTPlotter in the grid-printing grid
|
inlineslot |
sets the style of all Major grid lines
|
inlineslot |
sets the width of all Major grid lines
|
slot |
set the current plot magnification
|
slot |
maximum distance at which a tooltip for a point is still displayed, when the user action jkqtpmdaToolTipForClosestDataPoint is executed
|
inlineslot |
sets the color of all minor grid lines
|
inlineslot |
sets the style of all minor grid lines
|
inlineslot |
sets the width of all minor grid lines
|
slot |
allows to activate/deactivate toolbar buttons that can activate certain mouse drag actions
|
protectedslot |
action that activates the pan viewport tool
|
protectedslot |
action that activates the ruler tool
|
protectedslot |
action that activates the zoom rectangle tool
|
protectedslot |
action that activates the tooltip tool, when dragging the mouse with the left button pressed
|
protectedslot |
action that (de)activates the tooltip tool, when moving the mouse without any button pressed
|
slot |
specifies whether to display the current position of the mouse in the top border of the plot (this may automatically extent the top border, so the position fits in. The default widget font is used for the output.
|
protected |
sets an override mouse drag action for the given button/modifiers combination
void JKQTPlotter::setPlotUpdateEnabled | ( | bool | enable | ) |
sets whether automatic redrawing the plot is currently activated (e.g. you can sett his to false
while performing major updates on the plot)
|
inlineslot |
switches the visibility of the zero-axes associated with the x- and y-axis
showX | indicates whether to show the zero-axis associated with the x-axis (i.e. x==0 or the vertical zero-axis) |
showY | indicates whether to show the zero-axis associated with the y-axis (i.e. y==0 or the horizontal zero-axis) |
|
inlineslot |
switches the visibility of the zero-axes associated with the major x- and y-axis
showX | indicates whether to show the zero-axis associated with the x-axis (i.e. x==0 or the vertical zero-axis) |
showY | indicates whether to show the zero-axis associated with the y-axis (i.e. y==0 or the horizontal zero-axis) |
void JKQTPlotter::setSpecialContextMenu | ( | QMenu * | menu | ) |
sets a QMenu object to be used as special context menu
|
slot |
returns whether the toolbar is always visible or only when the mouse moves to the upper left area
If toolbarAlwaysOn is set to true:
If toolbarAlwaysOn is set to false
, the toolbar only appears when the mouse is in the right location:
|
slot |
returns whether the toolbar is enabled
void JKQTPlotter::setToolbarIconSize | ( | int | value | ) |
set the width/height of the icons in the toolbar in pt
|
slot |
sensitivity (i.e. max. distance to see as one point) for user actions
|
slot |
pen for location markers of user actions on the plot
|
slot |
size (diameter) of markers drawn by user actions
|
slot |
pen for location markers of user actions on the plot
|
slot |
type of the location markers of user actions on the plot
|
slot |
pen for user actions that cover parts of the plot (typically opaque, like e.g. tooltips)
|
slot |
pen for user actions that cover parts of the plot (typically opaque, like e.g. tooltips)
|
slot |
pen for user actions that overlay the plot (typically semi-transparent, like e.g. zoom-rectangles)
|
slot |
pen for user actions that overlay the plot (typically semi-transparent, like e.g. zoom-rectangles)
|
inlineslot |
sets the x-range of the plot (minimum and maximum x-value on the x-axis)
xminn | absolute minimum of x-axis |
xmaxx | absolute maximum of x-axis |
affectsSecondaryAxes | if true , the secondary axes are affectedtoo, by using a relative zooming scheme, i.e. if a major axis range shrinks by 50%, also the secondary ranges shrink by 50% [default: false ] |
Uppon setting, this function emits the signal zoomChangedLocally(), if emitting signals is activated at the moment (e.g. using setEmittingSignalsEnabled() ).
|
inlineslot |
sets the x- and y-range of the plot (minimum and maximum values on the x-/y-axis)
xminn | absolute minimum of x-axis |
xmaxx | absolute maximum of x-axis |
yminn | absolute minimum of y-axis |
ymaxx | absolute maximum of y-axis |
affectsSecondaryAxes | if true , the secondary axes are affectedtoo, by using a relative zooming scheme, i.e. if a major axis range shrinks by 50%, also the secondary ranges shrink by 50% [default: false ] |
Uppon setting, this function emits the signal zoomChangedLocally(), if emitting signals is activated at the moment (e.g. using setEmittingSignalsEnabled() ).
|
inlineslot |
sets the y-range of the plot (minimum and maximum y-value on the y-axis)
yminn | absolute minimum of y-axis |
ymaxx | absolute maximum of y-axis |
affectsSecondaryAxes | if true , the secondary axes are affectedtoo, by using a relative zooming scheme, i.e. if a major axis range shrinks by 50%, also the secondary ranges shrink by 50% [default: false ] |
Uppon setting, this function emits the signal zoomChangedLocally(), if emitting signals is activated at the moment (e.g. using setEmittingSignalsEnabled() ).
|
override |
returns the size of the widget
|
inline |
sort the graphs, using functor compareLess to find whether a first graph shall be before (i.e. less) than a second graph. After completing the operation, the graph is updated
void JKQTPlotter::synchronizeToMaster | ( | JKQTPlotter * | master, |
JKQTBasePlotter::SynchronizationDirection | synchronizeDirection, | ||
bool | synchronizeAxisLength = true , |
||
bool | synchronizeZoomingMasterToSlave = true , |
||
bool | synchronizeZoomingSlaveToMaster = true |
||
) |
synchronize the plot borders (and zooming) with a given plotter (master --> slave/this)
This function allows two plotters to draw a graph with exactly the same height or width as in another graph. For example if you want to have two plotters which are positioned one above the other (and have the same widget widths, which could be guaranteed by a QLayout) you may want to make sure that their plotWidth s are always the same. In this case call
of the lower plotter plotter2
. Now whenever the size of plotter1 changes, also plotter2 is redrawn with the changed borders.
master | the plotter widget to synchronize to |
synchronizeDirection | direction in which to synchronize |
synchronizeAxisLength | do you want the axis length to be synchronized? |
synchronizeZoomingMasterToSlave | if set, also zooming in the master leads to a modification of the linked axes in the slave |
synchronizeZoomingSlaveToMaster | if set, also zooming in the slave leads to a modification of the linked axes in the master |
|
slot |
may be connected to zoomChangedLocally() of a different plot and synchronizes the local x-axis to the other x-axis
void JKQTPlotter::synchronizeXToMaster | ( | JKQTPlotter * | master, |
bool | synchronizeAxisLength = true , |
||
bool | synchronizeZoomingMasterToSlave = true , |
||
bool | synchronizeZoomingSlaveToMaster = true |
||
) |
synchronize the plot x-axis width (and x-zooming) with a given master plotter (master --> slave/this)
master | the plotter widget to synchronize to |
synchronizeAxisLength | do you want the axis length to be synchronized? |
synchronizeZoomingMasterToSlave | if set, also zooming in the master leads to a modification of the linked axes in the slave |
synchronizeZoomingSlaveToMaster | if set, also zooming in the slave leads to a modification of the linked axes in the master |
synchronizeDirection=csXAxis
|
slot |
may be connected to zoomChangedLocally() of a different plot and synchronizes the local x- and y-axis to the other x- and y-axis
|
slot |
may be connected to zoomChangedLocally() of a different plot and synchronizes the local y-axis to the other y-axis
void JKQTPlotter::synchronizeYToMaster | ( | JKQTPlotter * | master, |
bool | synchronizeAxisLength = true , |
||
bool | synchronizeZoomingMasterToSlave = true , |
||
bool | synchronizeZoomingSlaveToMaster = true |
||
) |
synchronize the plot y-axis height (and y-zooming) with a given master plotter (master --> slave/this)
master | the plotter widget to synchronize to |
synchronizeAxisLength | do you want the axis length to be synchronized? |
synchronizeZoomingMasterToSlave | if set, also zooming in the master leads to a modification of the linked axes in the slave |
synchronizeZoomingSlaveToMaster | if set, also zooming in the slave leads to a modification of the linked axes in the master |
synchronizeDirection=csXAxis
|
signal |
emitted when a tooltip for a datapoint is displayed
x | x-coordinate of the center of the marked datapoint (in plot coordinates) |
y | y-coordinate of the center of the marked datapoint (in plot coordinates) |
entries | contents of the tooltip |
graphs | graph objects that created the entries |
|
protected |
set the current mouse cursor shappe according to currentMouseDragAction
|
protected |
update settings of the toolbar
void JKQTPlotter::updateToolbarActions | ( | ) |
reinitializes the toolbar, i.e. fills in QActions added to the QWidget since its creation/the last call to this function
|
inline |
tells the plotter object to use the given external datastore and treat it as an internal one (i.e. free it when the plotter object ist destroyed.
|
inline |
tells the plotter object to use the given external datastore.
If the current datastore is internally managed, this method will free that object and use the supplied datastore with external management. If the current datastore is already external, this method will simply replace it by the new one.
|
inline |
tells the plotter object to use an internal datastore. A new internal datastore object is generated only if the current datastore is not internal.
|
signal |
emitted when the mouse action JKQTPlotter::CircleEvents and the drawing of the new circle is finished (=mouse key released)
x | x-coordinate of the center of the circle (in plot coordinates) |
y | y-coordinate of the center of the circle (in plot coordinates) |
radius | radius of the circle (in plot coordinates) |
modifiers | key-modifiers when the rectangle was finished |
|
signal |
emitted when the mouse action JKQTPlotter::EllipseEvents and the drawing of the new ellipse is finished (=mouse key released)
x | x-coordinate of the center of the ellipse (in plot coordinates) |
y | y-coordinate of the center of the ellipse (in plot coordinates) |
radiusX | half-axis in x-direction of the ellipse (in plot coordinates) |
radiusY | half-axis in y-direction of the ellipse (in plot coordinates) |
modifiers | key-modifiers when the rectangle was finished |
|
signal |
emitted when the mouse action JKQTPlotter::LineEvents and the drawing of the new line is finished (=mouse key released)
x1 | x-coordinate of the start of the line (in plot coordinates) |
y1 | y-coordinate of the start of the line (in plot coordinates) |
x2 | x-coordinate of the end of the line (in plot coordinates) |
y2 | y-coordinate of the end of the line (in plot coordinates) |
modifiers | key-modifiers when the rectangle was finished |
|
signal |
emitted when the mouse action JKQTPlotter::RectangleEvents and the drawing of the new rectangle is finished (=mouse key released)
x | x-coordinate of the bottom left corner of the rectangle (in plot coordinates) |
y | y-coordinate of the bottom left corner of the rectangle (in plot coordinates) |
width | width of the rectangle (in plot coordinates) |
height | height of the rectangle (in plot coordinates) |
modifiers | key-modifiers when the rectangle was finished |
|
signal |
emitted when the mouse action JKQTPlotter::ScribbleEvents and a click event from the mouse occurs inside the plot, or the mouse moved while the left button is pressed down
x | x-position of the mouse (in plot coordinates) |
y | y-position of the mouse (in plot coordinates) |
modifiers | key-modifiers when the event was generated |
first | if true: this is the first event of a series that starts with pressing the mouse-button down, within the series, this is false |
last | if true: this is the last event of a series that ends when releasing the mouse-button, within the series, this is false |
|
overrideprotected |
event handler for a turn of the mouse wheel
Executes the user action defined for the mouse wheel.
|
signal |
signal: emitted whenever the widget is resized
new_width | new width of the widget (in pixels) |
new_height | new height of the widget (in pixels) |
sender | JKQTPlotter sending this event |
This signal is designed to be connected to these Q_SLOTS: synchronizeXAxis(), synchronizeYAxis(), synchronizeXYAxis()
|
inlineslot |
sets the x- and y-range of the plot (minimum and maximum values on the x-/y-axis)
xminn | absolute minimum of x-axis |
xmaxx | absolute maximum of x-axis |
yminn | absolute minimum of y-axis |
ymaxx | absolute maximum of y-axis |
affectsSecondaryAxes | if true , the secondary axes are affectedtoo, by using a relative zooming scheme, i.e. if a major axis range shrinks by 50%, also the secondary ranges shrink by 50% [default: false ] |
Uppon setting, this function emits the signal zoomChangedLocally(), if emitting signals is activated at the moment (e.g. using setEmittingSignalsEnabled() ).
|
signal |
signal: emitted whenever the user selects a new x-y zoom range (in the major axes, e.g. by mouse, setX(), setY(), setXY(), zoomToFit()... )
newxmin | start of the selected x-range (in plot coordinates) |
newxmax | end of the selected x-range (in plot coordinates) |
newymin | start of the selected x-range (in plot coordinates) |
newymax | end of the selected x-range (in plot coordinates) |
sender | JKQTPlotter sending this event |
This signal is designed to be connected to these Q_SLOTS: synchronizeXAxis(), synchronizeYAxis(), synchronizeXYAxis()
|
inlineslot |
zooms into the graph (the same as turning the mouse wheel) by the given factor
|
inlineslot |
zooms out of the graph (the same as turning the mouse wheel) by the given factor
|
inlineslot |
this method zooms the graph so that all plotted datapoints are visible.
zoomX | if set true (default) zooms the x axis |
zoomY | if set true (default) zooms the y axis |
includeX0 | if this is true zoomToFit() will ensure that is visible in the plot (only for non-logx plots, default: false) |
includeY0 | if this is true zoomToFit() will ensure that is visible in the plot (only for non-logy plots, default: false) |
scaleX | the plot will have a width of where is the actual x-axis data range For logx plots we actually use this on the logarithmized data! (default: 1.05) |
scaleY | the plot will have a height of where is the actual <-axis data range For log< plots we actually use this on the logarithmized data! (default: 1.05) |
|
protected |
action group, that groups the actMouseLeft... actions
|
protected |
action that activates the default action, set in plotterStyle!
|
protected |
action that activates the pan view tool (override!)
|
protected |
action that activates the ruler tool (override!)
|
protected |
action that activates the zoom rectangle tool (override!)
|
protected |
action that activates the tooltip tool (override!)
|
protected |
the context menu object used by this JKQTPlotter
==nullptr
occasionally, therefore you need to check it, before accessing it!
|
protected |
current mode for the default context menu (i.e. the right-click context menu)
|
protected |
internal storage for sub-menu entries of the internal contextMenu object, based on the actions returned by JKQTBasePlotter::getLstAdditionalPlotterActions()
|
protected |
the currently executed MouseDragAction
|
protected |
the currently executed MouseMoveActions
|
protected |
indicates whether the plot is updated automatically at the moment
|
protected |
this stores the currently displayed plot
|
staticprotected |
delay for resizing in milliseconds. If set to 0, resize delay is disabled and resizeTimer is unused.
|
protected |
storage for timestammp of the last QWheelEvent (used in wheelAction() to distinguish trackpad-pan ations in mode jkqtpmwaZoomByWheelAndTrackpadPan)
|
protected |
storage for last WheelActionType (used in wheelAction() to distinguish trackpad-pan ations in mode jkqtpmwaZoomByWheelAndTrackpadPan)
|
protected |
magnification factor for the display of the plot
|
protected |
the master plotter, this plotter is connected to in x-direction.
|
protected |
the master plotter, this plotter is connected to in y-direction.
|
protected |
max. time between two QWheelEvents that are recognized as one series
|
protected |
use this QMenu instance instead of the standard context menu of this widget
|
protected |
current minimal size of the JKQTPlotter widget to properly display the plot
|
protected |
x-position of the mouse (in plot coordinates) when a user mouse-action was started (e.g. drawing a rectangle)
|
protected |
y-position of the mouse (in plot coordinates) when a user mouse-action was started (e.g. drawing a rectangle)
|
protected |
this is set true
if we are drawing a zoom rectangle
|
protected |
internal list of markers to be drawn by paintUserAction()
|
protected |
when draging the mouse this contains the x-coordinate the mouse is currently pointing to
|
protected |
when draging the mouse this contains the x-coordinate the mouse is currently pointing to (in pixels)
|
protected |
when draging the mouse this contains the x-coordinate the user clicked on (in plot coordinates)
|
protected |
when draging the mouse this contains the x-coordinate the user clicked on (in pixels)
|
protected |
when zooming by moving the mouse this contains the y-coordinate the mouse is currently pointing to
|
protected |
when draging the mouse this contains the y-coordinate the mouse is currently pointing to (in pixels)
|
protected |
when draging the mouse this contains the y-coordinate the user clicked on (in plot coordinates)
|
protected |
when zooming by moving the mouse this contains the y-coordinate the user clicked on (in pixels)
|
protected |
x-position of the last mouse-click (in screen pixels)
|
protected |
y-position of the last mouse-click (in screen pixels)
|
protected |
x-position of the mouse during the last mouseMoveEvent() calls (in plot coordinates)
|
protected |
y-position of the mouse during the last mouseMoveEvent() calls (in plot coordinates)
|
protected |
this can be used when drawing a zoom rectangle to store an unchanged copy of the currently displayed image.
|
protected |
JKQTBasePlotter used to plot.
|
protected |
current style properties for this JKQTPlotter
|
protected |
list of override mouse drag action modes, that override the settings ing plotterStyle.registeredMouseDragActionModes
|
protected |
timer used while the graph is resized to delay the redrawing with new size (in the meantime, an intermediate graphic is displayed)
|
protected |
toolbar class used for user input