Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 3

Qt-interest Archive, August 2007
making selections in qgraphicview


Message 1 in thread

Hello there

 I'm looking a way to create selection on my graphicsview (qt4).

My canvas i widget that inherit after qgraphicsview. On canvas are other
widgets, and for example one type of them inherit after Graphics Rectangle.
I don't know how to implement selecting on the canvas.

Maybe this one:

In my canvas in function mousePressEvent is special value checking. If True,
then press event is not propagated. But object (rectangle with special green
;) for example borders is created). After any move on the canvas (with still
pressing left button mouse and of course special value still True) object is
re sized. After release button object is destroyed, pointers to all items on
the canvas are stored in the list. From all this pointers the top most are
taken. And for example, all of these items (and all of their childrens) are
set to yellow.

It's some idea, I'm looking a way to start.

Best regards
-- 
 [ signature omitted ]