To create a nested QAbstractListModel containing a QAbstractListModel

I have a structure i.e., Menu containing sub menu
I'm creating the ListModel in Qt subclassing the QAbstractListModel

Here's the code

Qt Code:
  1. class MenuItem;
  2.  
  3. class MenuModel : public QAbstractListModel
  4. {
  5. Q_OBJECT
  6. public:
  7. enum MenuRoles {
  8. NameRole = Qt::UserRole + 1
  9. };
  10.  
  11. MenuModel(QObject *parent = 0);
  12.  
  13. void addMenu(const MenuItem &menuitem);
  14.  
  15. int rowCount(const QModelIndex & parent = QModelIndex()) const;
  16.  
  17. QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
  18.  
  19. protected:
  20. QHash<int, QByteArray> roleNames() const;
  21.  
  22. private:
  23. QList<MenuItem> m_menuItems;
  24. };
  25.  
  26. class MenuItem
  27. {
  28. public:
  29. explicit MenuItem();
  30. ~MenuItem();
  31. void setName(QString name);
  32. private:
  33. QString m_strName;
  34. MenuModel m_subMenuModel;
  35. };
To copy to clipboard, switch view to plain text mode 

However I get compile time error saying " error: C2248: 'QAbstractListModel::QAbstractListModel' : cannot access private member declared in class 'QAbstractListModel' "

Is it possible to structure this way? or is there a better way?