equal
deleted
inserted
replaced
178 delete drag; |
178 delete drag; |
179 } |
179 } |
180 |
180 |
181 /*! |
181 /*! |
182 \qmlclass MouseArea QDeclarativeMouseArea |
182 \qmlclass MouseArea QDeclarativeMouseArea |
|
183 \ingroup qml-basic-interaction-elements |
183 \since 4.7 |
184 \since 4.7 |
184 \brief The MouseArea item enables simple mouse handling. |
185 \brief The MouseArea item enables simple mouse handling. |
185 \inherits Item |
186 \inherits Item |
186 |
187 |
187 A MouseArea is typically used in conjunction with a visible item, |
188 A MouseArea is typically used in conjunction with a visible item, |
314 case, if you execute some logic on the pressed signal and then start dragging, the \l Flickable will steal the mouse handling |
315 case, if you execute some logic on the pressed signal and then start dragging, the \l Flickable will steal the mouse handling |
315 from the MouseArea. In these cases, to reset the logic when the MouseArea has lost the mouse handling to the |
316 from the MouseArea. In these cases, to reset the logic when the MouseArea has lost the mouse handling to the |
316 \l Flickable, \c onCanceled should be used in addition to onReleased. |
317 \l Flickable, \c onCanceled should be used in addition to onReleased. |
317 */ |
318 */ |
318 |
319 |
319 /*! |
|
320 \internal |
|
321 \class QDeclarativeMouseArea |
|
322 \brief The QDeclarativeMouseArea class provides a simple mouse handling abstraction for use within QML. |
|
323 |
|
324 All QDeclarativeItem derived classes can do mouse handling but the QDeclarativeMouseArea class exposes mouse |
|
325 handling data as properties and tracks flicking and dragging of the mouse. |
|
326 |
|
327 A QDeclarativeMouseArea object can be instantiated in QML using the tag \l MouseArea. |
|
328 */ |
|
329 QDeclarativeMouseArea::QDeclarativeMouseArea(QDeclarativeItem *parent) |
320 QDeclarativeMouseArea::QDeclarativeMouseArea(QDeclarativeItem *parent) |
330 : QDeclarativeItem(*(new QDeclarativeMouseAreaPrivate), parent) |
321 : QDeclarativeItem(*(new QDeclarativeMouseAreaPrivate), parent) |
331 { |
322 { |
332 Q_D(QDeclarativeMouseArea); |
323 Q_D(QDeclarativeMouseArea); |
333 d->init(); |
324 d->init(); |
687 d->lastScenePos = mapToScene(d->lastPos); |
678 d->lastScenePos = mapToScene(d->lastPos); |
688 else if (newGeometry.x() != oldGeometry.x() || newGeometry.y() != oldGeometry.y()) |
679 else if (newGeometry.x() != oldGeometry.x() || newGeometry.y() != oldGeometry.y()) |
689 d->lastPos = mapFromScene(d->lastScenePos); |
680 d->lastPos = mapFromScene(d->lastScenePos); |
690 } |
681 } |
691 |
682 |
692 /*! \internal */ |
|
693 QVariant QDeclarativeMouseArea::itemChange(GraphicsItemChange change, |
683 QVariant QDeclarativeMouseArea::itemChange(GraphicsItemChange change, |
694 const QVariant &value) |
684 const QVariant &value) |
695 { |
685 { |
696 Q_D(QDeclarativeMouseArea); |
686 Q_D(QDeclarativeMouseArea); |
697 switch (change) { |
687 switch (change) { |