qt chapter 2 codes