Skip to content

Commit 53ea7ae

Browse files
Merge pull request dolphin-emu#12239 from AdmiralCurtiss/achievementprogresswidget-clearlayout
DolphinQt/AchievementProgressWidget: Use ClearLayoutRecursively() to clear layout.
2 parents 7122c7e + 3873664 commit 53ea7ae

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

Source/Core/DolphinQt/Achievements/AchievementProgressWidget.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include "Core/Core.h"
2626

2727
#include "DolphinQt/Config/ControllerInterface/ControllerInterfaceWindow.h"
28+
#include "DolphinQt/QtUtils/ClearLayoutRecursively.h"
2829
#include "DolphinQt/QtUtils/ModalMessageBox.h"
2930
#include "DolphinQt/QtUtils/NonDefaultQPushButton.h"
3031
#include "DolphinQt/QtUtils/SignalBlocking.h"
@@ -133,12 +134,7 @@ AchievementProgressWidget::CreateAchievementBox(const rc_api_achievement_definit
133134

134135
void AchievementProgressWidget::UpdateData()
135136
{
136-
QLayoutItem* item;
137-
while ((item = m_common_layout->layout()->takeAt(0)) != nullptr)
138-
{
139-
delete item->widget();
140-
delete item;
141-
}
137+
ClearLayoutRecursively(m_common_layout);
142138

143139
if (!AchievementManager::GetInstance()->IsGameLoaded())
144140
return;

0 commit comments

Comments
 (0)