我已经创建了一个从QGraphicsView派生的视图类,并将backgroundBrush设置为图像。我想翻译一下backgroundBrush。我尝试过以下几种方法
// graphicsView derived from QGraphicsView
graphicsView->backgroundBrush().transform().translate(moveX, moveY);但它并没有改变背景笔刷。
发布于 2015-09-28 20:33:02
您需要调用setBackgroundBrush()和setTransform()来修改这些属性:
QBrush brush = graphicsView->backgroundBrush();
brush.setTransform(QTransform::fromTranslate(moveX, moveY));
graphicsView->setBackgroundBrush(brush);https://stackoverflow.com/questions/32816196
复制相似问题