Moved stateChanged implementation to .cpp.