make example work on android; revisions

This commit is contained in:
pls.153 2022-02-11 13:05:59 +01:00
parent 113386fdae
commit 99ea5a081d
49 changed files with 637 additions and 133 deletions

25
src/cpp/single_shot.cpp Normal file
View file

@ -0,0 +1,25 @@
#include "single_shot.h"
QT_BEGIN_NAMESPACE
SingleShot::SingleShot(int msec, void* fun)
: function(fun) {
id = startTimer(msec);
}
void SingleShot::timerEvent(QTimerEvent*) {
killTimer(id);
const cl_env_ptr l_env = ecl_process_env();
CL_CATCH_ALL_BEGIN(l_env) {
CL_UNWIND_PROTECT_BEGIN(l_env) {
cl_funcall(1, (cl_object)function);
}
CL_UNWIND_PROTECT_EXIT {}
CL_UNWIND_PROTECT_END;
}
CL_CATCH_ALL_END;
deleteLater();
}
QT_END_NAMESPACE