Can't include

后端 未结 2 1361
有刺的猬
有刺的猬 2021-01-05 16:50

It seems I can\'t find a way to include in my header so Qt knows about the QLineSeries class.

  • I added Qt += cha
相关标签:
2条回答
  • 2021-01-05 17:17

    As I wrote the question I found the answer.

    I was missing using namespace QtCharts; in the header file. Got the reference from: http://doc.qt.io/qt-5/qtcharts-index.html

    0 讨论(0)
  • 2021-01-05 17:35

    If you want to avoid specifying the namespace, you can also declare your variable as:

    QtCharts::QLineSeries *series;
    

    With this solution you always have to prepend QtCharts::, but you also know your scope and the origin of your calls.

    0 讨论(0)
提交回复
热议问题