mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-22 10:04:39 +00:00
24 lines
342 B
C++
24 lines
342 B
C++
#pragma once
|
|
|
|
#include <QFutureWatcher>
|
|
|
|
namespace gui
|
|
{
|
|
namespace utils
|
|
{
|
|
template <typename T>
|
|
void stop_future_watcher(QFutureWatcher<T>& watcher, bool cancel)
|
|
{
|
|
if (watcher.isStarted() || watcher.isRunning())
|
|
{
|
|
if (cancel)
|
|
{
|
|
watcher.cancel();
|
|
}
|
|
watcher.waitForFinished();
|
|
}
|
|
}
|
|
} // utils
|
|
} // gui
|
|
|