[solved]Setting two images in a single QGraphicsView
-
Hi, I am trying to grab images from two QGraphicsViews in my widget and setting it in another QGraphicsView on the same widget created using QCreator. The problem which i am facing is :
1)Making both of the images visible in single widget, i guess i can try changing the opacity of the images or apply difference transform to it. I would like to have your suggestion which is the better method and some suggestion how to implement it.
- Adding the scenes which i grab from the other QGraphicsView into the third view. From some posts i came to know that, it can be done using adding the scene() into QGraphicsPixmapItem and setting the flags for it as movable and draggable.But i couldn't find how to add the scenes which are currently in the views into QGraphicsPixmapItems The code which i tried is
@
void Widget::on_pushButton_7_clicked()
{
QGraphicsScene *scn = ui->graphicsView->scene();
scn->addItem(item);
item->setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
scn = ui->graphicsView_2->scene();
scn->addItem(item1);
item1->setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
ui->graphicsView_3->setScene(scn);
ui->graphicsView_3->show();
ui->graphicsView_3->setScene(scn);
ui->graphicsView_3->show();
update();
}
@I know it's wrong, but i just wanted to post it to give an idea what i wanted to implement. I would be honoured to have your suggestions to implement it.
Regards,
Venkatesh Padmanabhan