title: How to expose a list of lists from C++ to Qml?
body: <p><strong>I want to expose a list of QStringlist from C++ to Qml and access its elements and their methods from the QML side.</strong>  </p>
  
  <p><em>Here What I've done so far:</em></p>
  
  <p>this my .h file for a class called manager.</p>
  
  <pre><code>#include &lt;QObject&gt;
  #include &lt;QStringList&gt;
  #include &lt;QList&gt;
  
  class Manager : public QObject
  {
      Q_OBJECT
      Q_PROPERTY(QStringList imagesPaths READ imagesPaths)
      Q_PROPERTY(QStringList imagesPaths READ imagesPaths2)
      Q_PROPERTY(QList&lt;QStringList&gt; imagesPathsLists READ imagesPathsLists)
  
  public:
      explicit Manager(QObject *parent = 0);
  
      QStringList imagesPaths() const;
      QStringList imagesPaths2() const;
      QList&lt;QStringList&gt; imagesPathsLists()const;
  
  signals:
  
  public slots:
  
  private:
      QStringList m_imagesPaths;
      QStringList m_imagesPaths2;
      QList&lt;QStringList&gt; m_imagesPathsLists;
  
  };
  </code></pre>
  
  <p>This is my .CPP file for the class methods implementations</p>
  
  <pre><code>#include "manager.h"
  
  Manager::Manager(QObject *parent) :
      QObject(parent)
  {
      m_imagesPaths &lt;&lt; "one" &lt;&lt; "two" &lt;&lt; "three" &lt;&lt; "four";
      m_imagesPaths2 &lt;&lt; "one-2" &lt;&lt; "two-2" &lt;&lt; "three-2" &lt;&lt; "four-2";
      m_imagesPathsLists &lt;&lt; m_imagesPaths &lt;&lt; m_imagesPaths2;
  }
  
  QStringList Manager::imagesPaths() const
  {
      return m_imagesPaths;
  }
  
  QStringList Manager::imagesPaths2() const
  {
      return m_imagesPaths2;
  }
  
  QList&lt;QStringList&gt; Manager::imagesPathsLists() const
  {
      return m_imagesPathsLists;
  }
  </code></pre>
  
  <p>And the main.cpp file which contain the registration for my Class</p>
  
  <pre><code>#include &lt;QtGui/QGuiApplication&gt;
  #include "qtquick2applicationviewer.h"
  #include &lt;qqmlcontext.h&gt;
  #include "manager.h"
  int main(int argc, char *argv[])
  {
      QGuiApplication app(argc, argv);
  
      QtQuick2ApplicationViewer viewer;
  
      Manager *mng = new Manager();
      QQmlContext *ctxt = viewer.rootContext();
      ctxt-&gt;setContextProperty("Manager",mng);
  
      viewer.setMainQmlFile(QStringLiteral("qml/listOfLists/main.qml"));
      viewer.showExpanded();
  
      return app.exec();
  } 
  </code></pre>
  
  <p>Finally the .Qml file which is trying to get data from the lists </p>
  
  <pre><code>import QtQuick 2.0
  
  Rectangle {
      width: 360
      height: 360
  
      MouseArea {
          anchors.fill: parent
          onClicked: {
              for(var i = 0; i &lt; Manager.imagesPathsLists.count(); i++){
                  for(var j = 0; j &lt; Manager.imagesPathsLists[i].count(); j++){
                      console.log(Manager.imagesPathsLists[i].at(j))
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p>Whenever I click on the rectangle I get the following error </p>
  
  <pre><code>QMetaProperty::read: Unable to handle unregistered datatype 'QList&lt;QStringList&gt;' for property 'Manager::imagesPathsLists'
  file:///E:/DevWork/build-listOfLists-Desktop_Qt_5_2_1_MinGW_32bit-Debug/qml/listOfLists/main.qml:10: TypeError: Cannot call method 'count' of undefined
  </code></pre>
  
  <p>I've been trying to solve this problem for two days now. I tried <strong>QQmlListProperty</strong> but with no success I don't know What I mess.</p>