I want to check for a mouseClickEvent within the paintevent. If it is within a specific coordinates then I would like it to paint another object. Is there a way to set the coordinates to a variable?

Is this a bad way to deal with a paintevent? Is it better to use a set of Qbuttons?

Thank You.