I am trying to catch the signal that indicates that the user has used the rubberband to select a region. I tried this:
QGraphicsScene* scene = new QGraphicsScene();
connect(scene, SIGNAL(selectionChanged()), this, SLOT(SelectionChanged()));
this->graphicsView->setScene(scene);
this->graphicsView->setDragMode(QGraphicsView::RubberBandDrag);
but my SelectionChanged() slot is never called. Any ideas how to do this?
In order the signal selectionChanged to be emitted whenever some items in the scene get selected. In order to get selected the flag QGraphicsItem::ItemIsSelectable should have been set.
Are you sure the items are selectable?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With