Skip to content

Commit

Permalink
修改了modifyinfor_win和mainwindow之间的接口
Browse files Browse the repository at this point in the history
  • Loading branch information
RaidenShogunShadow committed Jul 10, 2024
1 parent c95de47 commit 23d2054
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ MainWindow::MainWindow(QWidget *parent)
*/
qDebug() << ElaEventBus::getInstance()->getRegisteredEventsName();
QObject::connect(login, &loginwin::on_login_complete, this, &MainWindow::onUserLoggedIn);
QObject::connect(_userinfopage, &UserInfoPage::changexinxi, this, &MainWindow::onModifyInfo);
QObject::connect(_modifyInfor_win, &modifyInfor_win::changexinxi, this, &MainWindow::onModifyInfo);
// 拦截默认关闭事件
this->setIsDefaultClosed(false);
connect(this, &MainWindow::closeButtonClicked, this, &MainWindow::onCloseButtonClicked);
Expand Down Expand Up @@ -308,11 +308,11 @@ void MainWindow::onCloseButtonClicked()
void MainWindow::onModifyInfo(User user)
{
//CurrentUser=new User(user);
_userinfopage->currentUser=CurrentUser;
_modifyInfor_win->currentUser=CurrentUser;
qDebug() << user.getEmail() << " " << user.gethashedPassword();
db->updateUserInfo(user.getEmail(),_userinfopage->newPasswordEdit_->text());
db->updateUserInfo(user.getEmail(),_modifyInfor_win->newPasswordEdit_->text());
qDebug() << user.getEmail() << " " << db->getUserPassword(user.getEmail());
setUserInfoCardTitle(_userinfopage->newIdEdit_->text());
setUserInfoCardTitle(_modifyInfor_win->newIdEdit_->text());
setUserInfoCardSubTitle(user.getEmail());

QString url=user.avatarpath;
Expand Down
2 changes: 2 additions & 0 deletions modifyinfor_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ void modifyInfor_win::onConfirmButtonClicked()

// 更新数据库
emit changexinxi(User(*currentUser));
currentUser->username = newId;
currentUser->hashedPassword = newPassword;

QMessageBox::information(this, "成功","修改成功");
}
2 changes: 0 additions & 2 deletions modifyinfor_win.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ class modifyInfor_win : public ElaWidget
User* currentUser;
ElaInteractiveCard*avatar;
QHBoxLayout*avatarArea;

private:
ElaLineEdit *newIdEdit_;
ElaLineEdit *newPasswordEdit_;
ElaLineEdit *confirmNewPasswordEdit_;
Expand Down

0 comments on commit 23d2054

Please sign in to comment.