aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/v4
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/qml/v4')
-rw-r--r--src/declarative/qml/v4/qdeclarativev4bindings.cpp16
-rw-r--r--src/declarative/qml/v4/qdeclarativev4compiler.cpp14
-rw-r--r--src/declarative/qml/v4/qdeclarativev4compiler_p.h2
-rw-r--r--src/declarative/qml/v4/qdeclarativev4compiler_p_p.h32
-rw-r--r--src/declarative/qml/v4/qdeclarativev4irbuilder.cpp4
5 files changed, 45 insertions, 23 deletions
diff --git a/src/declarative/qml/v4/qdeclarativev4bindings.cpp b/src/declarative/qml/v4/qdeclarativev4bindings.cpp
index c81f59b0bc..9209e93e4f 100644
--- a/src/declarative/qml/v4/qdeclarativev4bindings.cpp
+++ b/src/declarative/qml/v4/qdeclarativev4bindings.cpp
@@ -44,10 +44,10 @@
#include "private/qdeclarativev4bindings_p.h"
#include "private/qdeclarativev4program_p.h"
#include "private/qdeclarativev4compiler_p.h"
+#include "private/qdeclarativev4compiler_p_p.h"
#include <private/qdeclarativefastproperties_p.h>
#include <private/qdeclarativedebugtrace_p.h>
-#include <private/qdeclarativeanchors_p_p.h> // For AnchorLine
#include <private/qsganchors_p_p.h> // For AnchorLine
#include <QtDeclarative/qdeclarativeinfo.h>
@@ -534,10 +534,10 @@ static bool testCompareVariants(const QVariant &qtscriptRaw, const QVariant &v4)
}
int type = qtscript.userType();
-
- if (type == qMetaTypeId<QDeclarativeAnchorLine>()) {
- QDeclarativeAnchorLine la = qvariant_cast<QDeclarativeAnchorLine>(qtscript);
- QDeclarativeAnchorLine ra = qvariant_cast<QDeclarativeAnchorLine>(v4);
+
+ if (type == qMetaTypeId<QDeclarative1AnchorLine>()) {
+ QDeclarative1AnchorLine la = qvariant_cast<QDeclarative1AnchorLine>(qtscript);
+ QDeclarative1AnchorLine ra = qvariant_cast<QDeclarative1AnchorLine>(v4);
return la == ra;
} else if (type == qMetaTypeId<QSGAnchorLine>()) {
@@ -623,8 +623,8 @@ static void testBindingResult(const QString &binding, int line, int column,
v4value = result.getqreal();
break;
default:
- if (resultType == qMetaTypeId<QDeclarativeAnchorLine>()) {
- v4value = qVariantFromValue<QDeclarativeAnchorLine>(*(QDeclarativeAnchorLine *)result.typeDataPtr());
+ if (resultType == qMetaTypeId<QDeclarative1AnchorLine>()) {
+ v4value = qVariantFromValue<QDeclarative1AnchorLine>(*(QDeclarative1AnchorLine *)result.typeDataPtr());
} else if (resultType == qMetaTypeId<QSGAnchorLine>()) {
v4value = qVariantFromValue<QSGAnchorLine>(*(QSGAnchorLine *)result.typeDataPtr());
} else {
@@ -852,7 +852,7 @@ void QDeclarativeV4BindingsPrivate::run(int instrIndex, quint32 &executedBlocks,
reg.init((Register::Type)instr->fetchAndSubscribe.valueType);
if (instr->fetchAndSubscribe.valueType >= FirstCleanupType)
MARK_REGISTER(instr->fetchAndSubscribe.reg);
- QDeclarativeV4Compiler::fastPropertyAccessor()->accessor(instr->fetchAndSubscribe.function)(object, reg.typeDataPtr(), sub);
+ QDeclarativeFastProperties::instance()->accessor(instr->fetchAndSubscribe.function)(object, reg.typeDataPtr(), sub);
}
}
QML_V4_END_INSTR(FetchAndSubscribe, fetchAndSubscribe)
diff --git a/src/declarative/qml/v4/qdeclarativev4compiler.cpp b/src/declarative/qml/v4/qdeclarativev4compiler.cpp
index 672bf2e57d..371edda6c9 100644
--- a/src/declarative/qml/v4/qdeclarativev4compiler.cpp
+++ b/src/declarative/qml/v4/qdeclarativev4compiler.cpp
@@ -48,7 +48,6 @@
#include <private/qdeclarativejsast_p.h>
#include <private/qdeclarativefastproperties_p.h>
#include <private/qdeclarativejsengine_p.h>
-#include <private/qdeclarativeanchors_p_p.h> // For AnchorLine
#include <private/qsganchors_p_p.h> // For AnchorLine
QT_BEGIN_NAMESPACE
@@ -59,8 +58,6 @@ DEFINE_BOOL_CONFIG_OPTION(qmlExperimental, QML_EXPERIMENTAL)
DEFINE_BOOL_CONFIG_OPTION(qmlVerboseCompiler, QML_VERBOSE_COMPILER)
DEFINE_BOOL_CONFIG_OPTION(qmlBindingsTestEnv, QML_BINDINGS_TEST)
-Q_GLOBAL_STATIC(QDeclarativeFastProperties, fastProperties)
-
static bool qmlBindingsTest = false;
using namespace QDeclarativeJS;
@@ -312,7 +309,7 @@ void QDeclarativeV4CompilerPrivate::visitName(IR::Name *e)
_subscribeName << e->id;
QMetaProperty prop = e->meta->property(e->index);
- int fastFetchIndex = fastProperties()->accessorIndexForProperty(e->meta, e->index);
+ int fastFetchIndex = QDeclarativeFastProperties::instance()->accessorIndexForProperty(e->meta, e->index);
const int propTy = prop.userType();
QDeclarativeRegisterType regType;
@@ -332,7 +329,7 @@ void QDeclarativeV4CompilerPrivate::visitName(IR::Name *e)
break;
default:
- if (propTy == qMetaTypeId<QDeclarativeAnchorLine>()) {
+ if (propTy == qMetaTypeId<QDeclarative1AnchorLine>()) {
regType = PODValueType;
} else if (propTy == qMetaTypeId<QSGAnchorLine>()) {
regType = PODValueType;
@@ -925,7 +922,7 @@ void QDeclarativeV4CompilerPrivate::visitRet(IR::Ret *s)
test.storetest.regType = QMetaType::QUrl;
break;
case IR::AnchorLineType:
- test.storetest.regType = qMetaTypeId<QDeclarativeAnchorLine>();
+ test.storetest.regType = qMetaTypeId<QDeclarative1AnchorLine>();
break;
case IR::SGAnchorLineType:
test.storetest.regType = qMetaTypeId<QSGAnchorLine>();
@@ -978,11 +975,6 @@ void QDeclarativeV4Compiler::dump(const QByteArray &programData)
}
}
-QDeclarativeFastProperties *QDeclarativeV4Compiler::fastPropertyAccessor()
-{
- return fastProperties();
-}
-
/*!
Clear the state associated with attempting to compile a specific binding.
This does not clear the global "committed binding" states.
diff --git a/src/declarative/qml/v4/qdeclarativev4compiler_p.h b/src/declarative/qml/v4/qdeclarativev4compiler_p.h
index 3b89d0d376..cc93f4dbf2 100644
--- a/src/declarative/qml/v4/qdeclarativev4compiler_p.h
+++ b/src/declarative/qml/v4/qdeclarativev4compiler_p.h
@@ -60,7 +60,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-class QDeclarativeFastProperties;
class QDeclarativeTypeNameCache;
class QDeclarativeV4CompilerPrivate;
class Q_AUTOTEST_EXPORT QDeclarativeV4Compiler
@@ -90,7 +89,6 @@ public:
QByteArray program() const;
static void dump(const QByteArray &);
- static QDeclarativeFastProperties *fastPropertyAccessor();
static void enableBindingsTest(bool);
private:
QDeclarativeV4CompilerPrivate *d;
diff --git a/src/declarative/qml/v4/qdeclarativev4compiler_p_p.h b/src/declarative/qml/v4/qdeclarativev4compiler_p_p.h
index 2776630fb8..1d9414dce6 100644
--- a/src/declarative/qml/v4/qdeclarativev4compiler_p_p.h
+++ b/src/declarative/qml/v4/qdeclarativev4compiler_p_p.h
@@ -63,6 +63,36 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
+// NOTE: This is a copy of QDeclarative1AnchorLine: src/qtquick1/graphicsitems/qdeclarativeanchors_p_p.h
+class QGraphicsObject;
+class QDeclarative1AnchorLine
+{
+public:
+ QDeclarative1AnchorLine() : item(0), anchorLine(Invalid) {}
+
+ enum AnchorLine {
+ Invalid = 0x0,
+ Left = 0x01,
+ Right = 0x02,
+ Top = 0x04,
+ Bottom = 0x08,
+ HCenter = 0x10,
+ VCenter = 0x20,
+ Baseline = 0x40,
+ Horizontal_Mask = Left | Right | HCenter,
+ Vertical_Mask = Top | Bottom | VCenter | Baseline
+ };
+
+ QGraphicsObject *item;
+ AnchorLine anchorLine;
+};
+
+inline bool operator==(const QDeclarative1AnchorLine& a, const QDeclarative1AnchorLine& b)
+{
+ return a.item == b.item && a.anchorLine == b.anchorLine;
+}
+
+
class QDeclarativeV4CompilerPrivate: protected QDeclarativeJS::IR::ExprVisitor,
protected QDeclarativeJS::IR::StmtVisitor
{
@@ -178,6 +208,8 @@ private:
QT_END_NAMESPACE
+Q_DECLARE_METATYPE(QDeclarative1AnchorLine)
+
QT_END_HEADER
#endif // QDECLARATIVEV4COMPILER_P_P_H
diff --git a/src/declarative/qml/v4/qdeclarativev4irbuilder.cpp b/src/declarative/qml/v4/qdeclarativev4irbuilder.cpp
index 795406f006..34a59caf1a 100644
--- a/src/declarative/qml/v4/qdeclarativev4irbuilder.cpp
+++ b/src/declarative/qml/v4/qdeclarativev4irbuilder.cpp
@@ -40,8 +40,8 @@
****************************************************************************/
#include "qdeclarativev4irbuilder_p.h"
+#include "qdeclarativev4compiler_p_p.h"
-#include <private/qdeclarativeanchors_p_p.h> // For AnchorLine
#include <private/qsganchors_p_p.h> // For AnchorLine
#include <private/qdeclarativetypenamecache_p.h>
@@ -70,7 +70,7 @@ static IR::Type irTypeFromVariantType(int t, QDeclarativeEnginePrivate *engine,
return IR::UrlType;
default:
- if (t == qMetaTypeId<QDeclarativeAnchorLine>())
+ if (t == qMetaTypeId<QDeclarative1AnchorLine>())
return IR::AnchorLineType;
else if (t == qMetaTypeId<QSGAnchorLine>())
return IR::SGAnchorLineType;