#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()) { if (a == QHostAddress::Null || a == QHostAddress::Broadcast || a == QHostAddress::LocalHost || a == QHostAddress::AnyIPv6) continue; QString ip = a.toString(); QLabel* label = new QLabel(tr("IP") ); QLabel* value = new QLabel(ip); _tableLayout->addRow(label, value); } /* TODO: Add other information */ }