The QValueAxis class adds values to a graph's axes. 更多...
头: | #include <QValueAxis> |
CMake: |
find_package(Qt6 REQUIRED COMPONENTS Graphs)
target_link_libraries(mytarget PRIVATE Qt6::Graphs) |
qmake: | QT += graphs |
实例化: | ValueAxis |
继承: | QAbstractAxis |
状态: | 技术预览 |
|
|
QValueAxis (QObject * parent = nullptr) | |
virtual | ~QValueAxis () |
int | labelDecimals () const |
QString | labelFormat () const |
qreal | max () const |
qreal | min () const |
int | minorTickCount () const |
void | setLabelDecimals (int decimals ) |
void | setLabelFormat (const QString & format ) |
void | setMax (qreal max ) |
void | setMin (qreal min ) |
void | setMinorTickCount (int count ) |
void | setRange (qreal min , qreal max ) |
void | setTickAnchor (qreal anchor ) |
void | setTickInterval (qreal insterval ) |
qreal | tickAnchor () const |
qreal | tickInterval () const |
virtual QAbstractAxis::AxisType | type () const override |
void | labelDecimalsChanged (int decimals ) |
void | labelFormatChanged (const QString & format ) |
void | maxChanged (qreal max ) |
void | minChanged (qreal min ) |
void | minorTickCountChanged (int minorTickCount ) |
void | rangeChanged (qreal min , qreal max ) |
void | tickAnchorChanged (qreal tickAnchor ) |
void | tickIntervalChanged (qreal tickInterval ) |
A value axis can be set up to show an axis line with tick marks, grid lines, and shades. The values on the axis are drawn at the positions of tick marks.
This property holds the number of decimals used for showing the labels. When set to -1, decimal amount is adjusted automatically based on the values range. The default value is -1.
访问函数:
int | labelDecimals () const |
void | setLabelDecimals (int decimals ) |
通知程序信号:
void | labelDecimalsChanged (int decimals ) |
此特性保持轴的标签格式。
格式字符串支持的以下转换说明符、长度修饰符和标志的提供通过
printf()
在标准 C++ 库:d、i、o、x、X、f、F、e、E、g、G、c。
The default value is empty, in which case 'f' format is used.
访问函数:
QString | labelFormat () const |
void | setLabelFormat (const QString & format ) |
通知程序信号:
void | labelFormatChanged (const QString & format ) |
另请参阅 QString::asprintf ().
此特性保持轴的最大值。
When setting this property, the minimum value is adjusted if necessary, to ensure that the range remains valid. The default value is 10.0
访问函数:
qreal | max () const |
void | setMax (qreal max ) |
通知程序信号:
void | maxChanged (qreal max ) |
此特性保持轴的最小值。
When setting this property, the maximum value is adjusted if necessary, to ensure that the range remains valid. The default value is 0.0
访问函数:
qreal | min () const |
void | setMin (qreal min ) |
通知程序信号:
void | minChanged (qreal min ) |
This property holds the number of minor tick marks on the axis. This indicates how many grid lines are drawn between major ticks on the graph. Labels are not drawn for minor ticks. The default value is 0.
访问函数:
int | minorTickCount () const |
void | setMinorTickCount (int count ) |
通知程序信号:
void | minorTickCountChanged (int minorTickCount ) |
This property holds the base value where the dynamically placed tick marks and labels are started from. The default value is 0.
访问函数:
qreal | tickAnchor () const |
void | setTickAnchor (qreal anchor ) |
通知程序信号:
void | tickAnchorChanged (qreal tickAnchor ) |
This property holds the interval between dynamically placed tick marks and labels. The default value is 0, which means that intervals are automatically calculated based on the min and max range.
访问函数:
qreal | tickInterval () const |
void | setTickInterval (qreal insterval ) |
通知程序信号:
void | tickIntervalChanged (qreal tickInterval ) |
[explicit]
QValueAxis::
QValueAxis
(
QObject
*
parent
= nullptr)
Constructs an axis object that is a child of parent .
[virtual noexcept]
QValueAxis::
~QValueAxis
()
销毁对象。
[signal]
void
QValueAxis::
labelDecimalsChanged
(
int
decimals
)
此信号发射当 decimals amount of axis labels changes.
注意: 通知程序信号对于特性 labelDecimals .
[signal]
void
QValueAxis::
labelFormatChanged
(const
QString
&
format
)
此信号发射当 format 对于轴标签改变。
注意: 通知程序信号对于特性 labelFormat .
[signal]
void
QValueAxis::
maxChanged
(
qreal
max
)
This signal is emitted when the maximum value of the axis, specified by max ,改变。
注意: 通知程序信号对于特性 max .
[signal]
void
QValueAxis::
minChanged
(
qreal
min
)
This signal is emitted when the minimum value of the axis, specified by min ,改变。
注意: 通知程序信号对于特性 min .
[signal]
void
QValueAxis::
minorTickCountChanged
(
int
minorTickCount
)
This signal is emitted when the number of minor tick marks on the axis, specified by minorTickCount ,改变。
注意: 通知程序信号对于特性 minorTickCount .
[signal]
void
QValueAxis::
rangeChanged
(
qreal
min
,
qreal
max
)
This signal is emitted when the minimum or maximum value of the axis, specified by min and max ,改变。
设置范围从 min to max 在轴。若 min 大于 max ,此函数返回不做任何改变。
[signal]
void
QValueAxis::
tickAnchorChanged
(
qreal
tickAnchor
)
This signal is emitted when the tick anchoring value, specified by tickAnchor ,改变。
注意: 通知程序信号对于特性 tickAnchor .
[signal]
void
QValueAxis::
tickIntervalChanged
(
qreal
tickInterval
)
This signal is emitted when the tick interval value, specified by tickInterval ,改变。
注意: 通知程序信号对于特性 tickInterval .
[override virtual]
QAbstractAxis::AxisType
QValueAxis::
type
() const
重实现: QAbstractAxis::type() const .
返回轴的类型。