QML UI: brute force around Qt 5.6.0 bug

With the current release candidate of Qt 5.6.0 we get into an infinite
recursion of the grid layout engine. This had happened before (prior to the 5.6
beta) and it appeared that setting the maximum width of the columns was
sufficient to fix this. But with the RC even that isn't sufficient, so now we
give up on having QML figure out the best possible column width and hard code
both preferred and maximum width to the same, predefined values. That's a total
shame, but at least now we can build against Qt 5.6 without infinite recursions
and crashes.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2016-03-03 14:36:57 -08:00
parent 0cad6d206c
commit 80f29bd3f6

View file

@ -148,6 +148,7 @@ Item {
wrapMode: Text.WrapAtWordBoundaryOrAnywhere wrapMode: Text.WrapAtWordBoundaryOrAnywhere
opacity: 0.6 opacity: 0.6
Layout.maximumWidth: detailsView.col1Width Layout.maximumWidth: detailsView.col1Width
Layout.preferredWidth: detailsView.col1Width
Layout.alignment: Qt.AlignRight Layout.alignment: Qt.AlignRight
} }
MobileComponents.Label { MobileComponents.Label {
@ -155,6 +156,7 @@ Item {
text: dive.suit text: dive.suit
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
Layout.maximumWidth: detailsView.col2Width Layout.maximumWidth: detailsView.col2Width
Layout.preferredWidth: detailsView.col2Width
} }
MobileComponents.Label { MobileComponents.Label {
@ -162,6 +164,7 @@ Item {
wrapMode: Text.WrapAtWordBoundaryOrAnywhere wrapMode: Text.WrapAtWordBoundaryOrAnywhere
opacity: 0.6 opacity: 0.6
Layout.maximumWidth: detailsView.col3Width Layout.maximumWidth: detailsView.col3Width
Layout.preferredWidth: detailsView.col3Width
Layout.alignment: Qt.AlignRight Layout.alignment: Qt.AlignRight
} }
MobileComponents.Label { MobileComponents.Label {
@ -169,6 +172,7 @@ Item {
text: dive.airTemp text: dive.airTemp
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
Layout.maximumWidth: detailsView.col4Width Layout.maximumWidth: detailsView.col4Width
Layout.preferredWidth: detailsView.col4Width
} }
MobileComponents.Label { MobileComponents.Label {
@ -176,6 +180,7 @@ Item {
wrapMode: Text.WrapAtWordBoundaryOrAnywhere wrapMode: Text.WrapAtWordBoundaryOrAnywhere
opacity: 0.6 opacity: 0.6
Layout.maximumWidth: detailsView.col1Width Layout.maximumWidth: detailsView.col1Width
Layout.preferredWidth: detailsView.col1Width
Layout.alignment: Qt.AlignRight Layout.alignment: Qt.AlignRight
} }
MobileComponents.Label { MobileComponents.Label {
@ -183,6 +188,7 @@ Item {
text: dive.getCylinder text: dive.getCylinder
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
Layout.maximumWidth: detailsView.col2Width Layout.maximumWidth: detailsView.col2Width
Layout.preferredWidth: detailsView.col2Width
} }
MobileComponents.Label { MobileComponents.Label {
@ -190,6 +196,7 @@ Item {
wrapMode: Text.WrapAtWordBoundaryOrAnywhere wrapMode: Text.WrapAtWordBoundaryOrAnywhere
opacity: 0.6 opacity: 0.6
Layout.maximumWidth: detailsView.col3Width Layout.maximumWidth: detailsView.col3Width
Layout.preferredWidth: detailsView.col3Width
Layout.alignment: Qt.AlignRight Layout.alignment: Qt.AlignRight
} }
MobileComponents.Label { MobileComponents.Label {
@ -197,6 +204,7 @@ Item {
text: dive.waterTemp text: dive.waterTemp
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
Layout.maximumWidth: detailsView.col4Width Layout.maximumWidth: detailsView.col4Width
Layout.preferredWidth: detailsView.col4Width
} }
MobileComponents.Label { MobileComponents.Label {
@ -204,6 +212,7 @@ Item {
wrapMode: Text.WrapAtWordBoundaryOrAnywhere wrapMode: Text.WrapAtWordBoundaryOrAnywhere
opacity: 0.6 opacity: 0.6
Layout.maximumWidth: detailsView.col1Width Layout.maximumWidth: detailsView.col1Width
Layout.preferredWidth: detailsView.col1Width
Layout.alignment: Qt.AlignRight Layout.alignment: Qt.AlignRight
} }
MobileComponents.Label { MobileComponents.Label {
@ -211,6 +220,7 @@ Item {
text: dive.divemaster text: dive.divemaster
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
Layout.maximumWidth: detailsView.col2Width Layout.maximumWidth: detailsView.col2Width
Layout.preferredWidth: detailsView.col2Width
} }
MobileComponents.Label { MobileComponents.Label {
@ -218,6 +228,7 @@ Item {
wrapMode: Text.WrapAtWordBoundaryOrAnywhere wrapMode: Text.WrapAtWordBoundaryOrAnywhere
opacity: 0.6 opacity: 0.6
Layout.maximumWidth: detailsView.col3Width Layout.maximumWidth: detailsView.col3Width
Layout.preferredWidth: detailsView.col3Width
Layout.alignment: Qt.AlignRight Layout.alignment: Qt.AlignRight
} }
MobileComponents.Label { MobileComponents.Label {
@ -225,6 +236,7 @@ Item {
text: dive.sumWeight text: dive.sumWeight
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
Layout.maximumWidth: detailsView.col4Width Layout.maximumWidth: detailsView.col4Width
Layout.preferredWidth: detailsView.col4Width
} }
MobileComponents.Label { MobileComponents.Label {
@ -232,6 +244,7 @@ Item {
wrapMode: Text.WrapAtWordBoundaryOrAnywhere wrapMode: Text.WrapAtWordBoundaryOrAnywhere
opacity: 0.6 opacity: 0.6
Layout.maximumWidth: detailsView.col1Width Layout.maximumWidth: detailsView.col1Width
Layout.preferredWidth: detailsView.col1Width
Layout.alignment: Qt.AlignRight Layout.alignment: Qt.AlignRight
} }
MobileComponents.Label { MobileComponents.Label {
@ -240,6 +253,7 @@ Item {
Layout.columnSpan: 3 Layout.columnSpan: 3
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
Layout.maximumWidth: detailsView.col2Width + detailsView.col3Width + detailsView.col4Width Layout.maximumWidth: detailsView.col2Width + detailsView.col3Width + detailsView.col4Width
Layout.preferredWidth: detailsView.col2Width + detailsView.col3Width + detailsView.col4Width
} }
MobileComponents.Heading { MobileComponents.Heading {