mirror of
https://github.com/edisionnano/QDiskInfo.git
synced 2026-04-16 00:01:27 +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->setItemDelegateForColumn(0, new StatusDot(tableWidget));
|
||||||
tableWidget->setRowCount(attributes.size());
|
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;
|
int row = 0;
|
||||||
for (const QJsonValue &attr : attributes) {
|
for (const QJsonValue &attr : attributes) {
|
||||||
QJsonObject attrObj = attr.toObject();
|
QJsonObject attrObj = attr.toObject();
|
||||||
|
|||||||
Reference in New Issue
Block a user