Use QHostInfo to get local host name.

Added dependency on QtNetwork for Qt4, too. In Qt5 we depend through
QtQuick.