//获取主机名 QString localHost = QHostInfo::localHostName(); 转载于:https://www.cnblogs.com/amwuau/p/8021758.html