summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2009-12-20 23:43:33 (GMT)
committerMartin Jones <martin.jones@nokia.com>2009-12-20 23:43:33 (GMT)
commitd49648884774f320473427fcea52a51ac2a4cca5 (patch)
tree25d03986ea02d6c8c1df0936fc3a7f1919f28827 /src/declarative/graphicsitems
parent45ca79610e1609f27c852afe7f8ae157f5ef7fbb (diff)
downloadQt-d49648884774f320473427fcea52a51ac2a4cca5.zip
Qt-d49648884774f320473427fcea52a51ac2a4cca5.tar.gz
Qt-d49648884774f320473427fcea52a51ac2a4cca5.tar.bz2
Fix Flickable within Flickable, with parent flickable !interactive.
Diffstat (limited to 'src/declarative/graphicsitems')
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsflickable.cpp20
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsflickable_p.h3
2 files changed, 14 insertions, 9 deletions
diff --git a/src/declarative/graphicsitems/qmlgraphicsflickable.cpp b/src/declarative/graphicsitems/qmlgraphicsflickable.cpp
index 393edb6..ed70b14 100644
--- a/src/declarative/graphicsitems/qmlgraphicsflickable.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicsflickable.cpp
@@ -498,13 +498,16 @@ bool QmlGraphicsFlickable::isInteractive() const
void QmlGraphicsFlickable::setInteractive(bool interactive)
{
Q_D(QmlGraphicsFlickable);
- d->interactive = interactive;
- if (!interactive && d->flicked) {
- d->timeline.clear();
- d->vTime = d->timeline.time();
- d->flicked = false;
- emit flickingChanged();
- emit flickEnded();
+ if (interactive != d->interactive) {
+ d->interactive = interactive;
+ if (!interactive && d->flicked) {
+ d->timeline.clear();
+ d->vTime = d->timeline.time();
+ d->flicked = false;
+ emit flickingChanged();
+ emit flickEnded();
+ }
+ emit interactiveChanged();
}
}
@@ -1147,7 +1150,8 @@ bool QmlGraphicsFlickable::sendMouseEvent(QGraphicsSceneMouseEvent *event)
bool QmlGraphicsFlickable::sceneEventFilter(QGraphicsItem *i, QEvent *e)
{
- if (!isVisible())
+ Q_D(QmlGraphicsFlickable);
+ if (!isVisible() || !d->interactive)
return QmlGraphicsItem::sceneEventFilter(i, e);
switch (e->type()) {
case QEvent::GraphicsSceneMousePress:
diff --git a/src/declarative/graphicsitems/qmlgraphicsflickable_p.h b/src/declarative/graphicsitems/qmlgraphicsflickable_p.h
index aa29f3e..df6f6b1 100644
--- a/src/declarative/graphicsitems/qmlgraphicsflickable_p.h
+++ b/src/declarative/graphicsitems/qmlgraphicsflickable_p.h
@@ -72,7 +72,7 @@ class Q_DECLARATIVE_EXPORT QmlGraphicsFlickable : public QmlGraphicsItem
Q_PROPERTY(bool flicking READ isFlicking NOTIFY flickingChanged)
Q_PROPERTY(FlickDirection flickDirection READ flickDirection WRITE setFlickDirection NOTIFY flickDirectionChanged)
- Q_PROPERTY(bool interactive READ isInteractive WRITE setInteractive)
+ Q_PROPERTY(bool interactive READ isInteractive WRITE setInteractive NOTIFY interactiveChanged)
Q_PROPERTY(int pressDelay READ pressDelay WRITE setPressDelay)
Q_PROPERTY(bool atXEnd READ isAtXEnd NOTIFY isAtBoundaryChanged)
@@ -159,6 +159,7 @@ Q_SIGNALS:
void isAtBoundaryChanged();
void pageChanged();
void flickDirectionChanged();
+ void interactiveChanged();
protected:
virtual bool sceneEventFilter(QGraphicsItem *, QEvent *);