Backport of Qt5 applicationName handling

Currently applicationName returns an empty value unless the user
explicitly sets it. Qt 5 is smarter and get the name either based on the
application arguments or a platform specific way (e.g. OS X using the
menu bar name) if the user didn't set it.

Based on f04b46f34e9446417cd5681f511332344679ef30
and 696060134d10d44175970ffd38618544ecdd9387

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