我可以在graphicsView上使用2个setScene吗?

时间:2012-06-03 05:36:51

标签: qt qgraphicsview

我使用此代码,但graphicsView将显示最后一个命令, 如何在一个graphicsView中显示两个setScence?

ui->setupUi(this);
line1= new QGraphicsScene (this);
line= new QGraphicsScene (this);

ui->graphicsView->setScene(line);    // not show
ui->graphicsView->setScene(line1);   // show

1 个答案:

答案 0 :(得分:2)

您需要两个QGraphicsViews。 QGraphicsView一次只能显示一个场景。我不确定任何其他方式都有意义。如果您想要并排放置两个场景/视图,也许可以查看QLayoutQSplitter