Qt-interest Archive, August 2006
QGraphicsView selection questions and comments
Message 1 in thread
Hi
I have some questions and comments about QGraphicsView selection in 4.2-tp1
(1) How "complete" will the selection implementation be in the end (will it
handle discontiguous selection with the control key, shift selection, etc)
or should I roll my own mechanism for this?
(2) There seems to be a bug where if I have a selected, non-movable item,
and I then drag a moveable item, the selected non-moveable item is moved as
well. (the non moveable item is a graph edge which is re-located according
to constraints rather than direct manipulation).
(3) It would be nice to have a selectNone() or unselectSelectedItems()
method in Scene. At the moment I'm using scene()->setSelectionArea(
QPainterPath() ); which is a bit ugly.
And another question: is there a way to set a global "tolerance" for hit
testing? (like a margin of a few pixels).. it seems quite expensive to have
to make a special painter path just to add a few pixels around a thin line
to hit test it.. perhaps this could even be a QSize returned by every
item...
Many thanks for QGraphics view, it's pretty amazing so far.
Ross.
--
[ signature omitted ]
Message 2 in thread
Ross Bencina wrote:
> (3) It would be nice to have a selectNone() or unselectSelectedItems()
> method in Scene. At the moment I'm using scene()->setSelectionArea(
> QPainterPath() ); which is a bit ugly.
Hi, Ross. QGraphicsScene::clearSelection() is probably what you're looking
for. I've added a see-also from setSelectionArea()'s documentation now.
Andreas
--
[ signature omitted ]