Merge pull request #12239 from AdmiralCurtiss/achievementprogresswidget-clearlayout

DolphinQt/AchievementProgressWidget: Use ClearLayoutRecursively() to clear layout.
This commit is contained in:
Admiral H. Curtiss 2023-10-17 12:45:40 +02:00 committed by GitHub
commit 53ea7aee1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 6 deletions

View File

@ -25,6 +25,7 @@
#include "Core/Core.h" #include "Core/Core.h"
#include "DolphinQt/Config/ControllerInterface/ControllerInterfaceWindow.h" #include "DolphinQt/Config/ControllerInterface/ControllerInterfaceWindow.h"
#include "DolphinQt/QtUtils/ClearLayoutRecursively.h"
#include "DolphinQt/QtUtils/ModalMessageBox.h" #include "DolphinQt/QtUtils/ModalMessageBox.h"
#include "DolphinQt/QtUtils/NonDefaultQPushButton.h" #include "DolphinQt/QtUtils/NonDefaultQPushButton.h"
#include "DolphinQt/QtUtils/SignalBlocking.h" #include "DolphinQt/QtUtils/SignalBlocking.h"
@ -133,12 +134,7 @@ AchievementProgressWidget::CreateAchievementBox(const rc_api_achievement_definit
void AchievementProgressWidget::UpdateData() void AchievementProgressWidget::UpdateData()
{ {
QLayoutItem* item; ClearLayoutRecursively(m_common_layout);
while ((item = m_common_layout->layout()->takeAt(0)) != nullptr)
{
delete item->widget();
delete item;
}
if (!AchievementManager::GetInstance()->IsGameLoaded()) if (!AchievementManager::GetInstance()->IsGameLoaded())
return; return;