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  · 

QML Column Element

The Column item arranges its children vertically. More...

Inherits Item

This element was introduced in Qt 4.7.

Properties

Detailed Description

The Column item positions its child items so that they are vertically aligned and not overlapping.

Spacing between items can be added using the spacing property. Transitions can be used for cases where items managed by a Column are added or moved. These are stored in the add and move properties respectively.

See Using QML Positioner and Repeater Items for more details about this item and other related items.

Example Usage

The following example positions differently shaped rectangles using a Column item.

 Column {
     spacing: 2
     Rectangle { color: "red"; width: 50; height: 50 }
     Rectangle { color: "green"; width: 20; height: 50 }
     Rectangle { color: "blue"; width: 50; height: 20 }
 }

Using Transitions

Transitions can be used to animate items that are added to, moved within, or removed from a Column item. The add and move properties can be set to the transitions that will be applied when items are added to, removed from, or re-positioned within a Column item.

The use of transitions with positioners is described in more detail in the Using QML Positioner and Repeater Items document.

 Column {
     spacing: 2
     add: Transition {
         // Define an animation for adding a new item...
     }
     move: Transition {
         // Define an animation for moving items within the column...
     }
     // ...
 }

Limitations

Note that the positioner assumes that the x and y positions of its children will not change. If you manually change the x or y properties in script, bind the x or y properties, use anchors on a child of a positioner, or have the height of a child depend on the position of a child, then the positioner may exhibit strange behavior. If you need to perform any of these actions, consider positioning the items without the use of a Column.

Items with a width or height of 0 will not be positioned.

See also Row, Grid, Flow, and Positioners example.

Property Documentation

This property holds the transition to be applied when adding an item to the positioner. The transition will only be applied to the added item(s). Positioner transitions will only affect the position (x, y) of items.

For a positioner, adding an item can mean that either the object has been created or reparented, and thus is now a child or the positioner, or that the object has had its opacity increased from zero, and thus is now visible.

See also move.


move : Transition

This property holds the transition to apply when moving an item within the positioner. Positioner transitions will only affect the position (x, y) of items.

This transition can be performed when other items are added or removed from the positioner, or when items resize themselves.

 Column {
     move: Transition {
         NumberAnimation {
             properties: "y"
             easing.type: Easing.OutBounce
         }
     }
 }

See also add and Positioners example.


spacing : int

The spacing is the amount in pixels left empty between adjacent items. The default spacing is 0.

See also Grid::spacing.


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