title: QML : reload a model
body: <p>I have a model I'm using in a Combobox. The model is well loaded at start. But I would like to reload it. I tried to use <code>Q_INVOKABLE</code>, but it doesn't work.<br>
  My model is defined in a header :</p>
  
  <pre><code>class StrategiesModel : public QAbstractListModel
  {
  Q_OBJECT
  
  public:
     enum StrategiesRoles{
        textRole =Qt::UserRole + 1
     };
     explicit StrategiesModel(QObject *parent = nullptr);
  
     // Basic functionality:
     int rowCount(const QModelIndex &amp;parent = QModelIndex()) const override;
  
     QVariant data(const QModelIndex &amp;index, int role = Qt::DisplayRole) const override;
  
     QHash&lt;int, QByteArray&gt; roleNames() const override;
  
     Q_INVOKABLE bool loadStrategie();
  
  private:
     QStringList mStrategies;
     const QString mFileName = "listStrategies.txt";
  };
  </code></pre>
  
  <p>and in the source :</p>
  
  <pre><code>    #include "strategiesmodel.h"
  
  StrategiesModel::StrategiesModel(QObject *parent)
      : QAbstractListModel(parent)
  {
      loadStrategie();
  }
  
  int StrategiesModel::rowCount(const QModelIndex &amp;parent) const
  {
      // For list models only the root node (an invalid parent) should return the list's size. For all
      // other (valid) parents, rowCount() should return 0 so that it does not become a tree model.
      if (parent.isValid())
          return 0;
  
      // FIXME: Implement me!
      return mStrategies.size();
  }
  
  QVariant StrategiesModel::data(const QModelIndex &amp;index, int role) const
  {
      if (!index.isValid())
          return QVariant();
  
      // FIXME: Implement me!
      if(role == textRole)
          return QVariant(mStrategies[index.row()]);
      else
          return QVariant();
  }
  
  QHash&lt;int, QByteArray&gt; StrategiesModel::roleNames() const
  {
      QHash&lt;int, QByteArray&gt; roles;
          roles[textRole] = "text";
          return roles;
  }
  
  bool StrategiesModel::loadStrategie()
  {
      mStrategies.clear();
      // Loading list from a file
  }
  </code></pre>
  
  <p>In the main, the model is load like this:</p>
  
  <pre><code>qmlRegisterType&lt;StrategiesModel&gt;("Strategies", 1, 0, "StrategiesModel");
  </code></pre>
  
  <p>But when I tried to reload the model, it fails:</p>
  
  <pre><code>strategies.model: StrategiesModel {} // First load works
  strategies.textRole: "text"
  
  
  refresh.onClicked: function(){
      StrategiesModel.loadStrategie(); // Fail
  }
  </code></pre>
  
  <p>I got this error :</p>
  
  <pre><code>TypeError: Property 'loadStrategie' of object [object Object] is not a function
  </code></pre>
  
  <p>How can I made my function accessible?</p>
  
  <p>Thanks in adavance!</p>