{
}
-#ifdef QT_DEPRECATED
-
-/*!
- \internal
-*/
-QJSEngine::QJSEngine(QJSEngine::ContextOwnership ownership)
- : d(new QV8Engine(this, ownership))
-{
-}
-
-#endif // QT_DEPRECATED
-
/*!
Constructs a QJSEngine object with the given \a parent.
{
Q_OBJECT
public:
-#ifdef QT_DEPRECATED
- enum ContextOwnership {
- AdoptCurrentContext,
- CreateNewContext
- };
- QT_DEPRECATED explicit QJSEngine(ContextOwnership ownership);
-#endif
-
QJSEngine();
explicit QJSEngine(QObject *parent);
virtual ~QJSEngine();
}
-QV8Engine::QV8Engine(QJSEngine* qq, QJSEngine::ContextOwnership ownership)
+QV8Engine::QV8Engine(QJSEngine* qq, ContextOwnership ownership)
: q(qq)
, m_engine(0)
- , m_ownsV8Context(ownership == QJSEngine::CreateNewContext)
+ , m_ownsV8Context(ownership == CreateNewContext)
, m_xmlHttpRequestData(0)
, m_listModelData(0)
, m_application(0)
ensurePerThreadIsolate();
v8::HandleScope handle_scope;
- m_context = (ownership == QJSEngine::CreateNewContext) ? v8::Context::New() : v8::Persistent<v8::Context>::New(v8::Context::GetCurrent());
+ m_context = (ownership == CreateNewContext) ? v8::Context::New() : v8::Persistent<v8::Context>::New(v8::Context::GetCurrent());
qPersistentRegister(m_context);
m_originalGlobalObject.init(m_context);
v8::Context::Scope context_scope(m_context);
static QV8Engine* get(QJSEngine* q) { Q_ASSERT(q); return q->handle(); }
static QJSEngine* get(QV8Engine* d) { Q_ASSERT(d); return d->q; }
- QV8Engine(QJSEngine* qq,QJSEngine::ContextOwnership ownership = QJSEngine::CreateNewContext);
+ enum ContextOwnership {
+ AdoptCurrentContext,
+ CreateNewContext
+ };
+ QV8Engine(QJSEngine* qq, ContextOwnership ownership = CreateNewContext);
virtual ~QV8Engine();
// This enum should be in sync with QQmlEngine::ObjectOwnership