summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-05-18 07:55:56 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-05-18 07:55:56 (GMT)
commit06557b8d7c472c6298f7d8b310feda225864265f (patch)
tree571e5078ee66377cdadbc07fc7851b334c0d5272 /doc
parent83a2be48a82394ae692d91587c64f8ccd385350f (diff)
parentfa065de6eb49c706feb4a75db7bc0a4618a81a13 (diff)
downloadQt-06557b8d7c472c6298f7d8b310feda225864265f.zip
Qt-06557b8d7c472c6298f7d8b310feda225864265f.tar.gz
Qt-06557b8d7c472c6298f7d8b310feda225864265f.tar.bz2
Merge branch 'master' of git://scm.dev.nokia.troll.no/qt/qt-releng-team
* 'master' of git://scm.dev.nokia.troll.no/qt/qt-releng-team: (195 commits) Re-apply licenseheader text in source files for qt4.8 Revert all QScroller and QFlickGesture related code. Fix regression that caused waitForXXX(-1) to fail. Fix thread safety regression of QNetworkConfigurationManager Fix instability in QNetworkConfigurationManager autotest Support word selection list with predictive text from splitview Fix softkey icon positioning in S60 5.3 QDeclarativeMouseArea: block context menu events ListViews loses items if all visible items are removed. Make TextEdit word selection more natural. Fixed license header. Ensure that recursive QMAKE_EXTRA_TARGETS use the correct makefile Clear confusion between QMainWindow and QMainWindowLayout. Fix for rounded corners bug in QMenu Compile QWidgetPrivate::setParent_sys might be using null pointer Ensure the TextEdit cursor delegate is repositioned on mouse events. Don't crash on an invalid replacementStart from an input method. Fix QGLWidget::renderPixmap for raster engine on Mac Check if OES_texture_npot is present on OpenGL ES 2. ...
Diffstat (limited to 'doc')
-rw-r--r--doc/src/examples/wheel.qdoc109
1 files changed, 0 insertions, 109 deletions
diff --git a/doc/src/examples/wheel.qdoc b/doc/src/examples/wheel.qdoc
deleted file mode 100644
index e14933c..0000000
--- a/doc/src/examples/wheel.qdoc
+++ /dev/null
@@ -1,109 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** GNU Free Documentation License
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms
-** and conditions contained in a signed written agreement between you
-** and Nokia.
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \example scroller/wheel
- \title Wheel Scroller Example
-
- The Wheel Scroller Example shows how to use QScroller, QScrollEvent
- and QScrollPrepareEvent to implement smooth scrolling for a
- custom Widget.
-
- \section1 Basics
-
- The QScroller class is the main part of the smooth scrolling
- mechanism in Qt. It keeps track of the current scroll position and
- speed and updates the object through events.
- QScroller will get touch events via the QFlickGesture.
- It will query the target object through a QScrollPrepareEvent for
- the scroll area and other information.
- QScroller will send QScrollEvents to inform the target object about
- the current scroll position.
- The target object (usually a QWidget or a QGraphicsObject) will
- then need to update it's graphical representation to reflect the
- new scroll position.
-
- \section1 The Wheel Widget class
-
- To demonstrate how to use the QScroller we implement a QWidget that
- looks and works like the wheel of a slot machine.
- The wheel can be started via touch events and will continue getting
- slower.
- Additionally the wheel should appear as if no border exists (which
- would seem unnatural) and the scrolling should snap to center one
- item.
-
- In the widget we need to grab the QFlickGesture. The gesture itself
- will setAcceptTouchEvents for us, so we don't need to do that here.
-
- \snippet examples/scroller/wheel/wheelwidget.cpp 0
-
- The widget will get gesture events but in addition we also will
- get the events from QScroller.
- We will need to accept the QScrollPrepareEvent to indicate that
- a scrolling should really be started from the given position.
-
- \snippet examples/scroller/wheel/wheelwidget.cpp 1
-
- We should call all three set functions form QScrollPrepareEvent.
-
- \list
- \o \c setViewportSize to indicate our viewport size. Actually the
- given code could be improved by giving our size minus the borders.
- \o \c setMaxContentPos to indicate the maximum values for the scroll
- position. The minimum values are implicitely set to 0.
- In our example we give a very high number here and hope that the user
- is not patient enough to scroll until the very end.
- \o \c setContentPos to indicate the current scroll position.
- We give a position in the middle of the huge scroll area.
- Actually we give this position every time a new scroll is started so
- the user will only reach the end if he continuously scrolls in one
- direction which is not very likely.
- \endlist
-
- The handling of the QScrollEvent is a lengthly code not fully shown here.
- \snippet examples/scroller/wheel/wheelwidget.cpp 2
-
- In principle it does three steps.
- \list
- \o It calculates and updates the current scroll position as given by
- QScroller.
- \o It repaints the widget so that the new position is shown.
- \o It centers the item as soon as the scrolling stopps.
- \endlist
-
- The following code does the centering.
- \snippet examples/scroller/wheel/wheelwidget.cpp 3
-
- We check if the scrolling is finished which is indicated in the
- QScrollEvent by the \c isLast flag.
- We then check if the item is not already centered and if not start a new
- scroll by calling QScroller::scrollTo.
-
- As you can see the QScroller can be used for other things besides simple
- scroll areas.
-*/