Introduction - If you have any usage issues, please Google them yourself
• application logic design
1. Light class
A. the main attributes and behaviors: bright quenching condition, associated resource object images, accept the bright quenching requirements of our clients
B. class CLight
Member variables: m_state
A member function: init, getState, setState
2. Switch class
A. the main attributes and behaviors: correlation of the lights CLight, accept customer press operation
B. class CSwitch
Member variables: m_pLight
A member function: init, push
3. The instance objects: two switch, a lamp
Operation: click on the button, click event response, invoke the member function push switch, to light up or put out the light
. Note: the above logic code written in a header file, use inline type to achieve its member functions, and submit.