void someclass
::drawForeground(QPainter *painter,
const QRectF &rect
){
if(m_measureDistDragging){
tmp.
setColor(QColor(230,
100,
50,
200));
tmp.setWidth(1);
painter->setPen(tmp);
painter->drawLine(m_measureDistStartPoint, m_currentMousePos);
}
}
void someclass::drawForeground(QPainter *painter, const QRectF &rect){
if(m_measureDistDragging){
QPen tmp;
tmp.setColor(QColor(230, 100, 50, 200));
tmp.setWidth(1);
painter->setPen(tmp);
painter->drawLine(m_measureDistStartPoint, m_currentMousePos);
}
}
To copy to clipboard, switch view to plain text mode
when the mouse is clicked m_measureDistStartPoint is set to mapToScene(event->pos()) since when I use it for drawing it needs to be in scene coordinates. The same applies to m_currentMousePos.
When I am debugging I can see that the line is there, but when I am just using the program, I never see the line drawn. Any ideas?
//edit: btw. m_measureDistDragging is true....
Bookmarks