@Dancingfairy - I don't think you did anything wrong in your response to your little girl - you were put on the spot, and had to think on your feet.
However, I do think that you need to tell her that it is not kind to remark on people's appearance - otherwise, if she thinks it is OK, the next person whose appearance she comments on may be very offended and upset. I am overweight - much more so than you - and whilst I am doing something about it, it is a long, long road, and if a child commented in public about how fat I am, I would be very upset indeed. I wouldn't necessarily show it there and then, and I wouldn't say anything to the child or their parent, but I would go home with those words nagging over and over in my brain, telling me what a failure I am and how gross I look.
You don't have to explain your weight gain to your child if you don't want to - that is up to you, in my opinion, but you need to tell her that what she said was unkind, and that she could have upset you - and then tell her that it is not polite to comment on other people's appearance, and it could be upsetting for them.
At 6, she is old enough to start to learn this lesson - but she does need to learn it.