Is there a cross-platform way to get the local IP address (i.e. something that looks like 192.168.1.49) of the computer using Qt?
192.168.1.49
I want to make an FTP
Use QNetworkInterface::allAddresses()
const QHostAddress &localhost = QHostAddress(QHostAddress::LocalHost); for (const QHostAddress &address: QNetworkInterface::allAddresses()) { if (address.protocol() == QAbstractSocket::IPv4Protocol && address != localhost) qDebug() << address.toString(); }