75 @return the requested data |
75 @return the requested data |
76 """ |
76 """ |
77 if not index.isValid(): |
77 if not index.isValid(): |
78 return None |
78 return None |
79 |
79 |
80 if role == Qt.ItemDataRole.DisplayRole: |
80 if ( |
81 if index.column() in [0, 1, 4]: |
81 role == Qt.ItemDataRole.DisplayRole and |
82 return self.watchpoints[index.row()][index.column()] |
82 index.column() in [0, 1, 4] |
83 |
83 ): |
84 if role == Qt.ItemDataRole.CheckStateRole: |
84 return self.watchpoints[index.row()][index.column()] |
85 if index.column() in [2, 3]: |
85 |
86 return self.watchpoints[index.row()][index.column()] |
86 if ( |
87 |
87 role == Qt.ItemDataRole.CheckStateRole and |
88 if role == Qt.ItemDataRole.ToolTipRole: |
88 index.column() in [2, 3] |
89 if index.column() in [0, 1]: |
89 ): |
90 return self.watchpoints[index.row()][index.column()] |
90 return self.watchpoints[index.row()][index.column()] |
91 |
91 |
92 if role == Qt.ItemDataRole.TextAlignmentRole: |
92 if ( |
93 if index.column() < len(self.alignments): |
93 role == Qt.ItemDataRole.ToolTipRole and |
94 return self.alignments[index.column()] |
94 index.column() in [0, 1] |
|
95 ): |
|
96 return self.watchpoints[index.row()][index.column()] |
|
97 |
|
98 if ( |
|
99 role == Qt.ItemDataRole.TextAlignmentRole and |
|
100 index.column() < len(self.alignments) |
|
101 ): |
|
102 return self.alignments[index.column()] |
95 |
103 |
96 return None |
104 return None |
97 |
105 |
98 def flags(self, index): |
106 def flags(self, index): |
99 """ |
107 """ |