summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/fx/qfxflickable.cpp6
-rw-r--r--src/declarative/fx/qfxitem.cpp16
-rw-r--r--src/declarative/fx/qfxitem.h15
-rw-r--r--src/declarative/fx/qfxpathview.cpp5
4 files changed, 13 insertions, 29 deletions
diff --git a/src/declarative/fx/qfxflickable.cpp b/src/declarative/fx/qfxflickable.cpp
index bd0c1be..4b504cb 100644
--- a/src/declarative/fx/qfxflickable.cpp
+++ b/src/declarative/fx/qfxflickable.cpp
@@ -1022,7 +1022,9 @@ bool QFxFlickable::sendMouseEvent(QGraphicsSceneMouseEvent *event)
Q_D(QFxFlickable);
QGraphicsSceneMouseEvent mouseEvent(event->type());
QRectF myRect = mapToScene(QRectF(0, 0, width(), height())).boundingRect();
- QFxItem *grabber = static_cast<QFxItem*>(mouseGrabberItem());
+
+ QGraphicsScene *s = scene();
+ QFxItem *grabber = s ? qobject_cast<QFxItem*>(s->mouseGrabberItem()) : 0;
if ((d->stealMouse || myRect.contains(event->scenePos().toPoint())) && (!grabber || !grabber->keepMouseGrab())) {
mouseEvent.setAccepted(false);
for (int i = 0x1; i <= 0x10; i <<= 1) {
@@ -1049,7 +1051,7 @@ bool QFxFlickable::sendMouseEvent(QGraphicsSceneMouseEvent *event)
default:
break;
}
- grabber = static_cast<QFxItem*>(mouseGrabberItem());
+ grabber = qobject_cast<QFxItem*>(s->mouseGrabberItem());
if (grabber && d->stealMouse && !grabber->keepMouseGrab() && grabber != this)
grabMouse();
diff --git a/src/declarative/fx/qfxitem.cpp b/src/declarative/fx/qfxitem.cpp
index 709a243..46bef3c 100644
--- a/src/declarative/fx/qfxitem.cpp
+++ b/src/declarative/fx/qfxitem.cpp
@@ -1201,12 +1201,6 @@ void QFxItem::setBaselineOffset(qreal offset)
\endtable
*/
-/*! \fn void QFxItem::rotationChanged()
- This signal is emitted when the rotation property is changed.
-
- \sa setRotation()
- */
-
/*!
\qmlproperty real Item::scale
This property holds the scale of the item.
@@ -1808,16 +1802,6 @@ bool QFxItem::heightValid() const
return d->heightValid;
}
-QFxItem *QFxItem::mouseGrabberItem() const
-{
- QGraphicsScene *s = scene();
- if (s) {
- QGraphicsItem *item = s->mouseGrabberItem();
- return static_cast<QFxItem*>(item); // ###
- }
- return 0;
-}
-
/*!
\qmlproperty bool Item::focus
This property indicates whether the item has has an active focus request. Set this
diff --git a/src/declarative/fx/qfxitem.h b/src/declarative/fx/qfxitem.h
index 884a6d8..2050ab9 100644
--- a/src/declarative/fx/qfxitem.h
+++ b/src/declarative/fx/qfxitem.h
@@ -198,12 +198,9 @@ public:
qreal width() const;
void setWidth(qreal);
- void setImplicitWidth(qreal);
- bool widthValid() const; // ### better name?
+
qreal height() const;
void setHeight(qreal);
- void setImplicitHeight(qreal);
- bool heightValid() const; // ### better name?
TransformOrigin transformOrigin() const;
void setTransformOrigin(TransformOrigin);
@@ -211,8 +208,6 @@ public:
QRectF boundingRect() const;
virtual void paintContents(QPainter &);
- QFxItem *mouseGrabberItem() const;
-
virtual bool hasFocus() const;
void setFocus(bool);
bool hasActiveFocus() const;
@@ -229,9 +224,6 @@ Q_SIGNALS:
void parentChanged();
void keyPress(QFxKeyEvent *event);
void keyRelease(QFxKeyEvent *event);
- void rotationChanged();
- void scaleChanged();
- void qmlChanged();
protected:
bool isComponentComplete() const;
@@ -243,6 +235,11 @@ protected:
virtual bool mouseFilter(QGraphicsSceneMouseEvent *);
virtual void mouseUngrabEvent();
+ void setImplicitWidth(qreal);
+ bool widthValid() const; // ### better name?
+ void setImplicitHeight(qreal);
+ bool heightValid() const; // ### better name?
+
virtual void classBegin();
virtual void componentComplete();
virtual void focusChanged(bool);
diff --git a/src/declarative/fx/qfxpathview.cpp b/src/declarative/fx/qfxpathview.cpp
index 98121e6..6546f69 100644
--- a/src/declarative/fx/qfxpathview.cpp
+++ b/src/declarative/fx/qfxpathview.cpp
@@ -496,7 +496,8 @@ bool QFxPathView::sendMouseEvent(QGraphicsSceneMouseEvent *event)
Q_D(QFxPathView);
QGraphicsSceneMouseEvent mouseEvent(event->type());
QRectF myRect = mapToScene(QRectF(0, 0, width(), height())).boundingRect();
- QFxItem *grabber = static_cast<QFxItem*>(mouseGrabberItem());
+ QGraphicsScene *s = scene();
+ QFxItem *grabber = s ? qobject_cast<QFxItem*>(s->mouseGrabberItem()) : 0;
if ((d->stealMouse || myRect.contains(event->scenePos().toPoint())) && (!grabber || !grabber->keepMouseGrab())) {
mouseEvent.setAccepted(false);
for (int i = 0x1; i <= 0x10; i <<= 1) {
@@ -523,7 +524,7 @@ bool QFxPathView::sendMouseEvent(QGraphicsSceneMouseEvent *event)
default:
break;
}
- grabber = static_cast<QFxItem*>(mouseGrabberItem());
+ grabber = qobject_cast<QFxItem*>(s->mouseGrabberItem());
if (grabber && d->stealMouse && !grabber->keepMouseGrab() && grabber != this)
grabMouse();