From e1743896185dc0313ccac8aa5c8d58abf1cc2b62 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sun, 7 Feb 2016 12:41:24 -0800 Subject: QML UI: another attempt to fix the random crashes I finally was able to reproduce the crashes with the infinite recursion when computing a GridLayout. This seems to be triggered by competing Layout.fillWidth settings that the layout engine couldn't figure out how to accomodate. I did three things to make this work better: - explicitly grab the columnWidth for the width of the DiveDetailsView. - split the GridLayout in two so the area above and below the profile are no longer forced to fit in the same column widths. - remove most of the Layout.fillWidth settings and only leave a couple that seem sufficient to get reasonable on screen layout in my experiments. Here's hoping that this one is finally resolved. Signed-off-by: Dirk Hohndel --- qt-mobile/qml/DiveDetailsView.qml | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'qt-mobile') diff --git a/qt-mobile/qml/DiveDetailsView.qml b/qt-mobile/qml/DiveDetailsView.qml index e3fe59416..e8e2f0f07 100644 --- a/qt-mobile/qml/DiveDetailsView.qml +++ b/qt-mobile/qml/DiveDetailsView.qml @@ -12,8 +12,8 @@ import org.kde.plasma.mobilecomponents 0.2 as MobileComponents Item { id: detailsView property int labelWidth: MobileComponents.Units.gridUnit * 10 - width: parent.width - height: mainLayout.implicitHeight + MobileComponents.Units.iconSizes.large + width: SubsurfaceTheme.columnWidth + height: mainLayout.implicitHeight + bottomLayout.implicitHeight + MobileComponents.Units.iconSizes.large Rectangle { z: 99 color: MobileComponents.Theme.textColor @@ -90,6 +90,8 @@ Item { } MobileComponents.Label { text: dive.depth + Layout.fillWidth: true + wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere } MobileComponents.Label { Layout.alignment: Qt.AlignRight @@ -99,7 +101,6 @@ Item { MobileComponents.Label { text: dive.duration wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere - Layout.fillWidth: true } QMLProfile { @@ -118,6 +119,18 @@ Item { anchors.fill: parent } } + } + GridLayout { + id: bottomLayout + anchors { + top: mainLayout.bottom + left: parent.left + right: parent.right + margins: MobileComponents.Units.gridUnit + } + columns: 4 + rowSpacing: MobileComponents.Units.smallSpacing * 2 + columnSpacing: MobileComponents.Units.smallSpacing MobileComponents.Heading { Layout.fillWidth: true @@ -146,7 +159,6 @@ Item { MobileComponents.Label { id: txtWaterTemp text: dive.waterTemp - Layout.fillWidth: true wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere } @@ -158,7 +170,6 @@ Item { MobileComponents.Label { id: txtSuit text: dive.suit - Layout.fillWidth: true wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere } @@ -170,7 +181,6 @@ Item { MobileComponents.Label { id: txtWeight text: dive.sumWeight - Layout.fillWidth: true wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere } @@ -182,7 +192,6 @@ Item { MobileComponents.Label { id: txtCylinder text: dive.getCylinder - Layout.fillWidth: true wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere } @@ -194,7 +203,6 @@ Item { MobileComponents.Label { id: txtDiveMaster text: dive.divemaster - Layout.fillWidth: true wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere } @@ -206,7 +214,6 @@ Item { MobileComponents.Label { id: txtBuddy text: dive.buddy - Layout.fillWidth: true Layout.columnSpan: 3 wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere } -- cgit v1.2.3-70-g09d2