• Hi,

    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?

    Code fragment:
    QPainterPath qtPath;
    QColor colour;
    std::vector<std::pair<QColor, QPainterPath> > ret;
    const size_t size = path.GetTotalNumPoints();
    if (size)
    RobotGraphicsPath::Point pt = path.GetPoint(0);
    colour = path.GetColour(0);
    qtPath.moveTo(pt.x, pt.y);
    for (size_t i = 1; i < size; ++i)
    RobotGraphicsPath::Point pt = path.GetPoint(i);
    qtPath.lineTo(pt.x, pt.y);
    if (path.GetColour(i) != colour) // If the colour has changed from the last point to this point start a new path.
    ret.push_back(std::make_pair(colour, qtPath));
    qtPath = QPainterPath();
    qtPath.moveTo(pt.x, pt.y); // Start next path where last path ends
    colour = path.GetColour(i);
    ret.push_back(std::make_pair(colour, qtPath));
    return ret;


Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.