RowLayout QML Type
Idêntico a GridLayout, mas com apenas uma linha. Mais...
| Import Statement: | import QtQuick.Layouts |
| Inherits: |
Propriedades
- layoutDirection : enumeration
(since QtQuick.Layouts 1.1) - spacing : real
- uniformCellSizes : bool
(since QtQuick.Layouts 6.6)
Descrição detalhada
Para utilizar esse tipo de maneira mais eficiente, recomenda-se que você compreenda o mecanismo geral do módulo Layouts do Qt Quick. Consulte a Visão geral do Layouts doQt Quick para obter mais informações.
Ele está disponível para facilitar o trabalho dos desenvolvedores, pois oferece uma API mais simples.
Os itens em um RowLayout suportam estas propriedades anexadas:
- Layout.minimumWidth
- Layout.minimumHeight
- Layout.preferredWidth
- Layout.preferredHeight
- Layout.maximumWidth
- Layout.maximumHeight
- Layout.fillWidth
- Layout.fillHeight
- Layout.alignment
- Layout.margins
- Layout.leftMargin
- Layout.rightMargin
- Layout.topMargin
- Layout.bottomMargin
- Layout.horizontalStretchFactor
- Layout.verticalStretchFactor

RowLayout {
id: layout
anchors.fill: parent
spacing: 6
Rectangle {
color: 'teal'
Layout.fillWidth: true
Layout.minimumWidth: 50
Layout.preferredWidth: 100
Layout.maximumWidth: 300
Layout.minimumHeight: 150
Text {
anchors.centerIn: parent
text: parent.width + 'x' + parent.height
}
}
Rectangle {
color: 'plum'
Layout.fillWidth: true
Layout.minimumWidth: 100
Layout.preferredWidth: 200
Layout.preferredHeight: 100
Text {
anchors.centerIn: parent
text: parent.width + 'x' + parent.height
}
}
}Leia mais sobre propriedades anexadas aqui.
Veja também ColumnLayout, GridLayout, StackLayout, Row e Visão geral dos layouts doQt Quick .
Documentação de propriedades
layoutDirection : enumeration [since QtQuick.Layouts 1.1]
Essa propriedade define a direção do layout da linha — ela controla se os itens são dispostos da esquerda para a direita ou da direita para a esquerda. Se for especificado “ Qt.RightToLeft ”, os itens alinhados à esquerda passarão a ser alinhados à direita, e os itens alinhados à direita passarão a ser alinhados à esquerda.
Valores possíveis:
| Constante | Descrição |
|---|---|
Qt.LeftToRight | (padrão) Os itens são dispostos da esquerda para a direita. |
Qt.RightToLeft | Os itens são dispostos da direita para a esquerda |
Essa propriedade foi introduzida no QtQuick.Layouts 1.1.
Veja também GridLayout::layoutDirection e ColumnLayout::layoutDirection.
spacing : real
Essa propriedade define o espaçamento entre cada célula. O valor padrão é 5.
uniformCellSizes : bool [since QtQuick.Layouts 6.6]
Se essa propriedade for definida como ` true`, o layout forçará todas as células a terem um tamanho uniforme.
Essa propriedade foi introduzida no QtQuick.Layouts 6.6.
Veja também ` GridLayout::uniformCellWidths`, ` GridLayout::uniformCellHeights` e ` ColumnLayout::uniformCellSizes`.
© 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.