跳转到内容
新建笔记

Qt Graphics View

()scene显示更新

// ui->graphicsView_2->show() 显示 graphicsView_2 组件。如果组件之前是隐藏的,这个方法将其显示在界面上。
// 使用 show() 可以确保组件可见。
// 如果图像没有显示出来,可能是因为组件没有被显示。
ui->graphicsView_2->show();
// ui->graphicsView_2->update() 更新 graphicsView_2 组件。这个方法会触发组件的重绘,调用 paintEvent。
// update() 不会显示隐藏的组件,只会刷新已经可见的组件。
// 如果图像已经显示在界面上,但需要刷新,可以使用 update()。
ui->graphicsView_2->update();
// 总结:如果要确保图像显示在界面上,使用 show()。如果只是想刷新已经显示的图像,使用 update()。