QString Gateway = QHostInfo::localHostName();
QList<QHostAddress> hostGateway = QHostInfo::fromName(Gateway).addresses();
foreach (const QHostAddress& address, hostGateway) {
if (address.protocol() == QAbstractSocket::IPv4Protocol && address.isLoopback() == false) {
Gateway = address.toString();
}
}