PDA

View Full Version : Adding items to a QGraphicsScene's selection list?



mooreaa
1st July 2008, 13:43
Can I manually add items to a QGraphicsScene's selection list?

mcosta
1st July 2008, 14:23
QGraphicsItem::setSelected() or QGraphicsScene::setSelectionArea()

mooreaa
1st July 2008, 21:01
Hmm i tried set selected, but had some problems.

Basically I'm trying to do this, If I have two boxes connected by an arrow, and I select the two boxes, I also want it to automatically select the arrow.

I tried putting my code on itemchanged on my boxes, and it works when I ctrl select the two boxes, but not if I drag a rubberband. It seems like it gets selected momentairly but since the rubberband doesn't intersect the arrow, it gets immediately deselected.

What can I do?