Mike Jackson
2015-12-04 00:07:53 UTC
I am trying to use a ScrollView in a QQuickWidget but the layout does not seem to be honoring what I am wanting. I have a bunch of âLabel/TextFieldâ pairs to the point where there are so many that I need them inside a scrollview. the issue is that if I do that then the TextFields which are set to fill in the rest of the row (inside a GridLayout) does not fill the row. If I remove the ScrollView then the TextField fills the remainder of the row?
Since this is my first foray into QML I am sure I am missing something obvious. this is with Qt 5.5.1 on OS X. Iâll post my
â
Mike Jackson [***@gmail.com <mailto:***@gmail.com>]
import QtQuick 2.4
import QtQuick.Controls 1.4
import QtQuick.Layouts 1.1
import LeroyJsonStorage 1.0
Rectangle {
// Make the background a bit darker
color: "Light Gray"
border.color: "Black"
ScrollView
{
anchors.fill: parent
height: 800
GridLayout {
columns: 2
anchors.fill: parent
Label {
text: "Foo"
Layout.row: 0
}
TextField {
text: "Bar"
Layout.row: 0
Layout.column: 1
Layout.fillWidth: true
}
Label {
text: "Foo"
Layout.row: 1
}
TextField {
text: "Bar"
Layout.row: 1
}
Label {
text: "Foo"
Layout.row: 2
}
TextField {
text: "Bar"
Layout.row: 2
}
Label {
text: "Foo"
Layout.row: 3
}
TextField {
text: "Bar"
Layout.row: 3
}
Label {
text: "Foo"
Layout.row: 4
}
TextField {
text: "Bar"
Layout.row: 4
}
Label {
text: "Foo"
Layout.row: 5
}
TextField {
text: "Bar"
Layout.row: 5
}
Label {
text: "Foo"
Layout.row: 6
}
TextField {
text: "Bar"
Layout.row: 6
}
Label {
text: "Foo"
Layout.row: 7
}
TextField {
text: "Bar"
Layout.row: 7
}
}
}
}
Since this is my first foray into QML I am sure I am missing something obvious. this is with Qt 5.5.1 on OS X. Iâll post my
â
Mike Jackson [***@gmail.com <mailto:***@gmail.com>]
import QtQuick 2.4
import QtQuick.Controls 1.4
import QtQuick.Layouts 1.1
import LeroyJsonStorage 1.0
Rectangle {
// Make the background a bit darker
color: "Light Gray"
border.color: "Black"
ScrollView
{
anchors.fill: parent
height: 800
GridLayout {
columns: 2
anchors.fill: parent
Label {
text: "Foo"
Layout.row: 0
}
TextField {
text: "Bar"
Layout.row: 0
Layout.column: 1
Layout.fillWidth: true
}
Label {
text: "Foo"
Layout.row: 1
}
TextField {
text: "Bar"
Layout.row: 1
}
Label {
text: "Foo"
Layout.row: 2
}
TextField {
text: "Bar"
Layout.row: 2
}
Label {
text: "Foo"
Layout.row: 3
}
TextField {
text: "Bar"
Layout.row: 3
}
Label {
text: "Foo"
Layout.row: 4
}
TextField {
text: "Bar"
Layout.row: 4
}
Label {
text: "Foo"
Layout.row: 5
}
TextField {
text: "Bar"
Layout.row: 5
}
Label {
text: "Foo"
Layout.row: 6
}
TextField {
text: "Bar"
Layout.row: 6
}
Label {
text: "Foo"
Layout.row: 7
}
TextField {
text: "Bar"
Layout.row: 7
}
}
}
}