ProjectModel::ProjectModel(Storage *storage, QObject *parent) : QAbstractItemModel(parent){ storage_ptr = storage; QObject::connect(storage_ptr, SIGNAL(taskEdited()), this, SLOT( dataEdited() ));}void ProjectModel::dataEdited(){ emit dataChanged(this->index(0,0,QModelIndex()),this->index(rowCount(QModelIndex),0,QModelIndex()));}TaskModel::TaskModel(Storage *storage, QObject *parent) : QAbstractItemModel(parent){ storage_ptr = storage; QObject::connect(storage_ptr, SIGNAL(taskEdited()), this, SLOT( dataEdited() ));}void TaskModel::dataEdited(){ emit dataChanged(this->index(0,0,QModelIndex()),this->index( rowCount(QModelIndex),0,QModelIndex()));}
struct Task{ int TaskID; int ProjectID; QString Name; QString Notes; int Importance;.......};
struct Project{ int ProjectID; QString Name; QString Notes;........};