QAbstractAxis 类

QAbstractAxis 类是用于专用轴类的基类。 更多...

头: #include <QAbstractAxis>
CMake: find_package(Qt6 REQUIRED COMPONENTS Graphs)
target_link_libraries(mytarget PRIVATE Qt6::Graphs)
qmake: QT += graphs
实例化: AbstractAxis
继承: QObject
继承者:

QBarCategoryAxis and QValueAxis

状态: 技术预览

公共类型

enum AxisType { AxisTypeNoAxis, AxisTypeValue, AxisTypeBarCategory }
flags AxisTypes

特性

公共函数

virtual ~QAbstractAxis ()
Qt::Alignment alignment () const
void hide ()
bool isGridLineVisible () const
bool isLineVisible () const
bool isMinorGridLineVisible () const
bool isTitleVisible () const
bool isVisible () const
qreal labelsAngle () const
bool labelsVisible () const
Qt::Orientation orientation () const
void setGridLineVisible (bool visible = true)
void setLabelsAngle (qreal angle )
void setLabelsVisible (bool visible = true)
void setLineVisible (bool visible = true)
void setMax (const QVariant & max )
void setMin (const QVariant & min )
void setMinorGridLineVisible (bool visible = true)
void setRange (const QVariant & min , const QVariant & max )
void setTitleColor (const QColor & color )
void setTitleFont (const QFont & font )
void setTitleText (const QString & title )
void setTitleVisible (bool visible = true)
void setVisible (bool visible = true)
void show ()
QColor titleColor () const
QFont titleFont () const
QString titleText () const
virtual QAbstractAxis::AxisType type () const = 0

信号

void gridVisibleChanged (bool visible )
void labelsAngleChanged (qreal angle )
void labelsVisibleChanged (bool visible )
void lineVisibleChanged (bool visible )
void minorGridVisibleChanged (bool visible )
void titleColorChanged (const QColor & color )
void titleFontChanged (const QFont & font )
void titleTextChanged (const QString & text )
void titleVisibleChanged (bool visible )
void update ()
void visibleChanged (bool visible )

详细描述

Each series can be bound to only one horizontal and vertical axis.

The properties and visibility of various axis elements, such as axis line, title, labels, and grid lines, can be individually controlled.

成员类型文档编制

enum QAbstractAxis:: AxisType
flags QAbstractAxis:: AxisTypes

此枚举类型指定轴对象的类型。

常量
QAbstractAxis::AxisTypeNoAxis 0x0
QAbstractAxis::AxisTypeValue 0x1
QAbstractAxis::AxisTypeBarCategory 0x2

AxisTypes 类型是 typedef 对于 QFlags <AxisType>。它存储 AxisType 值的 OR 组合。

特性文档编制

[read-only] alignment : const Qt::Alignment

此特性保持轴的对齐方式。

可以是 Qt::AlignLeft , Qt::AlignRight , Qt::AlignBottom ,或 Qt::AlignTop .

访问函数:

Qt::Alignment alignment () const

gridVisible : bool

This property holds the visibility of the grid lines. By default, the value is true .

访问函数:

bool isGridLineVisible () const
void setGridLineVisible (bool visible = true)

通知程序信号:

void gridVisibleChanged (bool visible )

labelsAngle : qreal

此特性保持轴标签的角度,以度为单位。

访问函数:

qreal labelsAngle () const
void setLabelsAngle (qreal angle )

通知程序信号:

void labelsAngleChanged (qreal angle )

labelsVisible : bool

This property holds whether axis labels are visible. By default, the value is true .

访问函数:

bool labelsVisible () const
void setLabelsVisible (bool visible = true)

通知程序信号:

void labelsVisibleChanged (bool visible )

lineVisible : bool

This property holds the visibility of the axis line. By default, the value is true .

访问函数:

bool isLineVisible () const
void setLineVisible (bool visible = true)

通知程序信号:

void lineVisibleChanged (bool visible )

minorGridVisible : bool

This property holds the visibility of the minor grid lines.

Applies only to axes that support minor grid lines. By default, the value is true .

访问函数:

bool isMinorGridLineVisible () const
void setMinorGridLineVisible (bool visible = true)

通知程序信号:

void minorGridVisibleChanged (bool visible )

[read-only] orientation : const Qt::Orientation

此特性保持轴的取向。

Fixed to either Qt::Horizontal or Qt::Vertical when the axis is added to a graph.

访问函数:

Qt::Orientation orientation () const

titleColor : QColor

This property holds the color used to draw the title text.

访问函数:

QColor titleColor () const
void setTitleColor (const QColor & color )

通知程序信号:

void titleColorChanged (const QColor & color )

titleFont : QFont

This property holds the font of the title of the axis.

访问函数:

QFont titleFont () const
void setTitleFont (const QFont & font )

通知程序信号:

void titleFontChanged (const QFont & font )

titleText : QString

此特性保持轴的标题。

默认为空。轴标题支持 HTML 格式。

访问函数:

QString titleText () const
void setTitleText (const QString & title )

通知程序信号:

void titleTextChanged (const QString & text )

titleVisible : bool

This property holds the visibility of the axis title.

By default, the value is true .

访问函数:

bool isTitleVisible () const
void setTitleVisible (bool visible = true)

通知程序信号:

void titleVisibleChanged (bool visible )

visible : bool

This property holds the visibility of the axis. By default, the value is true .

访问函数:

bool isVisible () const
void setVisible (bool visible = true)

通知程序信号:

void visibleChanged (bool visible )

成员函数文档编制

[virtual noexcept] QAbstractAxis:: ~QAbstractAxis ()

Destructs the axis object. When the axis is added to a graph, the graph object takes ownership.

[signal] void QAbstractAxis:: gridVisibleChanged ( bool visible )

This signal is emitted when the visibility of the grid lines of the axis changes to visible .

注意: 通知程序信号对于特性 gridVisible .

void QAbstractAxis:: hide ()

Makes the axis, labels, and grid lines invisible.

[signal] void QAbstractAxis:: labelsAngleChanged ( qreal angle )

This signal is emitted when the angle of the axis labels changes to angle .

注意: 通知程序信号对于特性 labelsAngle .

[signal] void QAbstractAxis:: labelsVisibleChanged ( bool visible )

This signal is emitted when the visibility of the labels of the axis changes to visible .

注意: 通知程序信号对于特性 labelsVisible .

[signal] void QAbstractAxis:: lineVisibleChanged ( bool visible )

This signal is emitted when the visibility of the axis line changes to visible .

注意: 通知程序信号对于特性 lineVisible .

[signal] void QAbstractAxis:: minorGridVisibleChanged ( bool visible )

This signal is emitted when the visibility of the minor grid lines of the axis changes to visible .

注意: 通知程序信号对于特性 minorGridVisible .

Qt::Orientation QAbstractAxis:: orientation () const

Returns the orientation of the axis (vertical or horizontal).

注意: Getter function for property orientation.

void QAbstractAxis:: setLineVisible ( bool visible = true)

Determines whether the axis line and tick marks are visible .

注意: setter 函数对于特性 lineVisible .

另请参阅 isLineVisible ().

void QAbstractAxis:: setMax (const QVariant & max )

Sets the maximum value shown on the axis. Depending on the actual axis type, the max parameter is converted to the appropriate type of value. If the conversion is impossible, the function call does nothing.

void QAbstractAxis:: setMin (const QVariant & min )

Sets the minimum value shown on the axis. Depending on the actual axis type, the min parameter is converted to the appropriate type of value. If the conversion is impossible, the function call does nothing.

void QAbstractAxis:: setRange (const QVariant & min , const QVariant & max )

Sets the range shown on the axis. Depending on the actual axis type, the min and max parameters are converted to appropriate types of values. If the conversion is impossible, the function call does nothing.

void QAbstractAxis:: setTitleColor (const QColor & color )

Sets the color used to draw titles to color .

注意: setter 函数对于特性 titleColor .

另请参阅 titleColor ().

void QAbstractAxis:: setTitleFont (const QFont & font )

Sets the font used to draw titles to font .

注意: setter 函数对于特性 titleFont .

另请参阅 titleFont ().

void QAbstractAxis:: setVisible ( bool visible = true)

Sets the visibility of the axis, labels, and grid lines to visible .

注意: setter 函数对于特性 visible .

另请参阅 isVisible ().

void QAbstractAxis:: show ()

Makes the axis, labels, and grid lines visible.

QColor QAbstractAxis:: titleColor () const

Returns the color used to draw titles.

注意: Getter function for property titleColor.

另请参阅 setTitleColor ().

[signal] void QAbstractAxis:: titleColorChanged (const QColor & color )

This signal is emitted when the color used to draw the axis title changes to color .

注意: 通知程序信号对于特性 titleColor .

QFont QAbstractAxis:: titleFont () const

Returns the font used to draw titles.

注意: Getter function for property titleFont.

另请参阅 setTitleFont ().

[signal] void QAbstractAxis:: titleFontChanged (const QFont & font )

This signal is emitted when the font of the axis title changes to font .

注意: 通知程序信号对于特性 titleFont .

[signal] void QAbstractAxis:: titleTextChanged (const QString & text )

This signal is emitted when the text of the axis title changes to text .

注意: 通知程序信号对于特性 titleText .

[signal] void QAbstractAxis:: titleVisibleChanged ( bool visible )

This signal is emitted when the visibility of the title text of the axis changes to visible .

注意: 通知程序信号对于特性 titleVisible .

[pure virtual] QAbstractAxis::AxisType QAbstractAxis:: type () const

返回轴的类型。

[signal] void QAbstractAxis:: update ()

This signal is emitted when the axis needs to be updated.

[signal] void QAbstractAxis:: visibleChanged ( bool visible )

This signal is emitted when the visibility of the axis changes to visible .

注意: 通知程序信号对于特性 visible .