A message factory in C++ / Qt5