Menu

[c54480]: / taskmodel.h  Maximize  Restore  History

Download this file

56 lines (44 with data), 1.7 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef TASKMODEL_H
#define TASKMODEL_H
#include <QAbstractTableModel>
#include <QList>
#include "task.h"
class BranchItem;
class VymModel;
class TaskModel : public QAbstractTableModel
{
Q_OBJECT
public:
TaskModel(QObject *parent=0);
QModelIndex index (Task* t) const;
QModelIndex indexRowEnd (Task* t);
Task* getTask (const QModelIndex &ix) const;
Task* getTask (const int i);
int rowCount(const QModelIndex &parent) const;
int columnCount(const QModelIndex &parent) const;
QVariant data(const QModelIndex &index, int role) const;
QVariant headerData(int section, Qt::Orientation orientation, int role) const;
Qt::ItemFlags flags(const QModelIndex &index) const;
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole);
// bool setData(const QModelIndex &index, Task *t, int role=Qt::EditRole);
void emitDataChanged (Task *t);
bool insertRows(int position, int rows, const QModelIndex &index=QModelIndex(),Task *t=NULL);
bool removeRows(int position, int rows, const QModelIndex &index=QModelIndex());
int count (VymModel *model=NULL);
Task* createTask (BranchItem *bi);
void deleteTask (Task* t);
bool updateAwake(bool force = false);
void recalcPriorities();
void setShowParentsLevel (uint i);
uint getShowParentsLevel ();
// Drag and drop support
Qt::DropActions supportedDropActions() const;
QStringList mimeTypes() const;
QMimeData * mimeData(const QModelIndexList &indexes) const;
bool dropMimeData(const QMimeData *data, Qt::DropAction action,
int row, int column, const QModelIndex &parent);
private:
QList <Task*> tasks;
uint showParentsLevel;
};
#endif
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.