diff options
author | Andrew den Exter <andrew.den-exter@nokia.com> | 2011-06-24 14:09:46 +1000 |
---|---|---|
committer | Andrew den Exter <andrew.den-exter@nokia.com> | 2011-06-24 14:14:03 +1000 |
commit | 024c2942338efd02f9464ed1eebc75f941cddc90 (patch) | |
tree | b444ac84a5a047bf59465728f3e8ad45d0072f91 | |
parent | 6e47798a7c4b7c603a7699afe02083b7c169aefb (diff) |
Add a javascript accessor for items in a visual item model.
Rework visualdatamodel example to use a repositioned delegate from the
model as the composer instead of an item created elsewhere.
-rw-r--r-- | examples/declarative/dragtarget/launcher/IconDelegate.qml | 2 | ||||
-rw-r--r-- | examples/declarative/dragtarget/launcher/launcher.qml | 10 | ||||
-rw-r--r-- | examples/declarative/modelviews/visualdatamodel/Bubble.qml | 183 | ||||
-rw-r--r-- | examples/declarative/modelviews/visualdatamodel/ComposerBubble.qml | 144 | ||||
-rw-r--r-- | examples/declarative/modelviews/visualdatamodel/visualdatamodel.qml | 89 | ||||
-rw-r--r-- | src/declarative/items/qsggridview.cpp | 2 | ||||
-rw-r--r-- | src/declarative/items/qsglistview.cpp | 2 | ||||
-rw-r--r-- | src/declarative/items/qsgpathview.cpp | 2 | ||||
-rw-r--r-- | src/declarative/items/qsgrepeater.cpp | 2 | ||||
-rw-r--r-- | src/declarative/items/qsgvisualitemmodel.cpp | 68 | ||||
-rw-r--r-- | src/declarative/items/qsgvisualitemmodel_p.h | 14 | ||||
-rw-r--r-- | src/declarative/particles/qsgmodelparticle.cpp | 2 | ||||
-rw-r--r-- | src/declarative/util/qdeclarativelistcompositor.cpp | 7 |
13 files changed, 196 insertions, 331 deletions
diff --git a/examples/declarative/dragtarget/launcher/IconDelegate.qml b/examples/declarative/dragtarget/launcher/IconDelegate.qml index ce90f2a68e..e8df365fe8 100644 --- a/examples/declarative/dragtarget/launcher/IconDelegate.qml +++ b/examples/declarative/dragtarget/launcher/IconDelegate.qml @@ -24,7 +24,7 @@ Item { anchors { horizontalCenter: parent.horizontalCenter; verticalCenter: parent.verticalCenter } drag.target: dragArea - drag.data: iconDelegate.VisualModel.index + drag.data: iconDelegate.VisualDataModel.index Binding { target: dragArea diff --git a/examples/declarative/dragtarget/launcher/launcher.qml b/examples/declarative/dragtarget/launcher/launcher.qml index d7ec46f0d3..d3233c937e 100644 --- a/examples/declarative/dragtarget/launcher/launcher.qml +++ b/examples/declarative/dragtarget/launcher/launcher.qml @@ -58,13 +58,12 @@ Rectangle { onEntered: { sourceIndex = drag.data - destinationIndex = applicationsView.indexAt(drag.x, drag.y) + destinationIndex = sourceIndex } onPositionChanged: { var index = applicationsView.indexAt(drag.x, drag.y) if (index != -1) { - if (destinationIndex != -1) - applicationsVisualModel.move(destinationIndex, index, 1) + applicationsVisualModel.move(destinationIndex, index, 1) destinationIndex = index } } @@ -97,6 +96,7 @@ Rectangle { } // onDropped: applicationsModel.move(sourceIndex, destinationIndex, 1) // onExited: applicationsModel.move(destinationIndex, sourceIndex, 1) + onExited: applicationsVisualModel.insert(sourceIndex, favoritesVisualModel, destinationIndex, 1) } Rectangle { @@ -155,7 +155,7 @@ Rectangle { onEntered: { sourceIndex = drag.data - destinationIndex = favoritesView.indexAt(drag.x, drag.y) + destinationIndex = sourceIndex } onPositionChanged: { var index = favoritesView.indexAt(drag.x, drag.y) @@ -195,7 +195,7 @@ Rectangle { } } // onDropped: favoritesModel.move(sourceIndex, destinationIndex, 1) -// onExited: favoritesModel.move(destinationIndex, sourceIndex, 1) + onExited: favoritesVisualModel.insert(sourceIndex, applicationsVisualModel, destinationIndex, 1) } } } diff --git a/examples/declarative/modelviews/visualdatamodel/Bubble.qml b/examples/declarative/modelviews/visualdatamodel/Bubble.qml index 2506139aeb..5f36a9a979 100644 --- a/examples/declarative/modelviews/visualdatamodel/Bubble.qml +++ b/examples/declarative/modelviews/visualdatamodel/Bubble.qml @@ -1,61 +1,156 @@ import QtQuick 2.0 -Rectangle { - x: 1 - width: 477 - height: Math.max(messageText.implicitHeight, 48) + senderText.implicitHeight + 6 +Item { + id: bubble - border.width: 1 - border.color: "#404040" - color: outbound ? "#202020" : "#313131" + width: 480 + height: content.height - Item { - id: avatarItem + property int contentHeight: content.height - senderText.implicitHeight + 2 - width: 48; height: 48 + Rectangle { + id: content - anchors { - left: outbound ? undefined : parent.left; right: outbound ? parent.right: undefined - top: parent.top - leftMargin: 3; topMargin: 3; rightMargin: 2 + x: 1; + width: 477 + height: Math.max(messageText.implicitHeight, 48) + senderText.implicitHeight + 6 + + border.width: 1 + border.color: "#404040" + color: outbound ? "#202020" : "#313131" + + state: delegateState + + Item { + id: avatarItem + + width: 48; height: 48 + + anchors { + left: outbound ? undefined : parent.left; right: outbound ? parent.right: undefined + top: parent.top + leftMargin: 3; topMargin: 3; rightMargin: 2 + } + + Image { + id: avatarImage + height: 48 + anchors.centerIn: parent + sourceSize.width: 48 + + source: avatar != "" ? avatar : "images/face-smile.png" + } + + Component { + id: sendComponent + + Rectangle { + id: sendButton + anchors { fill: parent; rightMargin: 1; bottomMargin: 1 } + + color: "#202020" + + opacity: sendArea.pressed ? 0.5 : 1.0 + + Behavior on opacity { NumberAnimation { duration: 150 } } + + Rectangle { + anchors.fill: parent + radius: 4 + color: "#080808" + } + + Text { + id: sendText + anchors.fill: parent + text: "Send" + + color: "#FFFFFF" + font.pixelSize: 16 + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + } + + MouseArea { + id: sendArea + + anchors.fill: parent + + onClicked: root.send(editorLoader.item.text) + } + } + } + + Loader { + id: sendLoader + anchors.fill: parent + } } - Image { - id: avatarImage - height: 48 - anchors.centerIn: parent - sourceSize.width: 48 + Text { + id: messageText - source: avatar != "" ? avatar : "images/face-smile.png" + anchors { + left: outbound ? parent.left : avatarItem.right; top: parent.top + right: outbound ? avatarItem.left : parent.right; margins: 2 + } + color: "#FFFFFF" + font.pixelSize: 18 + wrapMode: Text.WordWrap + text: message } - } - Text { - id: messageText + Component { + id: editorComponent - anchors { - left: outbound ? parent.left : avatarItem.right; top: parent.top - right: outbound ? avatarItem.left : parent.right; margins: 2 + TextEdit { + color: "#FFFFFF" + font.pixelSize: 18 + wrapMode: Text.WordWrap + focus: true + + Keys.onReturnPressed: root.send(text) + Keys.onEnterPressed: root.send(text) + } } - color: "#FFFFFF" - font.pixelSize: 18 - wrapMode: Text.WordWrap - text: message - } - Text { - id: senderText - anchors { left: parent.left; bottom: parent.bottom; margins: 2 } - color: "#DDDDDD" - font.pixelSize: 12 - text: sender - } + Loader { + id: editorLoader + anchors.fill: messageText + } - Text { - id: timeText - anchors { right: parent.right; bottom: parent.bottom; margins: 2 } - color: "#DDDDDD" - font.pixelSize: 12 - text: time + Text { + id: senderText + anchors { left: parent.left; bottom: parent.bottom; margins: 2 } + color: "#DDDDDD" + font.pixelSize: 12 + text: sender + } + + Text { + id: timeText + anchors { right: parent.right; bottom: parent.bottom; margins: 2 } + color: "#DDDDDD" + font.pixelSize: 12 + text: time + } + + states: State { + name: "composing" + + ParentChange { target: content; parent: composer; x: 0; y: 0 } + PropertyChanges { target: bubble; height: 0 } + PropertyChanges { target: editorLoader; sourceComponent: editorComponent } + PropertyChanges { target: sendLoader; sourceComponent: sendComponent } + } + + transitions: Transition { + from: "composing" + NumberAnimation { target: bubble; property: "height"; duration: 3000 } + ParentAnimation { + via: root + NumberAnimation { properties: "y"; duration: 3000; easing.type: Easing.InOutQuad } + } + } } } diff --git a/examples/declarative/modelviews/visualdatamodel/ComposerBubble.qml b/examples/declarative/modelviews/visualdatamodel/ComposerBubble.qml deleted file mode 100644 index 9a5932298c..0000000000 --- a/examples/declarative/modelviews/visualdatamodel/ComposerBubble.qml +++ /dev/null @@ -1,144 +0,0 @@ -import QtQuick 2.0 - -Rectangle { - id: composer - - property bool sending: false - property bool sent: false - property int margin: senderText.height + 1 - property int messageId; - property string sender - property url avatar - - function send() { - timeText.text = Qt.formatTime(Date.now()) - sending = true - sendText.visible = false - sendArea.enabled = false - messageText.focus = false - messageText.activeFocusOnPress = false - - root.send() - } - - border.width: 1 - border.color: "#404040" - color: "#202020" - - x: 1 - width: 477 - height: Math.max(messageText.implicitHeight, 48) + senderText.implicitHeight + 6 - - Behavior on height { - NumberAnimation { duration: 500 } - } - - Timer { - interval: Math.random() * 20000 - running: composer.sending - onTriggered: { - composer.sending = false - composer.sent = true - messageModel.append({ - "messageId": messageId, - "sender": sender, - "message": messageText.text, - "time": timeText.text, - "outbound": true, - "avatar": avatar - }) - } - } - - Item { - id: avatarItem - - width: 48; height: 48 - anchors { right: parent.right; top: parent.top; topMargin: 3; rightMargin: 2 } - Image { - id: avatarImage - height: 48 - anchors.centerIn: parent - sourceSize.width: 48 - - source: avatar != "" ? avatar : "images/face-smile.png" - - SequentialAnimation on opacity { - loops: Animation.Infinite - running: composer.sending - alwaysRunToEnd: true - NumberAnimation { - from: 1.0; to: 0.0 - duration: 5000 - } - NumberAnimation { - from: 0.0; to: 1.0 - duration: 5000 - } - } - - } - Rectangle { - anchors { fill: parent; rightMargin: 1; bottomMargin: 1 } - - color: "#202020" - - opacity: sendArea.pressed ? 0.5 : (composer.sending || composer.sent ? 0.0 : 1.0) - - Behavior on opacity { NumberAnimation { duration: 150 } } - - Rectangle { - anchors.fill: parent - radius: 4 - color: "#080808" - } - - Text { - id: sendText - anchors.fill: parent - text: "Send" - - color: "#FFFFFF" - font.pixelSize: 16 - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - } - - MouseArea { - id: sendArea - - anchors.fill: parent - - onClicked: composer.send() - } - } - } - - TextEdit { - id: messageText - - anchors { left: parent.left; top: parent.top; right: avatarItem.left; margins: 2 } - color: "#FFFFFF" - font.pixelSize: 18 - wrapMode: Text.WordWrap - focus: true - - Keys.onReturnPressed: composer.send() - Keys.onEnterPressed: composer.send() - } - - Text { - id: senderText - anchors { left: parent.left; bottom: parent.bottom; margins: 2 } - color: "#DDDDDD" - font.pixelSize: 12 - text: root.sender - } - - Text { - id: timeText - anchors { right: parent.right; bottom: parent.bottom; margins: 2 } - color: "#DDDDDD" - font.pixelSize: 12 - } -} diff --git a/examples/declarative/modelviews/visualdatamodel/visualdatamodel.qml b/examples/declarative/modelviews/visualdatamodel/visualdatamodel.qml index 476e6f9fce..5198e11d8b 100644 --- a/examples/declarative/modelviews/visualdatamodel/visualdatamodel.qml +++ b/examples/declarative/modelviews/visualdatamodel/visualdatamodel.qml @@ -3,19 +3,40 @@ import QtQuick 2.0 Rectangle { id: root - property Bubble messageBubble: initialBubble + property Item messageBubble property ListModel script: Conversation {} property int scriptIndex: 0 property string sender: "Me" property int messageCounter: 0 - function send() { - messageView.positionViewAtEnd() - visualModel.insert(visualModel.count, messageBubble) - messageBubble = bubbleComponent.createObject(composer, { "messageId": ++messageCounter } ) + function send(message) { + messageView.positionViewAtEnd() + messageModel.set(messageModel.count - 1, { + "sender": root.sender, + "message": message, + "avatar": "", + "outbound": true, + "time": Qt.formatTime(Date.now()), + "delegateState": "" + }) + newMessage() + } + + function newMessage() { + messageModel.append({ + "sender": root.sender, + "message": "", + "avatar": "", + "outbound": true, + "time": "", + "delegateState": "composing" + }) + messageBubble = visualModel.item(visualModel.count - 1) } + Component.onCompleted: newMessage() + width: 480; height: 640 gradient: Gradient { @@ -23,14 +44,6 @@ Rectangle { GradientStop { position: 1.0; color: "#080808" } } - Component { - id: bubbleComponent - - ComposerBubble { - sender: root.sender - } - } - ListView { id: messageView anchors { @@ -39,44 +52,13 @@ Rectangle { } spacing: 2 - add: Transition { - ParentAnimation { - via: root - NumberAnimation { properties: "x,y"; easing.type: Easing.InOutQuad; duration: 1500 } - } - } - cacheBuffer: 256 model: VisualDataModel { id: visualModel - model: ListModel { - id: messageModel - } - - delegate: Bubble { - y: -height - } - - onUpdated: { - for (var i = 0; i < inserts.length; ++i) { - for (var j = inserts[i].start; j < inserts[i].end; ++j) { - var message = messageModel.get(visualModel.getItemInfo(j).index) - if (!message.outbound) - continue - for (var k = 0; k < visualModel.children.length; ++k) { - var item = visualModel.children[k] - if (item.messageId != message.messageId) - continue - visualModel.replace(j, item) - // visualModel.move(item.VisualModel.index, j + 1 - // visualModel.replace(j + 1, j) - break - } - } - } - } + model: ListModel { id: messageModel } + delegate: Bubble {} } } @@ -87,13 +69,13 @@ Rectangle { onTriggered: { var message = script.get(scriptIndex); - messageModel.append({ + messageModel.insert(messageModel.count - 1, { "sender": message.sender, "message": message.message, "avatar": message.avatar, "outbound": false, - "messageId": -1, - "time": Qt.formatTime(Date.now()) + "time": Qt.formatTime(Date.now()), + "delegateState": "" }) scriptIndex = (scriptIndex + 1) % script.count @@ -104,14 +86,7 @@ Rectangle { Item { id: composer - height: messageBubble.height - messageBubble.margin + height: messageBubble != undefined ? messageBubble.contentHeight : 0 anchors { left: parent.left; right: parent.right; bottom: parent.bottom } - - ComposerBubble { - id: initialBubble - - sender: root.sender - messageId: 0 - } } } diff --git a/src/declarative/items/qsggridview.cpp b/src/declarative/items/qsggridview.cpp index c7a1187310..e9b52937fa 100644 --- a/src/declarative/items/qsggridview.cpp +++ b/src/declarative/items/qsggridview.cpp @@ -1531,7 +1531,7 @@ void QSGGridView::setModel(const QVariant &model) d->modelVariant = model; QObject *object = qvariant_cast<QObject*>(model); if (QSGVisualPartModel *partModel = qobject_cast<QSGVisualPartModel *>(object)) { - d->viewId = partModel->part().toUtf8(); + d->viewId = partModel->part(); object = partModel->model(); } else { d->viewId = QByteArray(); diff --git a/src/declarative/items/qsglistview.cpp b/src/declarative/items/qsglistview.cpp index bf3a2046af..4cd4625923 100644 --- a/src/declarative/items/qsglistview.cpp +++ b/src/declarative/items/qsglistview.cpp @@ -1767,7 +1767,7 @@ void QSGListView::setModel(const QVariant &model) d->modelVariant = model; QObject *object = qvariant_cast<QObject*>(model); if (QSGVisualPartModel *partModel = qobject_cast<QSGVisualPartModel *>(object)) { - d->viewId = partModel->part().toUtf8(); + d->viewId = partModel->part(); object = partModel->model(); } else { d->viewId = QByteArray(); diff --git a/src/declarative/items/qsgpathview.cpp b/src/declarative/items/qsgpathview.cpp index 1d9071faf0..aaf344d138 100644 --- a/src/declarative/items/qsgpathview.cpp +++ b/src/declarative/items/qsgpathview.cpp @@ -390,7 +390,7 @@ void QSGPathView::setModel(const QVariant &model) d->modelVariant = model; QObject *object = qvariant_cast<QObject*>(model); if (QSGVisualPartModel *partModel = qobject_cast<QSGVisualPartModel *>(object)) { - d->viewId = partModel->part().toUtf8(); + d->viewId = partModel->part(); object = partModel->model(); } else { d->viewId = QByteArray(); diff --git a/src/declarative/items/qsgrepeater.cpp b/src/declarative/items/qsgrepeater.cpp index 79860a17ef..c67ec70b8f 100644 --- a/src/declarative/items/qsgrepeater.cpp +++ b/src/declarative/items/qsgrepeater.cpp @@ -95,7 +95,7 @@ void QSGRepeater::setModel(const QVariant &model) d->dataSource = model; QObject *object = qvariant_cast<QObject*>(model); if (QSGVisualPartModel *partModel = qobject_cast<QSGVisualPartModel *>(object)) { - d->viewId = partModel->part().toUtf8(); + d->viewId = partModel->part(); object = partModel->model(); } else { d->viewId = QByteArray(); diff --git a/src/declarative/items/qsgvisualitemmodel.cpp b/src/declarative/items/qsgvisualitemmodel.cpp index 35f468956f..66d1a34876 100644 --- a/src/declarative/items/qsgvisualitemmodel.cpp +++ b/src/declarative/items/qsgvisualitemmodel.cpp @@ -99,9 +99,7 @@ void QSGVisualModelPartsMetaObject::propertyCreated(int, QMetaPropertyBuilder &p QVariant QSGVisualModelPartsMetaObject::initialValue(int id) { QSGVisualPartModel *m = new QSGVisualPartModel( - static_cast<QSGVisualModelParts *>(object())->model, - QString::fromUtf8(name(id)), - object()); + static_cast<QSGVisualModelParts *>(object())->model, name(id), object()); QVariant var = QVariant::fromValue(static_cast<QObject *>(m)); return var; @@ -367,6 +365,11 @@ QSGItem *QSGVisualModel::item(int index, const QByteArray &viewId, bool complete } } +QSGItem *QSGVisualModel::item(int index) +{ + return item(index, QByteArray()); +} + QSGVisualModel::ReleaseFlags QSGVisualModel::release(QSGItem *item) { Q_D(QSGVisualModel); @@ -588,64 +591,8 @@ void QSGVisualModel::move(int from, int to, int count) } } -void QSGVisualModel::replace(int index, QSGItem *item) -{ - Q_D(QSGVisualModel); - const int internalIndex = d->indexOf(item); - if (internalIndex != -1) { - int from = d->absoluteIndexOf(internalIndex); - if (d->merge(from, index)) { - d->transactionChanges.insertRemove(index, index + 1); - if (from > index) - from -= 1; - else - index -= 1; - if (from != index) - d->transactionChanges.insertMove(from, from + 1, index); - - d->invalidateIndexes(index); - if (!d->transaction) - d->emitTransactionChanges(); - } - } else { - d->replaceAt(index, item); - } - QSGVisualModelAttached *attached = QSGVisualModelAttached::properties(item); - attached->setModel(this); - attached->setIndex(index); -} - -void QSGVisualModel::replace(int destinationIndex, QSGVisualModel *sourceModel, int sourceIndex, int count) -{ - Q_D(QSGVisualModel); - if (sourceModel == this) { - return; - } else { - d->removeAt(destinationIndex, count); - for (int i = 0, difference = 0; i < count; i += difference) { - int offset = 0; - int internalIndex = 0; - QDeclarativeCompositeRange range = sourceModel->d_func()->at(sourceIndex, &offset, &internalIndex); - difference = range.count - offset; - - if (range.internal()) { - for (int j = 0; j < qMin(count - i, range.count - offset); ++j) - d->insertData(destinationIndex + i + j, sourceModel->d_func()->children.at(internalIndex + j).item); - } else { - d->insertList(destinationIndex + i, range.list, range.index + offset, qMin(count - i, range.count - offset), false); - d->connectModel(static_cast<QSGVisualData *>(range.list)); - } - } - sourceModel->d_func()->removeAt(sourceIndex, count); - sourceModel->d_func()->invalidateIndexes(sourceIndex); - emit sourceModel->itemsRemoved(sourceIndex, count); - emit sourceModel->countChanged(); - } -} - void QSGVisualModel::_q_itemsInserted(QSGVisualData *model, int index, int count) { - qDebug() << Q_FUNC_INFO << model << index << count; Q_D(QSGVisualModel); Q_ASSERT(count >= 0); @@ -654,9 +601,6 @@ void QSGVisualModel::_q_itemsInserted(QSGVisualData *model, int index, int count d->childrenChanged = false; d->listItemsInserted(model, index, index + count, &inserts); - - qDebug() << *d; - if (inserts.count() > 0) { d->invalidateIndexes(index); QDeclarativeEngine *dengine = d->context ? d->context->engine() : qmlEngine(this); diff --git a/src/declarative/items/qsgvisualitemmodel_p.h b/src/declarative/items/qsgvisualitemmodel_p.h index 32f7856907..966246b52b 100644 --- a/src/declarative/items/qsgvisualitemmodel_p.h +++ b/src/declarative/items/qsgvisualitemmodel_p.h @@ -105,6 +105,8 @@ public: static QSGVisualModelAttached *qmlAttachedProperties(QObject *obj); + Q_INVOKABLE QSGItem *item(int index); + public Q_SLOTS: void append(QSGItem *item); void append(QSGVisualModel *sourceModel, int sourceIndex, int count); @@ -112,8 +114,6 @@ public Q_SLOTS: void insert(int destinationIndex, QSGVisualModel *sourceModel, int sourceIndex, int count); void remove(int index, int count); void move(int from, int to, int count); - void replace(int index, QSGItem *item); - void replace(int destinationIndex, QSGVisualModel *sourceModel, int sourceIndex, int count); Q_SIGNALS: void childrenChanged(); @@ -303,17 +303,18 @@ private: class Q_DECLARATIVE_EXPORT QSGVisualPartModel : public QObject { Q_OBJECT - Q_PROPERTY(QString part READ part CONSTANT) public: - QSGVisualPartModel(QSGVisualModel *model, const QString &part, QObject *parent = 0) + QSGVisualPartModel(QSGVisualModel *model, const QByteArray &part, QObject *parent = 0) : QObject(parent), m_model(model), m_part(part) {} QSGVisualModel *model() const { return m_model; } - QString part() const { return m_part; } + QByteArray part() const { return m_part; } + + Q_INVOKABLE QSGItem *item(int index) { return m_model->item(index, m_part); } private: QSGVisualModel *m_model; - QString m_part; + QByteArray m_part; }; QT_END_NAMESPACE @@ -321,6 +322,7 @@ QT_END_NAMESPACE QML_DECLARE_TYPE(QSGVisualModel) QML_DECLARE_TYPEINFO(QSGVisualModel, QML_HAS_ATTACHED_PROPERTIES) QML_DECLARE_TYPE(QSGVisualData) +QML_DECLARE_TYPEINFO(QSGVisualDataModel, QML_HAS_ATTACHED_PROPERTIES) QML_DECLARE_TYPE(QSGVisualItemModel) QML_DECLARE_TYPEINFO(QSGVisualItemModel, QML_HAS_ATTACHED_PROPERTIES) QML_DECLARE_TYPE(QSGVisualDataModel) diff --git a/src/declarative/particles/qsgmodelparticle.cpp b/src/declarative/particles/qsgmodelparticle.cpp index 59021b71aa..a92830cdb3 100644 --- a/src/declarative/particles/qsgmodelparticle.cpp +++ b/src/declarative/particles/qsgmodelparticle.cpp @@ -72,7 +72,7 @@ void QSGModelParticle::setModel(const QVariant &arg) QObject *object = arg.value<QObject*>(); if (QSGVisualPartModel *partModel = qobject_cast<QSGVisualPartModel *>(object)) { - m_viewId = partModel->part().toUtf8(); + m_viewId = partModel->part(); object = partModel->model(); } else { m_viewId = QByteArray(); diff --git a/src/declarative/util/qdeclarativelistcompositor.cpp b/src/declarative/util/qdeclarativelistcompositor.cpp index ac524b4302..2e75336ac1 100644 --- a/src/declarative/util/qdeclarativelistcompositor.cpp +++ b/src/declarative/util/qdeclarativelistcompositor.cpp @@ -389,7 +389,6 @@ void QDeclarativeListCompositor::forwardToBackwardMove(int &from, int &to, int & void QDeclarativeListCompositor::move(int from, int to, int count) { - qDebug() << Q_FUNC_INFO << from << to << count; Q_ASSERT(from != to || count == 0); Q_ASSERT(from >=0 && from + count <= absoluteCount); Q_ASSERT(to >=0 && to <= absoluteCount); @@ -512,8 +511,6 @@ void QDeclarativeListCompositor::move(int from, int to, int count) for (int i = 0; i < movedRanges.count(); ++i) insertPos = ++ranges.insert(insertPos, movedRanges.at(i)); - qDebug() << *this; - Q_ASSERT(qt_verifyIntegrity(ranges, absoluteCount, internalCount)); } @@ -869,8 +866,6 @@ void QDeclarativeListCompositor::listItemsMoved( int from = start; int count = end - start; - qDebug() << Q_FUNC_INFO << from << to << count; - Q_ASSERT(from != to); Q_ASSERT(count != 0); @@ -900,8 +895,6 @@ void QDeclarativeListCompositor::listItemsMoved( } } - qDebug() << *this; - Q_ASSERT(qt_verifyIntegrity(ranges, absoluteCount, internalCount)); } |