Important: Please read the Qt Code of Conduct -

Passing Arguments to a C++ Model (QAbstractTableModel)

  • I am writing a custom C++ QAbstractTableModel model to be used from a QML view.
    I have written a model as a C++ Plugin. This model is referenced by a TableView in a QML file. The Model is supposed to fetch data over a websocket from a remote database. Unfortunately in my setup the websocket has already been made from another View. How do I pass the connection handle or connection information to the Model so that it can fetch the data from server ? I cant find a way to pass arguments to my model. When are the Model objects instantiated ? Is it behind the scenes ? Is there a way of getting a handle to the Model constructor ?

Log in to reply