diff --git a/mainwindow.cpp b/mainwindow.cpp index aaf4c72..3462507 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -285,6 +285,17 @@ void MainWindow::addSmartAttributesTable(const QJsonArray &attributes) tableWidget->setItemDelegateForColumn(0, new StatusDot(tableWidget)); tableWidget->setRowCount(attributes.size()); + for (int i = 0; i < tableWidget->columnCount(); ++i) { + QTableWidgetItem *headerItem = tableWidget->horizontalHeaderItem(i); + if (headerItem) { + if (i == 2) { + headerItem->setTextAlignment(Qt::AlignLeft | Qt::AlignVCenter); + } else if (i > 2) { + headerItem->setTextAlignment(Qt::AlignRight | Qt::AlignVCenter); + } + } + } + int row = 0; for (const QJsonValue &attr : attributes) { QJsonObject attrObj = attr.toObject();