aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel d'Andrada <daniel.dandrada@nokia.com>2010-11-18 12:49:05 +0200
committerDaniel d'Andrada <daniel.dandrada@nokia.com>2010-11-18 12:49:05 +0200
commit4e18f291b25d24c2e7300cd2981b77b7d9ddde2a (patch)
tree0c088b70403a56eac7cea54db8641c2e883c96be
parent5d613573e905c659bfe16350b0d371b52127be41 (diff)
Changes: Remove setAcceptTouchEvents() and grabGesture() calls from examples.
RevBy: TrustMe Details: MSceneWindow already does all that, so there's no need to do it again in inherited classes.
-rw-r--r--demos/widgetsgallery/imagepage.cpp3
-rw-r--r--demos/widgetsgallery/itemdetailpage.cpp2
-rw-r--r--doc/src/tutorial.dox14
-rw-r--r--examples/gestures/mypage.cpp21
-rw-r--r--examples/tutorial_music_catalogue/albumpage.cpp3
5 files changed, 1 insertions, 42 deletions
diff --git a/demos/widgetsgallery/imagepage.cpp b/demos/widgetsgallery/imagepage.cpp
index f9ec3312..3c2124fc 100644
--- a/demos/widgetsgallery/imagepage.cpp
+++ b/demos/widgetsgallery/imagepage.cpp
@@ -49,9 +49,6 @@ ImagePage::ImagePage() :
sliderValues[ImageZoom] = 10;
sliderValues[ImageTransparency] = 0;
sliderValues[ImageCrop] = 0;
-
- setAcceptTouchEvents(true);
- grabGesture(Qt::PinchGesture);
}
ImagePage::~ImagePage()
diff --git a/demos/widgetsgallery/itemdetailpage.cpp b/demos/widgetsgallery/itemdetailpage.cpp
index 3ed85755..abad7ef3 100644
--- a/demos/widgetsgallery/itemdetailpage.cpp
+++ b/demos/widgetsgallery/itemdetailpage.cpp
@@ -128,8 +128,6 @@ ItemDetailPage::ItemDetailPage() :
lastScaleFactor(1.0)
{
setObjectName("itemDetailPage");
- setAcceptTouchEvents(true);
- grabGesture(Qt::PinchGesture);
}
ItemDetailPage::~ItemDetailPage()
diff --git a/doc/src/tutorial.dox b/doc/src/tutorial.dox
index 7b05ad32..8b37f3cc 100644
--- a/doc/src/tutorial.dox
+++ b/doc/src/tutorial.dox
@@ -242,19 +242,7 @@ MeeGo Touch supports multipoint touch screens. Therefore, interactions such as p
The following example illustrates how to include gestures in the applications. In the example, the album cover image in the AlbumPage of our Music Catalogue application is made to support pinching gestures. By pinching the cover image you can zoom in and out.
-1. Tell the framework that AlbumPage is interested in getting touch events and subscribe the AlbumPage to receive pinching gestures:
-
-\code
-AlbumPage::AlbumPage(const Album *album, QGraphicsItem *parent)
- : MApplicationPage(parent), album(album), albumCover(0)
-{
- ...
- setAcceptTouchEvents(true);
- grabGesture(Qt::PinchGesture);
-}
-\endcode
-
-2. Reimplement the virtual method <code>MWidget::pinchGestureEvent()</code> to handle the pinching gestures.
+We just have to reimplement the virtual method <code>MWidget::pinchGestureEvent()</code> to handle the pinching gestures.
Add the following to <code>albumpage.h</code>:
\code
diff --git a/examples/gestures/mypage.cpp b/examples/gestures/mypage.cpp
index cb5f716e..0c56c152 100644
--- a/examples/gestures/mypage.cpp
+++ b/examples/gestures/mypage.cpp
@@ -18,27 +18,6 @@ MyPage::MyPage(QGraphicsItem *parent)
{
setTitle("Gestures example");
- // This enables delivery of low-level touch events to the widget.
- // While we aren't directly interested in these, on a multitouch
- // capable system the pinch gesture is recognized by the touch events.
- setAcceptTouchEvents(true);
-
- // The grabGesture methods enables delivery of the high-level gesture
- // events (QPinchGesture and QSwipeGesture in our case) to the widget.
- //
- // The reason the gestures are handled by the page instead of the
- // actual image widget, is that we want the entire page area to
- // function as a single pinching/rotating/swiping surface.
- //
- // In general, you should handle gestures on the largest possible
- // area, even if it holds multiple widgets. In case of multiple widgets,
- // you can determine the target of the gesture using the event's hotSpot
- // property.
- grabGesture(Qt::TapGesture);
- grabGesture(Qt::TapAndHoldGesture);
- grabGesture(Qt::PinchGesture);
- grabGesture(Qt::SwipeGesture);
-
// Setting up our animations
swipeAnimation = new QParallelAnimationGroup(this);
diff --git a/examples/tutorial_music_catalogue/albumpage.cpp b/examples/tutorial_music_catalogue/albumpage.cpp
index 18facc02..10c2c652 100644
--- a/examples/tutorial_music_catalogue/albumpage.cpp
+++ b/examples/tutorial_music_catalogue/albumpage.cpp
@@ -14,9 +14,6 @@ AlbumPage::AlbumPage(const Album *album, QGraphicsItem *parent)
{
setTitle(album->title);
connect(this, SIGNAL(appeared()), SLOT(fadeInAlbumCover()));
-
- setAcceptTouchEvents(true);
- grabGesture(Qt::PinchGesture);
}
void AlbumPage::createContent()