PDA

View Full Version : Chech if filled



Kamran Kawish
17th October 2012, 11:42
Hi,, I wanted to ask if there is any way we can check wether a shape(using QPainter) is filled or not

wysota
17th October 2012, 11:43
You mean after it was painted?

Kamran Kawish
17th October 2012, 11:46
Yes after it is painted,, or maybe there is something we can do before hand which will allow us to find out...

wysota
17th October 2012, 11:49
What exactly do you need it for?

Kamran Kawish
17th October 2012, 12:05
I am trying to remake a grid of squares i saw where we can fill and unfill the squares by clicking on them,,, I manages to fill them by using a pressMouseEvent. The box fills up when the left mouse button is pressed within the square, The X-Y starting point of the grid and the width of the squares is known. I use x() and y() to get where the LMB was clicked, find out in which square I am and drawFill a box overthere; I know that even an unfilled box is actually filled with default color. I wanted to know if can change the color back to default after clicking again on the box,, or I have completely redesign the function? and if I do, is there a commonly used method to do it

wysota
17th October 2012, 12:09
I am trying to remake a grid of squares i saw where we can fill and unfill the squares by clicking on them
In that case hold a data structure (e.g. an array) for the grid that denotes whether a particular cell is filled or not.

Kamran Kawish
17th October 2012, 12:30
hmmmm I was thinking about it,,, was wondering it mouse event could help over there,,,,, thankyou very much