Remove friends of QEvent.

Introduce function to set the spontaneous flag to
QCoreApplicationPrivate to solve a few cases.

Change-Id: I7c1f1f3644defe00deea9cecb244ca258afd5b94
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>