Refactor: Simplify closeRequest and remove closed signal (#6062)

* Refactor: simplify closeRequest and remove closed signal

* clean up closeRequest usages
This commit is contained in:
RickyRister 2025-08-01 19:45:54 -07:00 committed by GitHub
parent fd12a1f6be
commit 04be0fe634
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 61 additions and 57 deletions

View file

@ -103,7 +103,7 @@ TabRoom::TabRoom(TabSupervisor *_tabSupervisor,
hbox->addWidget(userList, 1);
aLeaveRoom = new QAction(this);
connect(aLeaveRoom, &QAction::triggered, this, [this] { closeRequest(); });
connect(aLeaveRoom, &QAction::triggered, this, &TabRoom::closeRequest);
roomMenu = new QMenu(this);
roomMenu->addAction(aLeaveRoom);
@ -173,11 +173,11 @@ void TabRoom::actShowPopup(const QString &message)
}
}
void TabRoom::closeRequest(bool /*forced*/)
void TabRoom::closeEvent(QCloseEvent *event)
{
sendRoomCommand(prepareRoomCommand(Command_LeaveRoom()));
emit roomClosing(this);
close();
event->accept();
}
void TabRoom::tabActivated()