summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire350@gmail.com>2015-08-06 20:57:33 +0200
committerPaul Lemire <paul.lemire@kdab.com>2015-08-07 19:43:23 +0000
commit8e056a0f967df9887c48a47d6a10150c5e15e5bd (patch)
tree3c7f5b754e8dbd2d17c90cbc9edb2fd33982e279
parent1f51eb03d8b4ee5d61f0dfdc1af0cc79b2bb878b (diff)
QAbstractAttribute fix: properly set the buffer
Change-Id: Ib31672239beeefe7915232c0b277f89f6194a155 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
-rw-r--r--src/core/io/qabstractattribute.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/core/io/qabstractattribute.cpp b/src/core/io/qabstractattribute.cpp
index f33bc0183..728a31a49 100644
--- a/src/core/io/qabstractattribute.cpp
+++ b/src/core/io/qabstractattribute.cpp
@@ -76,7 +76,7 @@ QAbstractAttribute::QAbstractAttribute(QAbstractBuffer *buf, DataType type, uint
: QNode(*new QAbstractAttributePrivate(), parent)
{
Q_D(QAbstractAttribute);
- d->m_buffer = buf;
+ setBuffer(buf);
d->m_count = count;
d->m_byteOffset = offset;
d->m_dataType = type;
@@ -93,7 +93,7 @@ QAbstractAttribute::QAbstractAttribute(QAbstractAttributePrivate &dd, QAbstractB
: QNode(dd, parent)
{
Q_D(QAbstractAttribute);
- d->m_buffer = buf;
+ setBuffer(buf);
d->m_name = name;
d->m_count = count;
d->m_byteOffset = offset;
@@ -184,12 +184,6 @@ void QAbstractAttribute::setBuffer(QAbstractBuffer *buffer)
d->notifyObservers(change);
}
-
- d->m_buffer = buffer;
- const bool blocked = blockNotifications(true);
- emit bufferChanged();
- blockNotifications(blocked);
-
// We need to add it as a child of the current node if it has been declared inline
// Or not previously added as a child of the current node so that
// 1) The backend gets notified about it's creation
@@ -197,6 +191,11 @@ void QAbstractAttribute::setBuffer(QAbstractBuffer *buffer)
if (buffer && !buffer->parent())
buffer->setParent(this);
+ d->m_buffer = buffer;
+ const bool blocked = blockNotifications(true);
+ emit bufferChanged();
+ blockNotifications(blocked);
+
if (d->m_buffer && d->m_changeArbiter) {
QScenePropertyChangePtr change(new QScenePropertyChange(NodeAdded, QSceneChange::Node, id()));
change->setPropertyName("buffer");