diff options
Diffstat (limited to 'examples/network/fortuneserver/server.cpp')
-rw-r--r-- | examples/network/fortuneserver/server.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/examples/network/fortuneserver/server.cpp b/examples/network/fortuneserver/server.cpp index a102ef2..5da43ab 100644 --- a/examples/network/fortuneserver/server.cpp +++ b/examples/network/fortuneserver/server.cpp @@ -63,10 +63,15 @@ Server::Server(QWidget *parent) return; } //! [0] + QList<QHostAddress> ipAddresseList = QNetworkInterface::allAddresses(); + QString ipAddresses; + for (int i = 0; i < ipAddresseList.size(); ++i) { + ipAddresses.append(ipAddresseList.at(i).toString()).append("\n"); + } - statusLabel->setText(tr("The server is running on port %1.\n" + statusLabel->setText(tr("The server is running on \n IP: \n%1 PORT: \n%2\n" "Run the Fortune Client example now.") - .arg(tcpServer->serverPort())); + .arg(ipAddresses).arg(tcpServer->serverPort())); //! [1] //! [2] |