添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
拉风的蟠桃  ·  javax.validation.Valid ...·  2 年前    · 
悲伤的橙子  ·  6.3.1 ...·  2 年前    · 
淡定的熊猫  ·  vb.net - ORA-03111 ...·  2 年前    · 
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams 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 do setData with a line and its not related to some graph so i can i Draw the line on a specefic graph??

ok. in MainWindow i have QCustomPlot* grid. i want to make a function with x_start, y_start, x_end, y_end and draw an arrow accordingly – asaf anter Jul 29, 2018 at 8:53 If you do not explain clearly what you want and provide a decent minimal reproducible example unfortunately I can not help you :) – eyllanesc Jul 29, 2018 at 9:26

QCPItemLine is drawn automatically without replot, if you want it not to be displayed you must use:

setVisible(False);

If you want it to be displayed use:

setVisible(True);
ui->grid->replot();
                yes but before i'm using start and end,  its is being plotted without it from (0,0) to (1,1). try to init the line like i did, play the program and change the window size, the line should appear from nowhere without using start and end. in addition iwant it to be on other graph, but i cant related the line to a graph
– asaf anter
                Jul 29, 2018 at 9:20
        

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.