- Refactor: score and course UI widget management into common files
[scorecard] / src / table-model.h
index c6f16c4..dc3832b 100644 (file)
@@ -5,6 +5,8 @@
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, version 2.
  */
+#ifndef TABLE_MODEL_H
+#define TABLE_MODEL_H
 
 #include <QStringList>
 #include <QAbstractTableModel>
@@ -19,8 +21,9 @@ class ScoreTableModel : public QAbstractTableModel
     Q_OBJECT
 
 public:
-    ScoreTableModel(Score *, Course *, QObject *parent = 0);
+    ScoreTableModel(QObject *parent = 0);
 
+    void set(Score *, Course *);
     int rowCount(const QModelIndex & parent) const;
     int columnCount(const QModelIndex & parent) const;
     QVariant data(const QModelIndex & index, int role) const;
@@ -52,8 +55,9 @@ class CourseTableModel : public QAbstractTableModel
     Q_OBJECT
 
 public:
-    CourseTableModel(Course *, QObject *parent = 0);
+    CourseTableModel(QObject *parent = 0);
 
+    void set(Course *);
     int rowCount(const QModelIndex & parent) const;
     int columnCount(const QModelIndex & parent) const;
     QVariant data(const QModelIndex & index, int role) const;
@@ -78,3 +82,4 @@ private:
     Club *club;
     Course *course;
 };
+#endif