|
rock_widget_collection
0.1
|
The central class which is also the QWidget which displays the plot and interacts with the user. More...
#include <qcustomplot.h>
Inherits QWidget.
Inherited by Plot2d.
Public Slots | |
| QString | title () const |
| QFont | titleFont () const |
| QRect | axisRect () const |
| int | marginLeft () const |
| int | marginRight () const |
| int | marginTop () const |
| int | marginBottom () const |
| bool | autoMargin () const |
| QColor | color () const |
| Qt::Orientations | rangeDrag () const |
| Qt::Orientations | rangeZoom () const |
| QCPAxis * | rangeDragAxis (Qt::Orientation orientation) |
| QCPAxis * | rangeZoomAxis (Qt::Orientation orientation) |
| double | rangeZoomFactor (Qt::Orientation orientation) |
| const AntialiasedElements | antialiasedElements () const |
| bool | autoAddPlottableToLegend () const |
| QPixmap | axisBackground () const |
| bool | axisBackgroundScaled () const |
| Qt::AspectRatioMode | axisBackgroundScaledMode () const |
| void | setTitle (const QString &title) |
| void | setTitleFont (const QFont &font) |
| void | setAxisRect (const QRect &arect) |
| void | setMarginLeft (int margin) |
| void | setMarginRight (int margin) |
| void | setMarginTop (int margin) |
| void | setMarginBottom (int margin) |
| void | setMargin (int left, int right, int top, int bottom) |
| void | setAutoMargin (bool enabled) |
| void | setColor (const QColor &color) |
| void | setRangeDrag (Qt::Orientations orientations) |
| void | setRangeZoom (Qt::Orientations orientations) |
| void | setRangeDragAxes (QCPAxis *horizontal, QCPAxis *vertical) |
| void | setRangeZoomAxes (QCPAxis *horizontal, QCPAxis *vertical) |
| void | setRangeZoomFactor (double horizontalFactor, double verticalFactor) |
| void | setRangeZoomFactor (double factor) |
| void | setAntialiasedElements (const AntialiasedElements &antialiasedElements) |
| void | setAntialiasedElement (AntialiasedElement antialiasedElement, bool enabled) |
| void | setAutoAddPlottableToLegend (bool on) |
| void | setAxisBackground (const QPixmap &pm) |
| void | setAxisBackground (const QPixmap &pm, bool scaled, Qt::AspectRatioMode mode=Qt::KeepAspectRatioByExpanding) |
| void | setAxisBackgroundScaled (bool scaled) |
| void | setAxisBackgroundScaledMode (Qt::AspectRatioMode mode) |
| QCPAbstractPlottable * | plottable (int index) |
| QCPAbstractPlottable * | plottable () |
| bool | addPlottable (QCPAbstractPlottable *plottable) |
| bool | removePlottable (QCPAbstractPlottable *plottable) |
| bool | removePlottable (int index) |
| int | clearPlottables () |
| int | plottableCount () const |
| QCPGraph * | graph (int index) const |
| QCPGraph * | graph () const |
| QCPGraph * | addGraph (QCPAxis *keyAxis=0, QCPAxis *valueAxis=0) |
| bool | removeGraph (QCPGraph *graph) |
| bool | removeGraph (int index) |
| int | clearGraphs () |
| int | graphCount () const |
| void | replot () |
| void | setupFullAxesBox () |
| void | rescaleAxes () |
| void | savePdf (const QString &fileName, bool noCosmeticPen=false, int width=0, int height=0) |
| void | savePng (const QString &fileName, int width=0, int height=0) |
| void | savePngScaled (const QString &fileName, double scale, int width=0, int height=0) |
Signals | |
| void | mouseDoubleClick (QMouseEvent *event) |
| void | mousePress (QMouseEvent *event) |
| void | mousePressOnLegendItem (QMouseEvent *event, QVariant itemIdx) |
| void | mousePressOnPlotArea (QMouseEvent *event) |
| void | mouseMove (QMouseEvent *event) |
| void | mouseRelease (QMouseEvent *event) |
| void | mouseWheel (QWheelEvent *event) |
Public Attributes | |
| QCPAxis * | xAxis |
| QCPAxis * | yAxis |
| QCPAxis * | xAxis2 |
| QCPAxis * | yAxis2 |
| QCPLegend * | legend |
Protected Member Functions | |
| virtual void | paintEvent (QPaintEvent *event) |
| virtual void | resizeEvent (QResizeEvent *event) |
| virtual void | mouseDoubleClickEvent (QMouseEvent *event) |
| virtual void | mousePressEvent (QMouseEvent *event) |
| virtual void | mouseMoveEvent (QMouseEvent *event) |
| virtual void | mouseReleaseEvent (QMouseEvent *event) |
| virtual void | wheelEvent (QWheelEvent *event) |
| virtual void | draw (QPainter *painter) |
| virtual void | drawAxisBackground (QPainter *painter) |
| void | updateAxisRect () |
Protected Attributes | |
| QPixmap | buffer |
| QString | mTitle |
| QFont | mTitleFont |
| QRect | mViewport |
| QRect | mAxisRect |
| int | mMarginLeft |
| int | mMarginRight |
| int | mMarginTop |
| int | mMarginBottom |
| bool | mAutoMargin |
| bool | mAutoAddPlottableToLegend |
| QColor | mColor |
| QList< QCPAbstractPlottable * > | mPlottables |
| QList< QCPGraph * > | mGraphs |
| Qt::Orientations | mRangeDrag |
| Qt::Orientations | mRangeZoom |
| QCPAxis * | mRangeDragHorzAxis |
| QCPAxis * | mRangeDragVertAxis |
| QCPAxis * | mRangeZoomHorzAxis |
| QCPAxis * | mRangeZoomVertAxis |
| double | mRangeZoomFactorHorz |
| double | mRangeZoomFactorVert |
| bool | mDragging |
| QPoint | mDragStart |
| QCPRange | mDragStartHorzRange |
| QCPRange | mDragStartVertRange |
| QFlags< AntialiasedElement > | mAntialiasedElements |
| QPixmap | mAxisBackground |
| QPixmap | mScaledAxisBackground |
| bool | mAxisBackgroundScaled |
| Qt::AspectRatioMode | mAxisBackgroundScaledMode |
Friends | |
| class | QCPLegend |
| class | QCPAxis |
The central class which is also the QWidget which displays the plot and interacts with the user.
For tutorials on how to use QCustomPlot, see the website
http://www.WorksLikeClockWork.com/index.php/components/qt-plotting-widget
Definition at line 895 of file qcustomplot.h.
Creates a new graph inside the plot. If keyAxis and valueAxis are left unspecified, the bottom (xAxis) is used as key and the left (yAxis) is used as value. keyAxis and valueAxis must reside in the same QCustomPlot.
| keyAxis | the axis that will be used as key axis for the graph (typically "x") |
| valueAxis | the axis that will be used as value axis for the graph (typically "y") |
Returns a pointer to the newly created graph.
Definition at line 5383 of file qcustomplot.cc.
|
slot |
Adds the specified plottable to the plot and, if setAutoAddPlottableToLegend is enabled, to the legend. QCustomPlot takes ownership of the plottable.
Returns true on success, i.e. when plottable wasn't already added to the plot and the parent plot of plottable is this QCustomPlot (the latter is controlled by what axes the plottable was passed in the constructor).
Definition at line 5248 of file qcustomplot.cc.
|
inlineslot |
Definition at line 949 of file qcustomplot.h.
|
inlineslot |
Definition at line 950 of file qcustomplot.h.
|
inlineslot |
Definition at line 942 of file qcustomplot.h.
|
inlineslot |
Definition at line 951 of file qcustomplot.h.
|
inlineslot |
Definition at line 952 of file qcustomplot.h.
|
inlineslot |
Definition at line 953 of file qcustomplot.h.
|
inlineslot |
Definition at line 937 of file qcustomplot.h.
|
slot |
Removes all graphs from the plot (and the legend, if necessary). Returns the number of graphs removed.
Definition at line 5430 of file qcustomplot.cc.
|
slot |
Removes all graphs from the plot (and the legend, if necessary).
Returns the number of graphs removed.
Definition at line 5317 of file qcustomplot.cc.
|
inlineslot |
Definition at line 943 of file qcustomplot.h.
|
protectedvirtual |
Definition at line 5875 of file qcustomplot.cc.
|
protectedvirtual |
Definition at line 5946 of file qcustomplot.cc.
|
slot |
Returns the graph with index. If the index is invalid, returns 0.
There is an overloaded version of this function with no parameter which returns the last created graph, see QCustomPlot::graph()
Definition at line 5343 of file qcustomplot.cc.
|
slot |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Returns the last graph, that was created with addGraph. If there are no graphs in the plot, returns 0.
Definition at line 5362 of file qcustomplot.cc.
|
slot |
Returns the number of currently existing graphs in the plot
Definition at line 5443 of file qcustomplot.cc.
|
inlineslot |
Definition at line 941 of file qcustomplot.h.
|
inlineslot |
Definition at line 938 of file qcustomplot.h.
|
inlineslot |
Definition at line 939 of file qcustomplot.h.
|
inlineslot |
Definition at line 940 of file qcustomplot.h.
|
signal |
|
protectedvirtual |
Definition at line 5735 of file qcustomplot.cc.
|
signal |
|
protectedvirtual |
Reimplemented in Plot2d.
Definition at line 5784 of file qcustomplot.cc.
|
signal |
|
protectedvirtual |
Definition at line 5750 of file qcustomplot.cc.
|
signal |
|
signal |
|
signal |
|
protectedvirtual |
Definition at line 5826 of file qcustomplot.cc.
|
signal |
|
protectedvirtual |
Definition at line 5708 of file qcustomplot.cc.
|
slot |
Returns the plottable with index. If the index is invalid, returns 0.
There is an overloaded version of this function with no parameter which returns the last created plottable, see QCustomPlot::plottable()
Definition at line 5210 of file qcustomplot.cc.
|
slot |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Returns the last plottable, that was created with addPlottable. If there are no plottables in the plot, returns 0.
Definition at line 5229 of file qcustomplot.cc.
|
slot |
Returns the number of currently existing plottables in the plot
Definition at line 5330 of file qcustomplot.cc.
|
inlineslot |
Definition at line 944 of file qcustomplot.h.
|
slot |
Returns the range drag axis of the orientation provided
Definition at line 4902 of file qcustomplot.cc.
|
inlineslot |
Definition at line 945 of file qcustomplot.h.
|
slot |
Returns the range zoom axis of the orientation provided
Definition at line 4911 of file qcustomplot.cc.
|
slot |
Returns the range zoom factor of the orientation provided
Definition at line 4920 of file qcustomplot.cc.
|
slot |
Removes the specified graph from the plot and, if necessary, from the legend. If any other graphs in the plot have a channel fill set towards the removed graph, the channel fill property of those graphs is reset to zero (no channel fill).
Returns true on success.
Definition at line 5408 of file qcustomplot.cc.
|
slot |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Removes the graph by its index.
Definition at line 5417 of file qcustomplot.cc.
|
slot |
Removes the specified plottable from the plot and, if necessary, from the legend.
Returns true on success.
Definition at line 5274 of file qcustomplot.cc.
|
slot |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Removes the plottable by its index.
Definition at line 5298 of file qcustomplot.cc.
|
slot |
Causes a complete replot (axes, labels, graphs, etc.) into the internal buffer QPixmap. Finally, update() is called, to redraw the buffer on the QCustomPlot widget surface.
Definition at line 5452 of file qcustomplot.cc.
|
slot |
Rescales the axes such that all plottables (e.g. graphs) in the plot are fully visible. It does this by calling QCPAbstractPlottable::rescaleAxes on all plottables.
Definition at line 5530 of file qcustomplot.cc.
|
protectedvirtual |
Definition at line 5722 of file qcustomplot.cc.
|
slot |
Saves a PDF with the vectorized plot to the file fileName. The axis ratio as well as the scale of texts and lines will be derived from the specified width and height. This means, the output will look like the normal on-screen output of a QCustomPlot widget with the corresponding pixel width and height. If either width or height is zero, the exported image will have the same dimensions as the QCustomPlot widget currently has.
noCosmeticPen disables the use of cosmetic pens when drawing to the PDF file. Cosmetic pens are pens with numerical width 0, which are always drawn as a one pixel wide line, no matter what zoom factor is set in the PDF-Viewer. For more information about cosmetic pens, see QPainter and QPen documentation.
Definition at line 5564 of file qcustomplot.cc.
|
slot |
Saves a PNG image file to fileName on disc. The output plot will have the dimensions width and height in pixels. If either width or height is zero, the exported image will have the same dimensions as the QCustomPlot widget currently has. Line widths and texts etc. are not scaled up when larger widths/heights are used. If you want that effect, consider the scaled version of this function.
Definition at line 5625 of file qcustomplot.cc.
|
slot |
Saves a PNG image file to fileName on disc. The output plot will have a base width and height which is then scaled by factor scale. If you for example set both width and height to 100 and scale to 2, you will end up with a PNG file of size 200*200 in which all graphical elements are scaled up by factor 2 (line widths, texts, etc.). This scaling is done not by stretching a 100*100 image but by actually scaling the painter, so the result will have full 200*200 pixel resolution.
Definition at line 5672 of file qcustomplot.cc.
|
slot |
Sets whether the specified antialiasedElement is drawn antialiased.
Definition at line 5130 of file qcustomplot.cc.
|
slot |
Sets which elements are drawn antialiased as an or combination of AntialiasedElement.
Definition at line 5122 of file qcustomplot.cc.
|
slot |
If set to true, adding a plottable (e.g. a graph) to the QCustomPlot automatically also adds the newly created plottable to the legend.
Definition at line 5144 of file qcustomplot.cc.
|
slot |
Sets whether the margins are calculated automatically depeding on the sizes of the tick labels, axis labels, paddings etc. If disabled, the margins must be set manually with the setMargin functions.
Definition at line 5026 of file qcustomplot.cc.
|
slot |
Sets pm as the axis background pixmap. The axis background pixmap will be drawn inside the current axis rect, before anything else (e.g. the axes themselves, grids, graphs, etc.) is drawn. If the provided pixmap doesn't have the same size as the axis rect, scaling can be enabled with setAxisBackgroundScaled and the scaling mode (i.e. whether and how the aspect ratio is preserved) can be set with setAxisBackgroundScaledMode. To set all these options in one call, consider using the overloaded version of this function.
Definition at line 5157 of file qcustomplot.cc.
|
slot |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Allows setting the background pixmap, whether it shall be scaled and how it shall be scaled in one call.
Definition at line 5168 of file qcustomplot.cc.
|
slot |
Sets whether the axis background pixmap shall be scaled to fit the current axis rect or not. If scaled is set to true, you may control whether and how the aspect ratio of the original pixmap is preserved with setAxisBackgroundScaledMode.
Note that the scaled version of the original pixmap is buffered, so there is no performance penalty on replots, when enabling the scaling. (Except of course, the axis rect is continuously changed, but that's not very likely.)
Definition at line 5187 of file qcustomplot.cc.
|
slot |
If scaling of the axis background pixmap is enabled (setAxisBackgroundScaled), use this function to define whether and how the aspect ratio of the original pixmap passed to setAxisBackground is preserved.
Definition at line 5197 of file qcustomplot.cc.
|
slot |
An alternative way to set the margins, by directly setting the wanted axis rect. The rect will be translated into appropriate margin values.
Definition at line 4955 of file qcustomplot.cc.
|
slot |
Sets the background color of the QCustomPlot widget.
Definition at line 5034 of file qcustomplot.cc.
|
slot |
Sets the margins manually. Will only have effect, if setAutoMargin is set to false. The margins are the distances in pixels between the axes box and the viewport box. The viewport box normally is the entire QCustomPlot widget or the entire image, if using one of the export functions. Positive margin values always mean the axes box is shrinked, going inward from the sides of the viewport box.
Definition at line 5011 of file qcustomplot.cc.
|
slot |
Sets the bottom margin manually. Will only have effect, if setAutoMargin is set to false. see setMargin for an explanation of what margins mean in QCustomPlot.
Definition at line 4998 of file qcustomplot.cc.
|
slot |
Sets the left margin manually. Will only have effect, if setAutoMargin is set to false. see setMargin for an explanation of what margins mean in QCustomPlot.
Definition at line 4968 of file qcustomplot.cc.
|
slot |
Sets the right margin manually. Will only have effect, if setAutoMargin is set to false. see setMargin for an explanation of what margins mean in QCustomPlot.
Definition at line 4978 of file qcustomplot.cc.
|
slot |
Sets the top margin manually. Will only have effect, if setAutoMargin is set to false. see setMargin for an explanation of what margins mean in QCustomPlot.
Definition at line 4988 of file qcustomplot.cc.
|
slot |
Sets which axis orientation may be range dragged by the user with mouse interaction. What orientation corresponds to which specific axis can be set with setRangeDragAxes(QCPAxis *horizontal, QCPAxis *vertical). By default, the horizontal axis is the bottom axis (xAxis) and the vertical axis is the left axis (yAxis). To disable range dragging entirely, pass 0 as orientations. To enable range dragging for both directions, pass Qt::Horizontal | Qt::Vertical as orientations.
Definition at line 5048 of file qcustomplot.cc.
Sets the axes whose range will be dragged when setRangeDrag enables mouse range dragging on the QCustomPlot widget.
Definition at line 5071 of file qcustomplot.cc.
|
slot |
Sets which axis orientation may be zoomed by the user with the mouse wheel. What orientation corresponds to which specific axis can be set with setRangeZoomAxes(QCPAxis *horizontal, QCPAxis *vertical). By default, the horizontal axis is the bottom axis (xAxis) and the vertical axis is the left axis (yAxis). To disable range zooming entirely, pass 0 as orientations. To enable range zooming for both directions, pass Qt::Horizontal | Qt::Vertical as orientations.
Definition at line 5062 of file qcustomplot.cc.
Sets the axes whose range will be zoomed when setRangeZoom enables mouse wheel zooming on the QCustomPlot widget. The two axes can be zoomed with different strengths, when different factors are passed to setRangeZoomFactor(double horizontalFactor, double verticalFactor).
Definition at line 5084 of file qcustomplot.cc.
|
slot |
Sets how strong one rotation step of the mouse wheel zooms, when range zoom was activated with setRangeZoom. The two parameters horizontalFactor and verticalFactor provide a way to let the horizontal axis zoom at different rates as the vertical axis. Which axis is horizontal and which is vertical, can be set with setRangeZoomAxes. When the zoom factor is greater than one, scrolling the mouse wheel backwards (towards the user) will zoom in. For zoom factors smaller than one, scrolling the mouse wheel forwards zooms in.
Definition at line 5100 of file qcustomplot.cc.
|
slot |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Sets how strong one rotation step of the mouse wheel zooms, when range zoom was activated with setRangeZoom. The zoom factor is applied to both horizontal and vertical range zooming. When the zoom factor is greater than one, scrolling the mouse wheel backwards (towards the user) will zoom in. For zoom factors smaller than one, scrolling the mouse wheel forwards zooms in.
Definition at line 5113 of file qcustomplot.cc.
|
slot |
Sets the plot title which will be drawn centered at the top of the widget. The title position is not dependant on the actual position of the axes. However, if setAutoMargin is set to true, the top margin will be adjusted appropriately, so the top axis labels/tick labels will not overlap with the title.
Definition at line 4931 of file qcustomplot.cc.
|
slot |
|
slot |
Convenience function to make the top and right axes visible and assign them the following properties from their corresponding bottom/left axes:
Tick labels (QCPAxis::setTickLabels) however, is always set to false.
This function does not connect the rangeChanged signals of the bottom and left axes to the QCPAxis::setRange slots of the top and right axes in order to synchronize the ranges permanently.
Definition at line 5485 of file qcustomplot.cc.
|
inlineslot |
Definition at line 935 of file qcustomplot.h.
|
inlineslot |
Definition at line 936 of file qcustomplot.h.
|
protected |
Definition at line 5972 of file qcustomplot.cc.
|
protectedvirtual |
Definition at line 5848 of file qcustomplot.cc.
|
friend |
Definition at line 1059 of file qcustomplot.h.
|
friend |
Definition at line 1058 of file qcustomplot.h.
|
protected |
Definition at line 1010 of file qcustomplot.h.
| QCPLegend* QCustomPlot::legend |
Definition at line 1007 of file qcustomplot.h.
|
protected |
Definition at line 1026 of file qcustomplot.h.
|
protected |
Definition at line 1016 of file qcustomplot.h.
|
protected |
Definition at line 1016 of file qcustomplot.h.
|
protected |
Definition at line 1027 of file qcustomplot.h.
|
protected |
Definition at line 1028 of file qcustomplot.h.
|
protected |
Definition at line 1029 of file qcustomplot.h.
|
protected |
Definition at line 1014 of file qcustomplot.h.
|
protected |
Definition at line 1017 of file qcustomplot.h.
|
protected |
Definition at line 1023 of file qcustomplot.h.
|
protected |
Definition at line 1024 of file qcustomplot.h.
|
protected |
Definition at line 1025 of file qcustomplot.h.
|
protected |
Definition at line 1025 of file qcustomplot.h.
|
protected |
Definition at line 1019 of file qcustomplot.h.
|
protected |
Definition at line 1015 of file qcustomplot.h.
|
protected |
Definition at line 1015 of file qcustomplot.h.
|
protected |
Definition at line 1015 of file qcustomplot.h.
|
protected |
Definition at line 1015 of file qcustomplot.h.
|
protected |
Definition at line 1018 of file qcustomplot.h.
|
protected |
Definition at line 1020 of file qcustomplot.h.
|
protected |
Definition at line 1021 of file qcustomplot.h.
|
protected |
Definition at line 1021 of file qcustomplot.h.
|
protected |
Definition at line 1020 of file qcustomplot.h.
|
protected |
Definition at line 1022 of file qcustomplot.h.
|
protected |
Definition at line 1022 of file qcustomplot.h.
|
protected |
Definition at line 1021 of file qcustomplot.h.
|
protected |
Definition at line 1021 of file qcustomplot.h.
|
protected |
Definition at line 1027 of file qcustomplot.h.
|
protected |
Definition at line 1011 of file qcustomplot.h.
|
protected |
Definition at line 1012 of file qcustomplot.h.
|
protected |
Definition at line 1013 of file qcustomplot.h.
| QCPAxis* QCustomPlot::xAxis |
Definition at line 1006 of file qcustomplot.h.
| QCPAxis * QCustomPlot::xAxis2 |
Definition at line 1006 of file qcustomplot.h.
| QCPAxis * QCustomPlot::yAxis |
Definition at line 1006 of file qcustomplot.h.
| QCPAxis * QCustomPlot::yAxis2 |
Definition at line 1006 of file qcustomplot.h.
1.8.6