Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business


OverviewFelgo 3 Support (Qt 5) › Where is ListPage.modelChanged() documented and defined ?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #16657


    Where is ListPage.modelChanged() documented and defined ?  I’m trying out the Felgo Master-Detail Application project template.  I have not modified the example yet.  The example runs fine in debug and release configs. In the MasterPage.qml file there are two calls to masterPage.modelChanged(), in the onClicked() handlers.  But I can not use the IDE tools to go to the definition of this function.  Nor does it show up in the Felgo or QML docs.  And in the debugger it has no source file to go to.  When I step into the call it changes debug context to ‘onModelChanged’, but I can’t find docs or defs on that either.  What gives ?



    Felgo Team

    Hi Bruce!

    ListPage contains a property called model, which defines the data that should be shown. Each property in QML (the programming language) supports reacting to changes of properties via signals.

    The corresponding signal for the model property would be onModelChanged, which is also available using autoCompletion. You can use it like this:

    ListPage {
      onModelChanged: {
         // do something when the model changes!


    The model is often described as an Array of objects. In contrast to simpler data types (like strings or integers), the modelChanged signal is not triggered automatically if some value within the array changes, as Qt does not detect all potentially little changes within a highly variable structure like an array:

    ListPage {
      id: page
      function changeModel() {
         // this will not trigger onModelChanged
         page.model[0] = { text: "New Entry" } 
         // but this will trigger onModelChanged
         page.model = []


    By manually calling modelChanged(), we can trigger the onModelChanged() signal whenever we change some value within the model. Thus all signal handlers run the appropriate code and also the ListPage will update its view to display the newest model version. Otherwise changes won’t be visible or propagated as the signal is not triggered automatically.


    So the reason why modelChanged is not in the API reference or auto-completion, is because it is not something added by Felgo, but just the way how Qt/QML allows to developers to manually trigger signals.

    Hope this helps!



Viewing 2 posts - 1 through 2 (of 2 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded