From 2cc57f1e33cc4d739b1b76c605e6241fa0f134a8 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 21 Aug 2012 18:19:01 +0200 Subject: [PATCH] Trim trailing whitespace. Change-Id: I3d268d3ce8d73c7287f51abe9a28c165cb75acb9 Reviewed-by: Chris Adams --- src/qml/qml/qqmlbinding.cpp | 16 +++---- src/qml/qml/qqmlpropertycache_p.h | 8 ++-- src/qml/qml/v4/qv4bindings.cpp | 50 +++++++++++----------- src/qml/qml/v4/qv4ir.cpp | 38 ++++++++--------- src/qml/qml/v8/qv8bindings.cpp | 4 +- src/qml/qml/v8/qv8engine.cpp | 30 ++++++------- tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp | 54 ++++++++++++------------ tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp | 14 +++--- 8 files changed, 107 insertions(+), 107 deletions(-) diff --git a/src/qml/qml/qqmlbinding.cpp b/src/qml/qml/qqmlbinding.cpp index f5f0f49..604080b 100644 --- a/src/qml/qml/qqmlbinding.cpp +++ b/src/qml/qml/qqmlbinding.cpp @@ -177,7 +177,7 @@ QQmlBinding::QQmlBinding(const QString &str, QObject *obj, QQmlContextData *ctxt v8function = evalFunction(ctxt, obj, code, QString(), 0); } -QQmlBinding::QQmlBinding(const QString &str, bool isRewritten, QObject *obj, +QQmlBinding::QQmlBinding(const QString &str, bool isRewritten, QObject *obj, QQmlContextData *ctxt, const QString &url, quint16 lineNumber, quint16 columnNumber) : QQmlJavaScriptExpression(&QQmlBinding_jsvtable), QQmlAbstractBinding(Binding), @@ -200,10 +200,10 @@ QQmlBinding::QQmlBinding(const QString &str, bool isRewritten, QObject *obj, v8function = evalFunction(ctxt, obj, code, url, m_lineNumber); } -/*! - \internal +/*! + \internal - To avoid exposing v8 in the public API, functionPtr must be a pointer to a v8::Handle. + To avoid exposing v8 in the public API, functionPtr must be a pointer to a v8::Handle. For example: v8::Handle function; new QQmlBinding(&function, scope, ctxt); @@ -275,7 +275,7 @@ void QQmlBinding::update(QQmlPropertyPrivate::WriteFlags flags) } else { QQmlEnginePrivate *ep = QQmlEnginePrivate::get(context()->engine); - ep->referenceScarceResources(); + ep->referenceScarceResources(); bool isUndefined = false; @@ -292,7 +292,7 @@ void QQmlBinding::update(QQmlPropertyPrivate::WriteFlags flags) this, result, isUndefined, flags); if (!watcher.wasDeleted()) { - + if (needsErrorLocationData) delayedError()->setErrorLocation(QUrl(m_url), m_lineNumber, m_columnNumber); @@ -304,7 +304,7 @@ void QQmlBinding::update(QQmlPropertyPrivate::WriteFlags flags) } - ep->dereferenceScarceResources(); + ep->dereferenceScarceResources(); } if (!watcher.wasDeleted()) @@ -385,7 +385,7 @@ void QQmlBinding::setEnabled(bool e, QQmlPropertyPrivate::WriteFlags flags) setEnabledFlag(e); setNotifyOnValueChanged(e); - if (e) + if (e) update(flags); } diff --git a/src/qml/qml/qqmlpropertycache_p.h b/src/qml/qml/qqmlpropertycache_p.h index 99c6671..87d15b3 100644 --- a/src/qml/qml/qqmlpropertycache_p.h +++ b/src/qml/qml/qqmlpropertycache_p.h @@ -396,7 +396,7 @@ public: private: QBiPointer _m; }; - + QQmlPropertyData::QQmlPropertyData() { propType = 0; @@ -405,7 +405,7 @@ QQmlPropertyData::QQmlPropertyData() overrideIndexIsProperty = false; overrideIndex = -1; revision = 0; - metaObjectOffset = -1; + metaObjectOffset = -1; flags = 0; } @@ -421,8 +421,8 @@ bool QQmlPropertyData::operator==(const QQmlPropertyRawData &other) coreIndex == other.coreIndex && notifyIndex == other.notifyIndex && revision == other.revision && - (!isValueTypeVirtual() || - (valueTypeCoreIndex == other.valueTypeCoreIndex && + (!isValueTypeVirtual() || + (valueTypeCoreIndex == other.valueTypeCoreIndex && valueTypePropType == other.valueTypePropType)); } diff --git a/src/qml/qml/v4/qv4bindings.cpp b/src/qml/qml/v4/qv4bindings.cpp index 6dce278..150a11d 100644 --- a/src/qml/qml/v4/qv4bindings.cpp +++ b/src/qml/qml/v4/qv4bindings.cpp @@ -295,7 +295,7 @@ void Register::copy(const Register &other) { *this = other; if (other.dataType >= FirstCleanupType) { - if (other.dataType == QStringType) + if (other.dataType == QStringType) copyConstructPointee(getstringptr(), other.getstringptr()); else if (other.dataType == QUrlType) copyConstructPointee(geturlptr(), other.geturlptr()); @@ -307,14 +307,14 @@ void Register::copy(const Register &other) copyConstructPointee(gethandleptr(), other.gethandleptr()); else if (other.dataType == qMetaTypeId()) copyConstructPointee(getjsvalueptr(), other.getjsvalueptr()); - } + } } void Register::init(Type type) { dataType = type; if (dataType >= FirstCleanupType) { - if (dataType == QStringType) + if (dataType == QStringType) defaultConstructPointee(getstringptr()); else if (dataType == QUrlType) defaultConstructPointee(geturlptr()); @@ -450,7 +450,7 @@ void QV4Bindings::run(Binding *binding, QQmlPropertyPrivate::WriteFlags flags) return; QQmlContextData *context = QQmlAbstractExpression::context(); - if (!context || !context->isValid()) + if (!context || !context->isValid()) return; // Check that the target has not been deleted @@ -544,14 +544,14 @@ void QV4Bindings::subscribeId(QQmlContextData *p, int idIndex, int subIndex) sub->connect(&p->idValues[idIndex].bindings); } } - + void QV4Bindings::subscribe(QObject *o, int notifyIndex, int subIndex, QQmlEngine *e) { Subscription *sub = (subscriptions + subIndex); if (sub->isConnected(o, notifyIndex)) return; sub->bindings = this; - sub->method = subIndex; + sub->method = subIndex; if (o) sub->connect(o, notifyIndex, e); else @@ -652,8 +652,8 @@ static void testBindingResult(const QString &binding, quint16 line, quint16 colu return; } else if(isUndefined != result.isUndefined()) { iserror = true; - } - + } + QVariant v4value; if (!result.isUndefined()) { switch (resultType) { @@ -696,7 +696,7 @@ static void testBindingResult(const QString &binding, quint16 line, quint16 colu if (v4Result.isEmpty()) v4Result = testResultToString(v4value, result.isUndefined()); - if (!testCompareVariants(value, v4value)) + if (!testCompareVariants(value, v4value)) iserror = true; if (iserror) { @@ -724,7 +724,7 @@ static void testBindingException(const QString &binding, quint16 line, quint16 c } } -static void throwException(int id, QQmlDelayedError *error, +static void throwException(int id, QQmlDelayedError *error, QV4Program *program, QQmlContextData *context, const QString &description = QString()) { @@ -784,7 +784,7 @@ inline quint32 QV4Bindings::toUint32(double n) if (testBinding) testBindingException(*testBindingSource, bindingLine, bindingColumn, context, scope); \ throwException((id), error, program, context, (str)); \ goto exceptionExit; \ -} +} #define THROW_VALUE_EXCEPTION_STR(id, str) { \ throwException((id), error, program, context, (str)); \ @@ -933,7 +933,7 @@ void QV4Bindings::run(int instrIndex, quint32 &executedBlocks, { Register ® = registers[instr->fetchAndSubscribe.reg]; - if (reg.isUndefined()) + if (reg.isUndefined()) THROW_EXCEPTION(instr->fetchAndSubscribe.exceptionId); QObject *object = reg.getQObject(); @@ -1014,7 +1014,7 @@ void QV4Bindings::run(int instrIndex, quint32 &executedBlocks, { const Register &input = registers[instr->attached.reg]; Register &output = registers[instr->attached.output]; - if (input.isUndefined()) + if (input.isUndefined()) THROW_EXCEPTION(instr->attached.exceptionId); QObject *object = registers[instr->attached.reg].getQObject(); @@ -1095,7 +1095,7 @@ void QV4Bindings::run(int instrIndex, quint32 &executedBlocks, Register &output = registers[instr->unaryop.output]; if (src.isUndefined()) { output.setUndefined(); - } else { + } else { new (output.getstringptr()) QString(QLatin1String(src.getbool() ? "true" : "false")); STRING_REGISTER(instr->unaryop.output); } @@ -1872,21 +1872,21 @@ void QV4Bindings::run(int instrIndex, quint32 &executedBlocks, QML_V4_BEGIN_INSTR(BitAndInt, binaryop) { - registers[instr->binaryop.output].setint(registers[instr->binaryop.left].getint() & + registers[instr->binaryop.output].setint(registers[instr->binaryop.left].getint() & registers[instr->binaryop.right].getint()); } QML_V4_END_INSTR(BitAndInt, binaryop) QML_V4_BEGIN_INSTR(BitOrInt, binaryop) { - registers[instr->binaryop.output].setint(registers[instr->binaryop.left].getint() | + registers[instr->binaryop.output].setint(registers[instr->binaryop.left].getint() | registers[instr->binaryop.right].getint()); } QML_V4_END_INSTR(BitAndInt, binaryop) QML_V4_BEGIN_INSTR(BitXorInt, binaryop) { - registers[instr->binaryop.output].setint(registers[instr->binaryop.left].getint() ^ + registers[instr->binaryop.output].setint(registers[instr->binaryop.left].getint() ^ registers[instr->binaryop.right].getint()); } QML_V4_END_INSTR(BitXorInt, binaryop) @@ -1904,7 +1904,7 @@ void QV4Bindings::run(int instrIndex, quint32 &executedBlocks, if (instr->binaryop.output == instr->binaryop.left) { string += registers[instr->binaryop.right].getstringptr(); } else { - string = *registers[instr->binaryop.left].getstringptr() + + string = *registers[instr->binaryop.left].getstringptr() + *registers[instr->binaryop.right].getstringptr(); } } @@ -1942,21 +1942,21 @@ void QV4Bindings::run(int instrIndex, quint32 &executedBlocks, QML_V4_BEGIN_INSTR(LShiftInt, binaryop) { - registers[instr->binaryop.output].setint(registers[instr->binaryop.left].getint() << + registers[instr->binaryop.output].setint(registers[instr->binaryop.left].getint() << registers[instr->binaryop.right].getint()); } QML_V4_END_INSTR(LShiftInt, binaryop) QML_V4_BEGIN_INSTR(RShiftInt, binaryop) { - registers[instr->binaryop.output].setint(registers[instr->binaryop.left].getint() >> + registers[instr->binaryop.output].setint(registers[instr->binaryop.left].getint() >> registers[instr->binaryop.right].getint()); } QML_V4_END_INSTR(RShiftInt, binaryop) QML_V4_BEGIN_INSTR(URShiftInt, binaryop) { - registers[instr->binaryop.output].setint((unsigned)registers[instr->binaryop.left].getint() >> + registers[instr->binaryop.output].setint((unsigned)registers[instr->binaryop.left].getint() >> registers[instr->binaryop.right].getint()); } QML_V4_END_INSTR(URShiftInt, binaryop) @@ -2227,7 +2227,7 @@ void QV4Bindings::run(int instrIndex, quint32 &executedBlocks, { Register ® = registers[instr->fetch.reg]; - if (reg.isUndefined()) + if (reg.isUndefined()) THROW_EXCEPTION(instr->fetch.exceptionId); QObject *object = reg.getQObject(); @@ -2254,7 +2254,7 @@ void QV4Bindings::run(int instrIndex, quint32 &executedBlocks, QML_V4_BEGIN_INSTR(TestV4Store, storetest) { Register &data = registers[instr->storetest.reg]; - testBindingResult(*testBindingSource, bindingLine, bindingColumn, context, + testBindingResult(*testBindingSource, bindingLine, bindingColumn, context, scope, data, instr->storetest.regType); } QML_V4_END_INSTR(TestV4Store, storetest) @@ -2263,7 +2263,7 @@ void QV4Bindings::run(int instrIndex, quint32 &executedBlocks, { Register &data = registers[instr->store.reg]; - if (data.isUndefined()) + if (data.isUndefined()) THROW_EXCEPTION_STR(instr->store.exceptionId, QLatin1String("Unable to assign undefined value")); if (data.gettype() == QObjectStarType) { @@ -2371,7 +2371,7 @@ exceptionExit: int reg = 0; while (cleanupRegisterMask) { - if (cleanupRegisterMask & 0x1) + if (cleanupRegisterMask & 0x1) registers[reg].cleanup(); reg++; diff --git a/src/qml/qml/v4/qv4ir.cpp b/src/qml/qml/v4/qv4ir.cpp index 51f6171..931a377 100644 --- a/src/qml/qml/v4/qv4ir.cpp +++ b/src/qml/qml/v4/qv4ir.cpp @@ -456,20 +456,20 @@ void Function::dump(QTextStream &out) out << '}' << endl; } -Temp *BasicBlock::TEMP(Type type, int index) -{ +Temp *BasicBlock::TEMP(Type type, int index) +{ Temp *e = function->pool->New(); e->init(type, index); return e; } -Temp *BasicBlock::TEMP(Type type) -{ - return TEMP(type, function->tempCount++); +Temp *BasicBlock::TEMP(Type type) +{ + return TEMP(type, function->tempCount++); } -Expr *BasicBlock::CONST(Type type, double value) -{ +Expr *BasicBlock::CONST(Type type, double value) +{ Const *e = function->pool->New(); e->init(type, value); return e; @@ -563,8 +563,8 @@ Name *BasicBlock::MODULE_OBJECT(const QString &id, const QQmlMetaObject &meta, N return name; } -Expr *BasicBlock::UNOP(AluOp op, Expr *expr) -{ +Expr *BasicBlock::UNOP(AluOp op, Expr *expr) +{ Unop *e = function->pool->New(); e->init(op, expr); return e; @@ -624,29 +624,29 @@ Expr *BasicBlock::BINOP(AluOp op, Expr *left, Expr *right) } Expr *BasicBlock::CALL(Expr *base, ExprList *args) -{ +{ Call *e = function->pool->New(); e->init(base, args); return e; } -Stmt *BasicBlock::EXP(Expr *expr) -{ +Stmt *BasicBlock::EXP(Expr *expr) +{ Exp *s = function->pool->New(); s->init(expr); statements.append(s); return s; } -Stmt *BasicBlock::MOVE(Expr *target, Expr *source, bool isMoveForReturn) -{ +Stmt *BasicBlock::MOVE(Expr *target, Expr *source, bool isMoveForReturn) +{ Move *s = function->pool->New(); s->init(target, source, isMoveForReturn); statements.append(s); return s; } -Stmt *BasicBlock::JUMP(BasicBlock *target) +Stmt *BasicBlock::JUMP(BasicBlock *target) { if (isTerminated()) return 0; @@ -657,7 +657,7 @@ Stmt *BasicBlock::JUMP(BasicBlock *target) return s; } -Stmt *BasicBlock::CJUMP(Expr *cond, BasicBlock *iftrue, BasicBlock *iffalse) +Stmt *BasicBlock::CJUMP(Expr *cond, BasicBlock *iftrue, BasicBlock *iffalse) { if (isTerminated()) return 0; @@ -691,7 +691,7 @@ void BasicBlock::dump(QTextStream &out) #ifdef DEBUG_IR_STRUCTURE -static const char *symbolname(Name::Symbol s) +static const char *symbolname(Name::Symbol s) { switch (s) { case Name::Unbound: @@ -710,7 +710,7 @@ static const char *symbolname(Name::Symbol s) return "Slot"; default: Q_ASSERT(!"Unreachable"); - return "Unknown"; + return "Unknown"; } } @@ -811,7 +811,7 @@ void IRDump::visitString(QQmlJS::IR::String *e) qWarning().nospace() << indent() << "String:Expr { type: " << typeName(e->type) << ", value: " << e->value << '}'; } -static void namedumprecur(QQmlJS::IR::Name *e, const char *indent) +static void namedumprecur(QQmlJS::IR::Name *e, const char *indent) { if (e->base) namedumprecur(e->base, indent); qWarning().nospace() << indent << " { type: " << typeName(e->type) << ", symbol: " << symbolname(e->symbol) << ", storage: " << storagename(e->storage) << ", id: " << e->id << '}'; diff --git a/src/qml/qml/v8/qv8bindings.cpp b/src/qml/qml/v8/qv8bindings.cpp index 9999ebc..dd57d57 100644 --- a/src/qml/qml/v8/qv8bindings.cpp +++ b/src/qml/qml/v8/qv8bindings.cpp @@ -162,7 +162,7 @@ void QV8Bindings::Binding::update(QQmlPropertyPrivate::WriteFlags flags) bool isUndefined = false; DeleteWatcher watcher(this); - ep->referenceScarceResources(); + ep->referenceScarceResources(); v8::HandleScope handle_scope; v8::Context::Scope scope(ep->v8engine()->context()); @@ -193,7 +193,7 @@ void QV8Bindings::Binding::update(QQmlPropertyPrivate::WriteFlags flags) setUpdatingFlag(false); } - ep->dereferenceScarceResources(); + ep->dereferenceScarceResources(); } else { QQmlProperty p = QQmlPropertyPrivate::restore(*target, instruction->property, context); diff --git a/src/qml/qml/v8/qv8engine.cpp b/src/qml/qml/v8/qv8engine.cpp index 8233cb7..9f37c2d 100644 --- a/src/qml/qml/v8/qv8engine.cpp +++ b/src/qml/qml/v8/qv8engine.cpp @@ -67,7 +67,7 @@ Q_DECLARE_METATYPE(QJSValue) Q_DECLARE_METATYPE(QList) -// XXX TODO: Need to check all the global functions will also work in a worker script where the +// XXX TODO: Need to check all the global functions will also work in a worker script where the // QQmlEngine is not available QT_BEGIN_NAMESPACE @@ -99,7 +99,7 @@ static bool ObjectComparisonCallback(v8::Local lhs, v8::Localengine->variantWrapper()->toVariant(lhsr) == + return lhsr->engine->variantWrapper()->toVariant(lhsr) == lhsr->engine->variantWrapper()->toVariant(rhsr); } else if (rhst == QV8ObjectResource::ValueTypeType) { return rhsr->engine->valueTypeWrapper()->isEqual(rhsr, rhsr->engine->variantWrapper()->toVariant(lhsr)); @@ -171,7 +171,7 @@ QV8Engine::QV8Engine(QJSEngine* qq, ContextOwnership ownership) QV8Engine::~QV8Engine() { Q_ASSERT_X(v8::Isolate::GetCurrent(), "QV8Engine::~QV8Engine()", "called after v8::Isolate has exited"); - for (int ii = 0; ii < m_extensionData.count(); ++ii) + for (int ii = 0; ii < m_extensionData.count(); ++ii) delete m_extensionData[ii]; m_extensionData.clear(); @@ -220,7 +220,7 @@ QString QV8Engine::toStringStatic(v8::Handle jsstr) QVariant QV8Engine::toVariant(v8::Handle value, int typeHint) { - if (value.IsEmpty()) + if (value.IsEmpty()) return QVariant(); if (typeHint == QVariant::Bool) @@ -320,7 +320,7 @@ static v8::Handle objectFromVariantMap(QV8Engine *engine, const QVar { v8::Context::Scope scope(engine->context()); v8::Local object = v8::Object::New(); - for (QVariantMap::ConstIterator iter = map.begin(); iter != map.end(); ++iter) + for (QVariantMap::ConstIterator iter = map.begin(); iter != map.end(); ++iter) object->Set(engine->toString(iter.key()), engine->fromVariant(iter.value())); return object; } @@ -417,14 +417,14 @@ v8::Handle QV8Engine::fromVariant(const QVariant &variant) // directly against QList? const QList &list = *(QList*)ptr; v8::Local array = v8::Array::New(list.count()); - for (int ii = 0; ii < list.count(); ++ii) + for (int ii = 0; ii < list.count(); ++ii) array->Set(ii, newQObject(list.at(ii))); return array; - } + } bool objOk; QObject *obj = QQmlMetaType::toQObject(variant, &objOk); - if (objOk) + if (objOk) return newQObject(obj); bool succeeded = false; @@ -453,7 +453,7 @@ v8::Local QV8Engine::qmlModeCompile(const QString &source, v8::ScriptOrigin origin(v8fileName, v8::Integer::New(lineNumber - 1)); - v8::Local script = v8::Script::Compile(v8source, &origin, 0, v8::Handle(), + v8::Local script = v8::Script::Compile(v8source, &origin, 0, v8::Handle(), v8::Script::QmlMode); return script; @@ -479,7 +479,7 @@ v8::Local QV8Engine::qmlModeCompile(const char *source, int sourceLe return script; } -QNetworkAccessManager *QV8Engine::networkAccessManager() +QNetworkAccessManager *QV8Engine::networkAccessManager() { return QQmlEnginePrivate::get(m_engine)->getNetworkAccessManager(); } @@ -681,7 +681,7 @@ void QV8Engine::initializeGlobal(v8::Handle global) v8::Handle args[] = { global }; v8::Local names = m_getOwnPropertyNames->Call(global, 1, args); v8::Local namesArray = v8::Local::Cast(names); - for (quint32 ii = 0; ii < namesArray->Length(); ++ii) + for (quint32 ii = 0; ii < namesArray->Length(); ++ii) m_illegalNames.insert(toString(namesArray->Get(ii)), true); } @@ -735,7 +735,7 @@ void QV8Engine::registerHandle(void *handle) return; } - if (!QV8Engine_activeHandles.hasLocalData()) + if (!QV8Engine_activeHandles.hasLocalData()) QV8Engine_activeHandles.setLocalData(new QSet); if (QV8Engine_activeHandles.localData()->contains(handle)) { @@ -750,7 +750,7 @@ void QV8Engine::releaseHandle(void *handle) if (!handle) return; - if (!QV8Engine_activeHandles.hasLocalData()) + if (!QV8Engine_activeHandles.hasLocalData()) QV8Engine_activeHandles.setLocalData(new QSet); if (QV8Engine_activeHandles.localData()->contains(handle)) { @@ -782,10 +782,10 @@ int QV8Engine::registerExtension() void QV8Engine::setExtensionData(int index, Deletable *data) { - if (m_extensionData.count() <= index) + if (m_extensionData.count() <= index) m_extensionData.resize(index + 1); - if (m_extensionData.at(index)) + if (m_extensionData.at(index)) delete m_extensionData.at(index); m_extensionData[index] = data; diff --git a/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp b/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp index 55f93c6..353e4ee 100644 --- a/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp +++ b/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp @@ -245,7 +245,7 @@ private: QCOMPARE(obj->property("test"), value); \ \ delete obj; \ -} +} void tst_qqmlcontext::setContextProperty() { @@ -287,56 +287,56 @@ void tst_qqmlcontext::setContextProperty() // Changes in context properties { - QQmlComponent component(&engine); + QQmlComponent component(&engine); component.setData("import QtQuick 2.0; QtObject { property variant test: a }", QUrl()); - QObject *obj = component.create(&ctxt2); + QObject *obj = component.create(&ctxt2); - QCOMPARE(obj->property("test"), QVariant(13)); + QCOMPARE(obj->property("test"), QVariant(13)); ctxt.setContextProperty("a", QVariant(19)); - QCOMPARE(obj->property("test"), QVariant(19)); + QCOMPARE(obj->property("test"), QVariant(19)); - delete obj; + delete obj; } { - QQmlComponent component(&engine); + QQmlComponent component(&engine); component.setData("import QtQuick 2.0; QtObject { property variant test: b }", QUrl()); - QObject *obj = component.create(&ctxt2); + QObject *obj = component.create(&ctxt2); - QCOMPARE(obj->property("test"), QVariant(8)); + QCOMPARE(obj->property("test"), QVariant(8)); ctxt.setContextProperty("b", QVariant(5)); - QCOMPARE(obj->property("test"), QVariant(8)); + QCOMPARE(obj->property("test"), QVariant(8)); ctxt2.setContextProperty("b", QVariant(1912)); - QCOMPARE(obj->property("test"), QVariant(1912)); + QCOMPARE(obj->property("test"), QVariant(1912)); - delete obj; + delete obj; } { - QQmlComponent component(&engine); + QQmlComponent component(&engine); component.setData("import QtQuick 2.0; QtObject { property variant test: e.a }", QUrl()); - QObject *obj = component.create(&ctxt2); + QObject *obj = component.create(&ctxt2); - QCOMPARE(obj->property("test"), QVariant(12)); + QCOMPARE(obj->property("test"), QVariant(12)); obj1.setA(13); - QCOMPARE(obj->property("test"), QVariant(13)); + QCOMPARE(obj->property("test"), QVariant(13)); - delete obj; + delete obj; } // New context properties { - QQmlComponent component(&engine); + QQmlComponent component(&engine); component.setData("import QtQuick 2.0; QtObject { property variant test: a }", QUrl()); - QObject *obj = component.create(&ctxt2); + QObject *obj = component.create(&ctxt2); - QCOMPARE(obj->property("test"), QVariant(19)); + QCOMPARE(obj->property("test"), QVariant(19)); ctxt2.setContextProperty("a", QVariant(1945)); - QCOMPARE(obj->property("test"), QVariant(1945)); + QCOMPARE(obj->property("test"), QVariant(1945)); - delete obj; + delete obj; } // Setting an object-variant context property @@ -389,16 +389,16 @@ void tst_qqmlcontext::setContextObject() // Changes in context properties { - QQmlComponent component(&engine); + QQmlComponent component(&engine); component.setData("import QtQuick 2.0; QtObject { property variant test: a }", QUrl()); - QObject *obj = component.create(&ctxt); + QObject *obj = component.create(&ctxt); - QCOMPARE(obj->property("test"), QVariant(12)); + QCOMPARE(obj->property("test"), QVariant(12)); to.setA(14); - QCOMPARE(obj->property("test"), QVariant(14)); + QCOMPARE(obj->property("test"), QVariant(14)); - delete obj; + delete obj; } } diff --git a/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp b/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp index 658874f..b8e47c8 100644 --- a/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp +++ b/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp @@ -461,8 +461,8 @@ void tst_qqmlproperty::qmlmetaproperty_object() void tst_qqmlproperty::qmlmetaproperty_object_string() { - QObject object; - PropertyObject dobject; + QObject object; + PropertyObject dobject; { QQmlProperty prop(&object, QString("defaultProperty")); @@ -765,8 +765,8 @@ void tst_qqmlproperty::qmlmetaproperty_object_context() void tst_qqmlproperty::qmlmetaproperty_object_string_context() { - QObject object; - PropertyObject dobject; + QObject object; + PropertyObject dobject; { QQmlProperty prop(&object, QString("defaultProperty"), engine.rootContext()); @@ -966,7 +966,7 @@ void tst_qqmlproperty::qmlmetaproperty_object_string_context() void tst_qqmlproperty::name() { - { + { QQmlProperty p; QCOMPARE(p.name(), QString()); } @@ -1039,7 +1039,7 @@ void tst_qqmlproperty::name() void tst_qqmlproperty::read() { - // Invalid + // Invalid { QQmlProperty p; QCOMPARE(p.read(), QVariant()); @@ -1108,7 +1108,7 @@ void tst_qqmlproperty::read() QCOMPARE(p.read(), QVariant()); } - // Automatic signal property + // Automatic signal property { PropertyObject o; QQmlProperty p(&o, "onPropertyWithNotifyChanged"); -- 2.7.4