我有一个QGraphicsScene
添加了一些QGraphicsItem
.
我需要在单个视图中显示整个场景的特定部分。
为此,我想创建多个实例,QGraphicsView
每个实例都显示我的特定部分QGraphicsScene
(不是相似部分)。
怎么做到呢?
QGraphicsScene mcpGraphicsScene = new QGraphicsScene(this);
QGraphicsRectItem * mcpGraphicsRect = mcpGraphicsScene->addRect(5,5,200,200);
QGraphicsLineItem * mcpGraphicsLine = mcpGraphicsScene->addLine(500,500,300,300);
QGraphicsView * mcpGraphicsView1 = new QGraphicsView(this);
mcpGraphicsView1->setScene(mcpGraphicsScene);
mcpGraphicsView1->setGeometry(260,20,311,500);
QGraphicsView * mcpGraphicsView2 = new QGraphicsView(this);
mcpGraphicsView2->setScene(mcpGraphicsScene);
mcpGraphicsView2->setGeometry(260,520,311,1061);