Qt で QGraphicsPathItem のパスを変更する方法はありますか?
この方法でアイテムを作成しました:
QGraphicsPathItem* item = new QGraphicsPathItem();
QPainterPath* path = new QPainterPath();
path->cubicTo(3,5, 3,10, 0,15);
item->setPath(*path);
item->moveBy(-20,-20);
scene->addItem(item);
今、私はパスの要素を変更したい:
item->path().elementAt(0).y = -5;
item->path().elementAt(0).x = 0;
しかし、私は次のエラーが発生します:
assignment of member 'QPainterPath::Element::y' in read-only object