Mon, 20 Jun 2022 11:04:28 +0200
Implemented a correction for a PyQt6 enum related issue.
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1 | # -*- coding: utf-8 -*- |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
2 | |
8881
54e42bc2437a
Updated copyright for 2022.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8318
diff
changeset
|
3 | # Copyright (c) 2006 - 2022 Detlev Offenbach <detlev@die-offenbachs.de> |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
4 | # |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
5 | |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
6 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
7 | Module implementing the Breakpoint model. |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
8 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
9 | |
8009
29818ac4853c
Implemented the JSON based session files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7923
diff
changeset
|
10 | import copy |
29818ac4853c
Implemented the JSON based session files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7923
diff
changeset
|
11 | |
8318
962bce857696
Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8312
diff
changeset
|
12 | from PyQt6.QtCore import pyqtSignal, Qt, QAbstractItemModel, QModelIndex |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
13 | |
945
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
791
diff
changeset
|
14 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
15 | class BreakPointModel(QAbstractItemModel): |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
16 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
17 | Class implementing a custom model for breakpoints. |
5726
e1dbd217214a
Fixed a few source docu issues (forgotten signals and exceptions).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5656
diff
changeset
|
18 | |
e1dbd217214a
Fixed a few source docu issues (forgotten signals and exceptions).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5656
diff
changeset
|
19 | @signal dataAboutToBeChanged(QModelIndex, QModelIndex) emitted to indicate |
e1dbd217214a
Fixed a few source docu issues (forgotten signals and exceptions).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5656
diff
changeset
|
20 | a change of the data |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
21 | """ |
460
6a3899e91d76
Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
13
diff
changeset
|
22 | dataAboutToBeChanged = pyqtSignal(QModelIndex, QModelIndex) |
6a3899e91d76
Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
13
diff
changeset
|
23 | |
8077 | 24 | def __init__(self, project, parent=None): |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
25 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
26 | Constructor |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
27 | |
8077 | 28 | @param project reference to the project object |
29 | @type Project | |
7882
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
30 | @param parent reference to the parent widget |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
31 | @type QObject |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
32 | """ |
8218
7c09585bd960
Applied some more code simplifications suggested by the new Simplify checker (super(Foo, self) => super()).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8143
diff
changeset
|
33 | super().__init__(parent) |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
34 | |
8077 | 35 | self.__project = project |
36 | ||
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
37 | self.breakpoints = [] |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
38 | self.header = [ |
3190
a9a94491c4fd
Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3160
diff
changeset
|
39 | self.tr("Filename"), |
a9a94491c4fd
Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3160
diff
changeset
|
40 | self.tr("Line"), |
a9a94491c4fd
Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3160
diff
changeset
|
41 | self.tr('Condition'), |
a9a94491c4fd
Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3160
diff
changeset
|
42 | self.tr('Temporary'), |
a9a94491c4fd
Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3160
diff
changeset
|
43 | self.tr('Enabled'), |
a9a94491c4fd
Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3160
diff
changeset
|
44 | self.tr('Ignore Count'), |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
45 | ] |
8318
962bce857696
Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8312
diff
changeset
|
46 | self.alignments = [Qt.AlignmentFlag.AlignLeft, |
962bce857696
Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8312
diff
changeset
|
47 | Qt.AlignmentFlag.AlignRight, |
962bce857696
Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8312
diff
changeset
|
48 | Qt.AlignmentFlag.AlignLeft, |
962bce857696
Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8312
diff
changeset
|
49 | Qt.AlignmentFlag.AlignHCenter, |
962bce857696
Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8312
diff
changeset
|
50 | Qt.AlignmentFlag.AlignHCenter, |
962bce857696
Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8312
diff
changeset
|
51 | Qt.AlignmentFlag.AlignRight, |
962bce857696
Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8312
diff
changeset
|
52 | Qt.AlignmentFlag.AlignHCenter, |
3032
927a2f8b3669
Fixed various coding style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3021
diff
changeset
|
53 | ] |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
54 | |
5656
9c21b2746218
Fixed a few code style issues related to the usage of class instances for default arguments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5389
diff
changeset
|
55 | def columnCount(self, parent=None): |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
56 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
57 | Public method to get the current column count. |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
58 | |
7882
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
59 | @param parent reference to parent index (Unused) |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
60 | @type QModelIndex |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
61 | @return column count |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
62 | @rtype int |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
63 | """ |
531
26efb720a299
Change the appearance of the breakpoint and watchpoint viewers (via the models).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
460
diff
changeset
|
64 | return len(self.header) |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
65 | |
5656
9c21b2746218
Fixed a few code style issues related to the usage of class instances for default arguments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5389
diff
changeset
|
66 | def rowCount(self, parent=None): |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
67 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
68 | Public method to get the current row count. |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
69 | |
7882
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
70 | @param parent reference to parent index |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
71 | @type QModelIndex |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
72 | @return row count |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
73 | @rtype int |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
74 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
75 | # we do not have a tree, parent should always be invalid |
5656
9c21b2746218
Fixed a few code style issues related to the usage of class instances for default arguments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5389
diff
changeset
|
76 | if parent is None or not parent.isValid(): |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
77 | return len(self.breakpoints) |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
78 | else: |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
79 | return 0 |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
80 | |
8143
2c730d5fd177
Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8077
diff
changeset
|
81 | def data(self, index, role=Qt.ItemDataRole.DisplayRole): |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
82 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
83 | Public method to get the requested data. |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
84 | |
7882
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
85 | @param index index of the requested data |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
86 | @type QModelIndex |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
87 | @param role role of the requested data |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
88 | @type Qt.ItemDataRole |
7
c679fb30c8f3
Change code dealing with QVariant (and QSettings) to use the PyQt4 QVariant v2 API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
89 | @return the requested data |
7882
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
90 | @rtype any |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
91 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
92 | if not index.isValid(): |
7
c679fb30c8f3
Change code dealing with QVariant (and QSettings) to use the PyQt4 QVariant v2 API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
93 | return None |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
94 | |
8143
2c730d5fd177
Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8077
diff
changeset
|
95 | if role == Qt.ItemDataRole.DisplayRole: |
8077 | 96 | if index.column() == 0: |
97 | filename = self.breakpoints[index.row()][0] | |
98 | if self.__project.isOpen(): | |
99 | return self.__project.getRelativePath(filename) | |
100 | else: | |
101 | return filename | |
102 | elif index.column() in (1, 2, 5): | |
531
26efb720a299
Change the appearance of the breakpoint and watchpoint viewers (via the models).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
460
diff
changeset
|
103 | return self.breakpoints[index.row()][index.column()] |
26efb720a299
Change the appearance of the breakpoint and watchpoint viewers (via the models).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
460
diff
changeset
|
104 | |
8222
5994b80b8760
Applied some more code simplifications suggested by the new Simplify checker (Y102: use single if) (batch 1).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8218
diff
changeset
|
105 | if ( |
5994b80b8760
Applied some more code simplifications suggested by the new Simplify checker (Y102: use single if) (batch 1).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8218
diff
changeset
|
106 | role == Qt.ItemDataRole.CheckStateRole and |
5994b80b8760
Applied some more code simplifications suggested by the new Simplify checker (Y102: use single if) (batch 1).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8218
diff
changeset
|
107 | index.column() in (3, 4) |
5994b80b8760
Applied some more code simplifications suggested by the new Simplify checker (Y102: use single if) (batch 1).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8218
diff
changeset
|
108 | ): |
5994b80b8760
Applied some more code simplifications suggested by the new Simplify checker (Y102: use single if) (batch 1).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8218
diff
changeset
|
109 | return self.breakpoints[index.row()][index.column()] |
531
26efb720a299
Change the appearance of the breakpoint and watchpoint viewers (via the models).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
460
diff
changeset
|
110 | |
8222
5994b80b8760
Applied some more code simplifications suggested by the new Simplify checker (Y102: use single if) (batch 1).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8218
diff
changeset
|
111 | if ( |
5994b80b8760
Applied some more code simplifications suggested by the new Simplify checker (Y102: use single if) (batch 1).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8218
diff
changeset
|
112 | role == Qt.ItemDataRole.ToolTipRole and |
5994b80b8760
Applied some more code simplifications suggested by the new Simplify checker (Y102: use single if) (batch 1).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8218
diff
changeset
|
113 | index.column() in (0, 2) |
5994b80b8760
Applied some more code simplifications suggested by the new Simplify checker (Y102: use single if) (batch 1).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8218
diff
changeset
|
114 | ): |
5994b80b8760
Applied some more code simplifications suggested by the new Simplify checker (Y102: use single if) (batch 1).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8218
diff
changeset
|
115 | return self.breakpoints[index.row()][index.column()] |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
116 | |
8222
5994b80b8760
Applied some more code simplifications suggested by the new Simplify checker (Y102: use single if) (batch 1).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8218
diff
changeset
|
117 | if ( |
5994b80b8760
Applied some more code simplifications suggested by the new Simplify checker (Y102: use single if) (batch 1).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8218
diff
changeset
|
118 | role == Qt.ItemDataRole.TextAlignmentRole and |
5994b80b8760
Applied some more code simplifications suggested by the new Simplify checker (Y102: use single if) (batch 1).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8218
diff
changeset
|
119 | index.column() < len(self.alignments) |
5994b80b8760
Applied some more code simplifications suggested by the new Simplify checker (Y102: use single if) (batch 1).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8218
diff
changeset
|
120 | ): |
9160
1675c039a568
Implemented a correction for a PyQt6 enum related issue.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8881
diff
changeset
|
121 | return self.alignments[index.column()].value |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
122 | |
7
c679fb30c8f3
Change code dealing with QVariant (and QSettings) to use the PyQt4 QVariant v2 API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
123 | return None |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
124 | |
8143
2c730d5fd177
Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8077
diff
changeset
|
125 | def setData(self, index, value, role=Qt.ItemDataRole.EditRole): |
1928
adde55ed4ce5
Fixed the breakpoint performance issue properly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1758
diff
changeset
|
126 | """ |
adde55ed4ce5
Fixed the breakpoint performance issue properly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1758
diff
changeset
|
127 | Public method to change data in the model. |
adde55ed4ce5
Fixed the breakpoint performance issue properly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1758
diff
changeset
|
128 | |
7882
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
129 | @param index index of the changed data |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
130 | @type QModelIndex |
1928
adde55ed4ce5
Fixed the breakpoint performance issue properly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1758
diff
changeset
|
131 | @param value value of the changed data |
7882
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
132 | @type any |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
133 | @param role role of the changed data |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
134 | @type Qt.ItemDataRole |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
135 | @return flag indicating success |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
136 | @rtype bool |
1928
adde55ed4ce5
Fixed the breakpoint performance issue properly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1758
diff
changeset
|
137 | """ |
7251
bc5b1b00560a
Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7229
diff
changeset
|
138 | if (not index.isValid() or |
bc5b1b00560a
Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7229
diff
changeset
|
139 | index.column() >= len(self.header) or |
bc5b1b00560a
Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7229
diff
changeset
|
140 | index.row() >= len(self.breakpoints)): |
1928
adde55ed4ce5
Fixed the breakpoint performance issue properly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1758
diff
changeset
|
141 | return False |
adde55ed4ce5
Fixed the breakpoint performance issue properly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1758
diff
changeset
|
142 | |
adde55ed4ce5
Fixed the breakpoint performance issue properly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1758
diff
changeset
|
143 | self.dataAboutToBeChanged.emit(index, index) |
adde55ed4ce5
Fixed the breakpoint performance issue properly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1758
diff
changeset
|
144 | self.breakpoints[index.row()][index.column()] = value |
2126
3744863a534e
Reverted the dataChanged signal change due to corrections in PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2081
diff
changeset
|
145 | self.dataChanged.emit(index, index) |
1928
adde55ed4ce5
Fixed the breakpoint performance issue properly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1758
diff
changeset
|
146 | return True |
adde55ed4ce5
Fixed the breakpoint performance issue properly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1758
diff
changeset
|
147 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
148 | def flags(self, index): |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
149 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
150 | Public method to get item flags. |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
151 | |
7882
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
152 | @param index index of the requested flags |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
153 | @type QModelIndex |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
154 | @return item flags for the given index |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
155 | @rtype Qt.ItemFlags |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
156 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
157 | if not index.isValid(): |
8143
2c730d5fd177
Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8077
diff
changeset
|
158 | return Qt.ItemFlag.ItemIsEnabled |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
159 | |
8143
2c730d5fd177
Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8077
diff
changeset
|
160 | return Qt.ItemFlag.ItemIsEnabled | Qt.ItemFlag.ItemIsSelectable |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
161 | |
8143
2c730d5fd177
Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8077
diff
changeset
|
162 | def headerData(self, section, orientation, |
2c730d5fd177
Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8077
diff
changeset
|
163 | role=Qt.ItemDataRole.DisplayRole): |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
164 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
165 | Public method to get header data. |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
166 | |
7882
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
167 | @param section section number of the requested header data |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
168 | @type int |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
169 | @param orientation orientation of the header |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
170 | @type Qt.Orientation |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
171 | @param role role of the requested data |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
172 | @type Qt.ItemDataRole |
7
c679fb30c8f3
Change code dealing with QVariant (and QSettings) to use the PyQt4 QVariant v2 API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
173 | @return header data |
7882
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
174 | @rtype str |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
175 | """ |
8143
2c730d5fd177
Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8077
diff
changeset
|
176 | if ( |
2c730d5fd177
Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8077
diff
changeset
|
177 | orientation == Qt.Orientation.Horizontal and |
2c730d5fd177
Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8077
diff
changeset
|
178 | role == Qt.ItemDataRole.DisplayRole |
2c730d5fd177
Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8077
diff
changeset
|
179 | ): |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
180 | if section >= len(self.header): |
7
c679fb30c8f3
Change code dealing with QVariant (and QSettings) to use the PyQt4 QVariant v2 API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
181 | return "" |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
182 | else: |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
183 | return self.header[section] |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
184 | |
7
c679fb30c8f3
Change code dealing with QVariant (and QSettings) to use the PyQt4 QVariant v2 API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
185 | return None |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
186 | |
5656
9c21b2746218
Fixed a few code style issues related to the usage of class instances for default arguments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5389
diff
changeset
|
187 | def index(self, row, column, parent=None): |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
188 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
189 | Public method to create an index. |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
190 | |
7882
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
191 | @param row row number for the index |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
192 | @type int |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
193 | @param column column number for the index |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
194 | @type int |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
195 | @param parent index of the parent item |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
196 | @type QModelIndex |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
197 | @return requested index |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
198 | @rtype QModelIndex |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
199 | """ |
7251
bc5b1b00560a
Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7229
diff
changeset
|
200 | if ((parent and parent.isValid()) or |
bc5b1b00560a
Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7229
diff
changeset
|
201 | row < 0 or row >= len(self.breakpoints) or |
bc5b1b00560a
Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7229
diff
changeset
|
202 | column < 0 or column >= len(self.header)): |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
203 | return QModelIndex() |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
204 | |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
205 | return self.createIndex(row, column, self.breakpoints[row]) |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
206 | |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
207 | def parent(self, index): |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
208 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
209 | Public method to get the parent index. |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
210 | |
7882
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
211 | @param index index of item to get parent |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
212 | @type QModelIndex |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
213 | @return index of parent |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
214 | @rtype QModelIndex |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
215 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
216 | return QModelIndex() |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
217 | |
5656
9c21b2746218
Fixed a few code style issues related to the usage of class instances for default arguments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5389
diff
changeset
|
218 | def hasChildren(self, parent=None): |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
219 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
220 | Public method to check for the presence of child items. |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
221 | |
7882
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
222 | @param parent index of parent item |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
223 | @type QModelIndex |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
224 | @return flag indicating the presence of child items |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
225 | @rtype bool |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
226 | """ |
5656
9c21b2746218
Fixed a few code style issues related to the usage of class instances for default arguments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5389
diff
changeset
|
227 | if parent is None or not parent.isValid(): |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
228 | return len(self.breakpoints) > 0 |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
229 | else: |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
230 | return False |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
231 | |
2988
f53c03574697
Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2953
diff
changeset
|
232 | ########################################################################### |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
233 | |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
234 | def addBreakPoint(self, fn, line, properties): |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
235 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
236 | Public method to add a new breakpoint to the list. |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
237 | |
7882
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
238 | @param fn filename of the breakpoint |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
239 | @type str |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
240 | @param line line number of the breakpoint |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
241 | @type int |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
242 | @param properties properties of the breakpoint |
7882
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
243 | (tuple of condition, temporary flag, enabled flag, ignore count) |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
244 | @type tuple of (str, bool, bool, int) |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
245 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
246 | bp = [fn, line] + list(properties) |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
247 | cnt = len(self.breakpoints) |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
248 | self.beginInsertRows(QModelIndex(), cnt, cnt) |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
249 | self.breakpoints.append(bp) |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
250 | self.endInsertRows() |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
251 | |
8009
29818ac4853c
Implemented the JSON based session files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7923
diff
changeset
|
252 | def addBreakPoints(self, breakpoints): |
29818ac4853c
Implemented the JSON based session files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7923
diff
changeset
|
253 | """ |
29818ac4853c
Implemented the JSON based session files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7923
diff
changeset
|
254 | Public method to add multiple breakpoints to the list. |
29818ac4853c
Implemented the JSON based session files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7923
diff
changeset
|
255 | |
29818ac4853c
Implemented the JSON based session files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7923
diff
changeset
|
256 | @param breakpoints list of breakpoints with file name, line number, |
29818ac4853c
Implemented the JSON based session files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7923
diff
changeset
|
257 | condition, temporary flag, enabled flag and ignore count each |
29818ac4853c
Implemented the JSON based session files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7923
diff
changeset
|
258 | @type list of (str, int, str, bool, bool, int) |
29818ac4853c
Implemented the JSON based session files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7923
diff
changeset
|
259 | """ |
29818ac4853c
Implemented the JSON based session files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7923
diff
changeset
|
260 | cnt = len(self.breakpoints) |
29818ac4853c
Implemented the JSON based session files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7923
diff
changeset
|
261 | self.beginInsertRows(QModelIndex(), cnt, cnt + len(breakpoints) - 1) |
29818ac4853c
Implemented the JSON based session files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7923
diff
changeset
|
262 | self.breakpoints += breakpoints |
29818ac4853c
Implemented the JSON based session files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7923
diff
changeset
|
263 | self.endInsertRows() |
29818ac4853c
Implemented the JSON based session files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7923
diff
changeset
|
264 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
265 | def setBreakPointByIndex(self, index, fn, line, properties): |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
266 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
267 | Public method to set the values of a breakpoint given by index. |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
268 | |
7882
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
269 | @param index index of the breakpoint |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
270 | @type QModelIndex |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
271 | @param fn filename of the breakpoint |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
272 | @type str |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
273 | @param line line number of the breakpoint |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
274 | @type int |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
275 | @param properties properties of the breakpoint |
7882
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
276 | (tuple of condition, temporary flag, enabled flag, ignore count) |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
277 | @type tuple of (str, bool, bool, int) |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
278 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
279 | if index.isValid(): |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
280 | row = index.row() |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
281 | index1 = self.createIndex(row, 0, self.breakpoints[row]) |
3021
801289962f4e
Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2988
diff
changeset
|
282 | index2 = self.createIndex( |
801289962f4e
Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2988
diff
changeset
|
283 | row, len(self.breakpoints[row]), self.breakpoints[row]) |
460
6a3899e91d76
Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
13
diff
changeset
|
284 | self.dataAboutToBeChanged.emit(index1, index2) |
1758
e18f96b1714b
A few optimizations and a fix for a bug, that caused incorrect display of breakpoints in the editor margin.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1509
diff
changeset
|
285 | self.breakpoints[row] = [fn, line] + list(properties) |
2126
3744863a534e
Reverted the dataChanged signal change due to corrections in PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2081
diff
changeset
|
286 | self.dataChanged.emit(index1, index2) |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
287 | |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
288 | def setBreakPointEnabledByIndex(self, index, enabled): |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
289 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
290 | Public method to set the enabled state of a breakpoint given by index. |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
291 | |
7882
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
292 | @param index index of the breakpoint |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
293 | @type QModelIndex |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
294 | @param enabled flag giving the enabled state |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
295 | @type bool |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
296 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
297 | if index.isValid(): |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
298 | row = index.row() |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
299 | col = 4 |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
300 | index1 = self.createIndex(row, col, self.breakpoints[row]) |
460
6a3899e91d76
Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
13
diff
changeset
|
301 | self.dataAboutToBeChanged.emit(index1, index1) |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
302 | self.breakpoints[row][col] = enabled |
2126
3744863a534e
Reverted the dataChanged signal change due to corrections in PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2081
diff
changeset
|
303 | self.dataChanged.emit(index1, index1) |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
304 | |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
305 | def deleteBreakPointByIndex(self, index): |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
306 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
307 | Public method to set the values of a breakpoint given by index. |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
308 | |
7882
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
309 | @param index index of the breakpoint |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
310 | @type QModelIndex |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
311 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
312 | if index.isValid(): |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
313 | row = index.row() |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
314 | self.beginRemoveRows(QModelIndex(), row, row) |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
315 | del self.breakpoints[row] |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
316 | self.endRemoveRows() |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
317 | |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
318 | def deleteBreakPoints(self, idxList): |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
319 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
320 | Public method to delete a list of breakpoints given by their indexes. |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
321 | |
7882
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
322 | @param idxList list of breakpoint indexes |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
323 | @type list of QModelIndex |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
324 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
325 | rows = [] |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
326 | for index in idxList: |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
327 | if index.isValid(): |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
328 | rows.append(index.row()) |
945
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
791
diff
changeset
|
329 | rows.sort(reverse=True) |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
330 | for row in rows: |
7025
83e110e3fcc6
BreakPointModel, WatchPointModel: fixed a potential issue deleting breakpoints/watchpoints.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6942
diff
changeset
|
331 | if row < len(self.breakpoints): |
83e110e3fcc6
BreakPointModel, WatchPointModel: fixed a potential issue deleting breakpoints/watchpoints.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6942
diff
changeset
|
332 | self.beginRemoveRows(QModelIndex(), row, row) |
83e110e3fcc6
BreakPointModel, WatchPointModel: fixed a potential issue deleting breakpoints/watchpoints.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6942
diff
changeset
|
333 | del self.breakpoints[row] |
83e110e3fcc6
BreakPointModel, WatchPointModel: fixed a potential issue deleting breakpoints/watchpoints.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6942
diff
changeset
|
334 | self.endRemoveRows() |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
335 | |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
336 | def deleteAll(self): |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
337 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
338 | Public method to delete all breakpoints. |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
339 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
340 | if self.breakpoints: |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
341 | self.beginRemoveRows(QModelIndex(), 0, len(self.breakpoints) - 1) |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
342 | self.breakpoints = [] |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
343 | self.endRemoveRows() |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
344 | |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
345 | def getBreakPointByIndex(self, index): |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
346 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
347 | Public method to get the values of a breakpoint given by index. |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
348 | |
7882
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
349 | @param index index of the breakpoint |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
350 | @type QModelIndex |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
351 | @return breakpoint (list of six values (filename, line number, |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
352 | condition, temporary flag, enabled flag, ignore count)) |
7882
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
353 | @rtype list of (str, int, str, bool, bool, int) |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
354 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
355 | if index.isValid(): |
945
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
791
diff
changeset
|
356 | return self.breakpoints[index.row()][:] # return a copy |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
357 | else: |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
358 | return [] |
8009
29818ac4853c
Implemented the JSON based session files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7923
diff
changeset
|
359 | |
29818ac4853c
Implemented the JSON based session files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7923
diff
changeset
|
360 | def getAllBreakpoints(self): |
29818ac4853c
Implemented the JSON based session files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7923
diff
changeset
|
361 | """ |
29818ac4853c
Implemented the JSON based session files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7923
diff
changeset
|
362 | Public method to get a copy of the breakpoints. |
29818ac4853c
Implemented the JSON based session files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7923
diff
changeset
|
363 | |
29818ac4853c
Implemented the JSON based session files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7923
diff
changeset
|
364 | @return list of breakpoints |
29818ac4853c
Implemented the JSON based session files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7923
diff
changeset
|
365 | @rtype list of list of [str, int, str, bool, bool, int] |
29818ac4853c
Implemented the JSON based session files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7923
diff
changeset
|
366 | """ |
29818ac4853c
Implemented the JSON based session files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7923
diff
changeset
|
367 | return copy.deepcopy(self.breakpoints) |
29818ac4853c
Implemented the JSON based session files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7923
diff
changeset
|
368 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
369 | def getBreakPointIndex(self, fn, lineno): |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
370 | """ |
2988
f53c03574697
Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2953
diff
changeset
|
371 | Public method to get the index of a breakpoint given by filename and |
f53c03574697
Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2953
diff
changeset
|
372 | line number. |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
373 | |
7882
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
374 | @param fn filename of the breakpoint |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
375 | @type str |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
376 | @param lineno line number of the breakpoint |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
377 | @type int |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
378 | @return index |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
379 | @rtype QModelIndex |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
380 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
381 | for row in range(len(self.breakpoints)): |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
382 | bp = self.breakpoints[row] |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
383 | if bp[0] == fn and bp[1] == lineno: |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
384 | return self.createIndex(row, 0, self.breakpoints[row]) |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
385 | |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
386 | return QModelIndex() |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
387 | |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
388 | def isBreakPointTemporaryByIndex(self, index): |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
389 | """ |
2763
e4794166ad70
Fixed a serious typo.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2302
diff
changeset
|
390 | Public method to test, if a breakpoint given by its index is temporary. |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
391 | |
7882
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
392 | @param index index of the breakpoint to test |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
393 | @type QModelIndex |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
394 | @return flag indicating a temporary breakpoint |
617cc27f11af
Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
395 | @rtype bool |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
396 | """ |
945
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
791
diff
changeset
|
397 | if index.isValid(): |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
398 | return self.breakpoints[index.row()][3] |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
399 | else: |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
400 | return False |