registers it with the script \a engine.
*/
QScriptValue::QScriptValue(QScriptEngine* engine, bool value)
- : d_ptr(new QScriptValuePrivate(engine, value))
{
+ if (engine)
+ d_ptr = new QScriptValuePrivate(QScriptEnginePrivate::get(engine), value);
+ else
+ d_ptr = new QScriptValuePrivate(value);
}
/*!
registers it with the script \a engine.
*/
QScriptValue::QScriptValue(QScriptEngine* engine, int value)
- : d_ptr(new QScriptValuePrivate(engine, value))
{
+ if (engine)
+ d_ptr = new QScriptValuePrivate(QScriptEnginePrivate::get(engine), value);
+ else
+ d_ptr = new QScriptValuePrivate(value);
}
/*!
registers it with the script \a engine.
*/
QScriptValue::QScriptValue(QScriptEngine* engine, uint value)
- : d_ptr(new QScriptValuePrivate(engine, value))
{
+ if (engine)
+ d_ptr = new QScriptValuePrivate(QScriptEnginePrivate::get(engine), value);
+ else
+ d_ptr = new QScriptValuePrivate(value);
}
/*!
registers it with the script \a engine.
*/
QScriptValue::QScriptValue(QScriptEngine* engine, qsreal value)
- : d_ptr(new QScriptValuePrivate(engine, value))
{
+ if (engine)
+ d_ptr = new QScriptValuePrivate(QScriptEnginePrivate::get(engine), value);
+ else
+ d_ptr = new QScriptValuePrivate(value);
}
/*!
registers it with the script \a engine.
*/
QScriptValue::QScriptValue(QScriptEngine* engine, const QString& value)
- : d_ptr(new QScriptValuePrivate(engine, value))
{
+ if (engine)
+ d_ptr = new QScriptValuePrivate(QScriptEnginePrivate::get(engine), value);
+ else
+ d_ptr = new QScriptValuePrivate(value);
}
/*!
registers it with the script \a engine.
*/
QScriptValue::QScriptValue(QScriptEngine* engine, const char* value)
- : d_ptr(new QScriptValuePrivate(engine, QString::fromUtf8(value)))
{
+ if (engine)
+ d_ptr = new QScriptValuePrivate(QScriptEnginePrivate::get(engine), QString::fromUtf8(value));
+ else
+ d_ptr = new QScriptValuePrivate(QString::fromUtf8(value));
}
/*!
registers it with the script \a engine.
*/
QScriptValue::QScriptValue(QScriptEngine* engine, SpecialValue value)
- : d_ptr(new QScriptValuePrivate(engine, value))
{
+ if (engine)
+ d_ptr = new QScriptValuePrivate(QScriptEnginePrivate::get(engine), value);
+ else
+ d_ptr = new QScriptValuePrivate(value);
}
/*!