Qt: Deprecate processEvents() part 2

This commit is contained in:
Elad 2024-11-26 11:01:31 +02:00
parent 191e132c6c
commit 378a69ea85
7 changed files with 202 additions and 72 deletions

View file

@ -13,6 +13,8 @@
LOG_CHANNEL(cfg_log, "CFG");
extern void qt_events_aware_op(int repeat_duration_ms, std::function<bool()> wrapped_op);
namespace gui
{
QString stylesheet;
@ -193,11 +195,18 @@ void gui_settings::ShowInfoBox(const QString& title, const QString& text, const
bool gui_settings::GetBootConfirmation(QWidget* parent, const gui_save& gui_save_entry)
{
while (Emu.GetStatus(false) == system_state::stopping)
auto info = Emu.GetEmulationIdentifier();
qt_events_aware_op(16, [&]()
{
QCoreApplication::processEvents();
std::this_thread::sleep_for(16ms);
}
if (Emu.GetStatus(false) != system_state::stopping)
{
ensure(info == Emu.GetEmulationIdentifier());
return true;
}
return false;
});
if (!Emu.IsStopped())
{