I draw a polygon int the paintEvent of class A,and create class B based on A.

Now I want to fill the polygon of A in the paintEvent of B,how to do?