Debugger/BreakPointModel.py

changeset 2953
703452a2876f
parent 2763
e4794166ad70
child 2988
f53c03574697
equal deleted inserted replaced
2952:94fc661a54a2 2953:703452a2876f
18 18
19 def __init__(self, parent=None): 19 def __init__(self, parent=None):
20 """ 20 """
21 Constructor 21 Constructor
22 22
23 @param reference to the parent widget (QObject) 23 @param parent reference to the parent widget (QObject)
24 """ 24 """
25 super().__init__(parent) 25 super().__init__(parent)
26 26
27 self.breakpoints = [] 27 self.breakpoints = []
28 self.header = [ 28 self.header = [
44 44
45 def columnCount(self, parent=QModelIndex()): 45 def columnCount(self, parent=QModelIndex()):
46 """ 46 """
47 Public method to get the current column count. 47 Public method to get the current column count.
48 48
49 @param parent reference to parent index (QModelIndex)
49 @return column count (integer) 50 @return column count (integer)
50 """ 51 """
51 return len(self.header) 52 return len(self.header)
52 53
53 def rowCount(self, parent=QModelIndex()): 54 def rowCount(self, parent=QModelIndex()):
54 """ 55 """
55 Public method to get the current row count. 56 Public method to get the current row count.
56 57
58 @param parent reference to parent index (QModelIndex)
57 @return row count (integer) 59 @return row count (integer)
58 """ 60 """
59 # we do not have a tree, parent should always be invalid 61 # we do not have a tree, parent should always be invalid
60 if not parent.isValid(): 62 if not parent.isValid():
61 return len(self.breakpoints) 63 return len(self.breakpoints)
282 def getBreakPointIndex(self, fn, lineno): 284 def getBreakPointIndex(self, fn, lineno):
283 """ 285 """
284 Public method to get the index of a breakpoint given by filename and line number. 286 Public method to get the index of a breakpoint given by filename and line number.
285 287
286 @param fn filename of the breakpoint (string) 288 @param fn filename of the breakpoint (string)
287 @param line line number of the breakpoint (integer) 289 @param lineno line number of the breakpoint (integer)
288 @return index (QModelIndex) 290 @return index (QModelIndex)
289 """ 291 """
290 for row in range(len(self.breakpoints)): 292 for row in range(len(self.breakpoints)):
291 bp = self.breakpoints[row] 293 bp = self.breakpoints[row]
292 if bp[0] == fn and bp[1] == lineno: 294 if bp[0] == fn and bp[1] == lineno:

eric ide

mercurial