UI: Add CreateQThread helper function
Allows creating a QThread via an std::function. A backward-compatible alternative to QThread::create for Qt versions older than 5.10 (when it became available in Qt).
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
#include <QThread>
|
||||
#include <obs.hpp>
|
||||
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
@@ -64,6 +65,8 @@ QDataStream &operator>>(QDataStream &in, OBSScene &scene);
|
||||
QDataStream &operator<<(QDataStream &out, const OBSSceneItem &si);
|
||||
QDataStream &operator>>(QDataStream &in, OBSSceneItem &si);
|
||||
|
||||
QThread *CreateQThread(std::function<void()> func);
|
||||
|
||||
class SignalBlocker {
|
||||
QWidget *widget;
|
||||
bool blocked;
|
||||
|
Reference in New Issue
Block a user