mirror of
https://github.com/edisionnano/QDiskInfo.git
synced 2026-03-12 15:50:53 +03:00
Fix header alignment
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user