Qt literacy-QAbstractSeries theory summary

I. Overview

The QAbstractSeries class is the base class for all Qt chart lines. Usually, the derived class specific to the sequence type is used instead of this base class. This base class only provides some information for managing and controlling the table, such as the name, the display and hiding of the entire table, transparency, and the adhesion relationship with QChart and Legend.

The following is a complete chart example
insert image description here
, while QAbstractSeries maintains the content of the line, and the drawing is controlled by QChart.
insert image description here
insert image description here

2. Commonly used functions

1. Properties

  • name() const
  • opacity() const
  • type() const

2. Setting function

  • setName(const QString &name): Set the name of this table sequence
  • setOpacity(qreal opacity)
  • setUseOpenGL(bool enable = true)
  • setVisible(bool visible = true)
  • show()

3. Show hide

  • void show()
  • void hide()
  • bool useOpenGL() const: use OpenGL to draw

4. Interaction with the drawing

  • bool attachAxis(QAbstractAxis *axis)

  • bool detachAxis(QAbstractAxis *axis)

  • QList<QAbstractAxis *> attachedAxes()
    maintains the relationship between the entire chart line and the coordinate axis

  • QChart *chart() const
    Get the ownership relationship of the chart of this graph line example

3. Signal

This is easy to understand. In fact, it is the signal generated after the properties set above change.

  • void nameChanged()
  • void opacityChanged()
  • void useOpenGLChanged()
  • void visibleChanged()

Guess you like

Origin blog.csdn.net/qq_43680827/article/details/130229491