Let's say I create a QGraphicsItem (rectangle) in a QGraphicsScene (scene), without creating a class for the item:
Constructur of Mainwindow (.cpp):
ui->setupUi(this);
ui->graphicsView->setScene(scene);
rectangle = scene->addRect(0,0,100,100);
ui->setupUi(this);
scene = new QGraphicsScene(this);
ui->graphicsView->setScene(scene);
rectangle = scene->addRect(0,0,100,100);
To copy to clipboard, switch view to plain text mode
Is there a way to overwrite a mouse click on the rectangle and make something happen, even if it is not in another class?
What about showing a tooltip when hovering over it?
I hope the question is clear and not completely redundant.
Bookmarks