summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable.cpp2
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit.cpp4
-rw-r--r--src/declarative/qml/qdeclarativebinding.cpp2
-rw-r--r--src/declarative/util/qdeclarativestate.cpp12
4 files changed, 18 insertions, 2 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
index 474126d2ad..ea7c3667fb 100644
--- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
@@ -1553,7 +1553,7 @@ bool QDeclarativeFlickable::sendMouseEvent(QGraphicsSceneMouseEvent *event)
d->handleMouseMoveEvent(&mouseEvent);
break;
case QEvent::GraphicsSceneMousePress:
- if (d->pressed) // we are already pressed - this is a delayed replay
+ if (d->pressed && !event->spontaneous()) // we are already pressed - this is a delayed replay
return false;
d->handleMousePressEvent(&mouseEvent);
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
index 24d7f75dab..a7444df409 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
@@ -1713,7 +1713,9 @@ void QDeclarativeTextEdit::updateSize()
setImplicitWidth(newWidth);
else if (d->requireImplicitWidth)
setImplicitWidth(naturalWidth);
- qreal newHeight = d->document->isEmpty() ? fm.height() : (int)d->document->size().height();
+ qreal newHeight = d->document->size().height();
+ if (newHeight == 0)
+ newHeight = fm.height();
setImplicitHeight(newHeight);
d->paintedSize = QSize(newWidth, newHeight);
diff --git a/src/declarative/qml/qdeclarativebinding.cpp b/src/declarative/qml/qdeclarativebinding.cpp
index 689cd00999..9359196d9f 100644
--- a/src/declarative/qml/qdeclarativebinding.cpp
+++ b/src/declarative/qml/qdeclarativebinding.cpp
@@ -254,6 +254,8 @@ QDeclarativeBinding::createBinding(Identifier id, QObject *obj, QDeclarativeCont
cdata = typeData->compiledData();
}
QDeclarativeBinding *rv = cdata ? new QDeclarativeBinding((void*)cdata->datas.at(id).constData(), cdata, obj, ctxtdata, url, lineNumber, parent) : 0;
+ if (cdata)
+ cdata->release();
if (typeData)
typeData->release();
return rv;
diff --git a/src/declarative/util/qdeclarativestate.cpp b/src/declarative/util/qdeclarativestate.cpp
index 9f56ccb02e..ee3d06b4db 100644
--- a/src/declarative/util/qdeclarativestate.cpp
+++ b/src/declarative/util/qdeclarativestate.cpp
@@ -173,6 +173,18 @@ QDeclarativeState::~QDeclarativeState()
Q_D(QDeclarativeState);
if (d->group)
d->group->removeState(this);
+
+ /*
+ destroying an active state does not return us to the
+ base state, so we need to clean up our revert list to
+ prevent leaks. In the future we may want to redconsider
+ this overall architecture.
+ */
+ for (int i = 0; i < d->revertList.count(); ++i) {
+ if (d->revertList.at(i).binding()) {
+ d->revertList.at(i).binding()->destroy();
+ }
+ }
}
/*!