rename header files from *.h to *.hpp
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
#pragma once
|
||||
|
||||
#include <QCoreApplication>
|
||||
|
||||
#include <QRunnable>
|
||||
#include <QThreadPool>
|
||||
|
||||
#include <functional>
|
||||
|
||||
#define async_exec(a) QThreadPool::globalInstance()->start(new LambdaRunnable(a));
|
||||
|
||||
class LambdaRunnable : public QRunnable
|
||||
{
|
||||
public:
|
||||
LambdaRunnable(std::function<void()> action)
|
||||
{
|
||||
this->action = action;
|
||||
}
|
||||
|
||||
void run()
|
||||
{
|
||||
this->action();
|
||||
}
|
||||
|
||||
private:
|
||||
std::function<void()> action;
|
||||
};
|
||||
Reference in New Issue
Block a user