diff options
Diffstat (limited to 'src')
7 files changed, 33 insertions, 8 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativelayoutitem.cpp b/src/declarative/graphicsitems/qdeclarativelayoutitem.cpp index 1bbdd97..c8ecbb6 100644 --- a/src/declarative/graphicsitems/qdeclarativelayoutitem.cpp +++ b/src/declarative/graphicsitems/qdeclarativelayoutitem.cpp @@ -50,7 +50,7 @@ QT_BEGIN_NAMESPACE /*! \qmlclass LayoutItem QDeclarativeLayoutItem \since 4.7 - \brief The LayoutItem element allows you to place your Fluid UI elements inside a classical Qt layout. + \brief The LayoutItem element allows you to place your declarative UI elements inside a classical Qt layout. LayoutItem is a variant of Item with a couple of additional properties. These properties provide the size hints needed for items to work in conjunction with Qt Layouts. The Qt Layout will resize the LayoutItem as appropriate, diff --git a/src/declarative/graphicsitems/qdeclarativerectangle.cpp b/src/declarative/graphicsitems/qdeclarativerectangle.cpp index ccabbde..d098aa0 100644 --- a/src/declarative/graphicsitems/qdeclarativerectangle.cpp +++ b/src/declarative/graphicsitems/qdeclarativerectangle.cpp @@ -380,7 +380,9 @@ void QDeclarativeRectangle::generateBorderedRect() key += d->pen->color().name() % QString::number(d->pen->color().alpha(), 16); if (!QPixmapCache::find(key, &d->rectImage)) { - d->rectImage = QPixmap(pw*2 + 3, pw*2 + 3); + // Adding 5 here makes qDrawBorderPixmap() paint correctly with smooth: true + // See QTBUG-7999 and QTBUG-10765 for more details. + d->rectImage = QPixmap(pw*2 + 5, pw*2 + 5); d->rectImage.fill(Qt::transparent); QPainter p(&(d->rectImage)); p.setRenderHint(QPainter::Antialiasing); diff --git a/src/declarative/qml/qdeclarativeinclude.cpp b/src/declarative/qml/qdeclarativeinclude.cpp index e37b68b..4cde54b 100644 --- a/src/declarative/qml/qdeclarativeinclude.cpp +++ b/src/declarative/qml/qdeclarativeinclude.cpp @@ -259,8 +259,6 @@ QScriptValue QDeclarativeInclude::worker_include(QScriptContext *ctxt, QScriptEn if (ctxt->argumentCount() == 0) return engine->undefinedValue(); - QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine); - QString urlString = ctxt->argument(0).toString(); QUrl url(ctxt->argument(0).toString()); if (url.isRelative()) { diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp index 1365cd7..de1c0cb 100644 --- a/src/declarative/util/qdeclarativeanimation.cpp +++ b/src/declarative/util/qdeclarativeanimation.cpp @@ -2543,7 +2543,6 @@ void QDeclarativeParentAnimation::transition(QDeclarativeStateActions &actions, QDeclarativeAction &yAction = pc->yIsSet() && i < actions.size()-1 ? actions[++i] : dummyAction; QDeclarativeAction &sAction = pc->scaleIsSet() && i < actions.size()-1 ? actions[++i] : dummyAction; QDeclarativeAction &rAction = pc->rotationIsSet() && i < actions.size()-1 ? actions[++i] : dummyAction; - bool forward = (direction == QDeclarativeAbstractAnimation::Forward); QDeclarativeItem *target = pc->object(); QDeclarativeItem *targetParent = action.reverseEvent ? pc->originalParent() : pc->parent(); diff --git a/src/declarative/util/qdeclarativelistmodel.cpp b/src/declarative/util/qdeclarativelistmodel.cpp index 9a5c9de..7518eb7 100644 --- a/src/declarative/util/qdeclarativelistmodel.cpp +++ b/src/declarative/util/qdeclarativelistmodel.cpp @@ -162,7 +162,7 @@ QDeclarativeListModelParser::ListInstruction *QDeclarativeListModelParser::ListM spacing: 5 Text { text: "Attributes:" } Repeater { - dataSource: attributes + model: attributes Component { Text { text: description } } } } diff --git a/src/declarative/util/qdeclarativexmllistmodel.cpp b/src/declarative/util/qdeclarativexmllistmodel.cpp index 4a374a5..cae1d3a 100644 --- a/src/declarative/util/qdeclarativexmllistmodel.cpp +++ b/src/declarative/util/qdeclarativexmllistmodel.cpp @@ -423,6 +423,7 @@ public: int highestRole; QNetworkReply *reply; QDeclarativeXmlListModel::Status status; + QString errorString; qreal progress; int queryId; QStringList keyRoleResultsCache; @@ -495,10 +496,11 @@ void QDeclarativeXmlListModelPrivate::clear_role(QDeclarativeListProperty<QDecla </rss> \endcode - Then it could be used to create the following model: + A XmlListModel could create a model from this data, like this: \qml XmlListModel { + id: xmlModel source: "http://www.mysite.com/feed.xml" query: "/rss/channel/item" XmlRole { name: "title"; query: "title/string()" } @@ -511,6 +513,16 @@ void QDeclarativeXmlListModelPrivate::clear_role(QDeclarativeListProperty<QDecla model item attributes; here, each model item will have \c title and \c pubDate attributes that match the \c title and \c pubDate values of its corresponding \c <item>. + The model could be used in a ListView, like this: + + \qml + ListView { + width: 180; height: 300 + model: xmlModel + delegate: Text { title + " (" + pubDate + ")" } + } + \endqml + \section2 Using key XML roles @@ -722,7 +734,8 @@ void QDeclarativeXmlListModel::setNamespaceDeclarations(const QString &declarati \o XmlListModel.Null - No XML data has been set for this model. \o XmlListModel.Ready - The XML data has been loaded into the model. \o XmlListModel.Loading - The model is in the process of reading and loading XML data. - \o XmlListModel.Error - An error occurred while the model was loading. + \o XmlListModel.Error - An error occurred while the model was loading. See errorString() for details + about the error. \endlist \sa progress @@ -755,6 +768,12 @@ qreal QDeclarativeXmlListModel::progress() const return d->progress; } +QString QDeclarativeXmlListModel::errorString() const +{ + Q_D(const QDeclarativeXmlListModel); + return d->errorString; +} + void QDeclarativeXmlListModel::classBegin() { Q_D(QDeclarativeXmlListModel); @@ -807,6 +826,7 @@ void QDeclarativeXmlListModel::reload() d->queryId = globalXmlQuery()->doQuery(d->query, d->namespaces, d->xml.toUtf8(), &d->roleObjects, d->keyRoleResultsCache); d->progress = 1.0; d->status = Loading; + d->errorString.clear(); emit progressChanged(d->progress); emit statusChanged(d->status); return; @@ -816,6 +836,7 @@ void QDeclarativeXmlListModel::reload() d->queryId = XMLLISTMODEL_CLEAR_ID; d->progress = 1.0; d->status = Loading; + d->errorString.clear(); emit progressChanged(d->progress); emit statusChanged(d->status); QTimer::singleShot(0, this, SLOT(dataCleared())); @@ -824,6 +845,7 @@ void QDeclarativeXmlListModel::reload() d->progress = 0.0; d->status = Loading; + d->errorString.clear(); emit progressChanged(d->progress); emit statusChanged(d->status); @@ -854,6 +876,7 @@ void QDeclarativeXmlListModel::requestFinished() d->redirectCount = 0; if (d->reply->error() != QNetworkReply::NoError) { + d->errorString = d->reply->errorString(); disconnect(d->reply, 0, this, 0); d->reply->deleteLater(); d->reply = 0; @@ -919,6 +942,7 @@ void QDeclarativeXmlListModel::queryCompleted(const QDeclarativeXmlQueryResult & d->data = result.data; d->keyRoleResultsCache = result.keyRoleResultsCache; d->status = Ready; + d->errorString.clear(); d->queryId = -1; bool hasKeys = false; diff --git a/src/declarative/util/qdeclarativexmllistmodel_p.h b/src/declarative/util/qdeclarativexmllistmodel_p.h index 7b85476..7101c57 100644 --- a/src/declarative/util/qdeclarativexmllistmodel_p.h +++ b/src/declarative/util/qdeclarativexmllistmodel_p.h @@ -113,6 +113,8 @@ public: Status status() const; qreal progress() const; + Q_INVOKABLE QString errorString() const; + virtual void classBegin(); virtual void componentComplete(); |