PDA

View Full Version : Bring the item to the front at mouse press event



sajis997
17th August 2011, 11:38
Hello forum,


I have many items in the graphics scene and i have sub-classed the graphics view. I would like to brint the selected item to the front once the item is selected with a mouse click.

I have created a slot that does the job , but a bit confused about the signal to throw.

I want to get it done with the mouse press event.


Any suggestion ?


Regards
Sajjad

mvuori
17th August 2011, 17:44
I think you need to use setZValue() -- give a Z value to each item and when you want one on top, give it the biggest Z value. (As Z value is a qreal, you won't run out of numbers soon, but still scaling back the values after long editing sessions would be neat -- just in case...)