summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/graphicsitems/qdeclarativeborderimage.cpp6
-rw-r--r--src/declarative/graphicsitems/qdeclarativeborderimage_p.h6
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable.cpp2
-rw-r--r--src/declarative/graphicsitems/qdeclarativegridview.cpp6
-rw-r--r--src/declarative/graphicsitems/qdeclarativelistview.cpp7
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit.cpp4
-rw-r--r--src/declarative/qml/qdeclarativebinding.cpp2
-rw-r--r--src/declarative/util/qdeclarativestate.cpp12
8 files changed, 34 insertions, 11 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp
index bd6405c..b696b9d 100644
--- a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp
@@ -291,6 +291,12 @@ void QDeclarativeBorderImage::setSource(const QUrl &url)
load();
}
+void QDeclarativeBorderImage::setSourceSize(const QSize& size)
+{
+ Q_UNUSED(size);
+ qmlInfo(this) << "Setting sourceSize for borderImage not supported";
+}
+
void QDeclarativeBorderImage::load()
{
Q_D(QDeclarativeBorderImage);
diff --git a/src/declarative/graphicsitems/qdeclarativeborderimage_p.h b/src/declarative/graphicsitems/qdeclarativeborderimage_p.h
index 6a50c3c..6b05608 100644
--- a/src/declarative/graphicsitems/qdeclarativeborderimage_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeborderimage_p.h
@@ -63,9 +63,6 @@ class Q_AUTOTEST_EXPORT QDeclarativeBorderImage : public QDeclarativeImageBase
Q_PROPERTY(TileMode horizontalTileMode READ horizontalTileMode WRITE setHorizontalTileMode NOTIFY horizontalTileModeChanged)
Q_PROPERTY(TileMode verticalTileMode READ verticalTileMode WRITE setVerticalTileMode NOTIFY verticalTileModeChanged)
- // read-only for BorderImage
- Q_PROPERTY(QSize sourceSize READ sourceSize NOTIFY sourceSizeChanged)
-
public:
QDeclarativeBorderImage(QDeclarativeItem *parent=0);
~QDeclarativeBorderImage();
@@ -83,10 +80,11 @@ public:
void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *);
void setSource(const QUrl &url);
+ void setSourceSize(const QSize&);
+
Q_SIGNALS:
void horizontalTileModeChanged();
void verticalTileModeChanged();
- void sourceSizeChanged();
protected:
virtual void load();
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
index 474126d..ea7c366 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/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp
index 20410ab..92b85f9 100644
--- a/src/declarative/graphicsitems/qdeclarativegridview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp
@@ -1064,6 +1064,8 @@ void QDeclarativeGridViewPrivate::fixup(AxisData &data, qreal minExtent, qreal m
highlightEnd = highlightRangeEnd;
}
+ bool strictHighlightRange = haveHighlightRange && highlightRange == QDeclarativeGridView::StrictlyEnforceRange;
+
if (snapMode != QDeclarativeGridView::NoSnap) {
qreal tempPosition = isRightToLeftTopToBottom() ? -position()-size() : position();
if (snapMode == QDeclarativeGridView::SnapOneRow && moveReason == Mouse) {
@@ -1081,7 +1083,7 @@ void QDeclarativeGridViewPrivate::fixup(AxisData &data, qreal minExtent, qreal m
FxGridItem *topItem = snapItemAt(tempPosition+highlightStart);
FxGridItem *bottomItem = snapItemAt(tempPosition+highlightEnd);
qreal pos;
- if (topItem && bottomItem && haveHighlightRange && highlightRange == QDeclarativeGridView::StrictlyEnforceRange) {
+ if (topItem && bottomItem && strictHighlightRange) {
qreal topPos = qMin(topItem->rowPos() - highlightStart, -maxExtent);
qreal bottomPos = qMax(bottomItem->rowPos() - highlightEnd, -minExtent);
pos = qAbs(data.move + topPos) < qAbs(data.move + bottomPos) ? topPos : bottomPos;
@@ -1089,7 +1091,7 @@ void QDeclarativeGridViewPrivate::fixup(AxisData &data, qreal minExtent, qreal m
qreal headerPos = 0;
if (header)
headerPos = isRightToLeftTopToBottom() ? header->rowPos() + cellWidth - headerSize() : header->rowPos();
- if (topItem->index == 0 && header && tempPosition+highlightStart < headerPos+headerSize()/2) {
+ if (topItem->index == 0 && header && tempPosition+highlightStart < headerPos+headerSize()/2 && !strictHighlightRange) {
pos = isRightToLeftTopToBottom() ? - headerPos + highlightStart - size() : headerPos - highlightStart;
} else {
if (isRightToLeftTopToBottom())
diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp
index e75189c..b34dc43 100644
--- a/src/declarative/graphicsitems/qdeclarativelistview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp
@@ -1293,6 +1293,7 @@ void QDeclarativeListViewPrivate::fixup(AxisData &data, qreal minExtent, qreal m
correctFlick = false;
fixupMode = moveReason == Mouse ? fixupMode : Immediate;
+ bool strictHighlightRange = haveHighlightRange && highlightRange == QDeclarativeListView::StrictlyEnforceRange;
qreal highlightStart;
qreal highlightEnd;
@@ -1325,9 +1326,9 @@ void QDeclarativeListViewPrivate::fixup(AxisData &data, qreal minExtent, qreal m
FxListItem *topItem = snapItemAt(tempPosition+highlightStart);
FxListItem *bottomItem = snapItemAt(tempPosition+highlightEnd);
qreal pos;
- bool isInBounds = -position() > maxExtent && -position() < minExtent;
+ bool isInBounds = -position() > maxExtent && -position() <= minExtent;
if (topItem && isInBounds) {
- if (topItem->index == 0 && header && tempPosition+highlightStart < header->position()+header->size()/2) {
+ if (topItem->index == 0 && header && tempPosition+highlightStart < header->position()+header->size()/2 && !strictHighlightRange) {
pos = isRightToLeft() ? - header->position() + highlightStart - size() : header->position() - highlightStart;
} else {
if (isRightToLeft())
@@ -1356,7 +1357,7 @@ void QDeclarativeListViewPrivate::fixup(AxisData &data, qreal minExtent, qreal m
}
vTime = timeline.time();
}
- } else if (currentItem && haveHighlightRange && highlightRange == QDeclarativeListView::StrictlyEnforceRange
+ } else if (currentItem && strictHighlightRange
&& moveReason != QDeclarativeListViewPrivate::SetIndex) {
updateHighlight();
qreal pos = currentItem->itemPosition();
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
index 24d7f75..a7444df 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 689cd00..9359196 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 9f56ccb..ee3d06b 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();
+ }
+ }
}
/*!