On Mon, May 2, 2016 at 5:14 AM, Thiago Macieira <[email protected]> wrote: > That means the layout is unstable. When asked for what its preferred size is > on qquicklinearlayout.cpp:414 > const QSizeF pref = sizeHint(Qt::PreferredSize); > the answer does not stabilise. > > I have absolutely no idea how the layout engine works. The only hint I have is > to check whether the constraints (the anchors) in whatever page is causing > this issue make sense.
I have a patch that even if is a bit a work around, I think it makes things more reliable anyways (so would be good even if the bug wasn't there). Can somebody hitting the crash on iOS or on the devel machine try to rebuild with attached patch? putting some debug around, I seen that the things that were actually returning a non stable size hint were some Label elements (so in the end the primitive Text element) those with "Buddy:" "Cylinder:" and so on. One thing I seen is that every single text element in that grid layout had wrap anywhere set. Regardless of the upstream bug that probably is indeed there, this can cause problems, as we have a grid of two columns, with each column having its width that depends from the width of the other. Since the implicit width depends from text layouting, if the text can wrap anywhere, if i resize the label, making it wrapping to two lines, its implicit width will change as well, so it seems this infinite recursion was due to the label answering once that it wanted its size as one line, the time after as wrapped in two lines, then as one line again etc. I think disabling wrapping for those small labels helps. it solves the crash for me. if as the attached patch disabling the wrapping altogether is deemed too much, using WordWrap as wrapmode would be already better (trying hard to wrap at word boundaries before splitting words). -- Marco Martin
From 921b87aa0117b46f22e86f414eb6137d539c9470 Mon Sep 17 00:00:00 2001 From: Marco Martin <[email protected]> Date: Mon, 2 May 2016 14:17:08 +0200 Subject: [PATCH] Don't wrap labels if the text in every column can wrap anywhre, we don't have a stable way to know how large the columns themselves may be. This can cause an infinite recursion while trying to figure out the width of the items, as the sizeHint(Qt::ImplicitSize) of those labels (Buddy, Cylinder etc) will not be stable as it will once return the size of the text wrapped and once the size of the text not wrapped. Signed-off-by: Marco Martin <[email protected]> --- mobile-widgets/qml/DiveDetailsView.qml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/mobile-widgets/qml/DiveDetailsView.qml b/mobile-widgets/qml/DiveDetailsView.qml index f7b2980..04121ca 100644 --- a/mobile-widgets/qml/DiveDetailsView.qml +++ b/mobile-widgets/qml/DiveDetailsView.qml @@ -174,7 +174,6 @@ Item { Kirigami.Label { text: "Cylinder:" - wrapMode: Text.WrapAtWordBoundaryOrAnywhere opacity: 0.6 Layout.maximumWidth: detailsView.col1Width Layout.preferredWidth: detailsView.col1Width @@ -222,7 +221,6 @@ Item { Kirigami.Label { text: "Weight:" - wrapMode: Text.WrapAtWordBoundaryOrAnywhere opacity: 0.6 Layout.maximumWidth: detailsView.col3Width Layout.preferredWidth: detailsView.col3Width @@ -252,7 +250,6 @@ Item { Kirigami.Label { text: "Buddy:" - wrapMode: Text.WrapAtWordBoundaryOrAnywhere opacity: 0.6 Layout.maximumWidth: detailsView.col1Width Layout.preferredWidth: detailsView.col1Width @@ -268,7 +265,6 @@ Item { Kirigami.Label { text: "SAC:" - wrapMode: Text.WrapAtWordBoundaryOrAnywhere opacity: 0.6 Layout.maximumWidth: detailsView.col3Width Layout.preferredWidth: detailsView.col3Width -- 2.1.4
_______________________________________________ subsurface mailing list [email protected] http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
