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
selectionChangedto be emitted whenever some items in the scene get selected. In order to get selected the flagQGraphicsItem::ItemIsSelectableshould have been set.Are you sure the items are selectable?