From f052ecabf63354737df71ac813adf157158e7b4d Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Fri, 24 Jul 2009 15:13:45 +1000 Subject: Rename QmlBindableComponent to QmlComponentJS, as per Aaron's request. --- src/declarative/qml/qml.pri | 6 +- src/declarative/qml/qmlbindablecomponent.cpp | 129 --------------------------- src/declarative/qml/qmlbindablecomponent.h | 92 ------------------- src/declarative/qml/qmlbindablecomponent_p.h | 77 ---------------- src/declarative/qml/qmlcomponentjs.cpp | 129 +++++++++++++++++++++++++++ src/declarative/qml/qmlcomponentjs.h | 92 +++++++++++++++++++ src/declarative/qml/qmlcomponentjs_p.h | 77 ++++++++++++++++ src/declarative/qml/qmlengine.cpp | 8 +- 8 files changed, 305 insertions(+), 305 deletions(-) delete mode 100644 src/declarative/qml/qmlbindablecomponent.cpp delete mode 100644 src/declarative/qml/qmlbindablecomponent.h delete mode 100644 src/declarative/qml/qmlbindablecomponent_p.h create mode 100644 src/declarative/qml/qmlcomponentjs.cpp create mode 100644 src/declarative/qml/qmlcomponentjs.h create mode 100644 src/declarative/qml/qmlcomponentjs_p.h diff --git a/src/declarative/qml/qml.pri b/src/declarative/qml/qml.pri index d8b69df..6ee670e 100644 --- a/src/declarative/qml/qml.pri +++ b/src/declarative/qml/qml.pri @@ -5,7 +5,7 @@ SOURCES += qml/qmlparser.cpp \ qml/qmlexpression.cpp \ qml/qmlbinding.cpp \ qml/qmlmetaproperty.cpp \ - qml/qmlbindablecomponent.cpp \ + qml/qmlcomponentjs.cpp \ qml/qmlcomponent.cpp \ qml/qmlcontext.cpp \ qml/qmlcustomparser.cpp \ @@ -38,8 +38,8 @@ HEADERS += qml/qmlparser_p.h \ qml/qmlbinding.h \ qml/qmlbinding_p.h \ qml/qmlmetaproperty.h \ - qml/qmlbindablecomponent.h \ - qml/qmlbindablecomponent_p.h \ + qml/qmlcomponentjs.h \ + qml/qmlcomponentjs_p.h \ qml/qmlcomponent.h \ qml/qmlcomponent_p.h \ qml/qmlcustomparser_p.h \ diff --git a/src/declarative/qml/qmlbindablecomponent.cpp b/src/declarative/qml/qmlbindablecomponent.cpp deleted file mode 100644 index 6938592..0000000 --- a/src/declarative/qml/qmlbindablecomponent.cpp +++ /dev/null @@ -1,129 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qmlbindablecomponent.h" -#include "qmlbindablecomponent_p.h" -#include "qmlcomponent.h" - -QT_BEGIN_NAMESPACE -QmlBindableComponent::QmlBindableComponent(QmlEngine *engine, QObject *parent) - : QmlComponent(*(new QmlBindableComponentPrivate), parent) -{ - Q_D(QmlBindableComponent); - d->engine = engine; - connect(this, SIGNAL(statusChanged(QmlComponent::Status)), - this, SLOT(statusChange(QmlComponent::Status))); -} - -QmlBindableComponent::QmlBindableComponent(QmlEngine *engine, const QUrl &url, QObject *parent) - : QmlComponent(*(new QmlBindableComponentPrivate), parent) -{ - Q_D(QmlBindableComponent); - d->engine = engine; - loadUrl(url); - connect(this, SIGNAL(statusChanged(QmlComponent::Status)), - this, SLOT(statusChange(QmlComponent::Status))); -} - -void QmlBindableComponent::setContext(QmlContext* c) -{ - Q_D(QmlBindableComponent); - d->ctxt =c; -} -/*! - Create a script object instance from this component. Returns a null - script object if creation failed. It will create the instance in the - same context that it was created it. QmlBindableComponent is only - meant to be created from with script - C++ developers should just use - QmlComponent directly. - - Similar to QmlComponent::create(), but creates an object suitable - for usage within scripts. -*/ -QScriptValue QmlBindableComponent::createObject() -{ - Q_D(QmlBindableComponent); - QObject* ret = create(d->ctxt); - return QmlEngine::qmlScriptObject(ret, d->engine); -} - -/*! - Return the list of errors that occured during the last compile or create - operation, as a single string. An empty string is returned if isError() - is not set. - - This function is similar to errors(), except more useful when called from - QML. C++ code should usually use errors(). - - \sa errors() -*/ -QString QmlBindableComponent::errorsString() const -{ - Q_D(const QmlBindableComponent); - QString ret; - if(!isError()) - return ret; - foreach(const QmlError &e, d->errors) { - ret += e.url().toString() + QLatin1String(":") + - QString::number(e.line()) + QLatin1String(" ") + - e.description() + QLatin1String("\n"); - } - return ret; -} - - -void QmlBindableComponent::statusChange(QmlComponent::Status newStatus) -{ - Q_D(QmlBindableComponent); - if(newStatus == d->prevStatus) - return; - if(newStatus == QmlComponent::Null || d->prevStatus == QmlComponent::Null) - emit isNullChanged(); - if(newStatus == QmlComponent::Ready || d->prevStatus == QmlComponent::Ready) - emit isReadyChanged(); - if(newStatus == QmlComponent::Loading || d->prevStatus == QmlComponent::Loading) - emit isLoadingChanged(); - if(newStatus == QmlComponent::Error || d->prevStatus == QmlComponent::Error) - emit isErrorChanged(); - d->prevStatus = newStatus; -} - -QT_END_NAMESPACE diff --git a/src/declarative/qml/qmlbindablecomponent.h b/src/declarative/qml/qmlbindablecomponent.h deleted file mode 100644 index 43e3537..0000000 --- a/src/declarative/qml/qmlbindablecomponent.h +++ /dev/null @@ -1,92 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLBINDABLECOMPONENT_H -#define QMLBINDABLECOMPONENT_H - -#include -#include -#include -#include -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QmlBindableComponentPrivate; -class QmlEngine; -class QmlContext; -class Q_DECLARATIVE_EXPORT QmlBindableComponent : public QmlComponent -{ - Q_OBJECT - Q_DECLARE_PRIVATE(QmlBindableComponent) - friend class QmlEngine; -public: - QmlBindableComponent(QmlEngine *, const QUrl &url, QObject *parent = 0); - QmlBindableComponent(QmlEngine *, QObject *parent=0); - Q_PROPERTY(bool isNull READ isNull NOTIFY isNullChanged); - Q_PROPERTY(bool isReady READ isReady NOTIFY isReadyChanged); - Q_PROPERTY(bool isError READ isError NOTIFY isErrorChanged); - Q_PROPERTY(bool isLoading READ isLoading NOTIFY isLoadingChanged); - - Q_INVOKABLE QScriptValue createObject(); - Q_INVOKABLE QString errorsString() const; - - void setContext(QmlContext* c); -Q_SIGNALS: - void isNullChanged(); - void isErrorChanged(); - void isReadyChanged(); - void isLoadingChanged(); -private slots: - void statusChange(QmlComponent::Status newStatus); -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QmlBindableComponent) - -QT_END_HEADER -#endif diff --git a/src/declarative/qml/qmlbindablecomponent_p.h b/src/declarative/qml/qmlbindablecomponent_p.h deleted file mode 100644 index 79335df..0000000 --- a/src/declarative/qml/qmlbindablecomponent_p.h +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLBINDABLECOMPONENT_P_H -#define QMLBINDABLECOMPONENT_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include "qmlcomponent.h" -#include "qmlbindablecomponent.h" -#include "qmlcomponent_p.h" - -QT_BEGIN_NAMESPACE - -class QmlContext; -class QmlBindableComponentPrivate : public QmlComponentPrivate -{ - Q_DECLARE_PUBLIC(QmlBindableComponent) -public: - QmlBindableComponentPrivate() : QmlComponentPrivate(), - prevStatus(QmlBindableComponent::Null), ctxt(0) - { } - - QmlComponent::Status prevStatus; - QmlContext* ctxt; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/declarative/qml/qmlcomponentjs.cpp b/src/declarative/qml/qmlcomponentjs.cpp new file mode 100644 index 0000000..32c2249 --- /dev/null +++ b/src/declarative/qml/qmlcomponentjs.cpp @@ -0,0 +1,129 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qmlcomponentjs.h" +#include "qmlcomponentjs_p.h" +#include "qmlcomponent.h" + +QT_BEGIN_NAMESPACE +QmlComponentJS::QmlComponentJS(QmlEngine *engine, QObject *parent) + : QmlComponent(*(new QmlComponentJSPrivate), parent) +{ + Q_D(QmlComponentJS); + d->engine = engine; + connect(this, SIGNAL(statusChanged(QmlComponent::Status)), + this, SLOT(statusChange(QmlComponent::Status))); +} + +QmlComponentJS::QmlComponentJS(QmlEngine *engine, const QUrl &url, QObject *parent) + : QmlComponent(*(new QmlComponentJSPrivate), parent) +{ + Q_D(QmlComponentJS); + d->engine = engine; + loadUrl(url); + connect(this, SIGNAL(statusChanged(QmlComponent::Status)), + this, SLOT(statusChange(QmlComponent::Status))); +} + +void QmlComponentJS::setContext(QmlContext* c) +{ + Q_D(QmlComponentJS); + d->ctxt =c; +} +/*! + Create a script object instance from this component. Returns a null + script object if creation failed. It will create the instance in the + same context that it was created it. QmlComponentJS is only + meant to be created from with script - C++ developers should just use + QmlComponent directly. + + Similar to QmlComponent::create(), but creates an object suitable + for usage within scripts. +*/ +QScriptValue QmlComponentJS::createObject() +{ + Q_D(QmlComponentJS); + QObject* ret = create(d->ctxt); + return QmlEngine::qmlScriptObject(ret, d->engine); +} + +/*! + Return the list of errors that occured during the last compile or create + operation, as a single string. An empty string is returned if isError() + is not set. + + This function is similar to errors(), except more useful when called from + QML. C++ code should usually use errors(). + + \sa errors() +*/ +QString QmlComponentJS::errorsString() const +{ + Q_D(const QmlComponentJS); + QString ret; + if(!isError()) + return ret; + foreach(const QmlError &e, d->errors) { + ret += e.url().toString() + QLatin1String(":") + + QString::number(e.line()) + QLatin1String(" ") + + e.description() + QLatin1String("\n"); + } + return ret; +} + + +void QmlComponentJS::statusChange(QmlComponent::Status newStatus) +{ + Q_D(QmlComponentJS); + if(newStatus == d->prevStatus) + return; + if(newStatus == QmlComponent::Null || d->prevStatus == QmlComponent::Null) + emit isNullChanged(); + if(newStatus == QmlComponent::Ready || d->prevStatus == QmlComponent::Ready) + emit isReadyChanged(); + if(newStatus == QmlComponent::Loading || d->prevStatus == QmlComponent::Loading) + emit isLoadingChanged(); + if(newStatus == QmlComponent::Error || d->prevStatus == QmlComponent::Error) + emit isErrorChanged(); + d->prevStatus = newStatus; +} + +QT_END_NAMESPACE diff --git a/src/declarative/qml/qmlcomponentjs.h b/src/declarative/qml/qmlcomponentjs.h new file mode 100644 index 0000000..5ad1635 --- /dev/null +++ b/src/declarative/qml/qmlcomponentjs.h @@ -0,0 +1,92 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLBINDABLECOMPONENT_H +#define QMLBINDABLECOMPONENT_H + +#include +#include +#include +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class QmlComponentJSPrivate; +class QmlEngine; +class QmlContext; +class Q_DECLARATIVE_EXPORT QmlComponentJS : public QmlComponent +{ + Q_OBJECT + Q_DECLARE_PRIVATE(QmlComponentJS) + friend class QmlEngine; +public: + QmlComponentJS(QmlEngine *, const QUrl &url, QObject *parent = 0); + QmlComponentJS(QmlEngine *, QObject *parent=0); + Q_PROPERTY(bool isNull READ isNull NOTIFY isNullChanged); + Q_PROPERTY(bool isReady READ isReady NOTIFY isReadyChanged); + Q_PROPERTY(bool isError READ isError NOTIFY isErrorChanged); + Q_PROPERTY(bool isLoading READ isLoading NOTIFY isLoadingChanged); + + Q_INVOKABLE QScriptValue createObject(); + Q_INVOKABLE QString errorsString() const; + + void setContext(QmlContext* c); +Q_SIGNALS: + void isNullChanged(); + void isErrorChanged(); + void isReadyChanged(); + void isLoadingChanged(); +private slots: + void statusChange(QmlComponent::Status newStatus); +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QmlComponentJS) + +QT_END_HEADER +#endif diff --git a/src/declarative/qml/qmlcomponentjs_p.h b/src/declarative/qml/qmlcomponentjs_p.h new file mode 100644 index 0000000..75d5517 --- /dev/null +++ b/src/declarative/qml/qmlcomponentjs_p.h @@ -0,0 +1,77 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLBINDABLECOMPONENT_P_H +#define QMLBINDABLECOMPONENT_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include "qmlcomponent.h" +#include "qmlcomponentjs.h" +#include "qmlcomponent_p.h" + +QT_BEGIN_NAMESPACE + +class QmlContext; +class QmlComponentJSPrivate : public QmlComponentPrivate +{ + Q_DECLARE_PUBLIC(QmlComponentJS) +public: + QmlComponentJSPrivate() : QmlComponentPrivate(), + prevStatus(QmlComponentJS::Null), ctxt(0) + { } + + QmlComponent::Status prevStatus; + QmlContext* ctxt; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp index 33c6710..69cc542 100644 --- a/src/declarative/qml/qmlengine.cpp +++ b/src/declarative/qml/qmlengine.cpp @@ -71,7 +71,7 @@ #include #include #include -#include +#include #include "private/qmlmetaproperty_p.h" #include #include @@ -602,18 +602,18 @@ QScriptValue QmlEngine::qmlScriptObject(QObject* object, QmlEngine* engine) */ QScriptValue QmlEngine::createComponent(QScriptContext *ctxt, QScriptEngine *engine) { - QmlBindableComponent* c; + QmlComponentJS* c; QmlEngine* activeEngine = qobject_cast( engine->globalObject().property(QLatin1String("qmlEngine")).toQObject()); QmlContext* context =activeEngine->d_func()->currentExpression->context(); if(ctxt->argumentCount() != 1 || !activeEngine){ - c = new QmlBindableComponent(activeEngine); + c = new QmlComponentJS(activeEngine); }else{ QUrl url = QUrl(context->resolvedUrl(ctxt->argument(0).toString())); if(!url.isValid()){ url = QUrl(ctxt->argument(0).toString()); } - c = new QmlBindableComponent(activeEngine, url, activeEngine); + c = new QmlComponentJS(activeEngine, url, activeEngine); } c->setContext(context); return engine->newQObject(c); -- cgit v0.12