We have moved to a new Sailfish OS Forum. Please start new discussions there.
![]() | 1 | initial version | posted 2016-06-17 10:14:06 +0200 |
In my QML/JS app, why I get every time the initial page is opened, a warning is written to the console? (the warning seems harmless anyhow, but...)
[W] unknown:38 - file:///usr/lib/qt5/qml/Sailfish/Silica/private/Util.js:38: TypeError: Cannot read property 'parent' of null
Looking at the code, the Util page gets a null parent, clear. Why is that? I had the same problem with some other pages, and it seemed to help that I declare all the offending pages in the <application-name.qml> which is invoked right from C++, inside a Component.
ApplicationWindow
{
id: appWindow
---8<--
Component {
id: anotherPage
AnotherPage {}
}
Component {
id: firstPage
FirstPage {}
}
initialPage: firstPage
---8<---
}
The pages are written in their own QML files, of course.
What's the problem, or is this just a charcteristic which just has to be ignored? In my opinion, the errors and warnings should be fixed in applications, or at least there should be a reason to leave them put.
![]() | 2 | No.2 Revision |
In my QML/JS app, why I get every time the initial page is opened, a warning is written to the console? (the warning seems harmless anyhow, but...)
[W] unknown:38 - file:///usr/lib/qt5/qml/Sailfish/Silica/private/Util.js:38: TypeError: Cannot read property 'parent' of null
Looking at the code, the Util page gets a null parent, clear. Why is that?
that?
function findFlickable(item) {
var parentItem = item.parent
I had the same problem with some other pages, and it seemed to help that I declare all the offending pages in the <application-name.qml> which is invoked right from C++, inside a Component.
ApplicationWindow
{
id: appWindow
---8<--
Component {
id: anotherPage
AnotherPage {}
}
Component {
id: firstPage
FirstPage {}
}
initialPage: firstPage
---8<---
}
The pages are written in their own QML files, of course.
Page {
id: firstPage
What's the problem, or is this just a charcteristic which just has to be ignored? In my opinion, the errors and warnings should be fixed in applications, or at least there should be a reason to leave them put.
In my QML/JS app, why I get every time the initial page is opened, a warning is written to the console? (the warning seems harmless anyhow, but...)
[W] unknown:38 - file:///usr/lib/qt5/qml/Sailfish/Silica/private/Util.js:38: TypeError: Cannot read property 'parent' of null
Looking at the code, the Util page gets a null parent, clear. Why is that?
function findFlickable(item) {
var parentItem = item.parent
I had the same problem with some other pages, and it seemed to help that I declare all the offending pages in the <application-name.qml> which is invoked right from C++, inside a Component.
ApplicationWindow
{
id: appWindow
---8<--
Component {
id: anotherPage
AnotherPage {}
}
Component {
id: firstPage
FirstPage {}
}
initialPage: firstPage
---8<---
}
The pages are written in their own QML files, of course. As Pages:
Page {
id: firstPage
What's the problem, or is this just a charcteristic which just has to be ignored? In my opinion, the errors and warnings should be fixed in applications, or at least there should be a reason to leave them put.