diff options
author | Tomi Korpipää <tomi.korpipaa@digia.com> | 2014-04-03 12:06:54 +0300 |
---|---|---|
committer | Tomi Korpipää <tomi.korpipaa@digia.com> | 2014-04-03 12:14:05 +0300 |
commit | fdf486f4eb908c4471830b9a8708ebe7333b7bbe (patch) | |
tree | 47916e96a779401065a20044f65470cf8abf41f3 /examples/datavisualization/custominput/doc | |
parent | 4633bb2121eb37397c7912ec9d54d7b3ba54d44d (diff) |
Axis label dragging support, part 2
Task-number: QTRD-2367
+ Added emitting selection signals
+ Added an example about creating an input handler for axis label dragging
- Snapshot for example docs to be taken
Change-Id: I641f4feb9e31c32023727b1c7c695324923accc4
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Diffstat (limited to 'examples/datavisualization/custominput/doc')
-rw-r--r-- | examples/datavisualization/custominput/doc/src/custominput.qdoc | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/examples/datavisualization/custominput/doc/src/custominput.qdoc b/examples/datavisualization/custominput/doc/src/custominput.qdoc index 59d3c090..46bcdb8d 100644 --- a/examples/datavisualization/custominput/doc/src/custominput.qdoc +++ b/examples/datavisualization/custominput/doc/src/custominput.qdoc @@ -22,49 +22,55 @@ \ingroup qtdatavisualization_examples \brief Implementing custom input handler in a widget application. - The Custom Input example shows how to customize the 3D graph controls in a widget application using a custom graph input handler to capture and process mouse events. - The code in this example shows also how the camera is controlled by using QPropertyAnimation to animate the camera and item selection - is done on mouseover rather than clicking any mouse buttons. Also the code shows how to implement similar zoom with mouse wheel functionality as the default - input handler implements. + The Custom Input example shows how to customize the 3D graph controls in a widget application + using a custom graph input handler to capture and process mouse events. + The code in this example shows also how the camera is controlled by using QPropertyAnimation + to animate the camera and item selection is done on mouseover rather than clicking any mouse + buttons. Also the code shows how to implement similar zoom with mouse wheel functionality as + the default input handler implements. \image custominput-example.png \section1 Replacing default input handling - The default input handling mechanism is replaced by setting the active input handler of \l Q3DScatter - to \c CustomInputHandler that implements the custom behavior. + The default input handling mechanism is replaced by setting the active input handler of + Q3DScatter to \c CustomInputHandler that implements the custom behavior. \snippet custominput/scatterdatamodifier.cpp 0 \section1 Implementing custom selection handling - The on mouseover selection handling is implemented in the \c CustomInputHandler that captures the mouse events. - It then stores the last known coordinates to the \l QAbstract3DInputHandler::inputPosition property. + The on mouseover selection handling is implemented in the \c CustomInputHandler that captures + the mouse events. It then stores the last known coordinates to the + QAbstract3DInputHandler::inputPosition property. \snippet custominput/custominputhandler.cpp 0 - As the selection is one shot, and is cleared each time a 3D frame is rendered, a timer is setup to retrigger selection so that the selection moves to the item - currently under the mouse cursor as the camera animates around the graph even when the mouse cursor is not moving. + As the selection is one shot, and is cleared each time a 3D frame is rendered, a timer is setup + to retrigger selection so that the selection moves to the item currently under the mouse cursor + as the camera animates around the graph even when the mouse cursor is not moving. \snippet custominput/scatterdatamodifier.cpp 1 \section1 Implementing custom zoom handling - The camera has a zoom factor that represents amount of zoom in percentages. In this example the zoom range is limited - between 10% and 500%. This range is then divided to four subranges where \c angleDelta is scaled to different amount of zoom change - based on the current subrange. + The camera has a zoom factor that represents amount of zoom in percentages. In this example the + zoom range is limited between 10% and 500%. This range is then divided to four subranges where + \c angleDelta is scaled to different amount of zoom change based on the current subrange. \snippet custominput/custominputhandler.cpp 1 \section1 Implementing custom camera handling - The camera is animated to constantly rotate around the graph with two animations. The rotation around the graph is done with - a simple QPropertyAnimation that just increments during 20 seconds from 0 degrees to 360 degrees and sets the \l Q3DCamera::xRotation property. + The camera is animated to constantly rotate around the graph with two animations. The rotation + around the graph is done with a simple QPropertyAnimation that just increments during 20 + seconds from 0 degrees to 360 degrees and sets the Q3DCamera::xRotation property. \snippet custominput/scatterdatamodifier.cpp 2 - The camera movement up and down is implemented with a QSequentialAnimationGroup that varies the \l Q3DCamera::yRotation property of the camera - from 5 degrees to 45 degrees and back with in and out easing. + The camera movement up and down is implemented with a QSequentialAnimationGroup that varies + the Q3DCamera::yRotation property of the camera from 5 degrees to 45 degrees and back with in + and out easing. \snippet custominput/scatterdatamodifier.cpp 3 */ |