aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml
diff options
context:
space:
mode:
authorMatthew Vogt <matthew.vogt@nokia.com>2012-08-24 10:05:53 +1000
committerQt by Nokia <qt-info@nokia.com>2012-08-24 07:07:56 +0200
commite8e3c206ac0d2ff436f7166fb73f33a7e8259b6a (patch)
treeae9bd0c1a09e5992241a7decd8d2a5adec6da98d /src/qml/qml
parentacf5251f855c8af7cd27776ecb1c9c7370b066bb (diff)
Fix warnings in QtQml
Change-Id: Ibba3b8e878257f7019bdc90a1344462b77f95a21 Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'src/qml/qml')
-rw-r--r--src/qml/qml/qqmlglobal_p.h2
-rw-r--r--src/qml/qml/qqmlmetatype.cpp16
-rw-r--r--src/qml/qml/qqmlmetatype_p.h2
-rw-r--r--src/qml/qml/qqmlvaluetype.cpp2
-rw-r--r--src/qml/qml/v4/qv4bindings.cpp3
5 files changed, 14 insertions, 11 deletions
diff --git a/src/qml/qml/qqmlglobal_p.h b/src/qml/qml/qqmlglobal_p.h
index e79a91f035..342c982140 100644
--- a/src/qml/qml/qqmlglobal_p.h
+++ b/src/qml/qml/qqmlglobal_p.h
@@ -167,7 +167,7 @@ T qmlobject_cast(QObject *object)
inline quint16 qmlSourceCoordinate(int n)
{
- return (n > 0 && n <= USHRT_MAX) ? static_cast<quint16>(n) : 0;
+ return (n > 0 && n <= static_cast<int>(USHRT_MAX)) ? static_cast<quint16>(n) : 0;
}
inline int qmlSourceCoordinate(quint16 n)
diff --git a/src/qml/qml/qqmlmetatype.cpp b/src/qml/qml/qqmlmetatype.cpp
index 35ff9fd5d1..1b94365d03 100644
--- a/src/qml/qml/qqmlmetatype.cpp
+++ b/src/qml/qml/qqmlmetatype.cpp
@@ -264,11 +264,11 @@ QQmlType::QQmlType(int index, const QQmlPrivate::RegisterInterface &interface)
d->m_version_min = 0;
}
-QQmlType::QQmlType(int index, const QQmlPrivate::RegisterType &type)
+QQmlType::QQmlType(int index, const QString &elementName, const QQmlPrivate::RegisterType &type)
: d(new QQmlTypePrivate)
{
+ d->m_elementName = elementName;
d->m_module = moduleFromUtf8(type.uri);
- d->m_elementName = QString::fromUtf8(type.elementName);
d->m_version_maj = type.versionMajor;
d->m_version_min = type.versionMinor;
@@ -943,11 +943,13 @@ int registerType(const QQmlPrivate::RegisterType &type)
QWriteLocker lock(metaTypeDataLock());
QQmlMetaTypeData *data = metaTypeData();
+ QString elementName = QString::fromUtf8(type.elementName);
+
if (type.uri && type.elementName) {
QString nameSpace = moduleFromUtf8(type.uri);
- if (data->singletonTypeExists(nameSpace, type.elementName, type.versionMajor, type.versionMinor)) {
- qWarning("Cannot register type %s in uri %s %d.%d (a conflicting singleton type already exists)", qPrintable(type.elementName), qPrintable(nameSpace), type.versionMajor, type.versionMinor);
+ if (data->singletonTypeExists(nameSpace, elementName, type.versionMajor, type.versionMinor)) {
+ qWarning("Cannot register type %s in uri %s %d.%d (a conflicting singleton type already exists)", qPrintable(elementName), qPrintable(nameSpace), type.versionMajor, type.versionMinor);
return -1;
}
@@ -956,7 +958,7 @@ int registerType(const QQmlPrivate::RegisterType &type)
if (nameSpace != data->typeRegistrationNamespace) {
QString failure(QCoreApplication::translate("qmlRegisterType",
"Cannot install element '%1' into unregistered namespace '%2'"));
- data->typeRegistrationFailures.append(failure.arg(QString::fromUtf8(type.elementName)).arg(nameSpace));
+ data->typeRegistrationFailures.append(failure.arg(elementName).arg(nameSpace));
return -1;
}
} else if (data->typeRegistrationNamespace != nameSpace) {
@@ -964,7 +966,7 @@ int registerType(const QQmlPrivate::RegisterType &type)
if (data->protectedNamespaces.contains(nameSpace)) {
QString failure(QCoreApplication::translate("qmlRegisterType",
"Cannot install element '%1' into protected namespace '%2'"));
- data->typeRegistrationFailures.append(failure.arg(QString::fromUtf8(type.elementName)).arg(nameSpace));
+ data->typeRegistrationFailures.append(failure.arg(elementName).arg(nameSpace));
return -1;
}
}
@@ -972,7 +974,7 @@ int registerType(const QQmlPrivate::RegisterType &type)
int index = data->types.count();
- QQmlType *dtype = new QQmlType(index, type);
+ QQmlType *dtype = new QQmlType(index, elementName, type);
data->types.append(dtype);
data->idToType.insert(dtype->typeId(), dtype);
diff --git a/src/qml/qml/qqmlmetatype_p.h b/src/qml/qml/qqmlmetatype_p.h
index 4e60c2d0d3..ad1ceb8052 100644
--- a/src/qml/qml/qqmlmetatype_p.h
+++ b/src/qml/qml/qqmlmetatype_p.h
@@ -213,7 +213,7 @@ private:
friend int registerType(const QQmlPrivate::RegisterType &);
friend int registerInterface(const QQmlPrivate::RegisterInterface &);
QQmlType(int, const QQmlPrivate::RegisterInterface &);
- QQmlType(int, const QQmlPrivate::RegisterType &);
+ QQmlType(int, const QString &, const QQmlPrivate::RegisterType &);
~QQmlType();
QQmlTypePrivate *d;
diff --git a/src/qml/qml/qqmlvaluetype.cpp b/src/qml/qml/qqmlvaluetype.cpp
index cd11721e2b..58227a1ff9 100644
--- a/src/qml/qml/qqmlvaluetype.cpp
+++ b/src/qml/qml/qqmlvaluetype.cpp
@@ -78,7 +78,7 @@ QQmlValueTypeFactoryImpl::~QQmlValueTypeFactoryImpl()
bool QQmlValueTypeFactoryImpl::isValueType(int idx)
{
- if (idx >= QVariant::UserType) {
+ if (idx >= (int)QVariant::UserType) {
return (valueType(idx) != 0);
} else if (idx >= 0
&& idx != QVariant::StringList
diff --git a/src/qml/qml/v4/qv4bindings.cpp b/src/qml/qml/v4/qv4bindings.cpp
index 169e60ec41..bd67a8d5e4 100644
--- a/src/qml/qml/v4/qv4bindings.cpp
+++ b/src/qml/qml/v4/qv4bindings.cpp
@@ -52,6 +52,7 @@
#include <private/qjsconverter_p.h>
#include <private/qjsconverter_impl_p.h>
#include <private/qjsvalue_impl_p.h>
+#include <private/qjsvalueiterator_impl_p.h>
#include <private/qv8engine_impl_p.h>
#include <private/qqmlaccessors_p.h>
@@ -864,7 +865,7 @@ inline quint32 QV4Bindings::toUint32(double n)
QQmlPropertyData *prop = (data && data->propertyCache) ? data->propertyCache->property((index)) : 0; \
if (prop && prop->isOverridden()) { \
int resolvedIndex = data->propertyCache->property(prop->name(obj))->coreIndex; \
- if (index < resolvedIndex) { \
+ if ((int)index < resolvedIndex) { \
*(inv) = true; \
goto programExit; \
} \