summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2009-08-05 07:05:59 (GMT)
committerMartin Jones <martin.jones@nokia.com>2009-08-05 07:05:59 (GMT)
commit351257e7553817ea77a7d2d9738456200fc08b68 (patch)
tree8b80b622dc6c5c6a90600cdf981c85a1acee201d /src
parentf55cf4660a9986c83de4573be5ad8444234d2324 (diff)
downloadQt-351257e7553817ea77a7d2d9738456200fc08b68.zip
Qt-351257e7553817ea77a7d2d9738456200fc08b68.tar.gz
Qt-351257e7553817ea77a7d2d9738456200fc08b68.tar.bz2
Document keepMouseFocus
Diffstat (limited to 'src')
-rw-r--r--src/declarative/fx/qfxitem.cpp20
-rw-r--r--src/declarative/fx/qfxitem.h6
2 files changed, 21 insertions, 5 deletions
diff --git a/src/declarative/fx/qfxitem.cpp b/src/declarative/fx/qfxitem.cpp
index b081edc..3411f03 100644
--- a/src/declarative/fx/qfxitem.cpp
+++ b/src/declarative/fx/qfxitem.cpp
@@ -1281,8 +1281,10 @@ void QFxItem::setBaselineOffset(qreal offset)
*/
/*!
- Returns a value indicating whether the mouse should
- remain with this item.
+ Returns a value indicating whether mouse input should
+ remain with this item exclusively.
+
+ \sa setKeepMouseGrab
*/
bool QFxItem::keepMouseGrab() const
{
@@ -1293,6 +1295,20 @@ bool QFxItem::keepMouseGrab() const
/*!
The flag indicating whether the mouse should remain
with this item is set to \a keep.
+
+ This is useful for items that wish to grab and keep mouse
+ interaction following a predefined gesture. For example,
+ an item that is interested in horizontal mouse movement
+ may set keepMouseGrab to true once a threshold has been
+ exceeded. Once keepMouseGrab has been set to true, filtering
+ items will not react to mouse events.
+
+ If the item does not indicate that it wishes to retain mouse grab,
+ a filtering item may steal the grab. For example, Flickable may attempt
+ to steal a mouse grab if it detects that the user has begun to
+ move the viewport.
+
+ \sa keepMouseGrab
*/
void QFxItem::setKeepMouseGrab(bool keep)
{
diff --git a/src/declarative/fx/qfxitem.h b/src/declarative/fx/qfxitem.h
index 4a26c9b..82819ee 100644
--- a/src/declarative/fx/qfxitem.h
+++ b/src/declarative/fx/qfxitem.h
@@ -163,9 +163,6 @@ public:
QmlList<QGraphicsTransform *> *transform();
- bool keepMouseGrab() const;
- void setKeepMouseGrab(bool);
-
qreal width() const;
void setWidth(qreal);
@@ -205,6 +202,9 @@ protected:
virtual QVariant itemChange(GraphicsItemChange, const QVariant &);
virtual void mouseUngrabEvent();
+ bool keepMouseGrab() const;
+ void setKeepMouseGrab(bool);
+
void setImplicitWidth(qreal);
bool widthValid() const; // ### better name?
void setImplicitHeight(qreal);