Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
maxg0 last edited by
I am working on a new application which uses a QPainterPath::drawPath function. It all works fine, however at some point the new drawn path starts erasing the old one!
There could be something wrong in the application algorithm, however is there anything I should be aware of in relation to drawPath which could cause such a behaviour?
std::vector<std::pair<QColor, QPainterPath> > ret;
const size_t size = path.GetTotalNumPoints();
RobotGraphicsPath::Point pt = path.GetPoint(0);
colour = path.GetColour(0);
for (size_t i = 1; i < size; ++i)
RobotGraphicsPath::Point pt = path.GetPoint(i);
if (path.GetColour(i) != colour) // If the colour has changed from the last point to this point start a new path.
qtPath = QPainterPath();
qtPath.moveTo(pt.x, pt.y); // Start next path where last path ends
colour = path.GetColour(i);