@borasemiz
I have solved it. I discovered that I needed to refresh my plot, which is to say I needed to re-plot my plot. Let me:
//I am just skipping to the click function of my button
QCPItemStraightLine* line = (QCPItemStraightLine) (ui->widget->item());
line->point1->setCoords(5,6);
line->point2->setCoords(5,7);
ui->widget->replot(); //This line solved the problem.