QAbstractAxis 类是用于专用轴类的基类。 更多...
头: | #include <QAbstractAxis> |
实例化: | AbstractAxis |
继承: | QObject |
继承者: | QBarCategoryAxis , QColorAxis , QDateTimeAxis , QLogValueAxis ,和 QValueAxis |
enum | AxisType { AxisTypeNoAxis, AxisTypeValue, AxisTypeBarCategory, AxisTypeCategory, AxisTypeDateTime, …, AxisTypeColor } |
flags | AxisTypes |
|
|
virtual | ~QAbstractAxis () |
Qt::Alignment | alignment () const |
QColor | gridLineColor () |
QPen | gridLinePen () const |
void | hide () |
bool | isGridLineVisible () const |
bool | isLineVisible () const |
bool | isMinorGridLineVisible () const |
bool | isReverse () const |
bool | isTitleVisible () const |
bool | isVisible () const |
int | labelsAngle () const |
QBrush | labelsBrush () const |
QColor | labelsColor () const |
bool | labelsEditable () const |
QFont | labelsFont () const |
bool | labelsTruncated () const |
bool | labelsVisible () const |
QPen | linePen () const |
QColor | linePenColor () const |
QColor | minorGridLineColor () |
QPen | minorGridLinePen () const |
Qt::Orientation | orientation () const |
void | setGridLineColor (const QColor & color ) |
void | setGridLinePen (const QPen & pen ) |
void | setGridLineVisible (bool visible = true) |
void | setLabelsAngle (int angle ) |
void | setLabelsBrush (const QBrush & brush ) |
void | setLabelsColor (QColor color ) |
void | setLabelsEditable (bool editable = true) |
void | setLabelsFont (const QFont & font ) |
void | setLabelsVisible (bool visible = true) |
void | setLinePen (const QPen & pen ) |
void | setLinePenColor (QColor color ) |
void | setLineVisible (bool visible = true) |
void | setMax (const QVariant & max ) |
void | setMin (const QVariant & min ) |
void | setMinorGridLineColor (const QColor & color ) |
void | setMinorGridLinePen (const QPen & pen ) |
void | setMinorGridLineVisible (bool visible = true) |
void | setRange (const QVariant & min , const QVariant & max ) |
void | setReverse (bool reverse = true) |
void | setShadesBorderColor (QColor color ) |
void | setShadesBrush (const QBrush & brush ) |
void | setShadesColor (QColor color ) |
void | setShadesPen (const QPen & pen ) |
void | setShadesVisible (bool visible = true) |
void | setTitleBrush (const QBrush & brush ) |
void | setTitleFont (const QFont & font ) |
void | setTitleText (const QString & title ) |
void | setTitleVisible (bool visible = true) |
void | setTruncateLabels (bool truncateLabels = true) |
void | setVisible (bool visible = true) |
QColor | shadesBorderColor () const |
QBrush | shadesBrush () const |
QColor | shadesColor () const |
QPen | shadesPen () const |
bool | shadesVisible () const |
void | show () |
QBrush | titleBrush () const |
QFont | titleFont () const |
QString | titleText () const |
bool | truncateLabels () const |
virtual QAbstractAxis::AxisType | type () const = 0 |
void | colorChanged (QColor color ) |
void | gridLineColorChanged (const QColor & color ) |
void | gridLinePenChanged (const QPen & pen ) |
void | gridVisibleChanged (bool visible ) |
void | labelsAngleChanged (int angle ) |
void | labelsBrushChanged (const QBrush & brush ) |
void | labelsColorChanged (QColor color ) |
void | labelsEditableChanged (bool editable ) |
void | labelsFontChanged (const QFont & font ) |
void | labelsTruncatedChanged (bool labelsTruncated ) |
void | labelsVisibleChanged (bool visible ) |
void | linePenChanged (const QPen & pen ) |
void | lineVisibleChanged (bool visible ) |
void | minorGridLineColorChanged (const QColor & color ) |
void | minorGridLinePenChanged (const QPen & pen ) |
void | minorGridVisibleChanged (bool visible ) |
void | reverseChanged (bool reverse ) |
void | shadesBorderColorChanged (QColor color ) |
void | shadesBrushChanged (const QBrush & brush ) |
void | shadesColorChanged (QColor color ) |
void | shadesPenChanged (const QPen & pen ) |
void | shadesVisibleChanged (bool visible ) |
void | titleBrushChanged (const QBrush & brush ) |
void | titleFontChanged (const QFont & font ) |
void | titleTextChanged (const QString & text ) |
void | titleVisibleChanged (bool visible ) |
void | truncateLabelsChanged (bool truncateLabels ) |
void | visibleChanged (bool visible ) |
Each series can be bound to one or more horizontal and vertical axes, but mixing axis types that would result in different domains is not supported, such as specifying QValueAxis and QLogValueAxis on the same orientation.
The properties and visibility of various axis elements, such as axis line, title, labels, grid lines, and shades, can be individually controlled.
此枚举类型指定轴对象的类型。
常量 | 值 |
---|---|
QAbstractAxis::AxisTypeNoAxis
|
0x0
|
QAbstractAxis::AxisTypeValue
|
0x1
|
QAbstractAxis::AxisTypeBarCategory
|
0x2
|
QAbstractAxis::AxisTypeCategory
|
0x4
|
QAbstractAxis::AxisTypeDateTime
|
0x8
|
QAbstractAxis::AxisTypeLogValue
|
0x10
|
QAbstractAxis::AxisTypeColor
|
0x20
|
AxisTypes 类型是 typedef 对于 QFlags <AxisType>。它存储 AxisType 值的 OR 组合。
[read-only]
alignment
: const
Qt::Alignment
此特性保持轴的对齐方式。
可以是 Qt::AlignLeft , Qt::AlignRight , Qt::AlignBottom ,或 Qt::AlignTop .
访问函数:
Qt::Alignment | alignment () const |
This property holds the color of the axis and tick marks.
访问函数:
QColor | linePenColor () const |
void | setLinePenColor (QColor color ) |
通知程序信号:
void | colorChanged (QColor color ) |
此特性保持栅格线的颜色。
访问函数:
QColor | gridLineColor () |
void | setGridLineColor (const QColor & color ) |
通知程序信号:
void | gridLineColorChanged (const QColor & color ) |
This property holds the pen used to draw the grid line.
访问函数:
QPen | gridLinePen () const |
void | setGridLinePen (const QPen & pen ) |
通知程序信号:
void | gridLinePenChanged (const QPen & pen ) |
This property holds the visibility of the grid lines.
访问函数:
bool | isGridLineVisible () const |
void | setGridLineVisible (bool visible = true) |
通知程序信号:
void | gridVisibleChanged (bool visible ) |
此特性保持轴标签的角度,以度为单位。
访问函数:
int | labelsAngle () const |
void | setLabelsAngle (int angle ) |
通知程序信号:
void | labelsAngleChanged (int angle ) |
This property holds the brush used to draw the labels.
Only the color of the brush is relevant.
访问函数:
QBrush | labelsBrush () const |
void | setLabelsBrush (const QBrush & brush ) |
通知程序信号:
void | labelsBrushChanged (const QBrush & brush ) |
This property holds the color of the axis labels.
访问函数:
QColor | labelsColor () const |
void | setLabelsColor (QColor color ) |
通知程序信号:
void | labelsColorChanged (QColor color ) |
This property holds the font of the axis labels.
访问函数:
QFont | labelsFont () const |
void | setLabelsFont (const QFont & font ) |
通知程序信号:
void | labelsFontChanged (const QFont & font ) |
[read-only]
labelsTruncated
: const
bool
返回
true
if at least one label on the axis is truncated.
Returned value will not be accurate before the axis is shown.
访问函数:
bool | labelsTruncated () const |
通知程序信号:
void | labelsTruncatedChanged (bool labelsTruncated ) |
This property holds whether axis labels are visible.
访问函数:
bool | labelsVisible () const |
void | setLabelsVisible (bool visible = true) |
通知程序信号:
void | labelsVisibleChanged (bool visible ) |
This property holds the pen used to draw the line.
访问函数:
QPen | linePen () const |
void | setLinePen (const QPen & pen ) |
通知程序信号:
void | linePenChanged (const QPen & pen ) |
This property holds the visibility of the axis line.
访问函数:
bool | isLineVisible () const |
void | setLineVisible (bool visible = true) |
通知程序信号:
void | lineVisibleChanged (bool visible ) |
This property holds the color of the minor grid line.
Applies only to axes that support minor grid lines.
访问函数:
QColor | minorGridLineColor () |
void | setMinorGridLineColor (const QColor & color ) |
通知程序信号:
void | minorGridLineColorChanged (const QColor & color ) |
This property holds the pen used to draw the minor grid line.
Applies only to axes that support minor grid lines.
访问函数:
QPen | minorGridLinePen () const |
void | setMinorGridLinePen (const QPen & pen ) |
通知程序信号:
void | minorGridLinePenChanged (const QPen & pen ) |
This property holds the visibility of the minor grid lines.
Applies only to axes that support minor grid lines.
访问函数:
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 chart.
访问函数:
Qt::Orientation | orientation () const |
此特性保持是否使用反向轴。
By default, the value is
false
.
The reverse axis is supported with a line, spline, and scatter series, as well as an area series with a cartesian chart. All axes of the same orientation attached to the same series must be reversed if one is reversed or the behavior is undefined.
访问函数:
bool | isReverse () const |
void | setReverse (bool reverse = true) |
通知程序信号:
void | reverseChanged (bool reverse ) |
This property holds the border (pen) color of the axis shades.
访问函数:
QColor | shadesBorderColor () const |
void | setShadesBorderColor (QColor color ) |
通知程序信号:
void | shadesBorderColorChanged (QColor color ) |
This property holds the brush used to draw the axis shades (the area between the grid lines).
访问函数:
QBrush | shadesBrush () const |
void | setShadesBrush (const QBrush & brush ) |
通知程序信号:
void | shadesBrushChanged (const QBrush & brush ) |
This property holds the fill (brush) color of the axis shades.
访问函数:
QColor | shadesColor () const |
void | setShadesColor (QColor color ) |
通知程序信号:
void | shadesColorChanged (QColor color ) |
This property holds the pen used to draw the axis shades (the area between the grid lines).
访问函数:
QPen | shadesPen () const |
void | setShadesPen (const QPen & pen ) |
通知程序信号:
void | shadesPenChanged (const QPen & pen ) |
This property holds the visibility of the axis shades.
访问函数:
bool | shadesVisible () const |
void | setShadesVisible (bool visible = true) |
通知程序信号:
void | shadesVisibleChanged (bool visible ) |
This property holds the brush used to draw the title text.
Only the color of the brush is relevant.
访问函数:
QBrush | titleBrush () const |
void | setTitleBrush (const QBrush & brush ) |
通知程序信号:
void | titleBrushChanged (const QBrush & brush ) |
This property holds the font of the title of the axis.
访问函数:
QFont | titleFont () const |
void | setTitleFont (const QFont & font ) |
通知程序信号:
void | titleFontChanged (const QFont & font ) |
此特性保持轴的标题。
默认为空。轴标题支持 HTML 格式。
访问函数:
QString | titleText () const |
void | setTitleText (const QString & title ) |
通知程序信号:
void | titleTextChanged (const QString & text ) |
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 ) |
This property holds the truncation state of labels.
Indicates whether labels should be truncated if there is no enough space for full text. It is equal to
true
在默认情况下。
访问函数:
bool | truncateLabels () const |
void | setTruncateLabels (bool truncateLabels = true) |
通知程序信号:
void | truncateLabelsChanged (bool truncateLabels ) |
This property holds the visibility of the axis.
访问函数:
bool | isVisible () const |
void | setVisible (bool visible = true) |
通知程序信号:
void | visibleChanged (bool visible ) |
[虚拟]
QAbstractAxis::
~QAbstractAxis
()
Destructs the axis object. When the axis is added to a chart, the chart object takes ownership.
[signal]
void
QAbstractAxis::
colorChanged
(
QColor
color
)
This signal is emitted when the color of the axis changes to color .
注意: 通知程序信号对于特性 color .
[signal]
void
QAbstractAxis::
gridLineColorChanged
(const
QColor
&
color
)
This signal is emitted when the color of the pen used to draw the grid line changes to color .
注意: 通知程序信号对于特性 gridLineColor .
Returns the pen used to draw the grid.
注意: Getter function for property gridLinePen.
另请参阅 setGridLinePen ().
[signal]
void
QAbstractAxis::
gridLinePenChanged
(const
QPen
&
pen
)
This signal is emitted when the pen used to draw the grid line changes to pen .
注意: 通知程序信号对于特性 gridLinePen .
[signal]
void
QAbstractAxis::
gridVisibleChanged
(
bool
visible
)
This signal is emitted when the visibility of the grid lines of the axis changes to visible .
注意: 通知程序信号对于特性 gridVisible .
Makes the axis, shades, labels, and grid lines invisible.
[signal]
void
QAbstractAxis::
labelsAngleChanged
(
int
angle
)
This signal is emitted when the angle of the axis labels changes to angle .
注意: 通知程序信号对于特性 labelsAngle .
Returns the brush used to draw labels.
注意: Getter function for property labelsBrush.
另请参阅 setLabelsBrush ().
[signal]
void
QAbstractAxis::
labelsBrushChanged
(const
QBrush
&
brush
)
This signal is emitted when the brush used to draw the axis labels changes to brush .
注意: 通知程序信号对于特性 labelsBrush .
[signal]
void
QAbstractAxis::
labelsColorChanged
(
QColor
color
)
This signal is emitted when the color of the axis labels changes to color .
注意: 通知程序信号对于特性 labelsColor .
返回
true
if axis labels are editable.
另请参阅 setLabelsEditable ().
[signal]
void
QAbstractAxis::
labelsEditableChanged
(
bool
editable
)
此信号被发射当 editable state of the label changes.
Returns the font used to draw labels.
注意: Getter function for property labelsFont.
另请参阅 setLabelsFont ().
[signal]
void
QAbstractAxis::
labelsFontChanged
(const
QFont
&
font
)
This signal is emitted when the font of the axis labels changes to font .
注意: 通知程序信号对于特性 labelsFont .
[signal, since 6.2]
void
QAbstractAxis::
labelsTruncatedChanged
(
bool
labelsTruncated
)
This signal is emitted in two cases; when the axis changes from having one or more truncated labels to having no truncated labels, and when the axis changes from having no truncated labels to having one or more truncated labels. Current state is identified by labelsTruncated .
注意: 通知程序信号对于特性 labelsTruncated .
该函数在 Qt 6.2 引入。
[signal]
void
QAbstractAxis::
labelsVisibleChanged
(
bool
visible
)
This signal is emitted when the visibility of the labels of the axis changes to visible .
注意: 通知程序信号对于特性 labelsVisible .
Returns the pen used to draw the axis line and tick marks.
注意: Getter function for property linePen.
另请参阅 setLinePen ().
[signal]
void
QAbstractAxis::
linePenChanged
(const
QPen
&
pen
)
This signal is emitted when the pen used to draw the line of the axis changes to pen .
注意: 通知程序信号对于特性 linePen .
[signal]
void
QAbstractAxis::
lineVisibleChanged
(
bool
visible
)
This signal is emitted when the visibility of the axis line changes to visible .
注意: 通知程序信号对于特性 lineVisible .
[signal]
void
QAbstractAxis::
minorGridLineColorChanged
(const
QColor
&
color
)
This signal is emitted when the color of the pen used to draw the minor grid line changes to color .
注意: 通知程序信号对于特性 minorGridLineColor .
[signal]
void
QAbstractAxis::
minorGridLinePenChanged
(const
QPen
&
pen
)
This signal is emitted when the pen used to draw the minor grid line changes to pen .
注意: 通知程序信号对于特性 minorGridLinePen .
[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 .
Returns the orientation of the axis (vertical or horizontal).
注意: Getter function for property orientation.
Sets the pen used to draw the grid lines to pen .
注意: setter 函数对于特性 gridLinePen .
另请参阅 gridLinePen ().
Sets the brush used to draw labels to brush .
注意: setter 函数对于特性 labelsBrush .
另请参阅 labelsBrush ().
Sets axis labels editability to editable .
When the labels are editable the user will be able to change the range of the axis conveniently by editing any of the labels. This feature is only supported for the QValueAxis 和 QDateTimeAxis .
By default, labels are not editable.
另请参阅 labelsEditable ().
Sets the font used to draw labels to font .
注意: setter 函数对于特性 labelsFont .
另请参阅 labelsFont ().
Sets the pen used to draw the axis line and tick marks to pen .
注意: setter 函数对于特性 linePen .
另请参阅 linePen ().
Determines whether the axis line and tick marks are visible .
注意: setter 函数对于特性 lineVisible .
另请参阅 isLineVisible ().
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.
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.
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.
Sets the brush used to draw shades to brush .
注意: setter 函数对于特性 shadesBrush .
另请参阅 shadesBrush ().
Sets the pen used to draw shades to pen .
注意: setter 函数对于特性 shadesPen .
另请参阅 shadesPen ().
Sets the brush used to draw titles to brush .
注意: setter 函数对于特性 titleBrush .
另请参阅 titleBrush ().
Sets the font used to draw titles to font .
注意: setter 函数对于特性 titleFont .
另请参阅 titleFont ().
Sets the visibility of the axis, shades, labels, and grid lines to visible .
注意: setter 函数对于特性 visible .
另请参阅 isVisible ().
[signal]
void
QAbstractAxis::
shadesBorderColorChanged
(
QColor
color
)
This signal is emitted when the border color of the axis shades changes to color .
注意: 通知程序信号对于特性 shadesBorderColor .
Returns the brush used to draw shades.
注意: Getter function for property shadesBrush.
另请参阅 setShadesBrush ().
[signal]
void
QAbstractAxis::
shadesBrushChanged
(const
QBrush
&
brush
)
This signal is emitted when the brush used to draw the axis shades changes to brush .
注意: 通知程序信号对于特性 shadesBrush .
[signal]
void
QAbstractAxis::
shadesColorChanged
(
QColor
color
)
This signal is emitted when the color of the axis shades changes to color .
注意: 通知程序信号对于特性 shadesColor .
Returns the pen used to draw shades.
注意: Getter function for property shadesPen.
另请参阅 setShadesPen ().
[signal]
void
QAbstractAxis::
shadesPenChanged
(const
QPen
&
pen
)
This signal is emitted when the pen used to draw the axis shades changes to pen .
注意: 通知程序信号对于特性 shadesPen .
[signal]
void
QAbstractAxis::
shadesVisibleChanged
(
bool
visible
)
This signal is emitted when the visibility of the axis shades changes to visible .
注意: 通知程序信号对于特性 shadesVisible .
Makes the axis, shades, labels, and grid lines visible.
Returns the brush used to draw titles.
注意: Getter function for property titleBrush.
另请参阅 setTitleBrush ().
[signal]
void
QAbstractAxis::
titleBrushChanged
(const
QBrush
&
brush
)
This signal is emitted when the brush used to draw the axis title changes to brush .
注意: 通知程序信号对于特性 titleBrush .
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 .
[signal, since 6.2]
void
QAbstractAxis::
truncateLabelsChanged
(
bool
truncateLabels
)
This signal is emitted when the truncation of the labels changes to truncateLabels .
注意: 通知程序信号对于特性 truncateLabels .
该函数在 Qt 6.2 引入。
[pure virtual]
QAbstractAxis::AxisType
QAbstractAxis::
type
() const
返回轴的类型。
[signal]
void
QAbstractAxis::
visibleChanged
(
bool
visible
)
This signal is emitted when the visibility of the axis changes to visible .
注意: 通知程序信号对于特性 visible .