[Interest] QQmlApplicationEngine::warnings is not emitted
Alexander Dyagilev
alervdvcw at gmail.com
Sat Jan 4 09:27:21 CET 2020
Well, all is OK in my app.
I made some special mistakes in QML code of my app so now it can't be
loaded.
My question is about QQmlApplicationEngine::warnings signal not emitting
for an unknown reason.
On 1/2/2020 5:26 PM, Jérôme Godbout wrote:
>
> You should verify your qmlUrl variables content and see if the
> resources can be found. Print the url and check the binary does have
> access to that url (either a direct file name, relative path or qrc:
> or an absolute path…). If it’s a resource, make sure you do include
> your resources into your build.
>
> The other problem could be that the main qml script is badly written
> and doesn’t load. You can try by making a very basic example with a
> window a a text only to ensure it’s not the content of your main qml
> file or any depending files.
>
> *From:*Interest <interest-bounces at qt-project.org> *On Behalf Of
> *Alexander Dyagilev
> *Sent:* January 1, 2020 11:48 PM
> *To:* interest at qt-project.org Interest <interest at qt-project.org>
> *Subject:* [Interest] QQmlApplicationEngine::warnings is not emitted
>
> Hello,
>
> Why this can happen?
>
> I'm getting empty root objects, errors in Application Output tab in Qt
> Creator and empty qmlWarnings variable.
>
> m_engine.reset(newQQmlApplicationEngine);
>
> QList<QQmlError>qmlWarnings;
> qtconnect(m_engine.data(),&QQmlApplicationEngine::warnings,
> [&qmlWarnings](constQList<QQmlError>&warnings)
> {
> qmlWarnings.append(warnings);
> });
> m_engine->load(qmlUrl);
> if(m_engine->rootObjects().isEmpty())
> {
> m_initFailed.first=true;
> m_errorDesc=QObject::tr("QMLloadfailure.");
> }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20200104/beaf50f2/attachment.html>
More information about the Interest
mailing list