mvbhavsar
20th April 2017, 09:31
Hi,
I want to implement grid using qgraphicsrectitem in which each cell can has multiple child and grandchildren. i.e. I have outer rectangle R1 with rect as R(0,0,300,300). This rect will have 3 child qgraphicsrectitem as RC1(0,0,300,100), RC2(0,100,300,100), RC3(0,200,300,100)
when I will add 2 children in RC1 as RGC1(0,0,300,75) and RGC1(0,75,300,75), it should change bounding rect as belows.
RGC1 - (0,0,300,75)
RGC2 - (0,75,300,75)
RC1 - (0,0,300,150),
RC2 - (0,150,300,100)
RC3 - (0,250,300,100)
R - (0,0,300,250)
This means basically, I want to implement that if child is added or resized all its parents and super parents to get re-shaped so that all children remain inside the bounding rect of parent and will not be out of border.
Any idea for this
Manish
I want to implement grid using qgraphicsrectitem in which each cell can has multiple child and grandchildren. i.e. I have outer rectangle R1 with rect as R(0,0,300,300). This rect will have 3 child qgraphicsrectitem as RC1(0,0,300,100), RC2(0,100,300,100), RC3(0,200,300,100)
when I will add 2 children in RC1 as RGC1(0,0,300,75) and RGC1(0,75,300,75), it should change bounding rect as belows.
RGC1 - (0,0,300,75)
RGC2 - (0,75,300,75)
RC1 - (0,0,300,150),
RC2 - (0,150,300,100)
RC3 - (0,250,300,100)
R - (0,0,300,250)
This means basically, I want to implement that if child is added or resized all its parents and super parents to get re-shaped so that all children remain inside the bounding rect of parent and will not be out of border.
Any idea for this
Manish