(self)
| 35 | |
| 36 | class MyWidget(QWidget): |
| 37 | def __init__(self): |
| 38 | super().__init__(None) |
| 39 | |
| 40 | self.view = View() |
| 41 | self.grid = DateTimeGrid() |
| 42 | self.slider = QSlider() |
| 43 | self.model = QStandardItemModel() |
| 44 | self.cmodel = ConstraintModel() |
| 45 | |
| 46 | for h in range(0, 19): |
| 47 | topitem = MyStandardItem("Top Item " + str(h)) |
| 48 | for i in range(0, 19): |
| 49 | item = MyStandardItem("Multi Item " + str(i)) |
| 50 | for j in range(0, 29, 3): |
| 51 | item.appendRow([MyStandardItem("Item " + str(j)), |
| 52 | MyStandardItem(KDGantt.TypeTask), |
| 53 | MyStandardItem(QDateTime.currentDateTime().addDays(j), |
| 54 | KDGantt.StartTimeRole), |
| 55 | MyStandardItem(QDateTime.currentDateTime().addDays(int(j+1+i/7)), |
| 56 | KDGantt.EndTimeRole), |
| 57 | MyStandardItem(50)]) |
| 58 | |
| 59 | item.appendRow([MyStandardItem("Event"), |
| 60 | MyStandardItem(KDGantt.TypeEvent), |
| 61 | MyStandardItem( |
| 62 | QDateTime.currentDateTime(), KDGantt.StartTimeRole), |
| 63 | MyStandardItem( |
| 64 | QDateTime(), KDGantt.EndTimeRole), |
| 65 | MyStandardItem("")]) |
| 66 | |
| 67 | topitem.appendRow([item, |
| 68 | MyStandardItem(KDGantt.TypeMulti), |
| 69 | MyStandardItem(""), |
| 70 | MyStandardItem(""), |
| 71 | MyStandardItem("")]) |
| 72 | |
| 73 | self.model.appendRow([topitem, |
| 74 | MyStandardItem(KDGantt.TypeMulti), |
| 75 | MyStandardItem(""), |
| 76 | MyStandardItem(""), |
| 77 | MyStandardItem("")]) |
| 78 | |
| 79 | self.model.appendRow([MyStandardItem("No data")]) |
| 80 | |
| 81 | # cmodel.addConstraint( KDGantt::Constraint( proxyModel.index( 0, 3 ), proxyModel.index( 10, 3 ) ) ); |
| 82 | # cmodel.addConstraint( KDGantt::Constraint( proxyModel.index( 10, 3 ), proxyModel.index( 5, 3 ) ) ); |
| 83 | pidx = self.model.index(0, 0) |
| 84 | pidx = self.model.index(0, 0, pidx) |
| 85 | self.cmodel.addConstraint(Constraint( |
| 86 | self.model.index(0, 0, pidx), self.model.index(1, 0, pidx))) |
| 87 | self.cmodel.addConstraint(Constraint( |
| 88 | self.model.index(1, 0, pidx), self.model.index(0, 0, pidx))) |
| 89 | self.cmodel.addConstraint(Constraint(self.model.index( |
| 90 | 1, 0, pidx), self.model.index(10, 0, pidx))) |
| 91 | self.cmodel.addConstraint(Constraint( |
| 92 | self.model.index(3, 0, pidx), self.model.index(5, 0, pidx))) |
| 93 | self.cmodel.addConstraint(Constraint( |
| 94 | self.model.index(7, 0, pidx), self.model.index(4, 0, pidx))) |
no test coverage detected