48 explicit inline Service( QObject *parent =
nullptr );
56 virtual QVariant ConvertToVariant (
int nType,
void *pValue );
58 virtual void* ConvertToParameterPtr(
int nTypeId,
59 const QString &sParamType,
61 const QString &sValue );
63 static bool ToBool(
const QString &sVal );
67 bool HAS_PARAM(
const QString&
p)
const {
return m_parsedParams.contains(
p); }
77 qRegisterMetaType< QFileInfo >();
85 #define SCRIPT_CATCH_EXCEPTION( default, code ) \
90 catch( QString &msg ) \
92 m_pEngine->currentContext()->throwError( QScriptContext::UnknownError, msg ); \
95 catch( const char *msg ) \
97 m_pEngine->currentContext()->throwError( QScriptContext::UnknownError, msg ); \
102 m_pEngine->currentContext()->throwError( QScriptContext::UnknownError, "Unknown Exception" ); \
113 #define Q_SCRIPT_DECLARE_QMETAOBJECT_MYTHTV(T, _Arg1) \
114 template<> inline QScriptValue qscriptQMetaObjectConstructor<T>(QScriptContext *ctx, QScriptEngine *eng, T *) \
116 _Arg1 arg1 = qscriptvalue_cast<_Arg1> (ctx->argument(0)); \
117 T* t = new T(eng, arg1); \
118 if (ctx->isCalledAsConstructor()) \
119 return eng->newQObject(ctx->thisObject(), t, QScriptEngine::AutoOwnership); \
120 QScriptValue o = eng->newQObject(t, QScriptEngine::AutoOwnership); \
121 o.setPrototype(ctx->callee().property(QString::fromLatin1("prototype"))); \