From 01335edc94d2961bd4061ed2cb81ebd1151797bf Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 31 Aug 2011 16:43:22 +0200 Subject: Fix export symbols for QtDeclarative and QtQuick1. Fix build on Windows and compiler warnings. Requires 090ee21eac7257644422e35395194e5fd7fb8efa in qtbase. Change-Id: Ief8da504ccd3e2c2e78644cc9943d685c4302019 Reviewed-on: http://codereview.qt.nokia.com/3988 Reviewed-by: Qt Sanity Bot Reviewed-by: Friedemann Kleint --- src/declarative/items/context2d/qsgcanvasitem.cpp | 2 +- src/declarative/items/context2d/qsgcontext2d.cpp | 1 + src/declarative/items/context2d/qsgcontext2d_p_p.h | 3 +- src/declarative/items/qsgcanvas.cpp | 6 ++-- src/declarative/items/qsgitemsmodule.cpp | 3 +- src/declarative/items/qsgshadereffect.cpp | 2 +- src/declarative/items/qsgtextedit.cpp | 2 +- src/declarative/items/qsgtextinput.cpp | 2 +- src/declarative/particles/qsgangleddirection.cpp | 2 +- .../particles/qsgcumulativedirection.cpp | 6 ++-- .../particles/qsgcumulativedirection_p.h | 1 + src/declarative/particles/qsgcustomparticle.cpp | 2 +- src/declarative/particles/qsgfollowemitter.cpp | 2 +- src/declarative/particles/qsgimageparticle.cpp | 32 ++++++++++---------- src/declarative/particles/qsgmodelparticle.cpp | 2 +- src/declarative/particles/qsgparticlesystem.cpp | 4 +-- src/declarative/qml/ftw/qdeclarativepool_p.h | 3 +- src/declarative/qml/ftw/qfastmetabuilder_p.h | 2 +- src/declarative/qml/ftw/qhashedstring_p.h | 4 +-- src/declarative/qml/qdeclarativecleanup_p.h | 4 ++- src/declarative/qml/qdeclarativecompiler.cpp | 4 +-- src/declarative/qml/qdeclarativeimport.cpp | 2 +- src/declarative/qml/qdeclarativeimport_p.h | 3 +- src/declarative/qml/qdeclarativeinfo.cpp | 3 +- src/declarative/qml/qdeclarativescript_p.h | 2 +- src/declarative/qml/qdeclarativesqldatabase.cpp | 10 +++---- src/declarative/qml/qdeclarativetypeloader_p.h | 9 ++++-- src/declarative/qml/qdeclarativevaluetype_p.h | 34 +++++++++++++--------- src/declarative/qml/qdeclarativexmlhttprequest.cpp | 26 ++++++++--------- src/declarative/qml/v8/qv8qobjectwrapper.cpp | 3 +- src/declarative/qml/v8/qv8variantwrapper.cpp | 4 +-- src/declarative/scenegraph/coreapi/qsgrenderer.cpp | 2 +- .../scenegraph/qsgdistancefieldglyphcache.cpp | 2 +- .../util/qdeclarativesmoothedanimation.cpp | 16 +++++----- 34 files changed, 112 insertions(+), 93 deletions(-) (limited to 'src/declarative') diff --git a/src/declarative/items/context2d/qsgcanvasitem.cpp b/src/declarative/items/context2d/qsgcanvasitem.cpp index 0bd9a47d8d..197a434921 100644 --- a/src/declarative/items/context2d/qsgcanvasitem.cpp +++ b/src/declarative/items/context2d/qsgcanvasitem.cpp @@ -264,7 +264,7 @@ QString QSGCanvasItem::toDataURL(const QString& mimeType) const image.save(&buffer, type.toAscii()); buffer.close(); QString dataUrl = QLatin1String("data:%1;base64,%2"); - return dataUrl.arg(mime).arg(ba.toBase64().constData()); + return dataUrl.arg(mime).arg(QString::fromAscii(ba.toBase64())); } return QLatin1String("data:,"); } diff --git a/src/declarative/items/context2d/qsgcontext2d.cpp b/src/declarative/items/context2d/qsgcontext2d.cpp index 71bc7df980..22a9c7029e 100644 --- a/src/declarative/items/context2d/qsgcontext2d.cpp +++ b/src/declarative/items/context2d/qsgcontext2d.cpp @@ -546,6 +546,7 @@ static v8::Handle ctx2d_valid(v8::Local, const v8::Access QV8Engine *engine = V8ENGINE_ACCESSOR(); + Q_UNUSED(engine) return v8::Boolean::New(r->context->valid()); } diff --git a/src/declarative/items/context2d/qsgcontext2d_p_p.h b/src/declarative/items/context2d/qsgcontext2d_p_p.h index d71a0bccf2..fc656f5f8f 100644 --- a/src/declarative/items/context2d/qsgcontext2d_p_p.h +++ b/src/declarative/items/context2d/qsgcontext2d_p_p.h @@ -58,7 +58,8 @@ QT_BEGIN_NAMESPACE class QSGCanvasItem; -struct QSGContext2DWorkerAgent { +class QSGContext2DWorkerAgent { +public: QSGContext2DWorkerAgent() :ref(1) , orig(0) diff --git a/src/declarative/items/qsgcanvas.cpp b/src/declarative/items/qsgcanvas.cpp index 95ee95d0f7..9f55c400ce 100644 --- a/src/declarative/items/qsgcanvas.cpp +++ b/src/declarative/items/qsgcanvas.cpp @@ -252,7 +252,7 @@ void QSGCanvas::exposeEvent(QExposeEvent *) d->thread->paint(); } -void QSGCanvas::resizeEvent(QResizeEvent *e) +void QSGCanvas::resizeEvent(QResizeEvent *) { Q_D(QSGCanvas); d->thread->resize(size()); @@ -268,7 +268,7 @@ void QSGCanvas::animationStopped() d_func()->thread->animationStopped(); } -void QSGCanvas::showEvent(QShowEvent *e) +void QSGCanvas::showEvent(QShowEvent *) { Q_D(QSGCanvas); if (d->vsyncAnimations) { @@ -286,7 +286,7 @@ void QSGCanvas::showEvent(QShowEvent *e) } } -void QSGCanvas::hideEvent(QHideEvent *e) +void QSGCanvas::hideEvent(QHideEvent *) { Q_D(QSGCanvas); d->thread->stopRendering(); diff --git a/src/declarative/items/qsgitemsmodule.cpp b/src/declarative/items/qsgitemsmodule.cpp index 9359906f25..9547dc01cc 100644 --- a/src/declarative/items/qsgitemsmodule.cpp +++ b/src/declarative/items/qsgitemsmodule.cpp @@ -126,7 +126,8 @@ static void qt_sgitems_defineModule(const char *uri, int major, int minor) qmlRegisterType(uri,major,minor,"PathPercent"); qmlRegisterType(uri,major,minor,"PathQuad"); qmlRegisterType(uri,major,minor,"PathView"); - qmlRegisterUncreatableType(uri,major,minor,"Positioner","Positioner is an abstract type that is only available as an attached property."); + qmlRegisterUncreatableType(uri,major,minor,"Positioner", + QStringLiteral("Positioner is an abstract type that is only available as an attached property.")); #ifndef QT_NO_VALIDATOR qmlRegisterType(uri,major,minor,"IntValidator"); qmlRegisterType(uri,major,minor,"DoubleValidator"); diff --git a/src/declarative/items/qsgshadereffect.cpp b/src/declarative/items/qsgshadereffect.cpp index b81e7f15af..7f7bff7719 100644 --- a/src/declarative/items/qsgshadereffect.cpp +++ b/src/declarative/items/qsgshadereffect.cpp @@ -417,7 +417,7 @@ void QSGShaderEffect::setSource(const QVariant &var, int index) QSGItem *item = qobject_cast(obj); if (!item || !item->isTextureProvider()) { qWarning("ShaderEffect: source uniform [%s] is not assigned a valid texture provider: %s [%s]", - qPrintable(source.name), qPrintable(obj->objectName()), obj->metaObject()->className()); + source.name.constData(), qPrintable(obj->objectName()), obj->metaObject()->className()); return; } diff --git a/src/declarative/items/qsgtextedit.cpp b/src/declarative/items/qsgtextedit.cpp index 1c0ed62f0d..cf861684fa 100644 --- a/src/declarative/items/qsgtextedit.cpp +++ b/src/declarative/items/qsgtextedit.cpp @@ -65,7 +65,7 @@ QT_BEGIN_NAMESPACE DEFINE_BOOL_CONFIG_OPTION(qmlDisableDistanceField, QML_DISABLE_DISTANCEFIELD) -QWidgetPrivate *qt_widget_private(QWidget *widget); +Q_WIDGETS_EXPORT QWidgetPrivate *qt_widget_private(QWidget *widget); /*! \qmlclass TextEdit QSGTextEdit \inqmlmodule QtQuick 2 diff --git a/src/declarative/items/qsgtextinput.cpp b/src/declarative/items/qsgtextinput.cpp index d30faadb34..f6b8ecd436 100644 --- a/src/declarative/items/qsgtextinput.cpp +++ b/src/declarative/items/qsgtextinput.cpp @@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE DEFINE_BOOL_CONFIG_OPTION(qmlDisableDistanceField, QML_DISABLE_DISTANCEFIELD) -QWidgetPrivate *qt_widget_private(QWidget *widget); +Q_WIDGETS_EXPORT QWidgetPrivate *qt_widget_private(QWidget *widget); /*! \qmlclass TextInput QSGTextInput diff --git a/src/declarative/particles/qsgangleddirection.cpp b/src/declarative/particles/qsgangleddirection.cpp index ab39b8a575..844941c178 100644 --- a/src/declarative/particles/qsgangleddirection.cpp +++ b/src/declarative/particles/qsgangleddirection.cpp @@ -102,7 +102,7 @@ QSGAngledDirection::QSGAngledDirection(QObject *parent) : } -const QPointF &QSGAngledDirection::sample(const QPointF &from) +const QPointF &QSGAngledDirection::sample(const QPointF &) { //TODO: Faster qreal theta = m_angle*CONV - m_angleVariation*CONV + rand()/float(RAND_MAX) * m_angleVariation*CONV * 2; diff --git a/src/declarative/particles/qsgcumulativedirection.cpp b/src/declarative/particles/qsgcumulativedirection.cpp index 1d7523972b..3502b41bce 100644 --- a/src/declarative/particles/qsgcumulativedirection.cpp +++ b/src/declarative/particles/qsgcumulativedirection.cpp @@ -61,10 +61,10 @@ QDeclarativeListProperty QSGCumulativeDirection::directi const QPointF &QSGCumulativeDirection::sample(const QPointF &from) { - QPointF ret; + m_ret = QPointF(); foreach (QSGStochasticDirection* dir, m_directions) - ret += dir->sample(from); - return ret; + m_ret += dir->sample(from); + return m_ret; } QT_END_NAMESPACE diff --git a/src/declarative/particles/qsgcumulativedirection_p.h b/src/declarative/particles/qsgcumulativedirection_p.h index c54a795931..53ed7613a1 100644 --- a/src/declarative/particles/qsgcumulativedirection_p.h +++ b/src/declarative/particles/qsgcumulativedirection_p.h @@ -60,5 +60,6 @@ public: const QPointF &sample(const QPointF &from); private: QList m_directions; + QPointF m_ret; }; #endif // QSGCUMULATIVEDIRECTION_P_H diff --git a/src/declarative/particles/qsgcustomparticle.cpp b/src/declarative/particles/qsgcustomparticle.cpp index 12d32a27b4..373d050627 100644 --- a/src/declarative/particles/qsgcustomparticle.cpp +++ b/src/declarative/particles/qsgcustomparticle.cpp @@ -281,7 +281,7 @@ void QSGCustomParticle::setSource(const QVariant &var, int index) source.item = qobject_cast(obj); if (!source.item || !source.item->isTextureProvider()) { qWarning("ShaderEffect: source uniform [%s] is not assigned a valid texture provider: %s [%s]", - qPrintable(source.name), qPrintable(obj->objectName()), obj->metaObject()->className()); + source.name.constData(), qPrintable(obj->objectName()), obj->metaObject()->className()); return; } diff --git a/src/declarative/particles/qsgfollowemitter.cpp b/src/declarative/particles/qsgfollowemitter.cpp index 68f0f6bf75..d2e3265e2d 100644 --- a/src/declarative/particles/qsgfollowemitter.cpp +++ b/src/declarative/particles/qsgfollowemitter.cpp @@ -209,7 +209,7 @@ void QSGFollowEmitter::emitWindow(int timeStamp) const QPointF &speed = m_speed->sample(newPos); datum->vx = speed.x() + m_speed_from_movement * d->vx; - datum->vy = speed.y(); + datum->vy = speed.y() + m_speed_from_movement * d->vy; // Particle acceleration diff --git a/src/declarative/particles/qsgimageparticle.cpp b/src/declarative/particles/qsgimageparticle.cpp index f269895536..1e410ad1b9 100644 --- a/src/declarative/particles/qsgimageparticle.cpp +++ b/src/declarative/particles/qsgimageparticle.cpp @@ -66,7 +66,7 @@ DEFINE_BOOL_CONFIG_OPTION(qmlParticlesDebug, QML_PARTICLES_DEBUG) //TODO: Make it larger on desktop? Requires fixing up shader code with the same define #define UNIFORM_ARRAY_SIZE 64 -const float CONV = 0.017453292519943295; +const qreal CONV = 0.017453292519943295; class ImageMaterialData { public: @@ -99,13 +99,13 @@ class TabledMaterial : public QSGSimpleMaterialShader public: TabledMaterial() { - QFile vf(":defaultshaders/imagevertex.shader"); + QFile vf(QStringLiteral(":defaultshaders/imagevertex.shader")); vf.open(QFile::ReadOnly); m_vertex_code = QByteArray(SHADER_DEFINES) + QByteArray("#define TABLE\n#define DEFORM\n#define COLOR\n") + vf.readAll(); - QFile ff(":defaultshaders/imagefragment.shader"); + QFile ff(QStringLiteral(":defaultshaders/imagefragment.shader")); ff.open(QFile::ReadOnly); m_fragment_code = QByteArray(SHADER_DEFINES) + QByteArray("#define TABLE\n#define DEFORM\n#define COLOR\n") @@ -167,13 +167,13 @@ class DeformableMaterial : public QSGSimpleMaterialShader public: SpriteMaterial() { - QFile vf(":defaultshaders/imagevertex.shader"); + QFile vf(QStringLiteral(":defaultshaders/imagevertex.shader")); vf.open(QFile::ReadOnly); m_vertex_code = QByteArray(SHADER_DEFINES) + QByteArray("#define SPRITE\n#define TABLE\n#define DEFORM\n#define COLOR\n") + vf.readAll(); - QFile ff(":defaultshaders/imagefragment.shader"); + QFile ff(QStringLiteral(":defaultshaders/imagefragment.shader")); ff.open(QFile::ReadOnly); m_fragment_code = QByteArray(SHADER_DEFINES) + QByteArray("#define SPRITE\n#define TABLE\n#define DEFORM\n#define COLOR\n") @@ -296,13 +296,13 @@ class ColoredMaterial : public QSGSimpleMaterialShader public: ColoredMaterial() { - QFile vf(":defaultshaders/imagevertex.shader"); + QFile vf(QStringLiteral(":defaultshaders/imagevertex.shader")); vf.open(QFile::ReadOnly); m_vertex_code = QByteArray(SHADER_DEFINES) + QByteArray("#define COLOR\n") + vf.readAll(); - QFile ff(":defaultshaders/imagefragment.shader"); + QFile ff(QStringLiteral(":defaultshaders/imagefragment.shader")); ff.open(QFile::ReadOnly); m_fragment_code = QByteArray(SHADER_DEFINES) + QByteArray("#define COLOR\n") @@ -317,7 +317,7 @@ public: void activate() { QSGSimpleMaterialShader::activate(); -#ifndef QT_OPENGL_ES_2 +#if !defined(QT_OPENGL_ES_2) && !defined(Q_OS_WIN) glEnable(GL_POINT_SPRITE); glEnable(GL_VERTEX_PROGRAM_POINT_SIZE); #endif @@ -325,7 +325,7 @@ public: void deactivate() { QSGSimpleMaterialShader::deactivate(); -#ifndef QT_OPENGL_ES_2 +#if !defined(QT_OPENGL_ES_2) && !defined(Q_OS_WIN) glDisable(GL_POINT_SPRITE); glDisable(GL_VERTEX_PROGRAM_POINT_SIZE); #endif @@ -367,12 +367,12 @@ class SimpleMaterial : public QSGSimpleMaterialShader public: SimpleMaterial() { - QFile vf(":defaultshaders/imagevertex.shader"); + QFile vf(QStringLiteral(":defaultshaders/imagevertex.shader")); vf.open(QFile::ReadOnly); m_vertex_code = QByteArray(SHADER_DEFINES) + vf.readAll(); - QFile ff(":defaultshaders/imagefragment.shader"); + QFile ff(QStringLiteral(":defaultshaders/imagefragment.shader")); ff.open(QFile::ReadOnly); m_fragment_code = QByteArray(SHADER_DEFINES) + ff.readAll(); @@ -386,7 +386,7 @@ public: void activate() { QSGSimpleMaterialShader::activate(); -#ifndef QT_OPENGL_ES_2 +#if !defined(QT_OPENGL_ES_2) && !defined(Q_OS_WIN) glEnable(GL_POINT_SPRITE); glEnable(GL_VERTEX_PROGRAM_POINT_SIZE); #endif @@ -394,7 +394,7 @@ public: void deactivate() { QSGSimpleMaterialShader::deactivate(); -#ifndef QT_OPENGL_ES_2 +#if !defined(QT_OPENGL_ES_2) && !defined(Q_OS_WIN) glDisable(GL_POINT_SPRITE); glDisable(GL_VERTEX_PROGRAM_POINT_SIZE); #endif @@ -913,7 +913,7 @@ QSGGeometryNode* QSGImageParticle::buildParticleNodes() sizetable = QImage(m_sizetable_name.toLocalFile()); opacitytable = QImage(m_opacitytable_name.toLocalFile()); if (colortable.isNull()) - colortable = QImage(":defaultshaders/identitytable.png"); + colortable = QImage(QStringLiteral(":defaultshaders/identitytable.png")); Q_ASSERT(!colortable.isNull()); getState(m_material)->colorTable = sceneGraphEngine()->createTextureFromImage(colortable); fillUniformArrayFromImage(getState(m_material)->sizeTable, sizetable, UNIFORM_ARRAY_SIZE); diff --git a/src/declarative/particles/qsgmodelparticle.cpp b/src/declarative/particles/qsgmodelparticle.cpp index 2646864283..d90b09fa6d 100644 --- a/src/declarative/particles/qsgmodelparticle.cpp +++ b/src/declarative/particles/qsgmodelparticle.cpp @@ -213,7 +213,7 @@ void QSGModelParticle::processPending() m_requests.clear(); } -void QSGModelParticle::commit(int gIdx, int pIdx) +void QSGModelParticle::commit(int /* gIdx */, int /* pIdx */) { //No-op unless we start copying the data. } diff --git a/src/declarative/particles/qsgparticlesystem.cpp b/src/declarative/particles/qsgparticlesystem.cpp index efd6c22bd9..d12165e4e8 100644 --- a/src/declarative/particles/qsgparticlesystem.cpp +++ b/src/declarative/particles/qsgparticlesystem.cpp @@ -493,7 +493,7 @@ QSGParticleSystem::QSGParticleSystem(QSGItem *parent) : { QSGParticleGroupData* gd = new QSGParticleGroupData(0, this);//Default group m_groupData.insert(0,gd); - m_groupIds.insert("",0); + m_groupIds.insert(QString(),0); m_nextGroupId = 1; connect(&m_painterMapper, SIGNAL(mapped(QObject*)), @@ -549,7 +549,7 @@ void QSGParticleSystem::loadPainter(QObject *p) int particleCount = 0; if (painter->particles().isEmpty()){//Uses default particle QStringList def; - def << ""; + def << QString(); painter->setParticles(def); particleCount += m_groupData[0]->size(); m_groupData[0]->painters << painter; diff --git a/src/declarative/qml/ftw/qdeclarativepool_p.h b/src/declarative/qml/ftw/qdeclarativepool_p.h index 8935046cc3..c4393fe2e6 100644 --- a/src/declarative/qml/ftw/qdeclarativepool_p.h +++ b/src/declarative/qml/ftw/qdeclarativepool_p.h @@ -58,7 +58,8 @@ QT_BEGIN_NAMESPACE -class QDeclarativePool +// Exported for QtQuick1 +class Q_DECLARATIVE_EXPORT QDeclarativePool { public: // The class has a destructor that needs to be called diff --git a/src/declarative/qml/ftw/qfastmetabuilder_p.h b/src/declarative/qml/ftw/qfastmetabuilder_p.h index 9a6971d652..e9457b5943 100644 --- a/src/declarative/qml/ftw/qfastmetabuilder_p.h +++ b/src/declarative/qml/ftw/qfastmetabuilder_p.h @@ -122,7 +122,7 @@ public: QByteArray toData() const { return m_data; } static void fromData(QMetaObject *, const QMetaObject *parent, const QByteArray &); private: - friend class StringRef; + friend struct StringRef; QByteArray m_data; int m_zeroPtr; diff --git a/src/declarative/qml/ftw/qhashedstring_p.h b/src/declarative/qml/ftw/qhashedstring_p.h index f6c7f20d3a..d0dada8d72 100644 --- a/src/declarative/qml/ftw/qhashedstring_p.h +++ b/src/declarative/qml/ftw/qhashedstring_p.h @@ -254,7 +254,7 @@ public: } }; -struct Q_AUTOTEST_EXPORT QStringHashData +class Q_AUTOTEST_EXPORT QStringHashData { public: QStringHashData() @@ -275,7 +275,7 @@ private: }; template -class Q_AUTOTEST_EXPORT QStringHash +class QStringHash { public: struct Node : public QStringHashNode { diff --git a/src/declarative/qml/qdeclarativecleanup_p.h b/src/declarative/qml/qdeclarativecleanup_p.h index 3f55bdbe48..1efe564edc 100644 --- a/src/declarative/qml/qdeclarativecleanup_p.h +++ b/src/declarative/qml/qdeclarativecleanup_p.h @@ -58,7 +58,9 @@ QT_BEGIN_NAMESPACE class QDeclarativeEngine; -class QDeclarativeCleanup + +// Exported for QtQuick1 +class Q_DECLARATIVE_EXPORT QDeclarativeCleanup { public: QDeclarativeCleanup(QDeclarativeEngine *); diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp index 79094b7e0e..b3d714dcb2 100644 --- a/src/declarative/qml/qdeclarativecompiler.cpp +++ b/src/declarative/qml/qdeclarativecompiler.cpp @@ -1595,7 +1595,7 @@ bool QDeclarativeCompiler::buildProperty(QDeclarativeScript::Property *prop, QDeclarativePropertyCache::Data defaultPropertyData; defaultPropertyData.load(p, engine); if (p.name()) - prop->setName(p.name()); + prop->setName(QLatin1String(p.name())); prop->core = defaultPropertyData; prop->index = prop->core.coreIndex; } @@ -2406,7 +2406,7 @@ const QMetaObject *QDeclarativeCompiler::resolveType(const QByteArray& name) con int QDeclarativeCompiler::rewriteBinding(const QString& expression, const QString& name) { QDeclarativeRewrite::RewriteBinding rewriteBinding; - rewriteBinding.setName(QLatin1Char('$') + name.mid(name.lastIndexOf('.') + 1)); + rewriteBinding.setName(QLatin1Char('$') + name.mid(name.lastIndexOf(QLatin1Char('.')) + 1)); QString rewrite = rewriteBinding(expression, 0, 0); diff --git a/src/declarative/qml/qdeclarativeimport.cpp b/src/declarative/qml/qdeclarativeimport.cpp index 0c0719a710..64bdaf108a 100644 --- a/src/declarative/qml/qdeclarativeimport.cpp +++ b/src/declarative/qml/qdeclarativeimport.cpp @@ -210,7 +210,7 @@ void QDeclarativeImports::populateCache(QDeclarativeTypeNameCache *cache, QDecla if (module) import.modules.append(QDeclarativeTypeModuleVersion(module, data.minversion)); - QDeclarativeMetaType::ModuleApi moduleApi = QDeclarativeMetaType::moduleApi(data.uri.toUtf8(), data.majversion, data.minversion); + QDeclarativeMetaType::ModuleApi moduleApi = QDeclarativeMetaType::moduleApi(data.uri, data.majversion, data.minversion); if (moduleApi.script || moduleApi.qobject) { QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine); QDeclarativeMetaType::ModuleApiInstance *a = ep->moduleApiInstances.value(moduleApi); diff --git a/src/declarative/qml/qdeclarativeimport_p.h b/src/declarative/qml/qdeclarativeimport_p.h index c695a6b423..7f0b499881 100644 --- a/src/declarative/qml/qdeclarativeimport_p.h +++ b/src/declarative/qml/qdeclarativeimport_p.h @@ -71,7 +71,8 @@ class QDeclarativeImportsPrivate; class QDeclarativeImportDatabase; class QDeclarativeTypeLoader; -class QDeclarativeImports +// Exported for QtQuick1 +class Q_DECLARATIVE_EXPORT QDeclarativeImports { public: QDeclarativeImports(QDeclarativeTypeLoader *); diff --git a/src/declarative/qml/qdeclarativeinfo.cpp b/src/declarative/qml/qdeclarativeinfo.cpp index e2f728ad69..995a6b9ad7 100644 --- a/src/declarative/qml/qdeclarativeinfo.cpp +++ b/src/declarative/qml/qdeclarativeinfo.cpp @@ -132,7 +132,8 @@ QDeclarativeInfo::~QDeclarativeInfo() marker = typeName.indexOf(QLatin1String("_QML_")); if (marker != -1) { - typeName = typeName.left(marker) + "*"; + typeName = typeName.left(marker); + typeName += QLatin1Char('*'); type = QDeclarativeMetaType::qmlType(QMetaType::type(typeName.toLatin1())); if (type) { typeName = QLatin1String(type->qmlTypeName()); diff --git a/src/declarative/qml/qdeclarativescript_p.h b/src/declarative/qml/qdeclarativescript_p.h index 3aff31789a..a985fd7a8a 100644 --- a/src/declarative/qml/qdeclarativescript_p.h +++ b/src/declarative/qml/qdeclarativescript_p.h @@ -72,7 +72,7 @@ QT_MODULE(Declarative) class QByteArray; class QDeclarativePropertyCache; namespace QDeclarativeJS { namespace AST { class Node; class StringLiteral; } } -namespace QDeclarativeCompilerTypes { class BindingReference; class ComponentCompileState; } +namespace QDeclarativeCompilerTypes { struct BindingReference; struct ComponentCompileState; } namespace QDeclarativeScript { diff --git a/src/declarative/qml/qdeclarativesqldatabase.cpp b/src/declarative/qml/qdeclarativesqldatabase.cpp index fbe5b95aeb..687aec9448 100644 --- a/src/declarative/qml/qdeclarativesqldatabase.cpp +++ b/src/declarative/qml/qdeclarativesqldatabase.cpp @@ -145,7 +145,7 @@ public: bool forwardOnly; // type == Rows }; -static v8::Handle qmlsqldatabase_version(v8::Local property, const v8::AccessorInfo& info) +static v8::Handle qmlsqldatabase_version(v8::Local /* property */, const v8::AccessorInfo& info) { QV8SqlDatabaseResource *r = v8_resource_cast(info.This()); if (!r || r->type != QV8SqlDatabaseResource::Database) @@ -154,7 +154,7 @@ static v8::Handle qmlsqldatabase_version(v8::Local proper return r->engine->toString(r->version); } -static v8::Handle qmlsqldatabase_rows_length(v8::Local property, const v8::AccessorInfo& info) +static v8::Handle qmlsqldatabase_rows_length(v8::Local /* property */, const v8::AccessorInfo& info) { QV8SqlDatabaseResource *r = v8_resource_cast(info.This()); if (!r || r->type != QV8SqlDatabaseResource::Rows) @@ -172,7 +172,7 @@ static v8::Handle qmlsqldatabase_rows_length(v8::Local pr return v8::Integer::New(s); } -static v8::Handle qmlsqldatabase_rows_forwardOnly(v8::Local property, +static v8::Handle qmlsqldatabase_rows_forwardOnly(v8::Local /* property */, const v8::AccessorInfo& info) { QV8SqlDatabaseResource *r = v8_resource_cast(info.This()); @@ -182,7 +182,7 @@ static v8::Handle qmlsqldatabase_rows_forwardOnly(v8::Localquery.isForwardOnly()); } -static void qmlsqldatabase_rows_setForwardOnly(v8::Local property, +static void qmlsqldatabase_rows_setForwardOnly(v8::Local /* property */, v8::Local value, const v8::AccessorInfo& info) { @@ -568,7 +568,7 @@ void *qt_add_qmlsqldatabase(QV8Engine *engine) return (void *)new QDeclarativeSqlDatabaseData(engine); } -void qt_rem_qmlsqldatabase(QV8Engine *engine, void *d) +void qt_rem_qmlsqldatabase(QV8Engine * /* engine */, void *d) { QDeclarativeSqlDatabaseData *data = (QDeclarativeSqlDatabaseData *)d; delete data; diff --git a/src/declarative/qml/qdeclarativetypeloader_p.h b/src/declarative/qml/qdeclarativetypeloader_p.h index 349a9f8428..af1a2f731e 100644 --- a/src/declarative/qml/qdeclarativetypeloader_p.h +++ b/src/declarative/qml/qdeclarativetypeloader_p.h @@ -77,7 +77,8 @@ class QDeclarativeComponentPrivate; class QDeclarativeTypeData; class QDeclarativeDataLoader; -class Q_AUTOTEST_EXPORT QDeclarativeDataBlob : public QDeclarativeRefCount +// Exported for QtQuick1 +class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDataBlob : public QDeclarativeRefCount { public: enum Status { @@ -160,7 +161,8 @@ private: QList m_errors; }; -class Q_AUTOTEST_EXPORT QDeclarativeDataLoader : public QObject +// Exported for QtQuick1 +class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDataLoader : public QObject { Q_OBJECT public: @@ -184,7 +186,8 @@ private: NetworkReplies m_networkReplies; }; -class Q_AUTOTEST_EXPORT QDeclarativeTypeLoader : public QDeclarativeDataLoader +// Exported for QtQuick1 +class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeTypeLoader : public QDeclarativeDataLoader { Q_OBJECT public: diff --git a/src/declarative/qml/qdeclarativevaluetype_p.h b/src/declarative/qml/qdeclarativevaluetype_p.h index 03cb83fdad..41d5e7cb8f 100644 --- a/src/declarative/qml/qdeclarativevaluetype_p.h +++ b/src/declarative/qml/qdeclarativevaluetype_p.h @@ -105,7 +105,8 @@ private: QDeclarativeValueType *valueTypes[QVariant::UserType - 1]; }; -class Q_AUTOTEST_EXPORT QDeclarativePointFValueType : public QDeclarativeValueType +// Exported for QtQuick1 +class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativePointFValueType : public QDeclarativeValueType { Q_PROPERTY(qreal x READ x WRITE setX) Q_PROPERTY(qreal y READ y WRITE setY) @@ -129,7 +130,8 @@ private: QPointF point; }; -class Q_AUTOTEST_EXPORT QDeclarativePointValueType : public QDeclarativeValueType +// Exported for QtQuick1 +class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativePointValueType : public QDeclarativeValueType { Q_PROPERTY(int x READ x WRITE setX) Q_PROPERTY(int y READ y WRITE setY) @@ -153,7 +155,8 @@ private: QPoint point; }; -class Q_AUTOTEST_EXPORT QDeclarativeSizeFValueType : public QDeclarativeValueType +// Exported for QtQuick1 +class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeSizeFValueType : public QDeclarativeValueType { Q_PROPERTY(qreal width READ width WRITE setWidth) Q_PROPERTY(qreal height READ height WRITE setHeight) @@ -177,7 +180,8 @@ private: QSizeF size; }; -class Q_AUTOTEST_EXPORT QDeclarativeSizeValueType : public QDeclarativeValueType +// Exported for QtQuick1 +class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeSizeValueType : public QDeclarativeValueType { Q_PROPERTY(int width READ width WRITE setWidth) Q_PROPERTY(int height READ height WRITE setHeight) @@ -201,7 +205,8 @@ private: QSize size; }; -class Q_AUTOTEST_EXPORT QDeclarativeRectFValueType : public QDeclarativeValueType +// Exported for QtQuick1 +class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeRectFValueType : public QDeclarativeValueType { Q_PROPERTY(qreal x READ x WRITE setX) Q_PROPERTY(qreal y READ y WRITE setY) @@ -232,7 +237,8 @@ private: QRectF rect; }; -class Q_AUTOTEST_EXPORT QDeclarativeRectValueType : public QDeclarativeValueType +// Exported for QtQuick1 +class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeRectValueType : public QDeclarativeValueType { Q_PROPERTY(int x READ x WRITE setX) Q_PROPERTY(int y READ y WRITE setY) @@ -263,7 +269,7 @@ private: QRect rect; }; -class Q_AUTOTEST_EXPORT QDeclarativeVector2DValueType : public QDeclarativeValueType +class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeVector2DValueType : public QDeclarativeValueType { Q_PROPERTY(qreal x READ x WRITE setX) Q_PROPERTY(qreal y READ y WRITE setY) @@ -287,7 +293,7 @@ private: QVector2D vector; }; -class Q_AUTOTEST_EXPORT QDeclarativeVector3DValueType : public QDeclarativeValueType +class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeVector3DValueType : public QDeclarativeValueType { Q_PROPERTY(qreal x READ x WRITE setX) Q_PROPERTY(qreal y READ y WRITE setY) @@ -314,7 +320,7 @@ private: QVector3D vector; }; -class Q_AUTOTEST_EXPORT QDeclarativeVector4DValueType : public QDeclarativeValueType +class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeVector4DValueType : public QDeclarativeValueType { Q_PROPERTY(qreal x READ x WRITE setX) Q_PROPERTY(qreal y READ y WRITE setY) @@ -344,7 +350,7 @@ private: QVector4D vector; }; -class Q_AUTOTEST_EXPORT QDeclarativeQuaternionValueType : public QDeclarativeValueType +class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeQuaternionValueType : public QDeclarativeValueType { Q_PROPERTY(qreal scalar READ scalar WRITE setScalar) Q_PROPERTY(qreal x READ x WRITE setX) @@ -374,7 +380,7 @@ private: QQuaternion quaternion; }; -class Q_AUTOTEST_EXPORT QDeclarativeMatrix4x4ValueType : public QDeclarativeValueType +class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeMatrix4x4ValueType : public QDeclarativeValueType { Q_PROPERTY(qreal m11 READ m11 WRITE setM11) Q_PROPERTY(qreal m12 READ m12 WRITE setM12) @@ -441,7 +447,7 @@ private: QMatrix4x4 matrix; }; -class Q_AUTOTEST_EXPORT QDeclarativeEasingValueType : public QDeclarativeValueType +class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeEasingValueType : public QDeclarativeValueType { Q_OBJECT Q_ENUMS(Type) @@ -499,7 +505,7 @@ private: QEasingCurve easing; }; -class Q_AUTOTEST_EXPORT QDeclarativeFontValueType : public QDeclarativeValueType +class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeFontValueType : public QDeclarativeValueType { Q_OBJECT Q_ENUMS(FontWeight) @@ -582,7 +588,7 @@ private: mutable QDeclarativeNullableValue dpi; }; -class Q_AUTOTEST_EXPORT QDeclarativeColorValueType : public QDeclarativeValueType +class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeColorValueType : public QDeclarativeValueType { Q_PROPERTY(qreal r READ r WRITE setR) Q_PROPERTY(qreal g READ g WRITE setG) diff --git a/src/declarative/qml/qdeclarativexmlhttprequest.cpp b/src/declarative/qml/qdeclarativexmlhttprequest.cpp index 0eb923a70c..23f21c91e3 100644 --- a/src/declarative/qml/qdeclarativexmlhttprequest.cpp +++ b/src/declarative/qml/qdeclarativexmlhttprequest.cpp @@ -613,7 +613,7 @@ v8::Handle CharacterData::length(v8::Local, const v8::Acc QDeclarativeDOMNodeResource *r = v8_resource_cast(args.This()); if (!r) return v8::Undefined(); QV8Engine *engine = V8ENGINE(); - + Q_UNUSED(engine) return v8::Integer::New(r->d->data.length()); } @@ -637,7 +637,7 @@ v8::Handle Text::isElementContentWhitespace(v8::Local, co QDeclarativeDOMNodeResource *r = v8_resource_cast(args.This()); if (!r) return v8::Undefined(); QV8Engine *engine = V8ENGINE(); - + Q_UNUSED(engine) return v8::Boolean::New(r->d->data.trimmed().isEmpty()); } @@ -810,7 +810,7 @@ v8::Handle NamedNodeMap::length(v8::Local, const v8::Acce QDeclarativeDOMNodeResource *r = v8_resource_cast(args.This()); if (!r) return v8::Undefined(); QV8Engine *engine = V8ENGINE(); - + Q_UNUSED(engine) return v8::Integer::New(r->list->count()); } @@ -888,7 +888,7 @@ v8::Handle NodeList::length(v8::Local, const v8::Accessor QDeclarativeDOMNodeResource *r = v8_resource_cast(args.This()); if (!r) return v8::Undefined(); QV8Engine *engine = V8ENGINE(); - + Q_UNUSED(engine) return v8::Integer::New(r->d->children.count()); } @@ -931,7 +931,7 @@ v8::Handle Document::xmlStandalone(v8::Local, const v8::A QDeclarativeDOMNodeResource *r = v8_resource_cast(args.This()); if (!r || r->d->type != NodeImpl::Document) return v8::Undefined(); QV8Engine *engine = V8ENGINE(); - + Q_UNUSED(engine) return v8::Boolean::New(static_cast(r->d)->isStandalone); } @@ -1646,7 +1646,7 @@ static v8::Handle qmlxmlhttprequest_getAllResponseHeaders(const v8::A } // XMLHttpRequest properties -static v8::Handle qmlxmlhttprequest_readyState(v8::Local property, +static v8::Handle qmlxmlhttprequest_readyState(v8::Local /* property */, const v8::AccessorInfo& info) { QDeclarativeXMLHttpRequest *r = v8_resource_cast(info.This()); @@ -1656,7 +1656,7 @@ static v8::Handle qmlxmlhttprequest_readyState(v8::Local return v8::Integer::NewFromUnsigned(r->readyState()); } -static v8::Handle qmlxmlhttprequest_status(v8::Local property, +static v8::Handle qmlxmlhttprequest_status(v8::Local /* property */, const v8::AccessorInfo& info) { QDeclarativeXMLHttpRequest *r = v8_resource_cast(info.This()); @@ -1673,7 +1673,7 @@ static v8::Handle qmlxmlhttprequest_status(v8::Local prop return v8::Integer::New(r->replyStatus()); } -static v8::Handle qmlxmlhttprequest_statusText(v8::Local property, +static v8::Handle qmlxmlhttprequest_statusText(v8::Local /* property */, const v8::AccessorInfo& info) { QDeclarativeXMLHttpRequest *r = v8_resource_cast(info.This()); @@ -1692,7 +1692,7 @@ static v8::Handle qmlxmlhttprequest_statusText(v8::Local return engine->toString(r->replyStatusText()); } -static v8::Handle qmlxmlhttprequest_responseText(v8::Local property, +static v8::Handle qmlxmlhttprequest_responseText(v8::Local /* property */, const v8::AccessorInfo& info) { QDeclarativeXMLHttpRequest *r = v8_resource_cast(info.This()); @@ -1708,8 +1708,8 @@ static v8::Handle qmlxmlhttprequest_responseText(v8::LocaltoString(r->responseBody()); } -static v8::Handle qmlxmlhttprequest_responseXML(v8::Local property, - const v8::AccessorInfo& info) +static v8::Handle qmlxmlhttprequest_responseXML(v8::Local /* property */, + const v8::AccessorInfo& info) { QDeclarativeXMLHttpRequest *r = v8_resource_cast(info.This()); if (!r) @@ -1729,7 +1729,7 @@ static v8::Handle qmlxmlhttprequest_new(const v8::Arguments &args) if (args.IsConstructCall()) { QV8Engine *engine = V8ENGINE(); QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine->engine()); - + Q_UNUSED(ep) QDeclarativeXMLHttpRequest *r = new QDeclarativeXMLHttpRequest(engine, engine->networkAccessManager()); args.This()->SetExternalResource(r); @@ -1741,7 +1741,7 @@ static v8::Handle qmlxmlhttprequest_new(const v8::Arguments &args) #define NEWFUNCTION(function) v8::FunctionTemplate::New(function)->GetFunction() -void qt_rem_qmlxmlhttprequest(QV8Engine *engine, void *d) +void qt_rem_qmlxmlhttprequest(QV8Engine * /* engine */, void *d) { QDeclarativeXMLHttpRequestData *data = (QDeclarativeXMLHttpRequestData *)d; delete data; diff --git a/src/declarative/qml/v8/qv8qobjectwrapper.cpp b/src/declarative/qml/v8/qv8qobjectwrapper.cpp index 52e106494c..46494daf55 100644 --- a/src/declarative/qml/v8/qv8qobjectwrapper.cpp +++ b/src/declarative/qml/v8/qv8qobjectwrapper.cpp @@ -1018,8 +1018,9 @@ QPair QV8QObjectWrapper::ExtractQtMethod(QV8Engine *engine, v8:: return qMakePair((QObject *)0, -1); } -struct QV8QObjectConnectionList : public QObject, public QDeclarativeGuard +class QV8QObjectConnectionList : public QObject, public QDeclarativeGuard { +public: QV8QObjectConnectionList(QObject *object, QV8Engine *engine); ~QV8QObjectConnectionList(); diff --git a/src/declarative/qml/v8/qv8variantwrapper.cpp b/src/declarative/qml/v8/qv8variantwrapper.cpp index de4f0ce2d7..4b2acfc965 100644 --- a/src/declarative/qml/v8/qv8variantwrapper.cpp +++ b/src/declarative/qml/v8/qv8variantwrapper.cpp @@ -166,13 +166,13 @@ QVariant &QV8VariantWrapper::variantValue(v8::Handle value) return static_cast(r)->data; } -v8::Handle QV8VariantWrapper::Getter(v8::Local property, +v8::Handle QV8VariantWrapper::Getter(v8::Local /* property */, const v8::AccessorInfo &info) { return v8::Handle(); } -v8::Handle QV8VariantWrapper::Setter(v8::Local property, +v8::Handle QV8VariantWrapper::Setter(v8::Local /* property */, v8::Local value, const v8::AccessorInfo &info) { diff --git a/src/declarative/scenegraph/coreapi/qsgrenderer.cpp b/src/declarative/scenegraph/coreapi/qsgrenderer.cpp index 607c5b5b1f..0df00b56cb 100644 --- a/src/declarative/scenegraph/coreapi/qsgrenderer.cpp +++ b/src/declarative/scenegraph/coreapi/qsgrenderer.cpp @@ -600,7 +600,7 @@ static inline GLenum qt_drawTypeForPattern(QSGGeometry::DataPattern p) void QSGRenderer::draw(const QSGMaterialShader *shader, const QSGGeometry *g) { // ### remove before final release... - static bool use_vbo = !QApplication::arguments().contains("--no-vbo"); + static bool use_vbo = !QApplication::arguments().contains(QLatin1String("--no-vbo")); const void *vertexData; int vertexByteSize = g->vertexCount() * g->stride(); diff --git a/src/declarative/scenegraph/qsgdistancefieldglyphcache.cpp b/src/declarative/scenegraph/qsgdistancefieldglyphcache.cpp index 13fe62a27a..ec69a64c58 100644 --- a/src/declarative/scenegraph/qsgdistancefieldglyphcache.cpp +++ b/src/declarative/scenegraph/qsgdistancefieldglyphcache.cpp @@ -1178,7 +1178,7 @@ void QSGDistanceFieldGlyphCache::updateCache() glBindTexture(GL_TEXTURE_2D, m_textureData->texture); // ### Remove before final release - static bool cacheDistanceFields = QGuiApplication::arguments().contains("--cache-distance-fields"); + static bool cacheDistanceFields = QGuiApplication::arguments().contains(QLatin1String("--cache-distance-fields")); // #define QSGDISTANCEFIELDS_TIME_CREATION #ifdef QSGDISTANCEFIELDS_TIME_CREATION diff --git a/src/declarative/util/qdeclarativesmoothedanimation.cpp b/src/declarative/util/qdeclarativesmoothedanimation.cpp index f76531a5f7..d306f8ab2b 100644 --- a/src/declarative/util/qdeclarativesmoothedanimation.cpp +++ b/src/declarative/util/qdeclarativesmoothedanimation.cpp @@ -123,14 +123,14 @@ bool QSmoothedAnimation::recalc() sd = s; } else if (maximumEasingTime != -1 && tf > (maximumEasingTime / 1000.)) { qreal met = maximumEasingTime / 1000.; - // tp| |td - // vp_ _______ - // / \ - // vi_ / \ - // \ - // \ _ 0 - // |ta| |ta| - // + /* tp| |td + * vp_ _______ + * / \ + * vi_ / \ + * \ + * \ _ 0 + * |ta| |ta| + */ qreal ta = met / 2.; a = (s - (vi * tf - 0.5 * vi * ta)) / (tf * ta - ta * ta); -- cgit v1.2.3