shadPS4/shadPS4/gui/qt_utils.h
2023-03-14 01:02:06 +02:00

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