try declaring the destructor, the paintEvent and the draw method as "virtual"...