<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 24, 2017 at 3:48 PM, Jan Mulder <span dir="ltr"><<a href="mailto:jlmulder@xs4all.nl" target="_blank">jlmulder@xs4all.nl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail-HOEnZb"><div class="gmail-h5">On 23-10-17 18:23, Jan Mulder wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
On 23-10-17 17:44, Dirk Hohndel wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
On Oct 23, 2017, at 11:41 AM, Tomaz Canabrava <<a href="mailto:tcanabrava@kde.org" target="_blank">tcanabrava@kde.org</a> <mailto:<a href="mailto:tcanabrava@kde.org" target="_blank">tcanabrava@kde.org</a>>> wrote:<br>
<br>
<br>
<br>
On Mon, Oct 23, 2017 at 5:37 PM, Jan Mulder <<a href="mailto:jlmulder@xs4all.nl" target="_blank">jlmulder@xs4all.nl</a> <mailto:<a href="mailto:jlmulder@xs4all.nl" target="_blank">jlmulder@xs4all.nl</a>>> wrote:<br>
<br>
            Unfortunately, very very limited progress. I found out<br>
            that 2nd code fragment above does not tell the whole<br>
            story. Obviously, it needs an "import QtQuick.Controls<br>
            2.2" the get the ApplicationWindow defined. However,<br>
            adding "import org.kde.kirigami 2.0 as Kirigami" triggers<br>
            the exit on the "can't create window object". So, its only<br>
            one input that triggers the error of an almost empty main.qml<br>
<br>
            The big question is now: is it Kirigami or Qt/QML? Of even<br>
            a combination of both?<br>
<br>
<br>
        Have you tried running this under strace to see if it tries to<br>
        open some library that it can't find or something?<br>
        I haven't been able to reproduce this on the desktop, only on<br>
        iOS for some reason - and I have no idea how to run strace<br>
        there :-(<br>
<br>
            I even tried to compile mobile-on-desktop against the beta<br>
            of Qt 5.10.0. No luck there, and the exact same behavior.<br>
<br>
<br>
<br>
    Ok, again having some time after the release of 4.7.1, I<br>
    investigated this issue further.<br>
<br>
    First. I'm (still) very tempted to say that it is a Kirigami<br>
    issue, that's why I put Marco in the to list.<br>
<br>
    With commenting 1 line of code in Kirigami, the Subsurface code:<br>
    engine.load(QUrl(QStringLitera<wbr>l("qrc:///qml/main.qml"))) passes.<br>
    That one line of code is:<br>
<br>
    qmlRegisterSingletonType(compo<wbr>nentUrl(QStringLiteral("Units.<wbr>qml")), uri,<br>
    2, 0, "Units")<br>
<br>
    from kirigamiplugin.cpp.<br>
<br>
    Obviously, our code fails somewhere later, as we use the units<br>
    extensively. Looked trough the git history of Kirigami and do not<br>
    see anything obvious, so I am still not 100% sure that it is<br>
    Kirigami, as there is also some relation to Qt 5.9.2.<br>
<br>
    So, Marco, do you see any lead here what might be going on? I just<br>
    do not understand enough with respect to qmlRegisterType stuff.<br>
<br>
<br>
This tries to register a C++ class into the Javascript engine that serves Qml, it will fail in runtime if it doesn't finds the Qt plugin for the type or if the string with the classname in the qmlRegisterType has a typo.<br>
can you check if your kirigami shared lib is $QT_PLUGIN_PATH ?<br>
</blockquote>
<br>
We're building Kirigami as static library, right? Is something with that broken?<br>
See CMakeLists.txt<br>
</blockquote>
<br>
The function where that one is commented out is KirigamiPlugin::registerTypes(<wbr>). There are at least 20 qml files registered as type. Only the Units.qml poses a problem. There is no issue with not finding libs (and yes its static: add_definitions(-DKIRIGAMI_BUI<wbr>LD_TYPE_STATIC))<br>
</blockquote>
<br></div></div>
Ok, after again multiple hours of searching, trying, bisecting, etc, I finally made some progress.<br>
<br>
I found one commit that is in Qt 5.9.2 (and not in 5.9.1) called "Fix qml cache invalidation when changing dependent C++ registered QML singletons"<br>
(commit 98358715930739ca8de172d88c5ce6<wbr>941c275ff3 in qtdeclarative). Related to QTBUG-62243.<br>
<br>
The rationale of that commit is fully sane to me, but ... I reverted this one, and my problem of unable to start Subsurface-mobile build with 5.9.2 (on desktop, for now) due to a silent failure of engine.load("main.qml") is gone, and the mobile-on-desktop app runs correctly as before.<br>
<br>
So, now the big question is ... how to proceed? I still cannot rule out that the whole issue is a result of some (still unknown) bug in Subsurface itself, or Kirigami or ... But, building a tiny bug demonstrator for Qt might be over my skill set :-)<br>
<br>
For anyone that might wonder how I found this suspicious commit ... I found earlier that the Kirigami file Units.qml was involved, and that is a singleton type object. That made me search for singleton related code changes in Qt.</blockquote><div><br></div><div>This is something that we can poke thiago, and thiago can poke more people.</div><div>And it's a serious issue as this can break a lot of usecases of qt.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail-HOEnZb"><div class="gmail-h5"><br>
<br>
--jan<br>
______________________________<wbr>_________________<br>
subsurface mailing list<br>
<a href="mailto:subsurface@subsurface-divelog.org" target="_blank">subsurface@subsurface-divelog.<wbr>org</a><br>
<a href="http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface" rel="noreferrer" target="_blank">http://lists.subsurface-divelo<wbr>g.org/cgi-bin/mailman/listinfo<wbr>/subsurface</a><br>
</div></div></blockquote></div><br></div></div>