summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qmlengine_p.h
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-10-02 07:09:09 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-10-05 02:40:47 (GMT)
commit3490b478ed02859f0355438efba900cd853e9c13 (patch)
treef554feca685671aef6775da255150a122597c258 /src/declarative/qml/qmlengine_p.h
parentb3605d7f45c1cdb61bbd2a572e58bd29aaea6956 (diff)
downloadQt-3490b478ed02859f0355438efba900cd853e9c13.zip
Qt-3490b478ed02859f0355438efba900cd853e9c13.tar.gz
Qt-3490b478ed02859f0355438efba900cd853e9c13.tar.bz2
Reenable types/enums and move scripts into an isolated scope
Diffstat (limited to 'src/declarative/qml/qmlengine_p.h')
-rw-r--r--src/declarative/qml/qmlengine_p.h75
1 files changed, 9 insertions, 66 deletions
diff --git a/src/declarative/qml/qmlengine_p.h b/src/declarative/qml/qmlengine_p.h
index 231388d..7978023 100644
--- a/src/declarative/qml/qmlengine_p.h
+++ b/src/declarative/qml/qmlengine_p.h
@@ -75,6 +75,7 @@
#include <private/qmlpropertycache_p.h>
#include <private/qmlobjectscriptclass_p.h>
#include <private/qmlcontextscriptclass_p.h>
+#include <private/qmlvaluetypescriptclass_p.h>
QT_BEGIN_NAMESPACE
@@ -92,6 +93,8 @@ class QNetworkReply;
class QNetworkAccessManager;
class QmlAbstractBinding;
class QScriptDeclarativeClass;
+class QmlTypeNameScriptClass;
+class QmlTypeNameCache;
class QmlEnginePrivate : public QObjectPrivate
{
@@ -102,13 +105,6 @@ public:
void init();
- QScriptClass::QueryFlags queryObject(const QString &name, uint *id,
- QObject *);
- QScriptValue propertyObject(const QString &propName, QObject *,
- uint id = 0);
- void setPropertyObject(const QScriptValue &, uint id);
-
-
struct CapturedProperty {
CapturedProperty(QObject *o, int c, int n)
: object(o), coreIndex(c), notifyIndex(n) {}
@@ -128,25 +124,6 @@ public:
#endif
struct ImportedNamespace;
- struct ResolveData {
- ResolveData() : safetyCheckId(0) {}
- int safetyCheckId;
-
- void clear() {
- object = 0; context = 0;
- type = 0; ns = 0;
- contextIndex = -1; isFunction = false;
- }
- QObject *object;
- QmlContext *context;
-
- QmlType *type;
- QmlEnginePrivate::ImportedNamespace *ns;
-
- int contextIndex;
- bool isFunction;
- QmlMetaProperty property;
- } resolveData;
QmlContextScriptClass *contextClass;
QmlObjectScriptClass *objectClass;
QmlValueTypeScriptClass *valueTypeClass;
@@ -211,9 +188,6 @@ public:
}
QmlValueTypeFactory valueTypes;
- // ### Fixme
- typedef QHash<QPair<const QMetaObject *, QString>, bool> FunctionCache;
- FunctionCache functionCache;
QHash<const QMetaObject *, QmlPropertyCache *> propertyCache;
QmlPropertyCache *cache(QObject *obj) {
@@ -228,6 +202,7 @@ public:
return rv;
}
+ // ### This whole class is embarrassing
struct Imports {
Imports();
~Imports();
@@ -237,6 +212,8 @@ public:
void setBaseUrl(const QUrl& url);
QUrl baseUrl() const;
+ QmlTypeNameCache *cache(QmlEngine *) const;
+
private:
friend class QmlEnginePrivate;
QmlImportsPrivate *d;
@@ -261,6 +238,9 @@ public:
QHash<int, int> m_qmlLists;
QHash<int, QmlCompiledData *> m_compositeTypes;
+ QScriptValue scriptValueFromVariant(const QVariant &);
+ QVariant scriptValueToVariant(const QScriptValue &);
+
static QScriptValue qmlScriptObject(QObject*, QmlEngine*);
static QScriptValue createComponent(QScriptContext*, QScriptEngine*);
static QScriptValue createQmlObject(QScriptContext*, QScriptEngine*);
@@ -292,43 +272,6 @@ protected:
QmlEngine *engine;
};
-class QmlTypeNameScriptClass : public QmlScriptClass
-{
-public:
- QmlTypeNameScriptClass(QmlEngine *);
- ~QmlTypeNameScriptClass();
-
- virtual QueryFlags queryProperty(const QScriptValue &object,
- const QScriptString &name,
- QueryFlags flags, uint *id);
- virtual QScriptValue property(const QScriptValue &object,
- const QScriptString &name,
- uint id);
-
-private:
- QObject *object;
- QmlType *type;
- quint32 enumValue;
-};
-
-class QmlValueTypeScriptClass : public QmlScriptClass
-{
-public:
- QmlValueTypeScriptClass(QmlEngine *);
- ~QmlValueTypeScriptClass();
-
- virtual QueryFlags queryProperty(const QScriptValue &object,
- const QScriptString &name,
- QueryFlags flags, uint *id);
- virtual QScriptValue property(const QScriptValue &object,
- const QScriptString &name,
- uint id);
- virtual void setProperty(QScriptValue &object,
- const QScriptString &name,
- uint id,
- const QScriptValue &value);
-};
-
QT_END_NAMESPACE
#endif // QMLENGINE_P_H