本文整理汇总了C++中QScriptEngine::setProcessEventsInterval方法的典型用法代码示例。如果您正苦于以下问题:C++ QScriptEngine::setProcessEventsInterval方法的具体用法?C++ QScriptEngine::setProcessEventsInterval怎么用?C++ QScriptEngine::setProcessEventsInterval使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QScriptEngine
的用法示例。
在下文中一共展示了QScriptEngine::setProcessEventsInterval方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QScriptEngine
QScriptEngine * ScriptEngineWorker::createScriptEngine(bool supportThreads)
{
QScriptEngine *engine = new QScriptEngine();
QLOG_INFO() << "New script engine" << engine << ", thread:" << QThread::currentThread();
Scriptable<BatteryInterface>::registerMetatype(engine);
Scriptable<ColorSensorInterface>::registerMetatype(engine);
Scriptable<DisplayInterface>::registerMetatype(engine);
Scriptable<EncoderInterface>::registerMetatype(engine);
Scriptable<EventCodeInterface>::registerMetatype(engine);
Scriptable<EventDeviceInterface>::registerMetatype(engine);
Scriptable<EventInterface>::registerMetatype(engine);
Scriptable<GamepadInterface>::registerMetatype(engine);
Scriptable<GyroSensorInterface>::registerMetatype(engine);
Scriptable<FifoInterface>::registerMetatype(engine);
Scriptable<KeysInterface>::registerMetatype(engine);
Scriptable<LedInterface>::registerMetatype(engine);
Scriptable<LineSensorInterface>::registerMetatype(engine);
Scriptable<MailboxInterface>::registerMetatype(engine);
Scriptable<MotorInterface>::registerMetatype(engine);
Scriptable<ObjectSensorInterface>::registerMetatype(engine);
Scriptable<SensorInterface>::registerMetatype(engine);
Scriptable<SoundSensorInterface>::registerMetatype(engine);
Scriptable<QTimer>::registerMetatype(engine);
qScriptRegisterMetaType(engine, timeValToScriptValue, timeValFromScriptValue);
Scriptable<VectorSensorInterface>::registerMetatype(engine);
qScriptRegisterSequenceMetaType<QVector<int>>(engine);
qScriptRegisterSequenceMetaType<QStringList>(engine);
engine->globalObject().setProperty("brick", engine->newQObject(&mBrick));
engine->globalObject().setProperty("script", engine->newQObject(&mScriptControl));
if (mMailbox) {
engine->globalObject().setProperty("mailbox", engine->newQObject(mMailbox));
}
// Gamepad can still be accessed from script as brick.gamepad(), 'gamepad' variable is here for backwards
// compatibility.
if (mBrick.gamepad()) {
engine->globalObject().setProperty("gamepad", engine->newQObject(mBrick.gamepad()));
}
if (supportThreads) {
engine->globalObject().setProperty("Threading", engine->newQObject(&mThreading));
}
for (const auto &step : mCustomInitSteps) {
step(engine);
}
evalSystemJs(engine);
engine->setProcessEventsInterval(1);
return engine;
}