QCPItemLine is being paint automatically
Clash Royale CLAN TAG #URR8PPP QCPItemLine is being paint automatically Im trying using QCustomPlot in my gui MainWindow.h public: void initArrow(); private: QCustomPlot* grid; QCPItemLine* arrow; MainWindow.cpp void MainWindow::initArrow() { arrow = new QCPItemLine(ui->grid); QPen pen(Qt::red); pen.setWidth(4); arrow->setPen(pen); arrow->setHead(QCPLLineEnding::esLineArrow); arrow->setHead(QCPLLineEnding::esDisc); } in this situation i'm playing the program, i resize the window and i see an arrow on the plot with coordinates (0,0) and (1,1). this is the code . I didnt use replot! I didnt use start! I didnt use end! in addition, when i will understand what is the problem I'm asking what is the correct way to draw a line when i'm trying to draw above other graph. normally if I'm using points it will be like: QVector<double> x; QVector<double> y; ui->grid->graph(number)->setData(x,y); ui->grid->graph(number)->replot(); but I cant ...