C++ (Qt)void PaintSomething( ... ){ drawState = true; ... drawState = false;} void DoSomething( ... ){ assert(!drawState); ...}