|
SETestKCL
1.0.
|
#include <qcustomplot.h>


Public Types | |
| enum | AxisType { atLeft = 0x01, atRight = 0x02, atTop = 0x04, atBottom = 0x08 } |
| enum | LabelType { ltNumber, ltDateTime } |
| enum | LabelSide { lsInside, lsOutside } |
| enum | ScaleType { stLinear, stLogarithmic } |
| enum | SelectablePart { spNone = 0, spAxis = 0x001, spTickLabels = 0x002, spAxisLabel = 0x004 } |
Signals | |
| void | ticksRequest () |
| void | rangeChanged (const QCPRange &newRange) |
| void | rangeChanged (const QCPRange &newRange, const QCPRange &oldRange) |
| void | scaleTypeChanged (QCPAxis::ScaleType scaleType) |
| void | selectionChanged (const QCPAxis::SelectableParts &parts) |
| void | selectableChanged (const QCPAxis::SelectableParts &parts) |
Signals inherited from QCPLayerable | |
| void | layerChanged (QCPLayer *newLayer) |
Public Member Functions | |
| QCPAxis (QCPAxisRect *parent, AxisType type) | |
| virtual | ~QCPAxis () |
| AxisType | axisType () const |
| QCPAxisRect * | axisRect () const |
| ScaleType | scaleType () const |
| double | scaleLogBase () const |
| const QCPRange | range () const |
| bool | rangeReversed () const |
| bool | autoTicks () const |
| int | autoTickCount () const |
| bool | autoTickLabels () const |
| bool | autoTickStep () const |
| bool | autoSubTicks () const |
| bool | ticks () const |
| bool | tickLabels () const |
| int | tickLabelPadding () const |
| LabelType | tickLabelType () const |
| QFont | tickLabelFont () const |
| QColor | tickLabelColor () const |
| double | tickLabelRotation () const |
| LabelSide | tickLabelSide () const |
| QString | dateTimeFormat () const |
| Qt::TimeSpec | dateTimeSpec () const |
| QString | numberFormat () const |
| int | numberPrecision () const |
| double | tickStep () const |
| QVector< double > | tickVector () const |
| QVector< QString > | tickVectorLabels () const |
| int | tickLengthIn () const |
| int | tickLengthOut () const |
| int | subTickCount () const |
| int | subTickLengthIn () const |
| int | subTickLengthOut () const |
| QPen | basePen () const |
| QPen | tickPen () const |
| QPen | subTickPen () const |
| QFont | labelFont () const |
| QColor | labelColor () const |
| QString | label () const |
| int | labelPadding () const |
| int | padding () const |
| int | offset () const |
| SelectableParts | selectedParts () const |
| SelectableParts | selectableParts () const |
| QFont | selectedTickLabelFont () const |
| QFont | selectedLabelFont () const |
| QColor | selectedTickLabelColor () const |
| QColor | selectedLabelColor () const |
| QPen | selectedBasePen () const |
| QPen | selectedTickPen () const |
| QPen | selectedSubTickPen () const |
| QCPLineEnding | lowerEnding () const |
| QCPLineEnding | upperEnding () const |
| QCPGrid * | grid () const |
| Q_SLOT void | setScaleType (QCPAxis::ScaleType type) |
| void | setScaleLogBase (double base) |
| Q_SLOT void | setRange (const QCPRange &range) |
| void | setRange (double lower, double upper) |
| void | setRange (double position, double size, Qt::AlignmentFlag alignment) |
| void | setRangeLower (double lower) |
| void | setRangeUpper (double upper) |
| void | setRangeReversed (bool reversed) |
| void | setAutoTicks (bool on) |
| void | setAutoTickCount (int approximateCount) |
| void | setAutoTickLabels (bool on) |
| void | setAutoTickStep (bool on) |
| void | setAutoSubTicks (bool on) |
| void | setTicks (bool show) |
| void | setTickLabels (bool show) |
| void | setTickLabelPadding (int padding) |
| void | setTickLabelType (LabelType type) |
| void | setTickLabelFont (const QFont &font) |
| void | setTickLabelColor (const QColor &color) |
| void | setTickLabelRotation (double degrees) |
| void | setTickLabelSide (LabelSide side) |
| void | setDateTimeFormat (const QString &format) |
| void | setDateTimeSpec (const Qt::TimeSpec &timeSpec) |
| void | setNumberFormat (const QString &formatCode) |
| void | setNumberPrecision (int precision) |
| void | setTickStep (double step) |
| void | setTickVector (const QVector< double > &vec) |
| void | setTickVectorLabels (const QVector< QString > &vec) |
| void | setTickLength (int inside, int outside=0) |
| void | setTickLengthIn (int inside) |
| void | setTickLengthOut (int outside) |
| void | setSubTickCount (int count) |
| void | setSubTickLength (int inside, int outside=0) |
| void | setSubTickLengthIn (int inside) |
| void | setSubTickLengthOut (int outside) |
| void | setBasePen (const QPen &pen) |
| void | setTickPen (const QPen &pen) |
| void | setSubTickPen (const QPen &pen) |
| void | setLabelFont (const QFont &font) |
| void | setLabelColor (const QColor &color) |
| void | setLabel (const QString &str) |
| void | setLabelPadding (int padding) |
| void | setPadding (int padding) |
| void | setOffset (int offset) |
| void | setSelectedTickLabelFont (const QFont &font) |
| void | setSelectedLabelFont (const QFont &font) |
| void | setSelectedTickLabelColor (const QColor &color) |
| void | setSelectedLabelColor (const QColor &color) |
| void | setSelectedBasePen (const QPen &pen) |
| void | setSelectedTickPen (const QPen &pen) |
| void | setSelectedSubTickPen (const QPen &pen) |
| Q_SLOT void | setSelectableParts (const QCPAxis::SelectableParts &selectableParts) |
| Q_SLOT void | setSelectedParts (const QCPAxis::SelectableParts &selectedParts) |
| void | setLowerEnding (const QCPLineEnding &ending) |
| void | setUpperEnding (const QCPLineEnding &ending) |
| virtual double | selectTest (const QPointF &pos, bool onlySelectable, QVariant *details=0) const |
| Qt::Orientation | orientation () const |
| void | moveRange (double diff) |
| void | scaleRange (double factor, double center) |
| void | setScaleRatio (const QCPAxis *otherAxis, double ratio=1.0) |
| void | rescale (bool onlyVisiblePlottables=false) |
| double | pixelToCoord (double value) const |
| double | coordToPixel (double value) const |
| SelectablePart | getPartAt (const QPointF &pos) const |
| QList< QCPAbstractPlottable * > | plottables () const |
| QList< QCPGraph * > | graphs () const |
| QList< QCPAbstractItem * > | items () const |
Public Member Functions inherited from QCPLayerable | |
| QCPLayerable (QCustomPlot *plot, QString targetLayer=QString(), QCPLayerable *parentLayerable=0) | |
| ~QCPLayerable () | |
| bool | visible () const |
| QCustomPlot * | parentPlot () const |
| QCPLayerable * | parentLayerable () const |
| QCPLayer * | layer () const |
| bool | antialiased () const |
| void | setVisible (bool on) |
| Q_SLOT bool | setLayer (QCPLayer *layer) |
| bool | setLayer (const QString &layerName) |
| void | setAntialiased (bool enabled) |
| bool | realVisibility () const |
Static Public Member Functions | |
| static AxisType | marginSideToAxisType (QCP::MarginSide side) |
| static Qt::Orientation | orientation (AxisType type) |
| static AxisType | opposite (AxisType type) |
Protected Member Functions | |
| virtual void | setupTickVectors () |
| virtual void | generateAutoTicks () |
| virtual int | calculateAutoSubTickCount (double tickStep) const |
| virtual int | calculateMargin () |
| virtual void | applyDefaultAntialiasingHint (QCPPainter *painter) const |
| virtual void | draw (QCPPainter *painter) |
| virtual QCP::Interaction | selectionCategory () const |
| virtual void | selectEvent (QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged) |
| virtual void | deselectEvent (bool *selectionStateChanged) |
| void | visibleTickBounds (int &lowIndex, int &highIndex) const |
| double | baseLog (double value) const |
| double | basePow (double value) const |
| QPen | getBasePen () const |
| QPen | getTickPen () const |
| QPen | getSubTickPen () const |
| QFont | getTickLabelFont () const |
| QFont | getLabelFont () const |
| QColor | getTickLabelColor () const |
| QColor | getLabelColor () const |
Protected Member Functions inherited from QCPLayerable | |
| virtual void | parentPlotInitialized (QCustomPlot *parentPlot) |
| virtual QRect | clipRect () const |
| void | initializeParentPlot (QCustomPlot *parentPlot) |
| void | setParentLayerable (QCPLayerable *parentLayerable) |
| bool | moveToLayer (QCPLayer *layer, bool prepend) |
| void | applyAntialiasingHint (QCPPainter *painter, bool localAntialiased, QCP::AntialiasedElement overrideElement) const |
Friends | |
| class | QCustomPlot |
| class | QCPGrid |
| class | QCPAxisRect |
Manages a single axis inside a QCustomPlot.
Usually doesn't need to be instantiated externally. Access QCustomPlot's default four axes via QCustomPlot::xAxis (bottom), QCustomPlot::yAxis (left), QCustomPlot::xAxis2 (top) and QCustomPlot::yAxis2 (right).
Axes are always part of an axis rect, see QCPAxisRect.
Definition at line 980 of file qcustomplot.h.
| enum AxisType |
Defines at which side of the axis rect the axis will appear. This also affects how the tick marks are drawn, on which side the labels are placed etc.
Definition at line 1042 of file qcustomplot.h.
| enum LabelSide |
Defines on which side of the axis the tick labels (numbers) shall appear.
| Enumerator | |
|---|---|
| lsInside |
Tick labels will be displayed inside the axis rect and clipped to the inner axis rect. |
| lsOutside |
Tick labels will be displayed outside the axis rect. |
Definition at line 1064 of file qcustomplot.h.
| enum LabelType |
When automatic tick label generation is enabled (setAutoTickLabels), defines how the coordinate of the tick is interpreted, i.e. translated into a string.
| Enumerator | |
|---|---|
| ltNumber |
Tick coordinate is regarded as normal number and will be displayed as such. (see setNumberFormat) |
| ltDateTime |
Tick coordinate is regarded as a date/time (seconds since 1970-01-01T00:00:00 UTC) and will be displayed and formatted as such. (for details, see setDateTimeFormat) |
Definition at line 1055 of file qcustomplot.h.
| enum ScaleType |
Defines the scale of an axis.
| Enumerator | |
|---|---|
| stLinear |
Linear scaling. |
| stLogarithmic |
Logarithmic scaling with correspondingly transformed plots and (major) tick marks at every base power (see setScaleLogBase). |
Definition at line 1072 of file qcustomplot.h.
| enum SelectablePart |
Defines the selectable parts of an axis.
| Enumerator | |
|---|---|
| spNone |
None of the selectable parts. |
| spAxis |
The axis backbone and tick marks. |
| spTickLabels |
Tick labels (numbers) of this axis (as a whole, not individually) |
| spAxisLabel |
The axis label. |
Definition at line 1080 of file qcustomplot.h.
|
explicit |
Constructs an Axis instance of Type type for the axis rect parent.
Usually it isn't necessary to instantiate axes directly, because you can let QCustomPlot create them for you with QCPAxisRect::addAxis. If you want to use own QCPAxis-subclasses however, create them manually and then inject them also via QCPAxisRect::addAxis.
Definition at line 3989 of file qcustomplot.cpp.
References atBottom, atLeft, atRight, atTop, QCustomPlot::currentLayer(), mGrid, QCPLayerable::mParentPlot, QCPLayerable::setAntialiased(), setLabelPadding(), QCPLayerable::setLayer(), setTickLabelPadding(), and QCPLayerable::setVisible().
|
virtual |
Definition at line 4069 of file qcustomplot.cpp.
References mAxisPainter, and mGrid.
|
protectedvirtual |
Implements QCPLayerable.
Definition at line 5775 of file qcustomplot.cpp.
References QCP::aeAxes, QCPLayerable::applyAntialiasingHint(), and QCPLayerable::mAntialiased.
|
inline |
Definition at line 1102 of file qcustomplot.h.
Referenced by QCPAxisRect::setupFullAxesBox().
|
inline |
Definition at line 1099 of file qcustomplot.h.
Referenced by QCPAxisRect::setupFullAxesBox().
|
inline |
Definition at line 1100 of file qcustomplot.h.
|
inline |
Definition at line 1098 of file qcustomplot.h.
|
inline |
Definition at line 1101 of file qcustomplot.h.
Referenced by QCPAxisRect::setupFullAxesBox().
|
inline |
Definition at line 1093 of file qcustomplot.h.
Referenced by QCPAxisRect::addAxis(), QCPBarsGroup::getPixelSpacing(), QCPGraph::lowerFillBasePoint(), QCustomPlot::plottableAt(), setScaleRatio(), and QCPGraph::upperFillBasePoint().
|
inline |
Definition at line 1092 of file qcustomplot.h.
Referenced by QCPAxisRect::addAxis(), QCPGraph::lowerFillBasePoint(), and QCPGraph::upperFillBasePoint().
|
protected |
Definition at line 5890 of file qcustomplot.cpp.
References mScaleLogBaseLogInv.
Referenced by coordToPixel(), and generateAutoTicks().
|
inline |
Definition at line 1123 of file qcustomplot.h.
|
protected |
Definition at line 5902 of file qcustomplot.cpp.
References mScaleLogBase.
Referenced by generateAutoTicks().
|
protectedvirtual |
Definition at line 5683 of file qcustomplot.cpp.
References mSubTickCount.
Referenced by generateAutoTicks().
|
protectedvirtual |
Definition at line 5991 of file qcustomplot.cpp.
References QCPAxisPainterPrivate::axisRect, coordToPixel(), getLabelFont(), QCPAxisPainterPrivate::label, QCPAxisPainterPrivate::labelFont, mAxisPainter, mAxisRect, mAxisType, mCachedMargin, mCachedMarginValid, mLabel, mPadding, QCPLayerable::mParentPlot, mTickLabelFont, mTickLabels, mTicks, mTickVector, mTickVectorLabels, QCPLayerable::mVisible, QCPLayoutElement::rect(), QCPAxisPainterPrivate::size(), QCPAxisPainterPrivate::tickLabelFont, tickLabels(), QCPAxisPainterPrivate::tickLabels, QCPAxisPainterPrivate::tickPositions, QCPAxisPainterPrivate::type, QCustomPlot::viewport(), QCPAxisPainterPrivate::viewportRect, and visibleTickBounds().
| double coordToPixel | ( | double | value | ) | const |
Transforms value, in coordinates of the axis, to pixel coordinates of the QCustomPlot widget.
Definition at line 5324 of file qcustomplot.cpp.
References baseLog(), QCPAxisRect::bottom(), QCPAxisRect::height(), QCPAxisRect::left(), QCPRange::lower, mAxisRect, mRange, mRangeReversed, mScaleType, orientation(), QCPAxisRect::right(), QCPRange::size(), stLinear, QCPAxisRect::top(), QCPRange::upper, and QCPAxisRect::width().
Referenced by calculateMargin(), QCPFinancial::candlestickSelectTest(), QCPAbstractPlottable::coordsToPixels(), draw(), QCPFinancial::drawCandlestickPlot(), QCPGraph::drawError(), QCPGrid::drawGridLines(), QCPFinancial::drawOhlcPlot(), QCPGraph::drawScatterPlot(), QCPGrid::drawSubGridLines(), QCPBars::getBarPolygon(), QCPCurve::getCurveData(), QCPGraph::getImpulsePlotData(), QCPGraph::getLinePlotData(), QCPBarsGroup::getPixelSpacing(), QCPGraph::getPreparedData(), QCPGraph::getStepCenterPlotData(), QCPGraph::getStepLeftPlotData(), QCPGraph::getStepRightPlotData(), QCPGraph::lowerFillBasePoint(), QCPFinancial::ohlcSelectTest(), and QCPGraph::upperFillBasePoint().
|
inline |
Definition at line 1111 of file qcustomplot.h.
Referenced by QCPAxisRect::setupFullAxesBox().
|
inline |
Definition at line 1112 of file qcustomplot.h.
Referenced by QCPAxisRect::setupFullAxesBox().
|
protectedvirtual |
Reimplemented from QCPLayerable.
Definition at line 5754 of file qcustomplot.cpp.
References mSelectableParts, mSelectedParts, and setSelectedParts().
|
protectedvirtual |
Implements QCPLayerable.
Definition at line 5785 of file qcustomplot.cpp.
References QCPAxisPainterPrivate::abbreviateDecimalPowers, QCPAxisPainterPrivate::axisRect, QCPAxisPainterPrivate::basePen, coordToPixel(), QCPAxisPainterPrivate::draw(), getBasePen(), getLabelColor(), getLabelFont(), getSubTickPen(), getTickLabelColor(), getTickLabelFont(), getTickPen(), QCPAxisPainterPrivate::label, QCPAxisPainterPrivate::labelColor, QCPAxisPainterPrivate::labelFont, ltNumber, mAutoTickLabels, mAxisPainter, mAxisRect, mAxisType, mHighestVisibleTick, mLabel, mLowestVisibleTick, mNumberBeautifulPowers, QCPLayerable::mParentPlot, mRangeReversed, mScaleType, mSubTickCount, mSubTickVector, mTickLabels, mTickLabelType, mTicks, mTickVector, mTickVectorLabels, QCPLayoutElement::rect(), QCPAxisPainterPrivate::reversedEndings, stLogarithmic, QCPAxisPainterPrivate::substituteExponent, subTickCount(), QCPAxisPainterPrivate::subTickPen, QCPAxisPainterPrivate::subTickPositions, QCPAxisPainterPrivate::tickLabelColor, QCPAxisPainterPrivate::tickLabelFont, tickLabels(), QCPAxisPainterPrivate::tickLabels, QCPAxisPainterPrivate::tickPen, QCPAxisPainterPrivate::tickPositions, QCPAxisPainterPrivate::type, QCustomPlot::viewport(), and QCPAxisPainterPrivate::viewportRect.
|
protectedvirtual |
Definition at line 5607 of file qcustomplot.cpp.
References baseLog(), basePow(), calculateAutoSubTickCount(), QCPRange::lower, mAutoSubTicks, mAutoTickCount, mAutoTickStep, mRange, mScaleLogBase, mScaleType, mSubTickCount, mTickStep, mTickVector, QCPRange::size(), stLinear, and QCPRange::upper.
Referenced by setupTickVectors().
|
protected |
Definition at line 5912 of file qcustomplot.cpp.
References mBasePen, mSelectedBasePen, mSelectedParts, and spAxis.
Referenced by draw().
|
protected |
Definition at line 5972 of file qcustomplot.cpp.
References mLabelColor, mSelectedLabelColor, mSelectedParts, and spAxisLabel.
Referenced by draw().
|
protected |
Definition at line 5952 of file qcustomplot.cpp.
References mLabelFont, mSelectedLabelFont, mSelectedParts, and spAxisLabel.
Referenced by calculateMargin(), and draw().
| QCPAxis::SelectablePart getPartAt | ( | const QPointF & | pos | ) | const |
Returns the part of the axis that is hit by pos (in pixels). The return value of this function is independent of the user-selectable parts defined with setSelectableParts. Further, this function does not change the current selection state of the axis.
If the axis is not visible (setVisible), this function always returns spNone.
Definition at line 5382 of file qcustomplot.cpp.
References QCPAxisPainterPrivate::axisSelectionBox(), QCPAxisPainterPrivate::labelSelectionBox(), mAxisPainter, QCPLayerable::mVisible, spAxis, spAxisLabel, spNone, spTickLabels, and QCPAxisPainterPrivate::tickLabelsSelectionBox().
Referenced by selectTest().
|
protected |
Definition at line 5932 of file qcustomplot.cpp.
References mSelectedParts, mSelectedSubTickPen, mSubTickPen, and spAxis.
Referenced by draw().
|
protected |
Definition at line 5962 of file qcustomplot.cpp.
References mSelectedParts, mSelectedTickLabelColor, mTickLabelColor, and spTickLabels.
Referenced by draw().
|
protected |
Definition at line 5942 of file qcustomplot.cpp.
References mSelectedParts, mSelectedTickLabelFont, mTickLabelFont, and spTickLabels.
Referenced by draw().
|
protected |
Definition at line 5922 of file qcustomplot.cpp.
References mSelectedParts, mSelectedTickPen, mTickPen, and spAxis.
Referenced by draw().
| QList< QCPGraph * > graphs | ( | ) | const |
Returns a list of all the graphs that have this axis as key or value axis.
Definition at line 5435 of file qcustomplot.cpp.
References QCustomPlot::mGraphs, and QCPLayerable::mParentPlot.
|
inline |
Returns the QCPGrid instance belonging to this axis. Access it to set details about the way the grid is displayed.
Definition at line 1143 of file qcustomplot.h.
Referenced by QCPAxisRect::QCPAxisRect(), QCPColorScaleAxisRectPrivate::QCPColorScaleAxisRectPrivate(), and QCustomPlot::QCustomPlot().
| QList< QCPAbstractItem * > items | ( | ) | const |
Returns a list of all the items that are associated with this axis. An item is considered associated with an axis if at least one of its positions uses the axis as key or value axis.
Definition at line 5454 of file qcustomplot.cpp.
References QCustomPlot::mItems, and QCPLayerable::mParentPlot.
|
inline |
Definition at line 1128 of file qcustomplot.h.
|
inline |
Definition at line 1127 of file qcustomplot.h.
|
inline |
Definition at line 1126 of file qcustomplot.h.
| int labelPadding | ( | ) | const |
Definition at line 4132 of file qcustomplot.cpp.
References QCPAxisPainterPrivate::labelPadding, and mAxisPainter.
| QCPLineEnding lowerEnding | ( | ) | const |
Definition at line 4144 of file qcustomplot.cpp.
References QCPAxisPainterPrivate::lowerEnding, and mAxisPainter.
|
static |
Transforms a margin side to the logically corresponding axis type. (QCP::msLeft to QCPAxis::atLeft, QCP::msRight to QCPAxis::atRight, etc.)
Definition at line 5478 of file qcustomplot.cpp.
References atBottom, atLeft, atRight, atTop, QCP::msBottom, QCP::msLeft, QCP::msRight, and QCP::msTop.
Referenced by QCPAxisRect::calculateAutoMargin().
| void moveRange | ( | double | diff | ) |
If the scale type (setScaleType) is stLinear, diff is added to the lower and upper bounds of the range. The range is simply moved by diff.
If the scale type is stLogarithmic, the range bounds are multiplied by diff. This corresponds to an apparent "linear" move in logarithmic scaling by a distance of log(diff).
Definition at line 5150 of file qcustomplot.cpp.
References QCPRange::lower, mCachedMarginValid, mRange, mScaleType, rangeChanged(), stLinear, and QCPRange::upper.
| QString numberFormat | ( | ) | const |
Definition at line 4094 of file qcustomplot.cpp.
References mAxisPainter, mNumberBeautifulPowers, mNumberFormatChar, and QCPAxisPainterPrivate::numberMultiplyCross.
Referenced by QCPAxisRect::setupFullAxesBox().
|
inline |
Definition at line 1114 of file qcustomplot.h.
Referenced by QCPAxisRect::setupFullAxesBox().
| int offset | ( | ) | const |
Definition at line 4138 of file qcustomplot.cpp.
References mAxisPainter, and QCPAxisPainterPrivate::offset.
Referenced by setOffset().
|
static |
|
inline |
Returns the orientation of this axis. The axis orientation (horizontal or vertical) is deduced from the axis type (left, top, right or bottom).
Definition at line 1206 of file qcustomplot.h.
Referenced by QCPFinancial::candlestickSelectTest(), QCPAbstractPlottable::coordsToPixels(), coordToPixel(), QCPAxisPainterPrivate::draw(), QCPColorMap::draw(), QCPFinancial::drawCandlestickPlot(), QCPGraph::drawError(), QCPGrid::drawGridLines(), QCPFinancial::drawOhlcPlot(), QCPGraph::drawScatterPlot(), QCPGrid::drawSubGridLines(), QCPBars::getBarPolygon(), QCPGraph::getChannelFillPolygon(), QCPCurve::getCurveData(), QCPGraph::getImpulsePlotData(), QCPGraph::getLinePlotData(), QCPBarsGroup::getPixelSpacing(), QCPGraph::getPreparedData(), QCPGraph::getStepCenterPlotData(), QCPGraph::getStepLeftPlotData(), QCPGraph::getStepRightPlotData(), QCPGraph::lowerFillBasePoint(), QCPFinancial::ohlcSelectTest(), QCPAbstractPlottable::pixelsToCoords(), pixelToCoord(), QCPAxisPainterPrivate::placeTickLabel(), QCPAbstractPlottable::QCPAbstractPlottable(), QCPColorScale::rangeDrag(), QCPColorScale::rangeZoom(), QCPColorScale::setRangeDrag(), QCPColorScale::setRangeZoom(), setScaleRatio(), QCPColorScale::setType(), QCPAxisPainterPrivate::size(), QCPColorMap::updateLegendIcon(), QCPColorMap::updateMapImage(), and QCPGraph::upperFillBasePoint().
|
inlinestatic |
Returns the orientation of the specified axis type
Definition at line 1219 of file qcustomplot.h.
|
inline |
Definition at line 1130 of file qcustomplot.h.
Referenced by setLabelPadding(), setPadding(), and setTickLabelPadding().
| double pixelToCoord | ( | double | value | ) | const |
Transforms value, in pixel coordinates of the QCustomPlot widget, to axis coordinates.
Definition at line 5286 of file qcustomplot.cpp.
References QCPAxisRect::bottom(), QCPAxisRect::height(), QCPAxisRect::left(), QCPRange::lower, mAxisRect, mRange, mRangeReversed, mScaleType, orientation(), QCPRange::size(), stLinear, QCPRange::upper, and QCPAxisRect::width().
Referenced by QCPCurve::getCurveData(), QCPGraph::getPreparedData(), and QCPAbstractPlottable::pixelsToCoords().
| QList< QCPAbstractPlottable * > plottables | ( | ) | const |
Returns a list of all the plottables that have this axis as key or value axis.
If you are only interested in plottables of type QCPGraph, see graphs.
Definition at line 5417 of file qcustomplot.cpp.
References QCPLayerable::mParentPlot, and QCustomPlot::mPlottables.
Referenced by rescale().
|
inline |
Definition at line 1096 of file qcustomplot.h.
Referenced by QCPGrid::drawGridLines(), QCPCurve::getCurveData(), QCPGraph::getPreparedData(), QCPGraph::lowerFillBasePoint(), QCPAbstractPlottable::rescaleKeyAxis(), QCPGraph::rescaleKeyAxis(), QCPAbstractPlottable::rescaleValueAxis(), QCPGraph::rescaleValueAxis(), setScaleRatio(), QCPAxisRect::setupFullAxesBox(), and QCPGraph::upperFillBasePoint().
|
signal |
This signal is emitted when the range of this axis has changed. You can connect it to the setRange slot of another axis to communicate the new range to the other axis, in order for it to be synchronized.
You may also manipulate/correct the range with setRange in a slot connected to this signal. This is useful if for example a maximum range span shall not be exceeded, or if the lower/upper range shouldn't go beyond certain values. For example, the following slot would limit the x axis to only positive ranges:
Referenced by moveRange(), scaleRange(), setRange(), setRangeLower(), and setRangeUpper().
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Additionally to the new range, this signal also provides the previous range held by the axis as oldRange.
|
inline |
Definition at line 1097 of file qcustomplot.h.
Referenced by QCPGraph::drawError(), QCPCurve::getCurveData(), QCPGraph::getPreparedData(), QCPGraph::lowerFillBasePoint(), QCPAxisRect::setupFullAxesBox(), and QCPGraph::upperFillBasePoint().
| void rescale | ( | bool | onlyVisiblePlottables = false | ) |
Changes the axis range such that all plottables associated with this axis are fully visible in that dimension.
Definition at line 5237 of file qcustomplot.cpp.
References QCPRange::expand(), QCPRange::lower, mRange, mScaleType, plottables(), QCPAbstractPlottable::sdBoth, QCPAbstractPlottable::sdNegative, QCPAbstractPlottable::sdPositive, setRange(), QCPRange::size(), stLinear, stLogarithmic, QCPRange::upper, and QCPRange::validRange().
Referenced by QCustomPlot::rescaleAxes().
|
inline |
Definition at line 1095 of file qcustomplot.h.
Referenced by QCPAxisRect::setupFullAxesBox().
| void scaleRange | ( | double | factor, |
| double | center | ||
| ) |
Scales the range of this axis by factor around the coordinate center. For example, if factor is 2.0, center is 1.0, then the axis range will double its size, and the point at coordinate 1.0 won't have changed its position in the QCustomPlot widget (i.e. coordinates around 1.0 will have moved symmetrically closer to 1.0).
Definition at line 5173 of file qcustomplot.cpp.
References QCPRange::lower, mCachedMarginValid, mRange, mScaleType, rangeChanged(), QCPRange::sanitizedForLinScale(), QCPRange::sanitizedForLogScale(), stLinear, QCPRange::upper, and QCPRange::validRange().
|
inline |
Definition at line 1094 of file qcustomplot.h.
Referenced by QCPGraph::getPreparedData(), QCPGraph::lowerFillBasePoint(), QCPAbstractPlottable::rescaleKeyAxis(), QCPGraph::rescaleKeyAxis(), QCPAbstractPlottable::rescaleValueAxis(), QCPGraph::rescaleValueAxis(), QCPAxisRect::setupFullAxesBox(), and QCPGraph::upperFillBasePoint().
|
signal |
This signal is emitted when the scale type changes, by calls to setScaleType
Referenced by setScaleType().
|
signal |
This signal is emitted when the selectability changes, by calls to setSelectableParts
Referenced by setSelectableParts().
|
inline |
Definition at line 1133 of file qcustomplot.h.
Referenced by QCPColorScaleAxisRectPrivate::axisSelectableChanged(), and QCPColorScaleAxisRectPrivate::axisSelectionChanged().
|
inline |
Definition at line 1138 of file qcustomplot.h.
|
inline |
Definition at line 1137 of file qcustomplot.h.
|
inline |
Definition at line 1135 of file qcustomplot.h.
|
inline |
Definition at line 1132 of file qcustomplot.h.
Referenced by QCustomPlot::selectedAxes().
|
inline |
Definition at line 1140 of file qcustomplot.h.
|
inline |
Definition at line 1136 of file qcustomplot.h.
|
inline |
Definition at line 1134 of file qcustomplot.h.
|
inline |
Definition at line 1139 of file qcustomplot.h.
|
protectedvirtual |
Reimplemented from QCPLayerable.
Definition at line 5740 of file qcustomplot.cpp.
References mSelectableParts, mSelectedParts, and setSelectedParts().
|
protectedvirtual |
Reimplemented from QCPLayerable.
Definition at line 6036 of file qcustomplot.cpp.
References QCP::iSelectAxes.
|
signal |
This signal is emitted when the selection state of this axis has changed, either by user interaction or by a direct call to setSelectedParts.
Referenced by setSelectedParts().
|
virtual |
This function is used to decide whether a click hits a layerable object or not.
pos is a point in pixel coordinates on the QCustomPlot surface. This function returns the shortest pixel distance of this point to the object. If the object is either invisible or the distance couldn't be determined, -1.0 is returned. Further, if onlySelectable is true and the object is not selectable, -1.0 is returned, too.
If the object is represented not by single lines but by an area like a QCPItemText or the bars of a QCPBars plottable, a click inside the area should also be considered a hit. In these cases this function thus returns a constant value greater zero but still below the parent plot's selection tolerance. (typically the selectionTolerance multiplied by 0.99).
Providing a constant value for area objects allows selecting line objects even when they are obscured by such area objects, by clicking close to the lines (i.e. closer than 0.99*selectionTolerance).
The actual setting of the selection state is not done by this function. This is handled by the parent QCustomPlot when the mouseReleaseEvent occurs, and the finally selected object is notified via the selectEvent/deselectEvent methods.
details is an optional output parameter. Every layerable subclass may place any information in details. This information will be passed to selectEvent when the parent QCustomPlot decides on the basis of this selectTest call, that the object was successfully selected. The subsequent call to selectEvent will carry the details. This is useful for multi-part objects (like QCPAxis). This way, a possibly complex calculation to decide which part was clicked is only done once in selectTest. The result (i.e. the actually clicked part) can then be placed in details. So in the subsequent selectEvent, the decision which part was selected doesn't have to be done a second time for a single selection operation.
You may pass 0 as details to indicate that you are not interested in those selection details.
Reimplemented from QCPLayerable.
Definition at line 5398 of file qcustomplot.cpp.
References getPartAt(), QCPLayerable::mParentPlot, mSelectableParts, QCustomPlot::selectionTolerance(), and spNone.
| void setAutoSubTicks | ( | bool | on | ) |
Sets whether the number of sub ticks in one tick interval is determined automatically. This works, as long as the tick step mantissa is a multiple of 0.5. When setAutoTickStep is enabled, this is always the case.
When on is set to false, you may set the sub tick count with setSubTickCount manually.
Definition at line 4485 of file qcustomplot.cpp.
References mAutoSubTicks, and mCachedMarginValid.
Referenced by QCPAxisRect::setupFullAxesBox().
| void setAutoTickCount | ( | int | approximateCount | ) |
When setAutoTickStep is true, approximateCount determines how many ticks should be generated in the visible range, approximately.
It's not guaranteed that this number of ticks is met exactly, but approximately within a tolerance of about two.
Only values greater than zero are accepted as approximateCount.
Definition at line 4418 of file qcustomplot.cpp.
References mAutoTickCount, and mCachedMarginValid.
Referenced by QCPAxisRect::setupFullAxesBox().
| void setAutoTickLabels | ( | bool | on | ) |
Sets whether the tick labels are generated automatically. Depending on the tick label type (ltNumber or ltDateTime), the labels will either show the coordinate as floating point number (setNumberFormat), or a date/time formatted according to setDateTimeFormat.
If on is set to false, you should provide the tick labels via setTickVectorLabels. This is usually used in a combination with setAutoTicks set to false for complete control over tick positions and labels, e.g. when the ticks should be at multiples of pi and show "2pi", "3pi" etc. as tick labels.
If you need dynamically calculated tick vectors (and possibly tick label vectors), set the vectors in a slot connected to the ticksRequest signal.
Definition at line 4446 of file qcustomplot.cpp.
References mAutoTickLabels, and mCachedMarginValid.
| void setAutoTicks | ( | bool | on | ) |
Sets whether the tick positions should be calculated automatically (either from an automatically generated tick step or a tick step provided manually via setTickStep, see setAutoTickStep).
If on is set to false, you must provide the tick positions manually via setTickVector. For these manual ticks you may let QCPAxis generate the appropriate labels automatically by leaving setAutoTickLabels set to true. If you also wish to control the displayed labels manually, set setAutoTickLabels to false and provide the label strings with setTickVectorLabels.
If you need dynamically calculated tick vectors (and possibly tick label vectors), set the vectors in a slot connected to the ticksRequest signal.
Definition at line 4398 of file qcustomplot.cpp.
References mAutoTicks, and mCachedMarginValid.
| void setAutoTickStep | ( | bool | on | ) |
Sets whether the tick step, i.e. the interval between two (major) ticks, is calculated automatically. If on is set to true, the axis finds a tick step that is reasonable for human readable plots.
The number of ticks the algorithm aims for within the visible range can be specified with setAutoTickCount.
If on is set to false, you may set the tick step manually with setTickStep.
Definition at line 4467 of file qcustomplot.cpp.
References mAutoTickStep, and mCachedMarginValid.
Referenced by QCPAxisRect::setupFullAxesBox().
| void setBasePen | ( | const QPen & | pen | ) |
Sets the pen, the axis base line is drawn with.
Definition at line 4927 of file qcustomplot.cpp.
References mBasePen.
| void setDateTimeFormat | ( | const QString & | format | ) |
Sets the format in which dates and times are displayed as tick labels, if setTickLabelType is ltDateTime. for details about the format string, see the documentation of QDateTime::toString().
Newlines can be inserted with "\n".
Definition at line 4631 of file qcustomplot.cpp.
References mCachedMarginValid, and mDateTimeFormat.
Referenced by QCPAxisRect::setupFullAxesBox().
| void setDateTimeSpec | ( | const Qt::TimeSpec & | timeSpec | ) |
Sets the time spec that is used for the date time values when setTickLabelType is ltDateTime.
The default value of QDateTime objects (and also QCustomPlot) is Qt::LocalTime. However, if the date time values passed to QCustomPlot are given in the UTC spec, set timeSpec to Qt::UTC to get the correct axis labels.
Definition at line 4650 of file qcustomplot.cpp.
References mDateTimeSpec.
Referenced by QCPAxisRect::setupFullAxesBox().
| void setLabel | ( | const QString & | str | ) |
Sets the text of the axis label that will be shown below/above or next to the axis, depending on its orientation. To disable axis labels, pass an empty string as str.
Definition at line 4980 of file qcustomplot.cpp.
References mCachedMarginValid, and mLabel.
| void setLabelColor | ( | const QColor & | color | ) |
Sets the color of the axis label.
Definition at line 4971 of file qcustomplot.cpp.
References mLabelColor.
| void setLabelFont | ( | const QFont & | font | ) |
Sets the font of the axis label.
Definition at line 4957 of file qcustomplot.cpp.
References mCachedMarginValid, and mLabelFont.
| void setLabelPadding | ( | int | padding | ) |
Sets the distance between the tick labels and the axis label.
Definition at line 4994 of file qcustomplot.cpp.
References QCPAxisPainterPrivate::labelPadding, mAxisPainter, mCachedMarginValid, and padding().
Referenced by QCPAxis().
| void setLowerEnding | ( | const QCPLineEnding & | ending | ) |
Sets the style for the lower axis ending. See the documentation of QCPLineEnding for available styles.
For horizontal axes, this method refers to the left ending, for vertical axes the bottom ending. Note that this meaning does not change when the axis range is reversed with setRangeReversed.
Definition at line 5123 of file qcustomplot.cpp.
References QCPAxisPainterPrivate::lowerEnding, and mAxisPainter.
Referenced by QCPAxisRect::addAxis().
| void setNumberFormat | ( | const QString & | formatCode | ) |
Sets the number format for the numbers drawn as tick labels (if tick label type is ltNumber). This formatCode is an extended version of the format code used e.g. by QString::number() and QLocale::toString(). For reference about that, see the "Argument Formats" section in the detailed description of the QString class. formatCode is a string of one, two or three characters. The first character is identical to the normal format code used by Qt. In short, this means: 'e'/'E' scientific format, 'f' fixed format, 'g'/'G' scientific or fixed, whichever is shorter.
The second and third characters are optional and specific to QCustomPlot:
If the first char was 'e' or 'g', numbers are/might be displayed in the scientific format, e.g. "5.5e9", which is ugly in a plot. So when the second char of formatCode is set to 'b' (for "beautiful"), those exponential numbers are formatted in a more natural way, i.e. "5.5
[multiplication sign] 10 [superscript] 9". By default, the multiplication sign is a centered dot. If instead a cross should be shown (as is usual in the USA), the third char of formatCode can be set to 'c'. The inserted multiplication signs are the UTF-8 characters 215 (0xD7) for the cross and 183 (0xB7) for the dot.
If the scale type (setScaleType) is stLogarithmic and the formatCode uses the 'b' option (beautifully typeset decimal powers), the display usually is "1 [multiplication sign] 10 [superscript] n", which looks unnatural for logarithmic scaling (the "1 [multiplication sign]" part). To only display the decimal power, set the number precision to zero with setNumberPrecision.
Examples for formatCode:
g normal format code behaviour. If number is small, fixed format is used, if number is large, normal scientific format is used gb If number is small, fixed format is used, if number is large, scientific format is used with beautifully typeset decimal powers and a dot as multiplication sign ebc All numbers are in scientific format with beautifully typeset decimal power and a cross as multiplication sign fb illegal format code, since fixed format doesn't support (or need) beautifully typeset decimal powers. Format code will be reduced to 'f'. hello illegal format code, since first char is not 'e', 'E', 'f', 'g' or 'G'. Current format code will not be changed. Definition at line 4691 of file qcustomplot.cpp.
References mAxisPainter, mCachedMarginValid, mNumberBeautifulPowers, mNumberFormatChar, and QCPAxisPainterPrivate::numberMultiplyCross.
Referenced by QCPAxisRect::setupFullAxesBox().
| void setNumberPrecision | ( | int | precision | ) |
Sets the precision of the tick label numbers. See QLocale::toString(double i, char f, int prec) for details. The effect of precisions are most notably for number Formats starting with 'e', see setNumberFormat
If the scale type (setScaleType) is stLogarithmic and the number format (setNumberFormat) uses the 'b' format code (beautifully typeset decimal powers), the display usually is "1 [multiplication sign] 10 [superscript] n", which looks unnatural for logarithmic scaling (the redundant "1 [multiplication sign]" part). To only display the decimal power "10 [superscript] n", set precision to zero.
Definition at line 4757 of file qcustomplot.cpp.
References mCachedMarginValid, and mNumberPrecision.
Referenced by QCPAxisRect::setupFullAxesBox().
| void setOffset | ( | int | offset | ) |
Sets the offset the axis has to its axis rect side.
If an axis rect side has multiple axes and automatic margin calculation is enabled for that side, only the offset of the inner most axis has meaning (even if it is set to be invisible). The offset of the other, outer axes is controlled automatically, to place them at appropriate positions.
Definition at line 5030 of file qcustomplot.cpp.
References mAxisPainter, offset(), and QCPAxisPainterPrivate::offset.
| void setPadding | ( | int | padding | ) |
Sets the padding of the axis.
When QCPAxisRect::setAutoMargins is enabled, the padding is the additional outer most space, that is left blank.
The axis padding has no meaning if QCPAxisRect::setAutoMargins is disabled.
Definition at line 5013 of file qcustomplot.cpp.
References mCachedMarginValid, mPadding, and padding().
Referenced by QCPColorScaleAxisRectPrivate::QCPColorScaleAxisRectPrivate().
| void setRange | ( | const QCPRange & | range | ) |
Sets the range of the axis.
This slot may be connected with the rangeChanged signal of another axis so this axis is always synchronized with the other axis range, when it changes.
To invert the direction of an axis, use setRangeReversed.
Definition at line 4206 of file qcustomplot.cpp.
References QCPRange::lower, mCachedMarginValid, mRange, mScaleType, rangeChanged(), QCPRange::sanitizedForLinScale(), QCPRange::sanitizedForLogScale(), stLogarithmic, QCPRange::upper, and QCPRange::validRange().
Referenced by rescale(), QCPAbstractPlottable::rescaleKeyAxis(), QCPGraph::rescaleKeyAxis(), QCPAbstractPlottable::rescaleValueAxis(), QCPGraph::rescaleValueAxis(), setRange(), setScaleRatio(), setScaleType(), and QCPAxisRect::setupFullAxesBox().
| void setRange | ( | double | lower, |
| double | upper | ||
| ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Sets the lower and upper bound of the axis range.
To invert the direction of an axis, use setRangeReversed.
There is also a slot to set a range, see setRange(const QCPRange &range).
Definition at line 4277 of file qcustomplot.cpp.
References QCPRange::lower, mCachedMarginValid, mRange, mScaleType, rangeChanged(), QCPRange::sanitizedForLinScale(), QCPRange::sanitizedForLogScale(), stLogarithmic, QCPRange::upper, and QCPRange::validRange().
| void setRange | ( | double | position, |
| double | size, | ||
| Qt::AlignmentFlag | alignment | ||
| ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Sets the range of the axis.
The position coordinate indicates together with the alignment parameter, where the new range will be positioned. size defines the size of the new axis range. alignment may be Qt::AlignLeft, Qt::AlignRight or Qt::AlignCenter. This will cause the left border, right border, or center of the range to be aligned with position. Any other values of alignment will default to Qt::AlignCenter.
Definition at line 4309 of file qcustomplot.cpp.
References setRange().
| void setRangeLower | ( | double | lower | ) |
Sets the lower bound of the axis range. The upper bound is not changed.
Definition at line 4323 of file qcustomplot.cpp.
References QCPRange::lower, mCachedMarginValid, mRange, mScaleType, rangeChanged(), QCPRange::sanitizedForLinScale(), QCPRange::sanitizedForLogScale(), and stLogarithmic.
| void setRangeReversed | ( | bool | reversed | ) |
Sets whether the axis range (direction) is displayed reversed. Normally, the values on horizontal axes increase left to right, on vertical axes bottom to top. When reversed is set to true, the direction of increasing values is inverted.
Note that the range and data interface stays the same for reversed axes, e.g. the lower part of the setRange interface will still reference the mathematically smaller number than the upper part.
Definition at line 4374 of file qcustomplot.cpp.
References mCachedMarginValid, and mRangeReversed.
Referenced by QCPAxisRect::setupFullAxesBox().
| void setRangeUpper | ( | double | upper | ) |
Sets the upper bound of the axis range. The lower bound is not changed.
Definition at line 4346 of file qcustomplot.cpp.
References mCachedMarginValid, mRange, mScaleType, rangeChanged(), QCPRange::sanitizedForLinScale(), QCPRange::sanitizedForLogScale(), stLogarithmic, and QCPRange::upper.
| void setScaleLogBase | ( | double | base | ) |
If setScaleType is set to stLogarithmic, base will be the logarithm base of the scaling. In logarithmic axis scaling, major tick marks appear at all powers of base.
Properties like tick step (setTickStep) don't apply in logarithmic scaling. If you wish a decimal base but less major ticks, consider choosing base 100, 1000 or even higher.
Definition at line 4187 of file qcustomplot.cpp.
References mCachedMarginValid, mScaleLogBase, and mScaleLogBaseLogInv.
Referenced by QCPAxisRect::setupFullAxesBox().
| void setScaleRatio | ( | const QCPAxis * | otherAxis, |
| double | ratio = 1.0 |
||
| ) |
Scales the range of this axis to have a certain scale ratio to otherAxis. The scaling will be done around the center of the current axis range.
For example, if ratio is 1, this axis is the yAxis and otherAxis is xAxis, graphs plotted with those axes will appear in a 1:1 aspect ratio, independent of the aspect ratio the axis rect has.
This is an operation that changes the range of this axis once, it doesn't fix the scale ratio indefinitely. Note that calling this function in the constructor of the QCustomPlot's parent won't have the desired effect, since the widget dimensions aren't defined yet, and a resizeEvent will follow.
Definition at line 5213 of file qcustomplot.cpp.
References axisRect(), QCPAxisRect::height(), orientation(), range(), setRange(), QCPRange::size(), and QCPAxisRect::width().
| void setScaleType | ( | QCPAxis::ScaleType | type | ) |
Sets whether the axis uses a linear scale or a logarithmic scale. If type is set to stLogarithmic, the logarithm base can be set with setScaleLogBase. In logarithmic axis scaling, major tick marks appear at all powers of the logarithm base. Properties like tick step (setTickStep) don't apply in logarithmic scaling. If you wish a decimal base but less major ticks, consider choosing a logarithm base of 100, 1000 or even higher.
If type is stLogarithmic and the number format (setNumberFormat) uses the 'b' option (beautifully typeset decimal powers), the display usually is "1 [multiplication sign] 10 [superscript] n", which looks unnatural for logarithmic scaling (the "1 [multiplication sign]" part). To only display the decimal power, set the number precision to zero with setNumberPrecision.
Definition at line 4168 of file qcustomplot.cpp.
References mCachedMarginValid, mRange, mScaleType, QCPRange::sanitizedForLogScale(), scaleTypeChanged(), setRange(), and stLogarithmic.
Referenced by QCPAxisRect::setupFullAxesBox().
| void setSelectableParts | ( | const QCPAxis::SelectableParts & | selectableParts | ) |
Sets whether the user can (de-)select the parts in selectable by clicking on the QCustomPlot surface. (When QCustomPlot::setInteractions contains iSelectAxes.)
However, even when selectable is set to a value not allowing the selection of a specific part, it is still possible to set the selection of this part manually, by calling setSelectedParts directly.
Definition at line 4235 of file qcustomplot.cpp.
References mSelectableParts, and selectableChanged().
Referenced by QCPColorScaleAxisRectPrivate::axisSelectableChanged().
| void setSelectedBasePen | ( | const QPen & | pen | ) |
Sets the pen that is used to draw the axis base line when selected.
Definition at line 5088 of file qcustomplot.cpp.
References mSelectedBasePen.
| void setSelectedLabelColor | ( | const QColor & | color | ) |
Sets the color that is used for the axis label when it is selected.
Definition at line 5078 of file qcustomplot.cpp.
References mSelectedLabelColor.
| void setSelectedLabelFont | ( | const QFont & | font | ) |
Sets the font that is used for the axis label when it is selected.
Definition at line 5054 of file qcustomplot.cpp.
References mSelectedLabelFont.
| void setSelectedParts | ( | const QCPAxis::SelectableParts & | selectedParts | ) |
Sets the selected state of the respective axis parts described by SelectablePart. When a part is selected, it uses a different pen/font.
The entire selection mechanism for axes is handled automatically when QCustomPlot::setInteractions contains iSelectAxes. You only need to call this function when you wish to change the selection state manually.
This function can change the selection state of a part, independent of the setSelectableParts setting.
emits the selectionChanged signal when selected is different from the previous selection state.
Definition at line 4259 of file qcustomplot.cpp.
References mSelectedParts, and selectionChanged().
Referenced by QCPColorScaleAxisRectPrivate::axisSelectionChanged(), deselectEvent(), and selectEvent().
| void setSelectedSubTickPen | ( | const QPen & | pen | ) |
Sets the pen that is used to draw the subticks when selected.
Definition at line 5108 of file qcustomplot.cpp.
References mSelectedSubTickPen.
| void setSelectedTickLabelColor | ( | const QColor & | color | ) |
Sets the color that is used for tick labels when they are selected.
Definition at line 5065 of file qcustomplot.cpp.
References mSelectedTickLabelColor.
| void setSelectedTickLabelFont | ( | const QFont & | font | ) |
Sets the font that is used for tick labels when they are selected.
Definition at line 5040 of file qcustomplot.cpp.
References mSelectedTickLabelFont.
| void setSelectedTickPen | ( | const QPen & | pen | ) |
Sets the pen that is used to draw the (major) ticks when selected.
Definition at line 5098 of file qcustomplot.cpp.
References mSelectedTickPen.
| void setSubTickCount | ( | int | count | ) |
Sets the number of sub ticks in one (major) tick step. A sub tick count of three for example, divides the tick intervals in four sub intervals.
By default, the number of sub ticks is chosen automatically in a reasonable manner as long as the mantissa of the tick step is a multiple of 0.5. When setAutoTickStep is enabled, this is always the case.
If you want to disable automatic sub tick count and use this function to set the count manually, see setAutoSubTicks.
Definition at line 4873 of file qcustomplot.cpp.
References mSubTickCount.
Referenced by QCPAxisRect::setupFullAxesBox().
| void setSubTickLength | ( | int | inside, |
| int | outside = 0 |
||
| ) |
Sets the length of the subticks in pixels. inside is the length the subticks will reach inside the plot and outside is the length they will reach outside the plot. If outside is greater than zero, the tick labels and axis label will increase their distance to the axis accordingly, so they won't collide with the ticks.
Definition at line 4886 of file qcustomplot.cpp.
References setSubTickLengthIn(), and setSubTickLengthOut().
| void setSubTickLengthIn | ( | int | inside | ) |
Sets the length of the inward subticks in pixels. inside is the length the subticks will reach inside the plot.
Definition at line 4898 of file qcustomplot.cpp.
References mAxisPainter, and QCPAxisPainterPrivate::subTickLengthIn.
Referenced by setSubTickLength().
| void setSubTickLengthOut | ( | int | outside | ) |
Sets the length of the outward subticks in pixels. outside is the length the subticks will reach outside the plot. If outside is greater than zero, the tick labels will increase their distance to the axis accordingly, so they won't collide with the ticks.
Definition at line 4913 of file qcustomplot.cpp.
References mAxisPainter, mCachedMarginValid, and QCPAxisPainterPrivate::subTickLengthOut.
Referenced by setSubTickLength().
| void setSubTickPen | ( | const QPen & | pen | ) |
Sets the pen, subtick marks will be drawn with.
Definition at line 4947 of file qcustomplot.cpp.
References mSubTickPen.
| void setTickLabelColor | ( | const QColor & | color | ) |
Sets the color of the tick labels.
Definition at line 4583 of file qcustomplot.cpp.
References mCachedMarginValid, and mTickLabelColor.
| void setTickLabelFont | ( | const QFont & | font | ) |
Sets the font of the tick labels.
Definition at line 4569 of file qcustomplot.cpp.
References mCachedMarginValid, and mTickLabelFont.
| void setTickLabelPadding | ( | int | padding | ) |
Sets the distance between the axis base line (including any outward ticks) and the tick labels.
Definition at line 4525 of file qcustomplot.cpp.
References mAxisPainter, mCachedMarginValid, padding(), and QCPAxisPainterPrivate::tickLabelPadding.
Referenced by QCPAxis().
| void setTickLabelRotation | ( | double | degrees | ) |
Sets the rotation of the tick labels. If degrees is zero, the labels are drawn normally. Else, the tick labels are drawn rotated by degrees clockwise. The specified angle is bound to values from -90 to 90 degrees.
If degrees is exactly -90, 0 or 90, the tick labels are centered on the tick coordinate. For other angles, the label is drawn with an offset such that it seems to point toward or away from the tick mark.
Definition at line 4601 of file qcustomplot.cpp.
References mAxisPainter, mCachedMarginValid, and QCPAxisPainterPrivate::tickLabelRotation.
| void setTickLabels | ( | bool | show | ) |
Sets whether tick labels are displayed. Tick labels are the numbers drawn next to tick marks.
Definition at line 4512 of file qcustomplot.cpp.
References mCachedMarginValid, and mTickLabels.
Referenced by QCPAxisRect::setupFullAxesBox().
| void setTickLabelSide | ( | LabelSide | side | ) |
Sets whether the tick labels (numbers) shall appear inside or outside the axis rect.
The usual and default setting is lsOutside. Very compact plots sometimes require tick labels to be inside the axis rect, to save space. If side is set to lsInside, the tick labels appear on the inside are additionally clipped to the axis rect.
Definition at line 4617 of file qcustomplot.cpp.
References mAxisPainter, mCachedMarginValid, and QCPAxisPainterPrivate::tickLabelSide.
| void setTickLabelType | ( | LabelType | type | ) |
Sets whether the tick labels display numbers or dates/times.
If type is set to ltNumber, the format specifications of setNumberFormat apply.
If type is set to ltDateTime, the format specifications of setDateTimeFormat apply.
In QCustomPlot, date/time coordinates are double numbers representing the seconds since 1970-01-01T00:00:00 UTC. This format can be retrieved from QDateTime objects with the QDateTime::toTime_t() function. Since this only gives a resolution of one second, there is also the QDateTime::toMSecsSinceEpoch() function which returns the timespan described above in milliseconds. Divide its return value by 1000.0 to get a value with the format needed for date/time plotting, with a resolution of one millisecond.
Using the toMSecsSinceEpoch function allows dates that go back to 2nd January 4713 B.C. (represented by a negative number), unlike the toTime_t function, which works with unsigned integers and thus only goes back to 1st January 1970. So both for range and accuracy, use of toMSecsSinceEpoch()/1000.0 should be preferred as key coordinate for date/time axes.
Definition at line 4555 of file qcustomplot.cpp.
References mCachedMarginValid, and mTickLabelType.
Referenced by QCPAxisRect::setupFullAxesBox().
| void setTickLength | ( | int | inside, |
| int | outside = 0 |
||
| ) |
Sets the length of the ticks in pixels. inside is the length the ticks will reach inside the plot and outside is the length they will reach outside the plot. If outside is greater than zero, the tick labels and axis label will increase their distance to the axis accordingly, so they won't collide with the ticks.
Definition at line 4826 of file qcustomplot.cpp.
References setTickLengthIn(), and setTickLengthOut().
| void setTickLengthIn | ( | int | inside | ) |
Sets the length of the inward ticks in pixels. inside is the length the ticks will reach inside the plot.
Definition at line 4838 of file qcustomplot.cpp.
References mAxisPainter, and QCPAxisPainterPrivate::tickLengthIn.
Referenced by setTickLength().
| void setTickLengthOut | ( | int | outside | ) |
Sets the length of the outward ticks in pixels. outside is the length the ticks will reach outside the plot. If outside is greater than zero, the tick labels and axis label will increase their distance to the axis accordingly, so they won't collide with the ticks.
Definition at line 4853 of file qcustomplot.cpp.
References mAxisPainter, mCachedMarginValid, and QCPAxisPainterPrivate::tickLengthOut.
Referenced by setTickLength().
| void setTickPen | ( | const QPen & | pen | ) |
Sets the pen, tick marks will be drawn with.
Definition at line 4937 of file qcustomplot.cpp.
References mTickPen.
| void setTicks | ( | bool | show | ) |
Sets whether tick marks are displayed.
Note that setting show to false does not imply that tick labels are invisible, too. To achieve that, see setTickLabels.
Definition at line 4500 of file qcustomplot.cpp.
References mCachedMarginValid, and mTicks.
Referenced by QCPAxisRect::setupFullAxesBox().
| void setTickStep | ( | double | step | ) |
If setAutoTickStep is set to false, use this function to set the tick step manually. The tick step is the interval between (major) ticks, in plot coordinates.
Definition at line 4771 of file qcustomplot.cpp.
References mCachedMarginValid, and mTickStep.
Referenced by QCPAxisRect::setupFullAxesBox().
| void setTickVector | ( | const QVector< double > & | vec | ) |
If you want full control over what ticks (and possibly labels) the axes show, this function is used to set the coordinates at which ticks will appear.setAutoTicks must be disabled, else the provided tick vector will be overwritten with automatically generated tick coordinates upon replot. The labels of the ticks can be generated automatically when setAutoTickLabels is left enabled. If it is disabled, you can set the labels manually with setTickVectorLabels.
vec is a vector containing the positions of the ticks, in plot coordinates.
Definition at line 4793 of file qcustomplot.cpp.
References mCachedMarginValid, and mTickVector.
| void setTickVectorLabels | ( | const QVector< QString > & | vec | ) |
If you want full control over what ticks and labels the axes show, this function is used to set a number of QStrings that will be displayed at the tick positions which you need to provide with setTickVector. These two vectors should have the same size. (Note that you need to disable setAutoTicks and setAutoTickLabels first.)
vec is a vector containing the labels of the ticks. The entries correspond to the respective indices in the tick vector, passed via setTickVector.
Definition at line 4811 of file qcustomplot.cpp.
References mCachedMarginValid, and mTickVectorLabels.
| void setUpperEnding | ( | const QCPLineEnding & | ending | ) |
Sets the style for the upper axis ending. See the documentation of QCPLineEnding for available styles.
For horizontal axes, this method refers to the right ending, for vertical axes the top ending. Note that this meaning does not change when the axis range is reversed with setRangeReversed.
Definition at line 5138 of file qcustomplot.cpp.
References mAxisPainter, and QCPAxisPainterPrivate::upperEnding.
Referenced by QCPAxisRect::addAxis().
|
protectedvirtual |
Definition at line 5514 of file qcustomplot.cpp.
References generateAutoTicks(), QCPRange::lower, ltDateTime, ltNumber, mAutoTickLabels, mAutoTicks, mDateTimeFormat, mDateTimeSpec, mGrid, mHighestVisibleTick, mLowestVisibleTick, mNumberFormatChar, mNumberPrecision, QCPLayerable::mParentPlot, mRange, mSubTickCount, mSubTickVector, mTickLabels, mTickLabelType, mTicks, mTickVector, mTickVectorLabels, QCPRange::size(), ticksRequest(), QCPRange::upper, QCPLayerable::visible(), and visibleTickBounds().
|
inline |
Definition at line 1120 of file qcustomplot.h.
Referenced by draw(), and QCPAxisRect::setupFullAxesBox().
| int subTickLengthIn | ( | ) | const |
Definition at line 4120 of file qcustomplot.cpp.
References mAxisPainter, and QCPAxisPainterPrivate::subTickLengthIn.
| int subTickLengthOut | ( | ) | const |
Definition at line 4126 of file qcustomplot.cpp.
References mAxisPainter, and QCPAxisPainterPrivate::subTickLengthOut.
|
inline |
Definition at line 1125 of file qcustomplot.h.
|
inline |
Definition at line 1108 of file qcustomplot.h.
|
inline |
Definition at line 1107 of file qcustomplot.h.
| int tickLabelPadding | ( | ) | const |
Definition at line 4076 of file qcustomplot.cpp.
References mAxisPainter, and QCPAxisPainterPrivate::tickLabelPadding.
| double tickLabelRotation | ( | ) | const |
Definition at line 4082 of file qcustomplot.cpp.
References mAxisPainter, and QCPAxisPainterPrivate::tickLabelRotation.
|
inline |
Definition at line 1104 of file qcustomplot.h.
Referenced by calculateMargin(), and draw().
| QCPAxis::LabelSide tickLabelSide | ( | ) | const |
Definition at line 4088 of file qcustomplot.cpp.
References mAxisPainter, and QCPAxisPainterPrivate::tickLabelSide.
|
inline |
Definition at line 1106 of file qcustomplot.h.
Referenced by QCPAxisRect::setupFullAxesBox().
| int tickLengthIn | ( | ) | const |
Definition at line 4108 of file qcustomplot.cpp.
References mAxisPainter, and QCPAxisPainterPrivate::tickLengthIn.
| int tickLengthOut | ( | ) | const |
Definition at line 4114 of file qcustomplot.cpp.
References mAxisPainter, and QCPAxisPainterPrivate::tickLengthOut.
|
inline |
Definition at line 1124 of file qcustomplot.h.
|
inline |
Definition at line 1103 of file qcustomplot.h.
Referenced by QCPAxisRect::setupFullAxesBox().
|
signal |
This signal is emitted when setAutoTicks is false and the axis is about to generate tick labels for a replot.
Modifying the tick positions can be done with setTickVector. If you also want to control the tick labels, set setAutoTickLabels to false and also provide the labels with setTickVectorLabels.
If you only want static ticks you probably don't need this signal, since you can just set the tick vector (and possibly tick label vector) once. However, if you want to provide ticks (and maybe labels) dynamically, e.g. depending on the current axis range, connect a slot to this signal and set the vector/vectors there.
Referenced by setupTickVectors().
|
inline |
Definition at line 1115 of file qcustomplot.h.
Referenced by QCPAxisRect::setupFullAxesBox().
|
inline |
Definition at line 1116 of file qcustomplot.h.
|
inline |
Definition at line 1117 of file qcustomplot.h.
| QCPLineEnding upperEnding | ( | ) | const |
Definition at line 4150 of file qcustomplot.cpp.
References mAxisPainter, and QCPAxisPainterPrivate::upperEnding.
|
protected |
Definition at line 5850 of file qcustomplot.cpp.
References QCPRange::lower, mRange, mTickVector, and QCPRange::upper.
Referenced by calculateMargin(), and setupTickVectors().
|
friend |
Definition at line 1314 of file qcustomplot.h.
|
friend |
Definition at line 1313 of file qcustomplot.h.
|
friend |
Definition at line 1312 of file qcustomplot.h.
|
protected |
Definition at line 1263 of file qcustomplot.h.
Referenced by generateAutoTicks(), and setAutoSubTicks().
|
protected |
Definition at line 1262 of file qcustomplot.h.
Referenced by generateAutoTicks(), and setAutoTickCount().
|
protected |
Definition at line 1248 of file qcustomplot.h.
Referenced by draw(), setAutoTickLabels(), and setupTickVectors().
|
protected |
Definition at line 1263 of file qcustomplot.h.
Referenced by setAutoTicks(), and setupTickVectors().
|
protected |
Definition at line 1263 of file qcustomplot.h.
Referenced by generateAutoTicks(), and setAutoTickStep().
|
protected |
Definition at line 1275 of file qcustomplot.h.
Referenced by calculateMargin(), draw(), getPartAt(), labelPadding(), lowerEnding(), numberFormat(), offset(), setLabelPadding(), setLowerEnding(), setNumberFormat(), setOffset(), setSubTickLengthIn(), setSubTickLengthOut(), setTickLabelPadding(), setTickLabelRotation(), setTickLabelSide(), setTickLengthIn(), setTickLengthOut(), setUpperEnding(), subTickLengthIn(), subTickLengthOut(), tickLabelPadding(), tickLabelRotation(), tickLabelSide(), tickLengthIn(), tickLengthOut(), upperEnding(), and ~QCPAxis().
|
protected |
Definition at line 1234 of file qcustomplot.h.
Referenced by calculateMargin(), coordToPixel(), draw(), QCPGrid::drawGridLines(), QCPGrid::drawSubGridLines(), and pixelToCoord().
|
protected |
Definition at line 1233 of file qcustomplot.h.
Referenced by calculateMargin(), and draw().
|
protected |
Definition at line 1239 of file qcustomplot.h.
Referenced by getBasePen(), and setBasePen().
|
protected |
Definition at line 1281 of file qcustomplot.h.
Referenced by calculateMargin().
|
protected |
Definition at line 1280 of file qcustomplot.h.
Referenced by calculateMargin(), moveRange(), scaleRange(), setAutoSubTicks(), setAutoTickCount(), setAutoTickLabels(), setAutoTicks(), setAutoTickStep(), setDateTimeFormat(), setLabel(), setLabelFont(), setLabelPadding(), setNumberFormat(), setNumberPrecision(), setPadding(), setRange(), setRangeLower(), setRangeReversed(), setRangeUpper(), setScaleLogBase(), setScaleType(), setSubTickLengthOut(), setTickLabelColor(), setTickLabelFont(), setTickLabelPadding(), setTickLabelRotation(), setTickLabels(), setTickLabelSide(), setTickLabelType(), setTickLengthOut(), setTicks(), setTickStep(), setTickVector(), and setTickVectorLabels().
|
protected |
Definition at line 1253 of file qcustomplot.h.
Referenced by setDateTimeFormat(), and setupTickVectors().
|
protected |
Definition at line 1254 of file qcustomplot.h.
Referenced by setDateTimeSpec(), and setupTickVectors().
|
protected |
Definition at line 1274 of file qcustomplot.h.
Referenced by QCPAxis(), setupTickVectors(), and ~QCPAxis().
|
protected |
Definition at line 1276 of file qcustomplot.h.
Referenced by draw(), QCPGrid::drawGridLines(), and setupTickVectors().
|
protected |
Definition at line 1243 of file qcustomplot.h.
Referenced by calculateMargin(), draw(), and setLabel().
|
protected |
Definition at line 1245 of file qcustomplot.h.
Referenced by getLabelColor(), and setLabelColor().
|
protected |
Definition at line 1244 of file qcustomplot.h.
Referenced by getLabelFont(), and setLabelFont().
|
protected |
Definition at line 1276 of file qcustomplot.h.
Referenced by draw(), QCPGrid::drawGridLines(), and setupTickVectors().
|
protected |
Definition at line 1257 of file qcustomplot.h.
Referenced by draw(), numberFormat(), and setNumberFormat().
|
protected |
Definition at line 1256 of file qcustomplot.h.
Referenced by numberFormat(), setNumberFormat(), and setupTickVectors().
|
protected |
Definition at line 1255 of file qcustomplot.h.
Referenced by setNumberPrecision(), and setupTickVectors().
|
protected |
Definition at line 1237 of file qcustomplot.h.
|
protected |
Definition at line 1236 of file qcustomplot.h.
Referenced by calculateMargin(), and setPadding().
|
protected |
Definition at line 1268 of file qcustomplot.h.
Referenced by coordToPixel(), QCPGrid::drawGridLines(), generateAutoTicks(), moveRange(), pixelToCoord(), rescale(), scaleRange(), setRange(), setRangeLower(), setRangeUpper(), setScaleType(), setupTickVectors(), and visibleTickBounds().
|
protected |
Definition at line 1269 of file qcustomplot.h.
Referenced by coordToPixel(), draw(), pixelToCoord(), and setRangeReversed().
|
protected |
Definition at line 1271 of file qcustomplot.h.
Referenced by basePow(), generateAutoTicks(), and setScaleLogBase().
|
protected |
Definition at line 1271 of file qcustomplot.h.
Referenced by baseLog(), and setScaleLogBase().
|
protected |
Definition at line 1270 of file qcustomplot.h.
Referenced by coordToPixel(), draw(), generateAutoTicks(), moveRange(), pixelToCoord(), rescale(), scaleRange(), setRange(), setRangeLower(), setRangeUpper(), and setScaleType().
|
protected |
Definition at line 1238 of file qcustomplot.h.
Referenced by deselectEvent(), selectEvent(), selectTest(), and setSelectableParts().
|
protected |
Definition at line 1239 of file qcustomplot.h.
Referenced by getBasePen(), and setSelectedBasePen().
|
protected |
Definition at line 1245 of file qcustomplot.h.
Referenced by getLabelColor(), and setSelectedLabelColor().
|
protected |
Definition at line 1244 of file qcustomplot.h.
Referenced by getLabelFont(), and setSelectedLabelFont().
|
protected |
Definition at line 1238 of file qcustomplot.h.
Referenced by deselectEvent(), getBasePen(), getLabelColor(), getLabelFont(), getSubTickPen(), getTickLabelColor(), getTickLabelFont(), getTickPen(), selectEvent(), and setSelectedParts().
|
protected |
Definition at line 1266 of file qcustomplot.h.
Referenced by getSubTickPen(), and setSelectedSubTickPen().
|
protected |
Definition at line 1252 of file qcustomplot.h.
Referenced by getTickLabelColor(), and setSelectedTickLabelColor().
|
protected |
Definition at line 1251 of file qcustomplot.h.
Referenced by getTickLabelFont(), and setSelectedTickLabelFont().
|
protected |
Definition at line 1265 of file qcustomplot.h.
Referenced by getTickPen(), and setSelectedTickPen().
|
protected |
Definition at line 1262 of file qcustomplot.h.
Referenced by calculateAutoSubTickCount(), draw(), generateAutoTicks(), setSubTickCount(), and setupTickVectors().
|
protected |
Definition at line 1266 of file qcustomplot.h.
Referenced by getSubTickPen(), and setSubTickPen().
|
protected |
Definition at line 1279 of file qcustomplot.h.
Referenced by draw(), QCPGrid::drawSubGridLines(), and setupTickVectors().
|
protected |
Definition at line 1252 of file qcustomplot.h.
Referenced by getTickLabelColor(), and setTickLabelColor().
|
protected |
Definition at line 1251 of file qcustomplot.h.
Referenced by calculateMargin(), getTickLabelFont(), and setTickLabelFont().
|
protected |
Definition at line 1248 of file qcustomplot.h.
Referenced by calculateMargin(), draw(), setTickLabels(), and setupTickVectors().
|
protected |
Definition at line 1250 of file qcustomplot.h.
Referenced by draw(), setTickLabelType(), and setupTickVectors().
|
protected |
Definition at line 1265 of file qcustomplot.h.
Referenced by getTickPen(), and setTickPen().
|
protected |
Definition at line 1260 of file qcustomplot.h.
Referenced by calculateMargin(), draw(), setTicks(), and setupTickVectors().
|
protected |
Definition at line 1261 of file qcustomplot.h.
Referenced by generateAutoTicks(), and setTickStep().
|
protected |
Definition at line 1277 of file qcustomplot.h.
Referenced by calculateMargin(), draw(), QCPGrid::drawGridLines(), generateAutoTicks(), setTickVector(), setupTickVectors(), and visibleTickBounds().
|
protected |
Definition at line 1278 of file qcustomplot.h.
Referenced by calculateMargin(), draw(), setTickVectorLabels(), and setupTickVectors().
1.8.5