QWT API (中文) 7.0.1
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
| Public 成员函数 | Protected 成员函数 | 所有成员列表
QwtDateScaleDraw类 参考

用于绘制日期时间刻度的类 更多...

#include <qwt_date_scale_draw.h>

类 QwtDateScaleDraw 继承关系图:
QwtScaleDraw QwtAbstractScaleDraw

class  PrivateData
 

Public 成员函数

 QwtDateScaleDraw (Qt::TimeSpec timeSpec=Qt::LocalTime)
 Constructor with time specification
 
virtual ~QwtDateScaleDraw ()
 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
 
- Public 成员函数 继承自 QwtScaleDraw
 QwtScaleDraw ()
 构造函数
 
virtual ~QwtScaleDraw ()
 Destructor
 
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
 计算垂直/水平刻度所需的宽度/高度
 
void move (double x, double y)
 移动刻度的位置
 
void move (const QPointF &)
 移动刻度的位置
 
void setLength (double length)
 设置主干的长度
 
Alignment alignment () const
 返回刻度的对齐方式
 
void setAlignment (Alignment)
 Set the alignment
 
Qt::Orientation orientation () const
 返回方向
 
QPointF pos () const
 获取刻度的原点
 
double length () const
 获取主干的长度
 
void setLabelAlignment (Qt::Alignment)
 Set the label alignment
 
Qt::Alignment labelAlignment () const
 获取标签标志
 
void setLabelRotation (double rotation)
 Set the label rotation
 
double labelRotation () const
 获取标签旋转角度
 
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
 
- Public 成员函数 继承自 QwtAbstractScaleDraw
 QwtAbstractScaleDraw ()
 QwtAbstractScaleDraw 构造函数
 
virtual ~QwtAbstractScaleDraw ()
 QwtAbstractScaleDraw 析构函数
 
void setScaleDiv (const QwtScaleDiv &)
 设置刻度划分
 
const QwtScaleDivscaleDiv () const
 返回刻度划分
 
void setTransformation (QwtTransform *)
 设置刻度变换
 
const QwtScaleMapscaleMap () const
 返回刻度映射(常量版本)
 
QwtScaleMapscaleMap ()
 返回刻度映射(非常量版本)
 
void enableComponent (ScaleComponent, bool enable=true)
 启用或禁用刻度组件
 
bool hasComponent (ScaleComponent) const
 检查组件是否已启用
 
void setTickLength (QwtScaleDiv::TickType, double length)
 设置刻度线长度
 
double tickLength (QwtScaleDiv::TickType) const
 获取刻度线长度
 
double maxTickLength () const
 获取最长刻度线的长度
 
void setSpacing (double)
 设置刻度线和标签之间的间距
 
double spacing () const
 获取间距
 
void setPenWidthF (qreal width)
 设置刻度画笔宽度
 
qreal penWidthF () const
 获取刻度画笔宽度
 
void setSelected (bool on)
 设置刻度绘制是否被选中
 
bool isSelected () const
 检查刻度绘制是否被选中
 
void setSelectedPenWidthOffset (qreal offset=1)
 设置坐标轴在选中状态下的画笔宽度附加值
 
qreal selectedPenWidthOffset () const
 获取当前坐标轴在选中状态下的画笔宽度附加值
 
virtual void draw (QPainter *, const QPalette &) const
 绘制刻度
 
void setMinimumExtent (double)
 设置范围的最小值
 
double minimumExtent () const
 获取最小范围
 
void invalidateCache ()
 清除 tickLabel() 使用的缓存
 

Protected 成员函数

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
 
- Protected 成员函数 继承自 QwtScaleDraw
QTransform labelTransformation (const QPointF &, const QSizeF &) const
 计算绘制标签所需的变换
 
virtual void drawTick (QPainter *, double value, double len) const override
 绘制刻度线
 
virtual void drawBackbone (QPainter *) const override
 绘制刻度的基线
 
virtual void drawLabel (QPainter *, double value) const override
 绘制主刻度标签
 
- Protected 成员函数 继承自 QwtAbstractScaleDraw
const QwtTexttickLabel (const QFont &, double value) const
 将值转换为表示标签并缓存
 

额外继承的成员函数

- Public 类型 继承自 QwtScaleDraw
enum  Alignment { BottomScale , TopScale , LeftScale , RightScale }
 刻度绘制的对齐方式 更多...
 
- Public 类型 继承自 QwtAbstractScaleDraw
enum  ScaleComponent { Backbone = 0x01 , Ticks = 0x02 , Labels = 0x04 }
 刻度的组件 更多...
 

详细描述

用于绘制日期时间刻度的类

构造及析构函数说明

◆ QwtDateScaleDraw()

QwtDateScaleDraw::QwtDateScaleDraw ( Qt::TimeSpec  timeSpec = Qt::LocalTime)
explicit

Constructor with time specification

构造函数

◆ ~QwtDateScaleDraw()

QwtDateScaleDraw::~QwtDateScaleDraw ( )
virtual

Destructor

析构函数

成员函数说明

◆ dateFormat()

QString QwtDateScaleDraw::dateFormat ( QwtDate::IntervalType  intervalType) const

Get the default format string for a datetime interval type

获取日期时间间隔类型的默认格式字符串

◆ dateFormatOfDate()

QString QwtDateScaleDraw::dateFormatOfDate ( const QDateTime &  dateTime,
QwtDate::IntervalType  intervalType 
) const
protectedvirtual

Format string for the representation of a datetime

dateFormatOfDate() is intended to be overloaded for situations, where formats are individual for specific datetime values.

The default setting ignores dateTime and return the default format for the interval type.

参数
dateTimeDatetime value
intervalTypeInterval type
返回
Format string
参见
setDateFormat(), QwtDate::toString()

◆ intervalType()

QwtDate::IntervalType QwtDateScaleDraw::intervalType ( const QwtScaleDiv scaleDiv) const
protectedvirtual

Find the less detailed datetime unit, where no rounding errors happen.

参数
scaleDivScale division
返回
Interval type
参见
dateFormatOfDate()

◆ label()

QwtText QwtDateScaleDraw::label ( double  value) const
overridevirtual

Convert a value into its representing label

将值转换为其表示的标签

重载 QwtAbstractScaleDraw .

◆ setDateFormat()

void QwtDateScaleDraw::setDateFormat ( QwtDate::IntervalType  intervalType,
const QString &  format 
)

Set the default format string for a datetime interval type

设置日期时间间隔类型的默认格式字符串

◆ setTimeSpec()

void QwtDateScaleDraw::setTimeSpec ( Qt::TimeSpec  timeSpec)

Set the time specification used for the tick labels

设置用于刻度标签的时间规范

◆ setUtcOffset()

void QwtDateScaleDraw::setUtcOffset ( int  seconds)

Set the offset in seconds from Coordinated Universal Time

设置与世界协调时间的偏移量(秒)

◆ setWeek0Type()

void QwtDateScaleDraw::setWeek0Type ( QwtDate::Week0Type  week0Type)

Set how to identify the first week of a year

设置如何确定一年的第一周

◆ timeSpec()

Qt::TimeSpec QwtDateScaleDraw::timeSpec ( ) const

Get the time specification used for the tick labels

获取用于刻度标签的时间规范

◆ toDateTime()

QDateTime QwtDateScaleDraw::toDateTime ( double  value) const

Translate a double value into a QDateTime object

将 double 值转换为 QDateTime 对象

◆ utcOffset()

int QwtDateScaleDraw::utcOffset ( ) const

Get the offset in seconds from Coordinated Universal Time

获取与世界协调时间的偏移量(秒)

◆ week0Type()

QwtDate::Week0Type QwtDateScaleDraw::week0Type ( ) const

Get how to identify the first week of a year

获取如何确定一年的第一周


该类的文档由以下文件生成: