Qt Simulator Manual 1.2.0

Simulating Touch

Touch screens allow users to interact with devices by touching the screen with one or more fingers. When designing applications for touch screen, try to minimise user input. Using a touch screen increases the risk of errors during data input, when compared with using a keypad.

Touch screens consume most power during touch operations. Avoid unnecessary user interaction also to increase power efficiency. Specifically, with resistive touch screens, avoid excessively long touch and drag actions. The continuous touch event flow keeps the CPU busy. The screen lock turns off the touch completely.

To prevent user errors, design user interaction so that navigation and controls are clear and meaningful. Meaningful controls are easy to learn and remember. For example, strokes along the touch screen should produce a logical outcome.

Qt includes a framework for gesture programming that forms gestures from a series of events, independently of the input methods used. A gesture can be a particular movement of a mouse, a touch screen action, or a series of events from some other source. The nature of the input, the interpretation of the gesture and the action taken are the choice of the developer.

You can use Qt Simulator to test several types of gestures that you can implement by using the classes in the the Qt gestures framework:

Testing Touch Events

"Touch view"

In the Multipoint-touch view, select the type of touch event to simulate:

  • Default mode (Alt+1) simulates tapping the screen with a finger.
  • Pinch mode (Alt+2) simulates a two-finger stroke that is typically used to change the scale factor, zoom, or level of detail of the user interface. To pinch open, users place two fingers close together on the screen and move them apart without lifting them from the screen. Similarly, to pinch close, users move the fingers toward each other.
  • Pan mode (Alt+3) simulates using a finger to drag content on the screen, instead of using a scroll bar for movement.
  • Swipe mode (Alt+4) simulates sliding 3 fingers quickly left or right on the screen. Swipe may be used, for example, when viewing images: an image is swiped left or right to view the next or previous image, respectively.
  • Free mode (Alt+5) allows you to select scripts that simulate touch events.

Pinch Mode

To simulate a pinch gesture, click on the screen to set the reference point, and then click and drag the mouse to move the touch points that represent the user's fingers.

"Pinch mode

Pan Mode

To simulate a pan event, click on the screen, and then click again and drag the mouse to move the content on the screen.

"Pan mode"

Swipe Mode

To simulate a swipe gesture, click on the screen twice to set two touch points, and then click again and drag the mouse left or right to move to the previous or next item, for example.

"Swipe mode"

Note: Swipe gestures require 3 touch points to be recognized, and therefore, they only work on devices that have 3 touch points. For example, the Nokia N8 only has 2 touch points and does not support swipe gestures.

Free Mode

To run scripts that simulate touch events, click Browse to locate the script on the development PC. Click on the screen to run the script.

In the scripts, you can either use screen cordinates to indicate touch points, or specify them as relative to the position of the mouse on the screen. For example, see the touch script examples in scripts/examples/.


Thank you for giving your feedback.

Make sure it is related to this specific page. For more general bugs and requests, please use the Qt Bug Tracker.

[0]; s.parentNode.insertBefore(ga, s); })();