add PaintEvent support
add method postEvent
refactor and add support for PaintEvent