feat: Fix account table select row when delete account.
This commit is contained in:
@@ -11,6 +11,7 @@
|
|||||||
#include "models/User.h"
|
#include "models/User.h"
|
||||||
#include "components/SlideTableView.h"
|
#include "components/SlideTableView.h"
|
||||||
#include "event/EventCenter.h"
|
#include "event/EventCenter.h"
|
||||||
|
#include "log/UserOperationLog.h"
|
||||||
|
|
||||||
AccountTableForm::AccountTableForm(QWidget* aParent)
|
AccountTableForm::AccountTableForm(QWidget* aParent)
|
||||||
: QWidget(aParent)
|
: QWidget(aParent)
|
||||||
@@ -129,7 +130,9 @@ AccountTableForm::AccountTableForm(QWidget* aParent)
|
|||||||
if ( DialogManager::Default()->requestAlertMessage(QString(tr("Delete account with ID:\"%1\"!")).arg(id), DialogButtonMode::OkAndCancel) != QDialog::Accepted) return;
|
if ( DialogManager::Default()->requestAlertMessage(QString(tr("Delete account with ID:\"%1\"!")).arg(id), DialogButtonMode::OkAndCancel) != QDialog::Accepted) return;
|
||||||
model->removeRow(mCurrentRow);
|
model->removeRow(mCurrentRow);
|
||||||
model->select();
|
model->select();
|
||||||
table->selectRow(model->rowCount() > mCurrentRow + 1 ? mCurrentRow : mCurrentRow - 1);
|
mCurrentRow = model->rowCount() > mCurrentRow + 1 ? mCurrentRow : mCurrentRow - 1;
|
||||||
|
table->selectRow(mCurrentRow);
|
||||||
|
LOG_USER_OPERATION("Delete Account, ID:" + id);
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(EventCenter::Default(), &EventCenter::ReloadLanguage, [=]() {
|
connect(EventCenter::Default(), &EventCenter::ReloadLanguage, [=]() {
|
||||||
|
|||||||
Reference in New Issue
Block a user