MCPcopy Create free account
hub / github.com/KDAB/KDChart / data

Method data

tests/Gantt/reorder/main.cpp:62–85  ·  view source on GitHub ↗

reimp*/

Source from the content-addressed store, hash-verified

60 return index.isValid() ? 0 : 4;
61 }
62 /*reimp*/ QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override
63 {
64 if (index.isValid() && index.row() < rowCount() && index.column() < columnCount()) {
65 switch (index.column()) {
66 case 0:
67 return (role == Qt::DisplayRole)
68 ? QVariant::fromValue(m_tasks[index.row()].title)
69 : QVariant();
70 case 1:
71 return (role == Qt::DisplayRole)
72 ? QVariant::fromValue(( int )KDGantt::TypeTask)
73 : QVariant();
74 case 2:
75 return (role == KDGantt::StartTimeRole || role == Qt::DisplayRole)
76 ? QVariant::fromValue(m_tasks[index.row()].start)
77 : QVariant();
78 case 3:
79 return (role == KDGantt::EndTimeRole || role == Qt::DisplayRole)
80 ? QVariant::fromValue(m_tasks[index.row()].end)
81 : QVariant();
82 }
83 }
84 return QVariant();
85 }
86
87 void moveRow(int from, int to)
88 {

Callers 3

initFromMethod · 0.45
addDependItemMethod · 0.45
enableActionsMethod · 0.45

Calls 3

rowMethod · 0.80
isValidMethod · 0.45
columnMethod · 0.45

Tested by

no test coverage detected