Changed the code to use QClass Object