diff options
Diffstat (limited to 'src/declarative')
-rw-r--r-- | src/declarative/debugger/qdeclarativedebug.cpp | 2 | ||||
-rw-r--r-- | src/declarative/declarative.pro | 9 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativeflickable.cpp | 69 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativetext.cpp | 23 | ||||
-rw-r--r-- | src/declarative/qml/parser/qdeclarativejsengine_p.h | 6 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativeengine.cpp | 32 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativesqldatabase.cpp | 8 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativestringconverters.cpp | 2 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativeworkerscript.cpp | 2 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativexmlhttprequest.cpp | 23 | ||||
-rw-r--r-- | src/declarative/util/qdeclarativeanimation.cpp | 4 | ||||
-rw-r--r-- | src/declarative/util/qdeclarativeanimation_p_p.h | 3 | ||||
-rw-r--r-- | src/declarative/util/qdeclarativelistmodel.cpp | 6 | ||||
-rw-r--r-- | src/declarative/util/qdeclarativeview.cpp | 17 | ||||
-rw-r--r-- | src/declarative/util/qdeclarativexmllistmodel.cpp | 2 |
15 files changed, 93 insertions, 115 deletions
diff --git a/src/declarative/debugger/qdeclarativedebug.cpp b/src/declarative/debugger/qdeclarativedebug.cpp index bf4aec5..62eb8fe 100644 --- a/src/declarative/debugger/qdeclarativedebug.cpp +++ b/src/declarative/debugger/qdeclarativedebug.cpp @@ -210,7 +210,7 @@ void QDeclarativeEngineDebugPrivate::decode(QDataStream &ds, QDeclarativeDebugOb { QDeclarativeDebugObjectReference obj; obj.m_debugId = prop.m_value.toInt(); - prop.m_value = qVariantFromValue(obj); + prop.m_value = QVariant::fromValue(obj); break; } case QDeclarativeEngineDebugServer::QDeclarativeObjectProperty::Unknown: diff --git a/src/declarative/declarative.pro b/src/declarative/declarative.pro index 1ad888b..6bd314f 100644 --- a/src/declarative/declarative.pro +++ b/src/declarative/declarative.pro @@ -6,7 +6,7 @@ DEFINES += QT_BUILD_DECLARATIVE_LIB QT_NO_URL_CAST_FROM_STRING win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x66000000 solaris-cc*:QMAKE_CXXFLAGS_RELEASE -= -O2 -unix:QMAKE_PKGCONFIG_REQUIRES = QtCore QtGui +unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES = QtCore QtGui exists("qdeclarative_enable_gcov") { QMAKE_CXXFLAGS = -fprofile-arcs -ftest-coverage -fno-elide-constructors @@ -27,6 +27,13 @@ include(debugger/debugger.pri) symbian: { TARGET.UID3=0x2001E623 LIBS += -lefsrv + + contains(QT_CONFIG, freetype) { + DEFINES += QT_NO_FONTCONFIG + INCLUDEPATH += \ + ../3rdparty/freetype/src \ + ../3rdparty/freetype/include + } } DEFINES += QT_NO_OPENTYPE diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp index 91230c0..1f1b39a 100644 --- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp +++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp @@ -1114,71 +1114,50 @@ void QDeclarativeFlickablePrivate::data_append(QDeclarativeListProperty<QObject> } } -static inline int children_count_helper(QGraphicsObject *object) +int QDeclarativeFlickablePrivate::data_count(QDeclarativeListProperty<QObject> *property) { - QGraphicsItemPrivate *d = QGraphicsItemPrivate::get(object); - return d->children.count(); + QDeclarativeItem *contentItem= static_cast<QDeclarativeFlickablePrivate*>(property->data)->contentItem; + return contentItem->childItems().count() + contentItem->children().count(); } -static inline QObject *children_at_helper(QGraphicsObject *object, int index) +QObject *QDeclarativeFlickablePrivate::data_at(QDeclarativeListProperty<QObject> *property, int index) { - QGraphicsItemPrivate *d = QGraphicsItemPrivate::get(object); - if (index >= 0 && index < d->children.count()) - return d->children.at(index)->toGraphicsObject(); - else + QDeclarativeItem *contentItem = static_cast<QDeclarativeFlickablePrivate*>(property->data)->contentItem; + + int childItemCount = contentItem->childItems().count(); + + if (index < 0) return 0; -} -static inline void children_clear_helper(QGraphicsObject *object) -{ - QGraphicsItemPrivate *d = QGraphicsItemPrivate::get(object); - int childCount = d->children.count(); - if (static_cast<QDeclarativeItemPrivate*>(d)->componentComplete) { - for (int index = 0 ;index < childCount; index++) { - d->children.at(0)->setParentItem(0); - } + if (index < childItemCount) { + return contentItem->childItems().at(index)->toGraphicsObject(); } else { - for (int index = 0 ;index < childCount; index++) { - QGraphicsItemPrivate::get(d->children.at(0))->setParentItemHelper(0, /*newParentVariant=*/0, /*thisPointerVariant=*/0); - } + return contentItem->children().at(index - childItemCount); } + return 0; } -int QDeclarativeFlickablePrivate::data_count(QDeclarativeListProperty<QObject> *prop) +void QDeclarativeFlickablePrivate::data_clear(QDeclarativeListProperty<QObject> *property) { - return QDeclarativeItemPrivate::resources_count(prop) + - children_count_helper(static_cast<QDeclarativeFlickablePrivate*>(prop->data)->contentItem); -} + QDeclarativeItem *contentItem = static_cast<QDeclarativeFlickablePrivate*>(property->data)->contentItem; -QObject *QDeclarativeFlickablePrivate::data_at(QDeclarativeListProperty<QObject> *prop, int i) -{ - int resourcesCount = QDeclarativeItemPrivate::resources_count(prop); - if (i < resourcesCount) - return QDeclarativeItemPrivate::resources_at(prop, i); - const int j = i - resourcesCount; - QGraphicsObject *contentObject = static_cast<QDeclarativeFlickablePrivate*>(prop->data)->contentItem; - if (j < children_count_helper(contentObject)) - return children_at_helper(contentObject, j); - return 0; -} + const QList<QGraphicsItem*> graphicsItems = contentItem->childItems(); + for (int i = 0; i < graphicsItems.count(); i++) + contentItem->scene()->removeItem(graphicsItems[i]); -void QDeclarativeFlickablePrivate::data_clear(QDeclarativeListProperty<QObject> *prop) -{ - QDeclarativeItemPrivate::resources_clear(prop); - QGraphicsObject *contentObject = - static_cast<QDeclarativeFlickablePrivate*>(prop->data)->contentItem; - children_clear_helper(contentObject); + const QList<QObject*> objects = contentItem->children(); + for (int i = 0; i < objects.count(); i++) + objects[i]->setParent(0); } QDeclarativeListProperty<QObject> QDeclarativeFlickable::flickableData() { Q_D(QDeclarativeFlickable); return QDeclarativeListProperty<QObject>(this, (void *)d, QDeclarativeFlickablePrivate::data_append, - QDeclarativeFlickablePrivate::data_count, - QDeclarativeFlickablePrivate::data_at, - QDeclarativeFlickablePrivate::data_clear - ); + QDeclarativeFlickablePrivate::data_count, + QDeclarativeFlickablePrivate::data_at, + QDeclarativeFlickablePrivate::data_clear); } QDeclarativeListProperty<QGraphicsObject> QDeclarativeFlickable::flickableChildren() diff --git a/src/declarative/graphicsitems/qdeclarativetext.cpp b/src/declarative/graphicsitems/qdeclarativetext.cpp index 049169e..559d061 100644 --- a/src/declarative/graphicsitems/qdeclarativetext.cpp +++ b/src/declarative/graphicsitems/qdeclarativetext.cpp @@ -41,7 +41,6 @@ #include "private/qdeclarativetext_p.h" #include "private/qdeclarativetext_p_p.h" -#include <private/qtextdocumentlayout_p.h> #include <qdeclarativestyledtext_p.h> #include <qdeclarativeinfo.h> #include <qdeclarativepixmapcache_p.h> @@ -84,14 +83,6 @@ private: static QSet<QUrl> errors; }; -class QDeclarativeTextDocumentLayout : public QTextDocumentLayout -{ - Q_OBJECT -public: - QDeclarativeTextDocumentLayout(QTextDocument *doc); - void setLineHeight(qreal lineHeight, QDeclarativeText::LineHeightMode mode); -}; - DEFINE_BOOL_CONFIG_OPTION(enableImageCache, QML_ENABLE_TEXT_IMAGE_CACHE); QString QDeclarativeTextPrivate::elideChar = QString(0x2026); @@ -186,15 +177,6 @@ void QTextDocumentWithImageResources::setText(const QString &text) QSet<QUrl> QTextDocumentWithImageResources::errors; -QDeclarativeTextDocumentLayout::QDeclarativeTextDocumentLayout(QTextDocument *doc) - : QTextDocumentLayout(doc) { -} - -void QDeclarativeTextDocumentLayout::setLineHeight(qreal lineHeight, QDeclarativeText::LineHeightMode mode = QDeclarativeText::ProportionalHeight) -{ - QTextDocumentLayout::setLineHeight(lineHeight, QTextDocumentLayout::LineHeightMode(mode)); -} - QDeclarativeTextPrivate::~QDeclarativeTextPrivate() { } @@ -240,11 +222,6 @@ void QDeclarativeTextPrivate::updateLayout() singleline = false; QDeclarativeStyledText::parse(text, layout); } - } else { - ensureDoc(); - QDeclarativeTextDocumentLayout *layout = new QDeclarativeTextDocumentLayout(doc); - layout->setLineHeight(lineHeight, lineHeightMode); - doc->setDocumentLayout(layout); } updateSize(); diff --git a/src/declarative/qml/parser/qdeclarativejsengine_p.h b/src/declarative/qml/parser/qdeclarativejsengine_p.h index 6c18b50..cacc961 100644 --- a/src/declarative/qml/parser/qdeclarativejsengine_p.h +++ b/src/declarative/qml/parser/qdeclarativejsengine_p.h @@ -88,12 +88,6 @@ uint qHash(const QDeclarativeJS::NameId &id); } // end of namespace QDeclarativeJS -#if defined(Q_CC_MSVC) && _MSC_VER <= 1300 -//this ensures that code outside QDeclarativeJS can use the hash function -//it also a workaround for some compilers -inline uint qHash(const QDeclarativeJS::NameId &nameId) { return QDeclarativeJS::qHash(nameId); } -#endif - namespace QDeclarativeJS { class Lexer; diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index 854d910..b7a02f1 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -1434,7 +1434,7 @@ QScriptValue QDeclarativeEnginePrivate::vector3d(QScriptContext *ctxt, QScriptEn qsreal x = ctxt->argument(0).toNumber(); qsreal y = ctxt->argument(1).toNumber(); qsreal z = ctxt->argument(2).toNumber(); - return QDeclarativeEnginePrivate::get(engine)->scriptValueFromVariant(qVariantFromValue(QVector3D(x, y, z))); + return QDeclarativeEnginePrivate::get(engine)->scriptValueFromVariant(QVariant::fromValue(QVector3D(x, y, z))); } /*! @@ -1464,14 +1464,14 @@ QScriptValue QDeclarativeEnginePrivate::formatDate(QScriptContext*ctxt, QScriptE QScriptValue formatArg = ctxt->argument(1); if (formatArg.isString()) { QString format = formatArg.toString(); - return engine->newVariant(qVariantFromValue(date.toString(format))); + return engine->newVariant(QVariant::fromValue(date.toString(format))); } else if (formatArg.isNumber()) { enumFormat = Qt::DateFormat(formatArg.toUInt32()); } else { return ctxt->throwError(QLatin1String("Qt.formatDate(): Invalid date format")); } } - return engine->newVariant(qVariantFromValue(date.toString(enumFormat))); + return engine->newVariant(QVariant::fromValue(date.toString(enumFormat))); } /*! @@ -1505,14 +1505,14 @@ QScriptValue QDeclarativeEnginePrivate::formatTime(QScriptContext*ctxt, QScriptE QScriptValue formatArg = ctxt->argument(1); if (formatArg.isString()) { QString format = formatArg.toString(); - return engine->newVariant(qVariantFromValue(time.toString(format))); + return engine->newVariant(QVariant::fromValue(time.toString(format))); } else if (formatArg.isNumber()) { enumFormat = Qt::DateFormat(formatArg.toUInt32()); } else { return ctxt->throwError(QLatin1String("Qt.formatTime(): Invalid time format")); } } - return engine->newVariant(qVariantFromValue(time.toString(enumFormat))); + return engine->newVariant(QVariant::fromValue(time.toString(enumFormat))); } /*! @@ -1615,14 +1615,14 @@ QScriptValue QDeclarativeEnginePrivate::formatDateTime(QScriptContext*ctxt, QScr QScriptValue formatArg = ctxt->argument(1); if (formatArg.isString()) { QString format = formatArg.toString(); - return engine->newVariant(qVariantFromValue(date.toString(format))); + return engine->newVariant(QVariant::fromValue(date.toString(format))); } else if (formatArg.isNumber()) { enumFormat = Qt::DateFormat(formatArg.toUInt32()); } else { return ctxt->throwError(QLatin1String("Qt.formatDateTime(): Invalid datetime format")); } } - return engine->newVariant(qVariantFromValue(date.toString(enumFormat))); + return engine->newVariant(QVariant::fromValue(date.toString(enumFormat))); } #endif // QT_NO_DATESTRING @@ -1651,7 +1651,7 @@ QScriptValue QDeclarativeEnginePrivate::rgba(QScriptContext *ctxt, QScriptEngine if (a < 0.0) a=0.0; if (a > 1.0) a=1.0; - return qScriptValueFromValue(engine, qVariantFromValue(QColor::fromRgbF(r, g, b, a))); + return engine->toScriptValue(QVariant::fromValue(QColor::fromRgbF(r, g, b, a))); } /*! @@ -1679,7 +1679,7 @@ QScriptValue QDeclarativeEnginePrivate::hsla(QScriptContext *ctxt, QScriptEngine if (a < 0.0) a=0.0; if (a > 1.0) a=1.0; - return qScriptValueFromValue(engine, qVariantFromValue(QColor::fromHslF(h, s, l, a))); + return engine->toScriptValue(QVariant::fromValue(QColor::fromHslF(h, s, l, a))); } /*! @@ -1702,7 +1702,7 @@ QScriptValue QDeclarativeEnginePrivate::rect(QScriptContext *ctxt, QScriptEngine if (w < 0 || h < 0) return engine->nullValue(); - return QDeclarativeEnginePrivate::get(engine)->scriptValueFromVariant(qVariantFromValue(QRectF(x, y, w, h))); + return QDeclarativeEnginePrivate::get(engine)->scriptValueFromVariant(QVariant::fromValue(QRectF(x, y, w, h))); } /*! @@ -1715,7 +1715,7 @@ QScriptValue QDeclarativeEnginePrivate::point(QScriptContext *ctxt, QScriptEngin return ctxt->throwError(QLatin1String("Qt.point(): Invalid arguments")); qsreal x = ctxt->argument(0).toNumber(); qsreal y = ctxt->argument(1).toNumber(); - return QDeclarativeEnginePrivate::get(engine)->scriptValueFromVariant(qVariantFromValue(QPointF(x, y))); + return QDeclarativeEnginePrivate::get(engine)->scriptValueFromVariant(QVariant::fromValue(QPointF(x, y))); } /*! @@ -1728,7 +1728,7 @@ QScriptValue QDeclarativeEnginePrivate::size(QScriptContext *ctxt, QScriptEngine return ctxt->throwError(QLatin1String("Qt.size(): Invalid arguments")); qsreal w = ctxt->argument(0).toNumber(); qsreal h = ctxt->argument(1).toNumber(); - return QDeclarativeEnginePrivate::get(engine)->scriptValueFromVariant(qVariantFromValue(QSizeF(w, h))); + return QDeclarativeEnginePrivate::get(engine)->scriptValueFromVariant(QVariant::fromValue(QSizeF(w, h))); } /*! @@ -1764,7 +1764,7 @@ QScriptValue QDeclarativeEnginePrivate::lighter(QScriptContext *ctxt, QScriptEng if (ctxt->argumentCount() == 2) factor = ctxt->argument(1).toNumber(); color = color.lighter(int(qRound(factor*100.))); - return qScriptValueFromValue(engine, qVariantFromValue(color)); + return engine->toScriptValue(QVariant::fromValue(color)); } /*! @@ -1801,7 +1801,7 @@ QScriptValue QDeclarativeEnginePrivate::darker(QScriptContext *ctxt, QScriptEngi if (ctxt->argumentCount() == 2) factor = ctxt->argument(1).toNumber(); color = color.darker(int(qRound(factor*100.))); - return qScriptValueFromValue(engine, qVariantFromValue(color)); + return engine->toScriptValue(QVariant::fromValue(color)); } /*! @@ -2051,7 +2051,7 @@ QScriptValue QDeclarativeEnginePrivate::tint(QScriptContext *ctxt, QScriptEngine a + inv_a * color.alphaF()); } - return qScriptValueFromValue(engine, qVariantFromValue(finalColor)); + return engine->toScriptValue(QVariant::fromValue(finalColor)); } QScriptValue QDeclarativeEnginePrivate::scriptValueFromVariant(const QVariant &val) @@ -2081,7 +2081,7 @@ QScriptValue QDeclarativeEnginePrivate::scriptValueFromVariant(const QVariant &v if (objOk) { return objectClass->newQObject(obj); } else { - return qScriptValueFromValue(&scriptEngine, val); + return scriptEngine.toScriptValue(val); } } diff --git a/src/declarative/qml/qdeclarativesqldatabase.cpp b/src/declarative/qml/qdeclarativesqldatabase.cpp index 8845b75..207fb57 100644 --- a/src/declarative/qml/qdeclarativesqldatabase.cpp +++ b/src/declarative/qml/qdeclarativesqldatabase.cpp @@ -244,7 +244,7 @@ static QScriptValue qmlsqldatabase_executeSql(QScriptContext *context, QScriptEn if (!qmlengine->sqlQueryClass) qmlengine->sqlQueryClass = new QDeclarativeSqlQueryScriptClass(engine); QScriptValue rows = engine->newObject(qmlengine->sqlQueryClass); - rows.setData(engine->newVariant(qVariantFromValue(query))); + rows.setData(engine->newVariant(QVariant::fromValue(query))); rows.setProperty(QLatin1String("item"), engine->newFunction(qmlsqldatabase_item,1), QScriptValue::SkipInEnumeration); result.setProperty(QLatin1String("rows"),rows); result.setProperty(QLatin1String("rowsAffected"),query.numRowsAffected()); @@ -282,7 +282,7 @@ static QScriptValue qmlsqldatabase_change_version(QScriptContext *context, QScri QScriptValue instance = engine->newObject(); instance.setProperty(QLatin1String("executeSql"), engine->newFunction(qmlsqldatabase_executeSql,1)); - QScriptValue tx = engine->newVariant(instance,qVariantFromValue(db)); + QScriptValue tx = engine->newVariant(instance,QVariant::fromValue(db)); QString foundvers = context->thisObject().property(QLatin1String("version")).toString(); if (from_version!=foundvers) { @@ -326,7 +326,7 @@ static QScriptValue qmlsqldatabase_transaction_shared(QScriptContext *context, Q QScriptValue instance = engine->newObject(); instance.setProperty(QLatin1String("executeSql"), engine->newFunction(readOnly ? qmlsqldatabase_executeSql_readonly : qmlsqldatabase_executeSql,1)); - QScriptValue tx = engine->newVariant(instance,qVariantFromValue(db)); + QScriptValue tx = engine->newVariant(instance,QVariant::fromValue(db)); db.transaction(); callback.call(QScriptValue(), QScriptValueList() << tx); @@ -411,7 +411,7 @@ static QScriptValue qmlsqldatabase_open_sync(QScriptContext *context, QScriptEng instance.setProperty(QLatin1String("version"), version, QScriptValue::ReadOnly); instance.setProperty(QLatin1String("changeVersion"), engine->newFunction(qmlsqldatabase_change_version,3)); - QScriptValue result = engine->newVariant(instance,qVariantFromValue(database)); + QScriptValue result = engine->newVariant(instance,QVariant::fromValue(database)); if (created && dbcreationCallback.isFunction()) { dbcreationCallback.call(QScriptValue(), QScriptValueList() << result); diff --git a/src/declarative/qml/qdeclarativestringconverters.cpp b/src/declarative/qml/qdeclarativestringconverters.cpp index f11aa4c..aa1de43 100644 --- a/src/declarative/qml/qdeclarativestringconverters.cpp +++ b/src/declarative/qml/qdeclarativestringconverters.cpp @@ -92,7 +92,7 @@ QVariant QDeclarativeStringConverters::variantFromString(const QString &s) QSizeF sz = sizeFFromString(s, &ok); if (ok) return QVariant(sz); QVector3D v = vector3DFromString(s, &ok); - if (ok) return qVariantFromValue(v); + if (ok) return QVariant::fromValue(v); return QVariant(s); } diff --git a/src/declarative/qml/qdeclarativeworkerscript.cpp b/src/declarative/qml/qdeclarativeworkerscript.cpp index f8d52b5..2e8ab18 100644 --- a/src/declarative/qml/qdeclarativeworkerscript.cpp +++ b/src/declarative/qml/qdeclarativeworkerscript.cpp @@ -384,7 +384,7 @@ QVariant QDeclarativeWorkerScriptEnginePrivate::scriptValueToVariant(const QScri QDeclarativeListModelWorkerAgent *agent = lm->agent(); if (agent) { QDeclarativeListModelWorkerAgent::VariantRef v(agent); - return qVariantFromValue(v); + return QVariant::fromValue(v); } else { return QVariant(); } diff --git a/src/declarative/qml/qdeclarativexmlhttprequest.cpp b/src/declarative/qml/qdeclarativexmlhttprequest.cpp index 1fc41c1..aefc896 100644 --- a/src/declarative/qml/qdeclarativexmlhttprequest.cpp +++ b/src/declarative/qml/qdeclarativexmlhttprequest.cpp @@ -58,6 +58,8 @@ #include <QtCore/qstack.h> #include <QtCore/qdebug.h> +#include <QtCore/QStringBuilder> + #ifndef QT_NO_XMLSTREAMREADER // From DOM-Level-3-Core spec @@ -510,7 +512,7 @@ QScriptValue Node::create(QScriptEngine *engine, NodeImpl *data) node.d = data; if (data) A(data); - return engine->newVariant(instance, qVariantFromValue(node)); + return engine->newVariant(instance, QVariant::fromValue(node)); } QScriptValue Element::prototype(QScriptEngine *engine) @@ -710,7 +712,7 @@ QScriptValue Document::load(QScriptEngine *engine, const QByteArray &data) instance.setPrototype(Document::prototype(engine)); Node documentNode; documentNode.d = document; - return engine->newVariant(instance, qVariantFromValue(documentNode)); + return engine->newVariant(instance, QVariant::fromValue(documentNode)); } Node::Node() @@ -761,7 +763,7 @@ QScriptValue NamedNodeMap::create(QScriptEngine *engine, NodeImpl *data, QList<N map.list = list; if (data) A(data); - instance.setData(engine->newVariant(qVariantFromValue(map))); + instance.setData(engine->newVariant(QVariant::fromValue(map))); if (!QDeclarativeScriptEngine::get(engine)->namedNodeMapClass) QDeclarativeScriptEngine::get(engine)->namedNodeMapClass= new NamedNodeMapClass(engine); @@ -818,7 +820,7 @@ QScriptValue NodeList::create(QScriptEngine *engine, NodeImpl *data) list.d = data; if (data) A(data); - instance.setData(engine->newVariant(qVariantFromValue(list))); + instance.setData(engine->newVariant(QVariant::fromValue(list))); if (!QDeclarativeScriptEngine::get(engine)->nodeListClass) QDeclarativeScriptEngine::get(engine)->nodeListClass= new NodeListClass(engine); @@ -1090,10 +1092,9 @@ QString QDeclarativeXMLHttpRequest::headers() foreach (const HeaderPair &header, m_headersList) { if (ret.length()) - ret.append(QString::fromUtf8("\r\n")); - ret.append(QString::fromUtf8(header.first)); - ret.append(QString::fromUtf8(": ")); - ret.append(QString::fromUtf8(header.second)); + ret.append(QLatin1String("\r\n")); + ret = ret % QString::fromUtf8(header.first) % QLatin1String(": ") + % QString::fromUtf8(header.second); } return ret; } @@ -1105,9 +1106,9 @@ void QDeclarativeXMLHttpRequest::fillHeadersList() m_headersList.clear(); foreach (const QByteArray &header, headerList) { HeaderPair pair (header.toLower(), m_network->rawHeader(header)); - if (pair.first == "set-cookie" || - pair.first == "set-cookie2") - continue; + if (pair.first == "set-cookie" || + pair.first == "set-cookie2") + continue; m_headersList << pair; } diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp index ac9c3c0..dc6d524 100644 --- a/src/declarative/util/qdeclarativeanimation.cpp +++ b/src/declarative/util/qdeclarativeanimation.cpp @@ -2939,4 +2939,8 @@ void QDeclarativeAnchorAnimation::transition(QDeclarativeStateActions &actions, } } +QDeclarativeScriptActionPrivate::QDeclarativeScriptActionPrivate() + : QDeclarativeAbstractAnimationPrivate(), hasRunScriptScript(false), reversing(false), proxy(this), rsa(0) {} + + QT_END_NAMESPACE diff --git a/src/declarative/util/qdeclarativeanimation_p_p.h b/src/declarative/util/qdeclarativeanimation_p_p.h index 3c41565..048ecb1 100644 --- a/src/declarative/util/qdeclarativeanimation_p_p.h +++ b/src/declarative/util/qdeclarativeanimation_p_p.h @@ -248,8 +248,7 @@ class QDeclarativeScriptActionPrivate : public QDeclarativeAbstractAnimationPriv { Q_DECLARE_PUBLIC(QDeclarativeScriptAction) public: - QDeclarativeScriptActionPrivate() - : QDeclarativeAbstractAnimationPrivate(), hasRunScriptScript(false), reversing(false), proxy(this), rsa(0) {} + QDeclarativeScriptActionPrivate(); void init(); diff --git a/src/declarative/util/qdeclarativelistmodel.cpp b/src/declarative/util/qdeclarativelistmodel.cpp index 9332de4..80b52fd 100644 --- a/src/declarative/util/qdeclarativelistmodel.cpp +++ b/src/declarative/util/qdeclarativelistmodel.cpp @@ -801,7 +801,7 @@ void QDeclarativeListModelParser::setCustomData(QObject *obj, const QByteArray & { ModelNode *n = nodes.top(); ModelNode *n2 = new ModelNode(rv->m_nested); - n->values << qVariantFromValue(n2); + n->values << QVariant::fromValue(n2); nodes.push(n2); if (processingSet) n->isArray = true; @@ -1328,7 +1328,7 @@ bool NestedListModel::insert(int index, const QScriptValue& valuemap) ModelNode *mn = new ModelNode(this); mn->listIndex = index; mn->setObjectValue(valuemap); - _root->values.insert(index,qVariantFromValue(mn)); + _root->values.insert(index,QVariant::fromValue(mn)); return true; } @@ -1508,7 +1508,7 @@ void ModelNode::setListValue(const QScriptValue& valuelist) { value->listIndex = i; value->values << v.toVariant(); } - values.append(qVariantFromValue(value)); + values.append(QVariant::fromValue(value)); } } diff --git a/src/declarative/util/qdeclarativeview.cpp b/src/declarative/util/qdeclarativeview.cpp index c2e5efe..99c29d5 100644 --- a/src/declarative/util/qdeclarativeview.cpp +++ b/src/declarative/util/qdeclarativeview.cpp @@ -713,6 +713,23 @@ void QDeclarativeView::paintEvent(QPaintEvent *event) if (frameRateDebug()) qDebug() << "paintEvent:" << d->frameTimer.elapsed() << "time since last frame:" << time; + +#if QT_SHOW_DECLARATIVEVIEW_FPS + static QTime timer; + static int frames; + + if (frames == 0) { + timer.start(); + } else if (timer.elapsed() > 5000) { + qreal avgtime = timer.elapsed() / (qreal) frames; + qDebug("Average time per frame: %f ms (%i fps)", avgtime, int(1000 / avgtime)); + timer.start(); + frames = 0; + } + ++frames; + scene()->update(); +#endif + } QT_END_NAMESPACE diff --git a/src/declarative/util/qdeclarativexmllistmodel.cpp b/src/declarative/util/qdeclarativexmllistmodel.cpp index 5af53e6..d5c7d1b 100644 --- a/src/declarative/util/qdeclarativexmllistmodel.cpp +++ b/src/declarative/util/qdeclarativexmllistmodel.cpp @@ -801,7 +801,7 @@ QScriptValue QDeclarativeXmlListModel::get(int index) const QScriptValue sv = sengine->newObject(); for (int i=0; i<d->roleObjects.count(); i++) - sv.setProperty(d->roleObjects[i]->name(), qScriptValueFromValue(sengine, d->data.value(i).value(index))); + sv.setProperty(d->roleObjects[i]->name(), sengine->toScriptValue(d->data.value(i).value(index))); return sv; } |