How to get rid of: TypeError: 'parent' of null @ Util.js:38 ?
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.</application-name.qml>
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.
show code where you using flickables
coderus ( 2016-06-17 17:56:26 +0200 )editIt's all there: https://github.com/alketola/harbour-ostos/tree/master/qml/
Almost all pages have a sort of Silica flickable, these have SilicaFlickable: https://github.com/alketola/harbour-ostos/blob/master/qml/harbour-ostos.qmlhttps://github.com/alketola/harbour-ostos/blob/master/qml/pages/ItemEditPage.qmlhttps://github.com/alketola/harbour-ostos/blob/master/qml/pages/SettingsPage.qml
In particular, there is a SilicaListView inside a SilicaFlickable in ItemAddPage...is it bad? https://github.com/alketola/harbour-ostos/blob/master/qml/pages/ItemAddPage.qml lines 63, 101
Thanks for your interest.
mobilitio ( 2016-06-17 20:21:23 +0200 )edittry assigning flickable: theFlickable for DialogHeader
coderus ( 2016-06-17 20:33:31 +0200 )editI removed the how-to tag, as that is for posts explaining how to solve an issue. And added some useful tags instead.
Tanghus ( 2018-12-03 19:08:24 +0200 )edit