DobotDemoForQt WAIT_CMD_EXECUTION()


#1

Would you explain, please, why the function WAIT_CMD_EXECUTION() code is written by so unusual way ?
In DobotDll.cpp :

#define WAIT_CMD_EXECUTION()
QScopedPointer isFinished(new bool);
QScopedPointer result(new int);

*isFinished = false;
*result = 0;

QMetaObject::invokeMethod(CDobot::instance()->communicator,
“insertMessage”,
Qt::QueuedConnection,
Q_ARG(void *, (void *)isFinished.data()),
Q_ARG(void *, (void *)result.data()),
Q_ARG(void *, (void *)message.data()));
while (*isFinished == false) {
QCoreApplication::processEvents(QEventLoop::AllEvents, 5);
}

Or point me please to some manual to read about such a feature.