Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Loader question



  • Hi everyone!

    In my app I have a timer which must refresh UI elements use requests to server. This timer calls method:

    loader.setSource("ContentsView.qml", {manager: root.manager});
    

    every 30 seconds. The ContentsView.qml is a qml file with a lot off other cml files with elements. In my app I'm using signal/slots logic for request and all qml files which shows some information form server content has connects to signals of requests. The my question is: When I call setSource() method the old content removed from memory and all connects to signals is removed? Because I have this problem:

    qrc:///qml/NestleanStatistic.qml:107: TypeError: Cannot read property of null
    qrc:///qml/NestleanStatistic.qml:107: TypeError: Cannot read property of null
    qrc:///qml/NestleanStatistic.qml:107: TypeError: Cannot read property of null
    qrc:///qml/NestleanStatistic.qml:107: TypeError: Cannot read property of null
    qrc:///qml/NestleanStatistic.qml:107: TypeError: Cannot read property of null
    qrc:///qml/NestleanStatistic.qml:107: TypeError: Cannot read property of null
    qrc:///qml/NestleanStatistic.qml:162: TypeError: Cannot read property of null
    qrc:///qml/NestleanStatistic.qml:162: TypeError: Cannot read property of null
    qrc:///qml/NestleanStatistic.qml:162: TypeError: Cannot read property of null
    qrc:///qml/NestleanStatistic.qml:162: TypeError: Cannot read property of null
    qrc:///qml/NestleanStatistic.qml:162: TypeError: Cannot read property of null
    qrc:///qml/NestleanStatistic.qml:162: TypeError: Cannot read property of null
    

    As you can see every time when timer reload Loader cml files has a more and more calls slots. What I do wrong? And the component it not null.


  • Moderators

    @shav

    When I call setSource() method the old content removed from memory and all connects to signals is removed?

    AFAIK, Yes.


Log in to reply