diff data/model/ModelDataTableModel.h @ 1748:91a194e2d80b by-id

Update to ModelId
author Chris Cannam
date Wed, 03 Jul 2019 14:20:19 +0100
parents c01cbe41aeb5
children 356be36b2391
line wrap: on
line diff
--- a/data/model/ModelDataTableModel.h	Tue Jul 02 15:28:51 2019 +0100
+++ b/data/model/ModelDataTableModel.h	Wed Jul 03 14:20:19 2019 +0100
@@ -22,6 +22,9 @@
 
 #include "base/BaseTypes.h"
 
+#include "TabularModel.h"
+#include "Model.h"
+
 class TabularModel;
 class Command;
 
@@ -30,7 +33,7 @@
     Q_OBJECT
 
 public:
-    ModelDataTableModel(TabularModel *m);
+    ModelDataTableModel(ModelId modelId); // a TabularModel
     virtual ~ModelDataTableModel();
 
     QVariant data(const QModelIndex &index, int role) const override;
@@ -75,7 +78,11 @@
     void modelAboutToBeDeleted();
 
 protected:
-    TabularModel *m_model;
+    std::shared_ptr<TabularModel> getTabularModel() const {
+        return ModelById::getAs<TabularModel>(m_model);
+    }
+    
+    ModelId m_model;
     int m_sortColumn;
     Qt::SortOrder m_sortOrdering;
     int m_currentRow;