Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

Presenting Data with QML

Introduction

Qt Quick contains a set of standard items that can be used to present data in a number of different ways. For simple user interfaces, Repeaters can be used in combination with Positioners to obtain pieces of data and arrange them in a user interface. However, when large quantities of data are involved, it is often better to use models with the standard views since these contain many built-in display and navigation features.

Views

Views are scrolling containers for collections of items. They are feature-rich, supporting many of the use cases found in typical applications, and can be customized to meet requirements on style and behavior.

A set of standard views are provided in the basic set of Qt Quick graphical elements:

  • ListView arranges items in a horizontal or vertical list
  • GridView arranges items in a grid within the available space
  • PathView arranges items on a path

Unlike these items, WebView is not a fully-featured view item, and needs to be combined with a Flickable item to create a view that performs like a Web browser.

ListView

ListView shows a classic list of items with horizontal or vertical placing of items.

The following example shows a minimal ListView displaying a sequence of numbers (using an integer as a model). A simple delegate is used to define an items for each piece of data in the model.


 import QtQuick 1.0

 ListView {
     width: 50; height: 200
     model: 4
     delegate: Text {
         text: index;
         font.pixelSize: 40
     }
 }

GridView

GridView displays items in a grid like an file manager's icon view.

PathView

PathView displays items on a path, where the selection remains in the same place and the items move around it.

Decorating Views

Headers and Footers

Sections

Navigation

In traditional user interfaces, views can be scrolled using standard controls, such as scroll bars and arrow buttons. In some situations, it is also possible to drag the view directly by pressing and holding a mouse button while moving the cursor. In touch-based user interfaces, this dragging action is often complemented with a flicking action, where scrolling continues after the user has stopped touching the view.

Further Reading

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 4.8
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web