summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-07-31 05:36:47 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2009-07-31 05:36:47 (GMT)
commita99fa7ada04d006fbc0043f436154a4a28e5ad8a (patch)
treee9f6429e4900dd06b4ef68bf0add2cb8bad1d00c /src
parent2776e24964a49c98bd807351ccdffebaed5e2eea (diff)
parentfc5af680d26aba684f4cbd4caa0440aabc3153d4 (diff)
downloadQt-a99fa7ada04d006fbc0043f436154a4a28e5ad8a.zip
Qt-a99fa7ada04d006fbc0043f436154a4a28e5ad8a.tar.gz
Qt-a99fa7ada04d006fbc0043f436154a4a28e5ad8a.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src')
-rw-r--r--src/declarative/fx/qfxitem.cpp20
-rw-r--r--src/declarative/fx/qfxitem.h2
-rw-r--r--src/declarative/fx/qfxitem_p.h5
-rw-r--r--src/declarative/fx/qfxlayouts.cpp10
-rw-r--r--src/declarative/fx/qfxlayouts.h2
5 files changed, 18 insertions, 21 deletions
diff --git a/src/declarative/fx/qfxitem.cpp b/src/declarative/fx/qfxitem.cpp
index a9c406d..5eb2516 100644
--- a/src/declarative/fx/qfxitem.cpp
+++ b/src/declarative/fx/qfxitem.cpp
@@ -1644,28 +1644,17 @@ bool QFxItem::sceneEvent(QEvent *event)
QVariant QFxItem::itemChange(GraphicsItemChange change,
const QVariant &value)
{
- Q_D(QFxItem);
- if (change == ItemSceneHasChanged) {
- d->canvas = qvariant_cast<QGraphicsScene *>(value);
- } else if (change == ItemChildAddedChange ||
- change == ItemChildRemovedChange) {
- childrenChanged();
- } else if (change == ItemParentHasChanged) {
+ if (change == ItemParentHasChanged) {
emit parentChanged();
}
return QGraphicsItem::itemChange(change, value);
}
-
void QFxItem::mouseUngrabEvent()
{
}
-void QFxItem::childrenChanged()
-{
-}
-
QRectF QFxItem::boundingRect() const
{
Q_D(const QFxItem);
@@ -1900,8 +1889,13 @@ void QFxItem::setOptions(Options options, bool set)
setFlag(QGraphicsItem::ItemAutoDetectsFocusProxy, d->options & IsFocusRealm);
}
-void QFxItem::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWidget *)
+void QFxItem::paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *)
+{
+}
+
+bool QFxItem::event(QEvent *ev)
{
+ return QGraphicsObject::event(ev);
}
QT_END_NAMESPACE
diff --git a/src/declarative/fx/qfxitem.h b/src/declarative/fx/qfxitem.h
index d33c07e..d9a7621 100644
--- a/src/declarative/fx/qfxitem.h
+++ b/src/declarative/fx/qfxitem.h
@@ -227,9 +227,9 @@ Q_SIGNALS:
protected:
bool isComponentComplete() const;
- virtual void childrenChanged();
virtual bool sceneEventFilter(QGraphicsItem *, QEvent *);
virtual bool sceneEvent(QEvent *);
+ virtual bool event(QEvent *);
virtual QVariant itemChange(GraphicsItemChange, const QVariant &);
virtual bool mouseFilter(QGraphicsSceneMouseEvent *);
virtual void mouseUngrabEvent();
diff --git a/src/declarative/fx/qfxitem_p.h b/src/declarative/fx/qfxitem_p.h
index 862171b..ae95fb5 100644
--- a/src/declarative/fx/qfxitem_p.h
+++ b/src/declarative/fx/qfxitem_p.h
@@ -77,7 +77,7 @@ public:
_baselineOffset(0),
_componentComplete(true), _keepMouse(false),
_anchorLines(0),
- _stateGroup(0), canvas(0), origin(QFxItem::TopLeft),
+ _stateGroup(0), origin(QFxItem::TopLeft),
options(QFxItem::NoOption),
widthValid(false), heightValid(false), width(0), height(0)
{}
@@ -176,9 +176,6 @@ public:
QmlStateGroup *states();
QmlStateGroup *_stateGroup;
-
- QGraphicsScene *canvas;
-
QFxItem::TransformOrigin origin:4;
int options:10;
bool widthValid:1;
diff --git a/src/declarative/fx/qfxlayouts.cpp b/src/declarative/fx/qfxlayouts.cpp
index da34b8c..836e3e4 100644
--- a/src/declarative/fx/qfxlayouts.cpp
+++ b/src/declarative/fx/qfxlayouts.cpp
@@ -253,9 +253,15 @@ void QFxBaseLayout::componentComplete()
preLayout();
}
-void QFxBaseLayout::childrenChanged()
+QVariant QFxBaseLayout::itemChange(GraphicsItemChange change,
+ const QVariant &value)
{
- preLayout();
+ if (change == ItemChildAddedChange ||
+ change == ItemChildRemovedChange) {
+ preLayout();
+ }
+
+ return QFxItem::itemChange(change, value);
}
bool QFxBaseLayout::event(QEvent *e)
diff --git a/src/declarative/fx/qfxlayouts.h b/src/declarative/fx/qfxlayouts.h
index 03ddf3e..e9c7f51 100644
--- a/src/declarative/fx/qfxlayouts.h
+++ b/src/declarative/fx/qfxlayouts.h
@@ -88,7 +88,7 @@ public:
protected:
virtual void componentComplete();
- virtual void childrenChanged();
+ virtual QVariant itemChange(GraphicsItemChange, const QVariant &);
virtual bool event(QEvent *);
QSet<QFxItem *>* newItems();
QSet<QFxItem *>* leavingItems();