I have this in my Dialog header:
QGraphicsScene *scene;
void mousePressEvent(QMouseEvent *);
void mouseMoveEvent(QMouseEvent*);
void mouseReleaseEvent(QMouseEvent *);
To copy to clipboard, switch view to plain text mode
And this in my cpp:
ui->graphicsView->setScene(scene);
QPixmap p2
("C:/Users/Pedro/Desktop/imagens/6.jpg");
scene->addItem(item);
scene=new QGraphicsScene(0,0,800,600);
ui->graphicsView->setScene(scene);
QPixmap p2("C:/Users/Pedro/Desktop/imagens/6.jpg");
QGraphicsPixmapItem* item = new QGraphicsPixmapItem(p2);
scene->addItem(item);
To copy to clipboard, switch view to plain text mode
Is possible to open a new window or to do any action when the item is clicked? Sorry people, I'm begginer. Can you help me, please?
}
void Dialog::mousePressEvent(QMouseEvent * e) {
}
To copy to clipboard, switch view to plain text mode
Bookmarks