Positioner QML Type
Proporciona propiedades asociadas que contienen detalles sobre la ubicación de un elemento en un posicionador. Más...
| Import Statement: | import QtQuick |
Propiedades asociadas
- index : int
- isFirstItem : bool
- isLastItem : bool
Descripción detallada
Un objeto de tipo «Positioner» se adjunta al elemento secundario de nivel superior dentro de una columna, fila, flujo o cuadrícula. Proporciona propiedades que permiten a un elemento secundario determinar dónde se encuentra dentro del diseño de su columna, fila, flujo o cuadrícula principal.
Por ejemplo, a continuación se muestra una « Grid » con 16 rectángulos hijos, creada mediante un « Repeater ». Cada « Rectangle » muestra su índice en la «Grid» utilizando « Positioner.index », y el primer elemento se colorea de forma diferente teniendo en cuenta « Positioner.isFirstItem »:
Grid {
Repeater {
model: 16
Rectangle {
id: rect
width: 30; height: 30
border.width: 1
color: Positioner.isFirstItem ? "yellow" : "lightsteelblue"
Text { text: rect.Positioner.index }
}
}
}
Documentación de la propiedad adjunta
Positioner.index : int [read-only attached]
Esta propiedad permite que el elemento determine su índice dentro del posicionador.
Positioner.isFirstItem : bool [read-only attached]
Positioner.isLastItem : bool [read-only attached]
Estas propiedades permiten que el elemento determine si es el primero o el último elemento del posicionador, respectivamente.
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.