10#include <QCoreApplication>
20 eventType = QEvent::registerEventType(QEvent::User + 1000);
41 : QEvent(QEvent::Type(s_instance->eventType)),
42 destination(_destination)
47 : QEvent(QEvent::Type(s_instance->eventType)),
48 destination(rhs.destination)
62 return s_instance->eventType;
68 s_barrier->callback = callback;
73 s_instance->enableAutoModeForUnittests =
value;
78 return s_instance->enableAutoModeForUnittests;
89 qApp->processEvents(QEventLoop::ExcludeUserInputEvents);
91 s_barrier->callback();
96 if (
event->type() == s_instance->eventType) {
105 return QObject::event(
event);
110 if (s_instance->enableAutoModeForUnittests && QThread::currentThread() == this->thread()) {
117 if (s_barrier->callback) {
118 s_barrier->callback();
float value(const T *src, size_t ch)
Q_GLOBAL_STATIC(KisStoragePluginRegistry, s_instance)
static void registerSynchronizedEventBarrier(std::function< void()> callback)
virtual void deliverEventToReceiver()=0
static bool isAutoModeForUnittestsEnabled()
static void forceDeliverAllSynchronizedEvents()
bool event(QEvent *event) override
static void setAutoModeForUnittestsEnabled(bool value)
#define KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE(cond, val)
#define KIS_SAFE_ASSERT_RECOVER_RETURN(cond)
#define KIS_SAFE_ASSERT_RECOVER_NOOP(cond)
typedef void(QOPENGLF_APIENTRYP PFNGLINVALIDATEBUFFERDATAPROC)(GLuint buffer)
std::function< void()> callback
The KisSynchronizedConnectionEventTypeRegistrar is a simple class to register QEvent type in the Qt's...
bool enableAutoModeForUnittests
KisSynchronizedConnectionEventTypeRegistrar()
Event type used for synchronizing connection in KisSynchronizedConnection.
const QPointer< QObject > destination
KisSynchronizedConnectionEvent(QObject *_destination)
~KisSynchronizedConnectionEvent() override