Important: Please read the Qt Code of Conduct -

How To pass QAreaSeries Series as an argument into an other function.

  • Hello everyone,

    I need to know how to pass

                            QLineSeries *series0 = new QLineSeries();
    			QLineSeries *series1 = new QLineSeries();
    			*series0 << QPointF(1, 6) << QPointF(1, 10);
    			*series1 << QPointF(4, 6) << QPointF(4, 10);
    			QAreaSeries *series = new QAreaSeries(series0, series1);

    How to pass "Series" as an argument to another function?

  • Lifetime Qt Champion

    Do you mean like

    void SomeFunc(QAreaSeries * serie) {

    SomeFunc(series );

    Just as a note.
    Since you normally are in a mainwindow, you can also make
    QAreaSeries *series; a class memeber.
    (put it in .h inside class)

    and make sure you new it like
    series = new QAreaSeries(series0, series1);

    then the variable series is available to all functions of MainWindow.

Log in to reply