Original Post
Hi, I'm currently dusting off my c++ skills (or lack thereof) and learning qt while I'm at it. Now, on to my question, and I think it's a simple one. In My class declaration I have a nice simple: int currentColour; which is set to 0 during the class destructor, then I have a function: void Row::setColour(int colour) { currentColour = colour; printf("in Row::setColour %X \n", currentColour); } which, naturally sets currentColour to whatever I pass in, printf 'proves' this. But then when another function gets called (a qt slot) void Row::btnClicked(void) { printf("Setting one to palette %X \n", currentColour); } currentColour is ALWAYS what it was set to in the constructor. So I think I've either done something stupid or I'm missing something about what moc (a qt file conversion thingy) does to my sockets. To eliminate the chance of it being the former I've searched through the file to find all instances of currentColour, so I'm not overwriting it anywhere, and it's a private member so it's not being overwritten anywhere. So, can anyone help me with this? I'm stumped that something so straighforward can cause sucha headache!