This commit is contained in:
zhaominyong 2021-12-29 11:13:34 +08:00
parent 72b7e55603
commit cb92357cbd
4 changed files with 7 additions and 4 deletions

View File

@ -38,8 +38,11 @@ BackupPointListDialog::BackupPointListDialog(QWidget *parent, bool isOnlyShowLoc
m_tableWidget = new QTableWidget;
m_tableWidget->setColumnCount(headerLabels.size());
m_tableWidget->setHorizontalHeaderLabels(headerLabels);
m_tableWidget->horizontalHeader()->setDefaultAlignment(Qt::AlignCenter);
m_tableWidget->horizontalHeader()->setDefaultAlignment(Qt::AlignLeft | Qt::AlignVCenter);
m_tableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
// m_tableWidget->horizontalHeader()->setSectionResizeMode(Column_Index::Backup_Name, QHeaderView::Stretch);
// m_tableWidget->horizontalHeader()->setSectionResizeMode(Column_Index::UUID, QHeaderView::Stretch);
// m_tableWidget->horizontalHeader()->setSectionResizeMode(Column_Index::Backup_Device, QHeaderView::Stretch);
m_tableWidget->horizontalHeader()->setTextElideMode( Qt::ElideRight);
m_tableWidget->horizontalHeader()->setFixedHeight(30);
m_tableWidget->verticalHeader()->setHidden(true); // 好像隐藏不掉

View File

@ -42,7 +42,7 @@ signals:
protected:
void keyPressEvent(QKeyEvent* event);
void setItem(int row, int column, const QString& text, int alignFlag = Qt::AlignCenter);
void setItem(int row, int column, const QString& text, int alignFlag = Qt::AlignLeft | Qt::AlignVCenter);
QString text(int row, int column);
QTableWidget *m_tableWidget;

View File

@ -114,7 +114,7 @@ void ManageBackupPointList::insertLines(const QList<ParseBackupList::BackupPoint
m_tableWidget->insertRow(indexOfRow);
setItem(indexOfRow, Column_Index::Backup_Name, backupPoint.m_backupName);
setItem(indexOfRow, Column_Index::UUID, backupPoint.m_uuid, Qt::AlignLeft | Qt::AlignVCenter);
setItem(indexOfRow, Column_Index::UUID, backupPoint.m_uuid);
setItem(indexOfRow, Column_Index::Backup_Time, backupPoint.m_time);
setItem(indexOfRow, Column_Index::Backup_Size, backupPoint.m_size);

View File

@ -130,7 +130,7 @@ void SelectRestorePoint::insertLines(const QList<ParseBackupList::BackupPoint> &
m_tableWidget->insertRow(indexOfRow);
setItem(indexOfRow, Column_Index::Backup_Name, backupPoint.m_backupName);
setItem(indexOfRow, Column_Index::UUID, backupPoint.m_uuid, Qt::AlignLeft | Qt::AlignVCenter);
setItem(indexOfRow, Column_Index::UUID, backupPoint.m_uuid);
setItem(indexOfRow, Column_Index::Backup_Time, backupPoint.m_time);
setItem(indexOfRow, Column_Index::Backup_Size, backupPoint.m_size);