From cd1a69ec3e27a4b6c0df692ec5bdbc9b789c74b4 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Wed, 10 Nov 2010 14:26:08 +1000 Subject: Flickable does not reposition its content when it is resized. Call fixup() after Flickable resize to ensure contents are within bounds. Task-number: QTBUG-15173 Reviewed-by: Bea Lam --- src/declarative/graphicsitems/qdeclarativeflickable.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp index 01a8585..90cf9ed 100644 --- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp +++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp @@ -1029,6 +1029,13 @@ void QDeclarativeFlickable::geometryChanged(const QRectF &newGeometry, d->contentItem->setWidth(width()); emit contentWidthChanged(); } + // Make sure that we're entirely in view. + if (!d->pressed && !d->movingHorizontally && !d->movingVertically) { + int oldDuration = d->fixupDuration; + d->fixupDuration = 0; + d->fixupX(); + d->fixupDuration = oldDuration; + } } if (newGeometry.height() != oldGeometry.height()) { if (yflick()) @@ -1037,6 +1044,13 @@ void QDeclarativeFlickable::geometryChanged(const QRectF &newGeometry, d->contentItem->setHeight(height()); emit contentHeightChanged(); } + // Make sure that we're entirely in view. + if (!d->pressed && !d->movingHorizontally && !d->movingVertically) { + int oldDuration = d->fixupDuration; + d->fixupDuration = 0; + d->fixupY(); + d->fixupDuration = oldDuration; + } } if (changed) -- cgit v0.12 From 7cc777265b5d6c5e87c86283b4061f2632952a8c Mon Sep 17 00:00:00 2001 From: Christiaan Janssen Date: Wed, 10 Nov 2010 14:42:24 +0100 Subject: QDeclarativeDebug: Keep source information when changing an expression Copy over the source code location of an expression when it is changed throu the debugging facilities. This enables JavaScript breakpoints to be hit even after the source code of the function has changed. Task-number: QTCREATORBUG-2824 Reviewed-by: Kai Koehne --- src/declarative/qml/qdeclarativeenginedebug.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/declarative/qml/qdeclarativeenginedebug.cpp b/src/declarative/qml/qdeclarativeenginedebug.cpp index ed28185..bffe681 100644 --- a/src/declarative/qml/qdeclarativeenginedebug.cpp +++ b/src/declarative/qml/qdeclarativeenginedebug.cpp @@ -502,7 +502,8 @@ void QDeclarativeEngineDebugServer::setBinding(int objectId, property.write(expression); } else if (hasValidSignal(object, propertyName)) { QDeclarativeExpression *declarativeExpression = new QDeclarativeExpression(context, object, expression.toString()); - QDeclarativePropertyPrivate::setSignalExpression(property, declarativeExpression); + QDeclarativeExpression *oldExpression = QDeclarativePropertyPrivate::setSignalExpression(property, declarativeExpression); + declarativeExpression->setSourceLocation(oldExpression->sourceFile(), oldExpression->lineNumber()); } else if (property.isProperty()) { QDeclarativeBinding *binding = new QDeclarativeBinding(expression.toString(), object, context); binding->setTarget(property); -- cgit v0.12