如何在QGraphicsView中重置比例
How to reset the scale in QGraphicsView?
本文关键字:QGraphicsView 更新时间:2023-10-16
如何重置图形视图的比例,而不管之前应用的任何比例?使用scale()
乘以我给它的前一个刻度:
ui->graphicsView->scale(0.1, 0.1);
ui->graphicsView->scale(2, 2);
// the scale factor is (0.2,0.2) instead of (2,2)
QGraphicsView::resetMatrix()
重置矩阵,在应用尺度之前调用它的工作:
view->scale(0.1, 0.1);
view->resetMatrix();
view->scale(2, 2);
// the scale factor is (2,2)
需要补充的内容:
QGraphicsView::resetMatrix()等于QGraphicsView::resetTransform(),可以从源代码中看到:
void QGraphicsView::resetMatrix()
{
resetTransform();
}
相关文章:
- 调整布局上的 QGraphicsView 小部件的大小
- 将 QGraphicsView 或 Scene 转换为 XML/JSON
- 如何在QGraphicsView中移动QWidget?
- 在继承自 QGraphicsView 的类中使用 QGraphicsSceneMouseEvent
- 如何在 QGraphicsView 中显示图像
- 如何在客户端连接时在QT中更新QGraphicsView
- 在QGraphicsView上实现交互式样条曲线的最佳方法是什么?
- 围绕QgraphicsScene移动QGraphicsView
- 来自子类 QGraphicsView 的信号在插槽中无法识别
- Qt - QGraphicsScene 和 QGraphicsView 不更新更改?
- QGraphicsView scaling with High DPI
- 如何正确删除是中央小部件的Qgraphicsview对象
- QgraphicsView慢速,大量QgraphicsPixMapiTem
- 使用QgraphicsView子类绘制QPAINTER线
- QStateMachine如何在不同的QState中显示和隐藏QGraphicsView和QObject
- 从QGraphicsView转发按键
- 将QGraphicsview信号连接到UI插槽
- 将 QGraphicsView 锚定到屏幕的一角
- QGraphicsView和Qgraphicsscene坐标系
- QGraphicsView / Qgraphicsscene Timer事件不起作用