summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2009-10-26 05:47:12 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2009-10-26 05:48:03 (GMT)
commitee0c9c7003dc020113886070b5c04dc0a7529bf4 (patch)
tree4bcb10b46991161a59a784db65c13b9dfe34ce0a
parent7eddab2dc75c79b05d86e2e4b48ac9f4cf102406 (diff)
downloadQt-ee0c9c7003dc020113886070b5c04dc0a7529bf4.zip
Qt-ee0c9c7003dc020113886070b5c04dc0a7529bf4.tar.gz
Qt-ee0c9c7003dc020113886070b5c04dc0a7529bf4.tar.bz2
Fix more warnings.
-rw-r--r--src/declarative/extra/qmlbehavior.h1
-rw-r--r--src/declarative/qml/qmlcontext.cpp4
-rw-r--r--src/declarative/qml/qmlcontext_p.h2
-rw-r--r--src/declarative/qml/qmlenginedebug.cpp4
-rw-r--r--src/declarative/qml/qmlglobalscriptclass.cpp9
-rw-r--r--src/declarative/qml/qmlobjectscriptclass.cpp1
-rw-r--r--src/declarative/qml/qmlpropertycache.cpp2
-rw-r--r--src/declarative/qml/qmlrewrite.cpp12
-rw-r--r--src/declarative/qml/qmlvme.cpp2
-rw-r--r--src/declarative/qml/qmlvmemetaobject.cpp2
-rw-r--r--src/declarative/util/qmlanimation.h1
-rw-r--r--src/declarative/util/qmllistaccessor.cpp2
12 files changed, 25 insertions, 17 deletions
diff --git a/src/declarative/extra/qmlbehavior.h b/src/declarative/extra/qmlbehavior.h
index 994d85c..6508455 100644
--- a/src/declarative/extra/qmlbehavior.h
+++ b/src/declarative/extra/qmlbehavior.h
@@ -60,6 +60,7 @@ class Q_DECLARATIVE_EXPORT QmlBehavior : public QObject, public QmlPropertyValue
Q_OBJECT
Q_DECLARE_PRIVATE(QmlBehavior)
+ Q_INTERFACES(QmlPropertyValueInterceptor)
Q_CLASSINFO("DefaultProperty", "animation")
Q_PROPERTY(QmlAbstractAnimation *animation READ animation WRITE setAnimation)
diff --git a/src/declarative/qml/qmlcontext.cpp b/src/declarative/qml/qmlcontext.cpp
index 31d4e1f..7ba3544 100644
--- a/src/declarative/qml/qmlcontext.cpp
+++ b/src/declarative/qml/qmlcontext.cpp
@@ -396,8 +396,7 @@ void QmlContext::setContextProperty(const QString &name, const QVariant &value)
}
}
-void QmlContextPrivate::setIdProperty(const QString &name, int idx,
- QObject *obj)
+void QmlContextPrivate::setIdProperty(int idx, QObject *obj)
{
if (notifyIndex == -1) {
Q_Q(QmlContext);
@@ -487,7 +486,6 @@ void QmlContext::setBaseUrl(const QUrl &baseUrl)
*/
QUrl QmlContext::baseUrl() const
{
- Q_D(const QmlContext);
const QmlContext* p = this;
while (p && p->d_func()->url.isEmpty()) {
p = p->parentContext();
diff --git a/src/declarative/qml/qmlcontext_p.h b/src/declarative/qml/qmlcontext_p.h
index 9a77e94..be7bf1d 100644
--- a/src/declarative/qml/qmlcontext_p.h
+++ b/src/declarative/qml/qmlcontext_p.h
@@ -129,7 +129,7 @@ public:
};
ContextGuard *idValues;
int idValueCount;
- void setIdProperty(const QString &, int, QObject *);
+ void setIdProperty(int, QObject *);
void setIdPropertyData(QmlIntegerCache *);
void destroyed(ContextGuard *);
diff --git a/src/declarative/qml/qmlenginedebug.cpp b/src/declarative/qml/qmlenginedebug.cpp
index 7178e6c..664ca3f 100644
--- a/src/declarative/qml/qmlenginedebug.cpp
+++ b/src/declarative/qml/qmlenginedebug.cpp
@@ -104,7 +104,7 @@ QmlEngineDebugServer::propertyData(QObject *obj, int propIdx)
rv.type = QmlObjectProperty::Unknown;
rv.valueTypeName = QString::fromUtf8(prop.typeName());
- rv.name = prop.name();
+ rv.name = QString::fromUtf8(prop.name());
rv.hasNotifySignal = prop.hasNotifySignal();
QmlAbstractBinding *binding = QmlMetaProperty(obj, rv.name).binding();
if (binding)
@@ -229,7 +229,7 @@ QmlEngineDebugServer::objectData(QObject *object)
}
rv.objectName = object->objectName();
- rv.objectType = object->metaObject()->className();
+ rv.objectType = QString::fromUtf8(object->metaObject()->className());
rv.objectId = QmlDebugService::idForObject(object);
rv.contextId = QmlDebugService::idForObject(qmlContext(object));
diff --git a/src/declarative/qml/qmlglobalscriptclass.cpp b/src/declarative/qml/qmlglobalscriptclass.cpp
index 0ade5ee..91187c7 100644
--- a/src/declarative/qml/qmlglobalscriptclass.cpp
+++ b/src/declarative/qml/qmlglobalscriptclass.cpp
@@ -70,6 +70,10 @@ QmlGlobalScriptClass::queryProperty(const QScriptValue &object,
const QScriptString &name,
QueryFlags flags, uint *id)
{
+ Q_UNUSED(object)
+ Q_UNUSED(name)
+ Q_UNUSED(flags)
+ Q_UNUSED(id)
return HandlesReadAccess | HandlesWriteAccess;
}
@@ -78,6 +82,9 @@ QmlGlobalScriptClass::property(const QScriptValue &object,
const QScriptString &name,
uint id)
{
+ Q_UNUSED(object)
+ Q_UNUSED(name)
+ Q_UNUSED(id)
return engine()->undefinedValue();
}
@@ -85,6 +92,8 @@ void QmlGlobalScriptClass::setProperty(QScriptValue &object,
const QScriptString &name,
uint id, const QScriptValue &value)
{
+ Q_UNUSED(object)
+ Q_UNUSED(value)
QString error = QLatin1String("Invalid write to global property \"") +
name.toString() + QLatin1String("\"");
engine()->currentContext()->throwError(error);
diff --git a/src/declarative/qml/qmlobjectscriptclass.cpp b/src/declarative/qml/qmlobjectscriptclass.cpp
index a6edd3b..eac354d 100644
--- a/src/declarative/qml/qmlobjectscriptclass.cpp
+++ b/src/declarative/qml/qmlobjectscriptclass.cpp
@@ -134,7 +134,6 @@ QmlObjectScriptClass::queryProperty(QObject *obj, const Identifier &name,
return 0;
QmlEnginePrivate *enginePrivate = QmlEnginePrivate::get(engine);
- QScriptEngine *scriptEngine = QmlEnginePrivate::getScriptEngine(engine);
QmlPropertyCache *cache = 0;
QmlDeclarativeData *ddata = QmlDeclarativeData::get(obj);
diff --git a/src/declarative/qml/qmlpropertycache.cpp b/src/declarative/qml/qmlpropertycache.cpp
index 3ede341..4c24cdd 100644
--- a/src/declarative/qml/qmlpropertycache.cpp
+++ b/src/declarative/qml/qmlpropertycache.cpp
@@ -48,7 +48,7 @@ QT_BEGIN_NAMESPACE
void QmlPropertyCache::Data::load(const QMetaProperty &p)
{
propType = p.userType();
- if (propType == QVariant::LastType)
+ if (QVariant::Type(propType) == QVariant::LastType)
propType = qMetaTypeId<QVariant>();
coreIndex = p.propertyIndex();
notifyIndex = p.notifySignalIndex();
diff --git a/src/declarative/qml/qmlrewrite.cpp b/src/declarative/qml/qmlrewrite.cpp
index 43b2529..7cf8888 100644
--- a/src/declarative/qml/qmlrewrite.cpp
+++ b/src/declarative/qml/qmlrewrite.cpp
@@ -120,7 +120,7 @@ bool RewriteBinding::visit(AST::ExpressionStatement *ast)
return false;
}
-bool RewriteBinding::visit(AST::DoWhileStatement *ast)
+bool RewriteBinding::visit(AST::DoWhileStatement *)
{
++_inLoop;
return true;
@@ -131,7 +131,7 @@ void RewriteBinding::endVisit(AST::DoWhileStatement *)
--_inLoop;
}
-bool RewriteBinding::visit(AST::WhileStatement *ast)
+bool RewriteBinding::visit(AST::WhileStatement *)
{
++_inLoop;
return true;
@@ -142,7 +142,7 @@ void RewriteBinding::endVisit(AST::WhileStatement *)
--_inLoop;
}
-bool RewriteBinding::visit(AST::ForStatement *ast)
+bool RewriteBinding::visit(AST::ForStatement *)
{
++_inLoop;
return true;
@@ -153,7 +153,7 @@ void RewriteBinding::endVisit(AST::ForStatement *)
--_inLoop;
}
-bool RewriteBinding::visit(AST::LocalForStatement *ast)
+bool RewriteBinding::visit(AST::LocalForStatement *)
{
++_inLoop;
return true;
@@ -164,7 +164,7 @@ void RewriteBinding::endVisit(AST::LocalForStatement *)
--_inLoop;
}
-bool RewriteBinding::visit(AST::ForEachStatement *ast)
+bool RewriteBinding::visit(AST::ForEachStatement *)
{
++_inLoop;
return true;
@@ -175,7 +175,7 @@ void RewriteBinding::endVisit(AST::ForEachStatement *)
--_inLoop;
}
-bool RewriteBinding::visit(AST::LocalForEachStatement *ast)
+bool RewriteBinding::visit(AST::LocalForEachStatement *)
{
++_inLoop;
return true;
diff --git a/src/declarative/qml/qmlvme.cpp b/src/declarative/qml/qmlvme.cpp
index 802a78f..b986b60 100644
--- a/src/declarative/qml/qmlvme.cpp
+++ b/src/declarative/qml/qmlvme.cpp
@@ -225,7 +225,7 @@ QObject *QmlVME::run(QStack<QObject *> &stack, QmlContext *ctxt,
{
QObject *target = stack.top();
// ctxt->setContextProperty(primitives.at(instr.setId.value), target);
- cp->setIdProperty(primitives.at(instr.setId.value), instr.setId.index, target);
+ cp->setIdProperty(instr.setId.index, target);
}
break;
diff --git a/src/declarative/qml/qmlvmemetaobject.cpp b/src/declarative/qml/qmlvmemetaobject.cpp
index a627bf9..3e1d931 100644
--- a/src/declarative/qml/qmlvmemetaobject.cpp
+++ b/src/declarative/qml/qmlvmemetaobject.cpp
@@ -278,7 +278,7 @@ int QmlVMEMetaObject::metaCall(QMetaObject::Call c, int _id, void **a)
QMetaMethod m = method(_id);
QList<QByteArray> names = m.parameterNames();
for (int ii = 0; ii < names.count(); ++ii)
- newCtxt.setContextProperty(names.at(ii), *(QVariant *)a[ii + 1]);
+ newCtxt.setContextProperty(QString::fromLatin1(names.at(ii)), *(QVariant *)a[ii + 1]);
QmlExpression expr(&newCtxt, code, object);
expr.setTrackChange(false);
expr.value();
diff --git a/src/declarative/util/qmlanimation.h b/src/declarative/util/qmlanimation.h
index 7898980..f4f9f38 100644
--- a/src/declarative/util/qmlanimation.h
+++ b/src/declarative/util/qmlanimation.h
@@ -65,6 +65,7 @@ class Q_AUTOTEST_EXPORT QmlAbstractAnimation : public QObject, public QmlPropert
Q_DECLARE_PRIVATE(QmlAbstractAnimation)
Q_INTERFACES(QmlParserStatus)
+ Q_INTERFACES(QmlPropertyValueSource)
Q_PROPERTY(bool running READ isRunning WRITE setRunning NOTIFY runningChanged)
Q_PROPERTY(bool paused READ isPaused WRITE setPaused NOTIFY pausedChanged)
Q_PROPERTY(bool alwaysRunToEnd READ alwaysRunToEnd WRITE setAlwaysRunToEnd NOTIFY alwaysRunToEndChanged())
diff --git a/src/declarative/util/qmllistaccessor.cpp b/src/declarative/util/qmllistaccessor.cpp
index 21007d6..3e4cb64 100644
--- a/src/declarative/util/qmllistaccessor.cpp
+++ b/src/declarative/util/qmllistaccessor.cpp
@@ -73,7 +73,7 @@ void QmlListAccessor::setList(const QVariant &v, QmlEngine *engine)
m_type = Invalid;
} else if (d.type() == QVariant::StringList) {
m_type = StringList;
- } else if (d.type() == QMetaType::QVariantList) {
+ } else if (d.type() == (QVariant::Type)QMetaType::QVariantList) {
m_type = VariantList;
} else if (d.canConvert(QVariant::Int)) {
m_type = Integer;