mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-18 08:22:15 -07:00
Review: use hideEvent and call super
This commit is contained in:
parent
e57a2116b8
commit
f5674a3920
3 changed files with 7 additions and 4 deletions
|
|
@ -1751,10 +1751,8 @@ void TabGame::createMessageDock(bool bReplay)
|
|||
connect(messageLayoutDock, SIGNAL(topLevelChanged(bool)), this, SLOT(dockTopLevelChanged(bool)));
|
||||
}
|
||||
|
||||
void TabGame::closeEvent(QCloseEvent *event)
|
||||
void TabGame::hideEvent(QHideEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
|
||||
LayoutsSettings &layouts = SettingsCache::instance().layouts();
|
||||
if (replay) {
|
||||
layouts.setReplayPlayAreaState(saveState());
|
||||
|
|
@ -1770,6 +1768,8 @@ void TabGame::closeEvent(QCloseEvent *event)
|
|||
layouts.setGameMessageLayoutSize(messageLayoutDock->size());
|
||||
layouts.setGamePlayerListSize(playerListDock->size());
|
||||
}
|
||||
|
||||
Tab::hideEvent(event);
|
||||
}
|
||||
|
||||
// Method uses to sync docks state with menu items state
|
||||
|
|
|
|||
|
|
@ -208,7 +208,7 @@ private slots:
|
|||
void actResetLayout();
|
||||
void freeDocksSize();
|
||||
|
||||
void closeEvent(QCloseEvent *event) override;
|
||||
void hideEvent(QHideEvent *event) override;
|
||||
bool eventFilter(QObject *o, QEvent *e) override;
|
||||
void dockVisibleTriggered();
|
||||
void dockFloatingTriggered();
|
||||
|
|
|
|||
|
|
@ -234,6 +234,9 @@ void TabSupervisor::refreshShortcuts()
|
|||
|
||||
void TabSupervisor::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
// This will accept the event, which we may then override.
|
||||
QTabWidget::closeEvent(event);
|
||||
|
||||
if (getGameCount()) {
|
||||
if (QMessageBox::question(this, tr("Are you sure?"),
|
||||
tr("There are still open games. Are you sure you want to quit?"),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue