#include "informationdialog.h" #include #include InformationDialog::InformationDialog() : QDialog() { /* widgets */ _lblTitle = new QLabel(tr("

system information

")); _tableWidget = new QWidget(); /* layouts */ _layout = new QVBoxLayout(); _tableLayout = new QFormLayout(); /* */ _tableWidget->setLayout(_tableLayout); _layout->addWidget(_lblTitle); _layout->addWidget(_tableWidget); this->setLayout(_layout); initTable(); qDebug() << "create information dialog"; } void InformationDialog::initTable() { /* NETWORK*/ /* hostnames */ _tableLayout->addRow(new QLabel(tr("hostname")), new QLabel(QHostInfo::localHostName())); /* ips */ for (QHostAddress a: QNetworkInterface::allAddresses()) { QString ip = a.toString(); if (ip == "::1" || ip == "127.0.0.1") { continue;} QLabel* label = new QLabel(tr("IP") ); QLabel* value = new QLabel(ip); _tableLayout->addRow(label, value); } /* TODO: Add other information */ }