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
|
| 在 QML: | ValueAxis |
| 繼承: | QAbstractAxis |
|
|
| QValueAxis (QObject * parent = nullptr) | |
| virtual | ~QValueAxis () override |
| int | labelDecimals () const |
| QString | labelFormat () const |
| qreal | max () const |
| qreal | min () const |
| void | setLabelDecimals (int decimals ) |
| void | setLabelFormat (const QString & format ) |
| void | setMax (qreal max ) |
| void | setMin (qreal min ) |
| void | setRange (qreal min , qreal max ) |
| void | setSubTickCount (qsizetype count ) |
| void | setTickAnchor (qreal anchor ) |
| void | setTickInterval (qreal interval ) |
| qsizetype | subTickCount () const |
| 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 | subTickCountChanged (qsizetype subTickCount ) |
| 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 subticks on the axis. This indicates how many subticks are drawn between major lines on the graph. Labels are not drawn for subticks. The default value is 0.
訪問函數:
| qsizetype | subTickCount () const |
| void | setSubTickCount (qsizetype count ) |
通知程序信號:
| void | subTickCountChanged (qsizetype subTickCount ) |
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 interval ) |
通知程序信號:
| void | tickIntervalChanged (qreal tickInterval ) |
[explicit]
QValueAxis::
QValueAxis
(
QObject
*
parent
= nullptr)
Constructs an axis object that is a child of parent .
[override virtual noexcept]
QValueAxis::
~QValueAxis
()
銷毀對象。
設置範圍從 min to max 在軸。若 min 大於 max ,此函數返迴不做任何改變。
[override virtual]
QAbstractAxis::AxisType
QValueAxis::
type
() const
重實現: QAbstractAxis::type () const.
返迴軸的類型。