I want to draw my kurves in a function. I want to send the diagram together with some parameters into the function and do the plotting there. ui->dia_simulation is my QCustomPlot widget.

        kv_text.darstellen(ui->dia_simulation, QString("Testkurve"), true, bp_auslegung.get_qstr());

Now i get the following error:

Fehler: no matching function for call to 'Kurve::darstellen(QCustomPlot*&, QString, bool, QString)'
         kv_text.darstellen(ui->dia_simulation, QString("Testkurve"), true, bp_auslegung.get_qstr());

My function looks like this:

void Kurve::darstellen(QCustomPlot diagramm, QString legend_name, bool sonder_jn, QString dim_q){
    diagramm->addGraph();
    diagramm->graph(ui->diagramm->graphCount()-1)->setData(get_sonder_x(), get_sonder_y());
    diagramm->graph(ui->diagramm->graphCount()-1)->setPen(QPen(Qt::red));
    diagramm->graph(ui->diagramm->graphCount()-1)->setLineStyle(QCPGraph::lsNone);
    diagramm->graph(ui->diagramm->graphCount()-1)->setScatterStyle(QCPScatterStyle(QCPScatterStyle::ssDisc, 6));
    diagramm->graph(ui->diagramm->graphCount()-1)->setName(legend_name);
    if (sonder_jn){
        diagramm->addGraph();
        diagramm->graph(dia_simulation->graphCount()-1)->setData({get_qopt_from_q_str(dim_q)}, {fx5(get_parameter(), get_qopt_from_q_str(dim_q))});
        diagramm->graph(dia_simulation->graphCount()-1)->setPen(QPen(Qt::green));
        diagramm->graph(dia_simulation->graphCount()-1)->setLineStyle(QCPGraph::lsNone);
        diagramm->graph(dia_simulation->graphCount()-1)->setScatterStyle(QCPScatterStyle(QCPScatterStyle::ssStar, 6));
        diagramm->graph(dia_simulation->graphCount()-1)->setName(legend_name + " SP");
    }
}

What am I doing wrong?

Thomas