<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 2 May 2016 at 22:33, Marco Martin <span dir="ltr"><<a href="mailto:notmart@gmail.com" target="_blank">notmart@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Mon, May 2, 2016 at 5:14 AM, Thiago Macieira <<a href="mailto:thiago@macieira.org">thiago@macieira.org</a>> wrote:<br>
> That means the layout is unstable. When asked for what its preferred size is<br>
> on qquicklinearlayout.cpp:414<br>
>     const QSizeF pref = sizeHint(Qt::PreferredSize);<br>
> the answer does not stabilise.<br>
><br>
> I have absolutely no idea how the layout engine works. The only hint I have is<br>
> to check whether the constraints (the anchors) in whatever page is causing<br>
> this issue make sense.<br>
<br>
</span>I have a patch that even if is a bit a work around, I think it makes<br>
things more reliable anyways (so would be good even if the bug wasn't<br>
there).<br>
<br>
Can somebody hitting the crash on iOS or on the devel machine try to<br>
rebuild with attached patch?<br>
<br>
putting some debug around, I seen that the things that were actually<br>
returning a non stable size hint were some Label elements (so in the<br>
end the primitive Text element)<br>
those with "Buddy:" "Cylinder:" and so on.<br>
<br>
One thing I seen is that every single text element in that grid layout<br>
had wrap anywhere set. Regardless of the upstream bug that probably is<br>
indeed there, this can cause problems, as we have a grid of two<br>
columns, with each column having its width that depends from the width<br>
of the other. Since the implicit width depends from text layouting, if<br>
the text can wrap anywhere, if i resize the label, making it wrapping<br>
to two lines, its implicit width will change as well, so it seems this<br>
infinite recursion was due to the label answering once that it wanted<br>
its size as one line, the time after as wrapped in two lines, then as<br>
one line again etc.<br>
<br>
I think disabling wrapping for those small labels helps. it solves the<br>
crash for me.<br>
if as the attached patch disabling the wrapping altogether is deemed<br>
too much, using WordWrap as wrapmode would be already better (trying<br>
hard to wrap at word boundaries before splitting words).<br>
<br></blockquote><div>I don't have an idevice, and my android build isn't working at the moment.  But I did test with subsurface-mobile on the desktop (Linux).  The patch appeared to make it less fragile, but I did still run into an infinite loop.  I think maybe you haven't gone far enough.  I haven't tracked it down, but I'm suspicious of anywhere we wrap AND set the preferred width (numerous places in divedetailsview.qml).<br><br>It's my bedtime now, but it's worth testing dives with long or very long field entries (suit, buddy, etc.).<br><br></div><div>Of course, it would be nice if qml were made to be smart enough that it can detect when an infinite loop exists, and exit with a default width property.  I'm quite sure that's easier said than done.<br></div><div> <br></div></div></div></div>