log4qt code (ported for Q5.2)