|
| | QwtDateScaleDraw (Qt::TimeSpec timeSpec=Qt::LocalTime) |
| | Constructor with time specification.
|
| |
|
| ~QwtDateScaleDraw () override |
| | Destructor.
|
| |
| void | setDateFormat (QwtDate::IntervalType, const QString &) |
| | Set the default format string for a datetime interval type.
|
| |
| QString | dateFormat (QwtDate::IntervalType) const |
| | Get the default format string for a datetime interval type.
|
| |
| void | setTimeSpec (Qt::TimeSpec) |
| | Set the time specification used for the tick labels.
|
| |
| Qt::TimeSpec | timeSpec () const |
| | Get the time specification used for the tick labels.
|
| |
| void | setUtcOffset (int seconds) |
| | Set the offset in seconds from Coordinated Universal Time.
|
| |
| int | utcOffset () const |
| | Get the offset in seconds from Coordinated Universal Time.
|
| |
| void | setWeek0Type (QwtDate::Week0Type) |
| | Set how to identify the first week of a year.
|
| |
| QwtDate::Week0Type | week0Type () const |
| | Get how to identify the first week of a year.
|
| |
| virtual QwtText | label (double) const override |
| | Convert a value into its representing label.
|
| |
| QDateTime | toDateTime (double) const |
| | Translate a double value into a QDateTime object.
|
| |
| | QwtScaleDraw () |
| | Constructor.
|
| |
| void | getBorderDistHint (const QFont &, int &start, int &end) const |
| | Get the border distance hint.
|
| |
| int | minLabelDist (const QFont &) const |
| | Get the minimum label distance.
|
| |
| int | minLength (const QFont &) const |
| | Get the minimum length.
|
| |
| virtual double | extent (const QFont &) const override |
| | Calculate the width/height that is needed for a vertical/horizontal scale.
|
| |
| void | move (double x, double y) |
| | Move the position of the scale.
|
| |
| void | move (const QPointF &) |
| | Move the position of the scale.
|
| |
| void | setLength (double length) |
| | Set the length of the backbone.
|
| |
| Alignment | alignment () const |
| | Return alignment of the scale.
|
| |
| void | setAlignment (Alignment) |
| | Set the alignment.
|
| |
| Qt::Orientation | orientation () const |
| | Return the orientation.
|
| |
| QPointF | pos () const |
| | Get origin of the scale.
|
| |
| double | length () const |
| | Get the length of the backbone.
|
| |
| void | setLabelAlignment (Qt::Alignment) |
| | Set the label alignment.
|
| |
| Qt::Alignment | labelAlignment () const |
| | Get the label flags.
|
| |
| void | setLabelRotation (double rotation) |
| | Set the label rotation.
|
| |
| double | labelRotation () const |
| | Get the label rotation.
|
| |
| int | maxLabelHeight (const QFont &) const |
| | Get the maximum label height.
|
| |
| int | maxLabelWidth (const QFont &) const |
| | Get the maximum label width.
|
| |
| QPointF | labelPosition (double value) const |
| | Get the label position for a value.
|
| |
| QRectF | labelRect (const QFont &, double value) const |
| | Get the label rectangle for a value.
|
| |
| QSizeF | labelSize (const QFont &, double value) const |
| | Get the label size for a value.
|
| |
| QRect | boundingLabelRect (const QFont &, double value) const |
| | Get the bounding label rectangle.
|
| |
| | QwtAbstractScaleDraw () |
| | Constructor for QwtAbstractScaleDraw.
|
| |
| void | setScaleDiv (const QwtScaleDiv &) |
| | Set the scale division.
|
| |
| const QwtScaleDiv & | scaleDiv () const |
| | Return the scale division.
|
| |
| void | setTransformation (QwtTransform *) |
| | Set the scale transformation.
|
| |
| const QwtScaleMap & | scaleMap () const |
| | Return the scale map (const version)
|
| |
| QwtScaleMap & | scaleMap () |
| | Return the scale map (non-const version)
|
| |
| void | enableComponent (ScaleComponent, bool enable=true) |
| | Enable or disable a scale component.
|
| |
| bool | hasComponent (ScaleComponent) const |
| | Check if a component is enabled.
|
| |
| void | setTickLength (QwtScaleDiv::TickType, double length) |
| | Set the length of the ticks.
|
| |
| double | tickLength (QwtScaleDiv::TickType) const |
| | Get the length of the ticks.
|
| |
| double | maxTickLength () const |
| | Get the length of the longest tick.
|
| |
| void | setSpacing (double) |
| | Set the spacing between tick and labels.
|
| |
| double | spacing () const |
| | Get the spacing.
|
| |
| void | setPenWidthF (qreal width) |
| | Specify the width of the scale pen.
|
| |
| qreal | penWidthF () const |
| | Get the scale pen width.
|
| |
| void | setSelected (bool on) |
| | Set whether the scale draw is selected.
|
| |
| bool | isSelected () const |
| | Check if the scale draw is selected.
|
| |
| void | setSelectedPenWidthOffset (qreal offset=1) |
| | Set the pen width offset for the axis when it is in selected state.
|
| |
| qreal | selectedPenWidthOffset () const |
| | Get the current pen width offset for the axis when it is in selected state.
|
| |
| virtual void | draw (QPainter *, const QPalette &) const |
| | Draw the scale.
|
| |
| void | setMinimumExtent (double) |
| | Set a minimum for the extent.
|
| |
| double | minimumExtent () const |
| | Get the minimum extent.
|
| |
| void | invalidateCache () |
| | Invalidate the cache used by tickLabel()
|
| |
|
| virtual QwtDate::IntervalType | intervalType (const QwtScaleDiv &) const |
| | Find the less detailed datetime unit, where no rounding errors happen.
|
| |
| virtual QString | dateFormatOfDate (const QDateTime &, QwtDate::IntervalType) const |
| | Format string for the representation of a datetime.
|
| |
| QTransform | labelTransformation (const QPointF &, const QSizeF &) const |
| | Calculate the transformation that is needed to paint a label.
|
| |
| virtual void | drawTick (QPainter *, double value, double len) const override |
| | Draw a tick.
|
| |
| virtual void | drawBackbone (QPainter *) const override |
| | Draws the baseline of the scale.
|
| |
| virtual void | drawLabel (QPainter *, double value) const override |
| | Draws the label for a major scale tick.
|
| |
| const QwtText & | tickLabel (const QFont &, double value) const |
| | Convert a value into its representing label and cache it.
|
| |
A class for drawing datetime scales.
QwtDateScaleDraw displays values as datetime labels. The format of the labels depends on the alignment of the major tick labels.
The default format strings are:
- Millisecond: "hh:mm:ss:zzz\nddd dd MMM yyyy"
- Second: "hh:mm:ss\nddd dd MMM yyyy"
- Minute: "hh:mm\nddd dd MMM yyyy"
- Hour: "hh:mm\nddd dd MMM yyyy"
- Day: "ddd dd MMM yyyy"
- Week: "Www yyyy"
- Month: "MMM yyyy"
- Year: "yyyy"
The format strings can be modified using setDateFormat() or individually for each tick label by overloading dateFormatOfDate().
Usually QwtDateScaleDraw is used in combination with QwtDateScaleEngine, that calculates scales for datetime intervals.
- See also
- QwtDateScaleEngine, QwtPlot::setAxisScaleDraw()