Hi, I have to update every second (QTimer) the QGraphicsView, the QGraphicsView only have QGraphicsPixmapItems at specific positions in the whole frame.
I have to modify every time like five or seven images on this QGraphicsView, but I don't know how to do it.
Here's an example of my main code.
scene->setSceneRect(0.0,0.0,400.0,400.0);
for(int i=0;i<5;i++){
image->setPixmap(icon);
scene->addItem(image);
image->setPos(i*icon.width(),0);
}
QGraphicsPixmapItem *image2
= new QGraphicsItem();
// with this default QGraphicsPixmapItem I'm trying to get the item at specific position, and set to this value (image2). //I know I'm not doing anything now, I just deleted the things I tried to do before posting this thread.
view->setScene(scene);
view->show();
QGraphicsScene *scene = new QGraphicsScene();
scene->setSceneRect(0.0,0.0,400.0,400.0);
for(int i=0;i<5;i++){
QGraphicsPixmapItem *image = new QGraphicsPixmapItem();
image->setPixmap(icon);
scene->addItem(image);
image->setPos(i*icon.width(),0);
}
QGraphicsPixmapItem *image2 = new QGraphicsItem(); // with this default QGraphicsPixmapItem I'm trying to get the item at specific position, and set to this value (image2).
//I know I'm not doing anything now, I just deleted the things I tried to do before posting this thread.
QGraphicsView *view = new QGraphicsView();
view->setScene(scene);
view->show();
To copy to clipboard, switch view to plain text mode
I want to change the image located in a specific position for another one, and move this image to the next position (left,right,top,bot).
I tried using QGraphicsScene::itemat(); But I think Dont work with QGraphicsPixmapItem.
If my question is vague, please let me know, I can explain it better, just that I don't have time right now.
Thanks for your time.
Bookmarks