From cb92357cbd49925b208b6e8952425e752837a4a2 Mon Sep 17 00:00:00 2001 From: zhaominyong Date: Wed, 29 Dec 2021 11:13:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kybackup/backuppointlistdialog.cpp | 5 ++++- kybackup/backuppointlistdialog.h | 2 +- kybackup/module/managebackuppointlist.cpp | 2 +- kybackup/module/selectrestorepoint.cpp | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/kybackup/backuppointlistdialog.cpp b/kybackup/backuppointlistdialog.cpp index 1145fd7..9482e8b 100755 --- a/kybackup/backuppointlistdialog.cpp +++ b/kybackup/backuppointlistdialog.cpp @@ -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); // 好像隐藏不掉 diff --git a/kybackup/backuppointlistdialog.h b/kybackup/backuppointlistdialog.h index 69f1211..e82a806 100755 --- a/kybackup/backuppointlistdialog.h +++ b/kybackup/backuppointlistdialog.h @@ -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; diff --git a/kybackup/module/managebackuppointlist.cpp b/kybackup/module/managebackuppointlist.cpp index 220402d..c82ed91 100644 --- a/kybackup/module/managebackuppointlist.cpp +++ b/kybackup/module/managebackuppointlist.cpp @@ -114,7 +114,7 @@ void ManageBackupPointList::insertLines(const QListinsertRow(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); diff --git a/kybackup/module/selectrestorepoint.cpp b/kybackup/module/selectrestorepoint.cpp index 6416d64..12e070c 100644 --- a/kybackup/module/selectrestorepoint.cpp +++ b/kybackup/module/selectrestorepoint.cpp @@ -130,7 +130,7 @@ void SelectRestorePoint::insertLines(const QList & 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);