|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.DataViews.CodeMetricsDialog</title> |
|
4 <meta charset="UTF-8"> |
|
5 <link rel="stylesheet" href="styles.css"> |
|
6 </head> |
|
7 <body> |
|
8 <a NAME="top" ID="top"></a> |
|
9 <h1>eric7.DataViews.CodeMetricsDialog</h1> |
|
10 |
|
11 <p> |
|
12 Module implementing a code metrics dialog. |
|
13 </p> |
|
14 <h3>Global Attributes</h3> |
|
15 |
|
16 <table> |
|
17 <tr><td>None</td></tr> |
|
18 </table> |
|
19 <h3>Classes</h3> |
|
20 |
|
21 <table> |
|
22 |
|
23 <tr> |
|
24 <td><a href="#CodeMetricsDialog">CodeMetricsDialog</a></td> |
|
25 <td>Class implementing a dialog to display the code metrics.</td> |
|
26 </tr> |
|
27 </table> |
|
28 <h3>Functions</h3> |
|
29 |
|
30 <table> |
|
31 <tr><td>None</td></tr> |
|
32 </table> |
|
33 <hr /> |
|
34 <hr /> |
|
35 <a NAME="CodeMetricsDialog" ID="CodeMetricsDialog"></a> |
|
36 <h2>CodeMetricsDialog</h2> |
|
37 |
|
38 <p> |
|
39 Class implementing a dialog to display the code metrics. |
|
40 </p> |
|
41 <h3>Derived from</h3> |
|
42 QDialog, Ui_CodeMetricsDialog |
|
43 <h3>Class Attributes</h3> |
|
44 |
|
45 <table> |
|
46 <tr><td>None</td></tr> |
|
47 </table> |
|
48 <h3>Class Methods</h3> |
|
49 |
|
50 <table> |
|
51 <tr><td>None</td></tr> |
|
52 </table> |
|
53 <h3>Methods</h3> |
|
54 |
|
55 <table> |
|
56 |
|
57 <tr> |
|
58 <td><a href="#CodeMetricsDialog.__init__">CodeMetricsDialog</a></td> |
|
59 <td>Constructor</td> |
|
60 </tr> |
|
61 <tr> |
|
62 <td><a href="#CodeMetricsDialog.__createResultItem">__createResultItem</a></td> |
|
63 <td>Private slot to create a new item in the result list.</td> |
|
64 </tr> |
|
65 <tr> |
|
66 <td><a href="#CodeMetricsDialog.__createSummaryItem">__createSummaryItem</a></td> |
|
67 <td>Private slot to create a new item in the summary list.</td> |
|
68 </tr> |
|
69 <tr> |
|
70 <td><a href="#CodeMetricsDialog.__finish">__finish</a></td> |
|
71 <td>Private slot called when the action finished or the user pressed the button.</td> |
|
72 </tr> |
|
73 <tr> |
|
74 <td><a href="#CodeMetricsDialog.__getValues">__getValues</a></td> |
|
75 <td>Private method to extract the code metric values.</td> |
|
76 </tr> |
|
77 <tr> |
|
78 <td><a href="#CodeMetricsDialog.__resizeResultColumns">__resizeResultColumns</a></td> |
|
79 <td>Private method to resize the list columns.</td> |
|
80 </tr> |
|
81 <tr> |
|
82 <td><a href="#CodeMetricsDialog.__resizeSummaryColumns">__resizeSummaryColumns</a></td> |
|
83 <td>Private method to resize the list columns.</td> |
|
84 </tr> |
|
85 <tr> |
|
86 <td><a href="#CodeMetricsDialog.__resultCollapse">__resultCollapse</a></td> |
|
87 <td>Private slot to collapse all entries of the resultlist.</td> |
|
88 </tr> |
|
89 <tr> |
|
90 <td><a href="#CodeMetricsDialog.__resultExpand">__resultExpand</a></td> |
|
91 <td>Private slot to expand all entries of the resultlist.</td> |
|
92 </tr> |
|
93 <tr> |
|
94 <td><a href="#CodeMetricsDialog.__showContextMenu">__showContextMenu</a></td> |
|
95 <td>Private slot to show the context menu of the listview.</td> |
|
96 </tr> |
|
97 <tr> |
|
98 <td><a href="#CodeMetricsDialog.on_buttonBox_clicked">on_buttonBox_clicked</a></td> |
|
99 <td>Private slot called by a button of the button box clicked.</td> |
|
100 </tr> |
|
101 <tr> |
|
102 <td><a href="#CodeMetricsDialog.on_startButton_clicked">on_startButton_clicked</a></td> |
|
103 <td>Private slot to start a code metrics run.</td> |
|
104 </tr> |
|
105 <tr> |
|
106 <td><a href="#CodeMetricsDialog.prepare">prepare</a></td> |
|
107 <td>Public method to prepare the dialog with a list of filenames.</td> |
|
108 </tr> |
|
109 <tr> |
|
110 <td><a href="#CodeMetricsDialog.start">start</a></td> |
|
111 <td>Public slot to start the code metrics determination.</td> |
|
112 </tr> |
|
113 </table> |
|
114 <h3>Static Methods</h3> |
|
115 |
|
116 <table> |
|
117 <tr><td>None</td></tr> |
|
118 </table> |
|
119 |
|
120 <a NAME="CodeMetricsDialog.__init__" ID="CodeMetricsDialog.__init__"></a> |
|
121 <h4>CodeMetricsDialog (Constructor)</h4> |
|
122 <b>CodeMetricsDialog</b>(<i>parent=None</i>) |
|
123 |
|
124 <p> |
|
125 Constructor |
|
126 </p> |
|
127 <dl> |
|
128 |
|
129 <dt><i>parent</i></dt> |
|
130 <dd> |
|
131 parent widget (QWidget) |
|
132 </dd> |
|
133 </dl> |
|
134 <a NAME="CodeMetricsDialog.__createResultItem" ID="CodeMetricsDialog.__createResultItem"></a> |
|
135 <h4>CodeMetricsDialog.__createResultItem</h4> |
|
136 <b>__createResultItem</b>(<i>parent, values</i>) |
|
137 |
|
138 <p> |
|
139 Private slot to create a new item in the result list. |
|
140 </p> |
|
141 <dl> |
|
142 |
|
143 <dt><i>parent</i></dt> |
|
144 <dd> |
|
145 parent of the new item (QTreeWidget or QTreeWidgetItem) |
|
146 </dd> |
|
147 <dt><i>values</i></dt> |
|
148 <dd> |
|
149 values to be displayed (list) |
|
150 </dd> |
|
151 </dl> |
|
152 <dl> |
|
153 <dt>Return:</dt> |
|
154 <dd> |
|
155 the generated item |
|
156 </dd> |
|
157 </dl> |
|
158 <a NAME="CodeMetricsDialog.__createSummaryItem" ID="CodeMetricsDialog.__createSummaryItem"></a> |
|
159 <h4>CodeMetricsDialog.__createSummaryItem</h4> |
|
160 <b>__createSummaryItem</b>(<i>col0, col1</i>) |
|
161 |
|
162 <p> |
|
163 Private slot to create a new item in the summary list. |
|
164 </p> |
|
165 <dl> |
|
166 |
|
167 <dt><i>col0</i></dt> |
|
168 <dd> |
|
169 string for column 0 (string) |
|
170 </dd> |
|
171 <dt><i>col1</i></dt> |
|
172 <dd> |
|
173 string for column 1 (string) |
|
174 </dd> |
|
175 </dl> |
|
176 <a NAME="CodeMetricsDialog.__finish" ID="CodeMetricsDialog.__finish"></a> |
|
177 <h4>CodeMetricsDialog.__finish</h4> |
|
178 <b>__finish</b>(<i></i>) |
|
179 |
|
180 <p> |
|
181 Private slot called when the action finished or the user pressed the |
|
182 button. |
|
183 </p> |
|
184 <a NAME="CodeMetricsDialog.__getValues" ID="CodeMetricsDialog.__getValues"></a> |
|
185 <h4>CodeMetricsDialog.__getValues</h4> |
|
186 <b>__getValues</b>(<i>loc, stats, identifier</i>) |
|
187 |
|
188 <p> |
|
189 Private method to extract the code metric values. |
|
190 </p> |
|
191 <dl> |
|
192 |
|
193 <dt><i>loc</i></dt> |
|
194 <dd> |
|
195 reference to the locale object (QLocale) |
|
196 </dd> |
|
197 <dt><i>stats</i></dt> |
|
198 <dd> |
|
199 reference to the code metric statistics object |
|
200 </dd> |
|
201 <dt><i>identifier</i></dt> |
|
202 <dd> |
|
203 identifier to get values for |
|
204 </dd> |
|
205 </dl> |
|
206 <dl> |
|
207 <dt>Return:</dt> |
|
208 <dd> |
|
209 list of values suitable for display (list of strings) |
|
210 </dd> |
|
211 </dl> |
|
212 <a NAME="CodeMetricsDialog.__resizeResultColumns" ID="CodeMetricsDialog.__resizeResultColumns"></a> |
|
213 <h4>CodeMetricsDialog.__resizeResultColumns</h4> |
|
214 <b>__resizeResultColumns</b>(<i></i>) |
|
215 |
|
216 <p> |
|
217 Private method to resize the list columns. |
|
218 </p> |
|
219 <a NAME="CodeMetricsDialog.__resizeSummaryColumns" ID="CodeMetricsDialog.__resizeSummaryColumns"></a> |
|
220 <h4>CodeMetricsDialog.__resizeSummaryColumns</h4> |
|
221 <b>__resizeSummaryColumns</b>(<i></i>) |
|
222 |
|
223 <p> |
|
224 Private method to resize the list columns. |
|
225 </p> |
|
226 <a NAME="CodeMetricsDialog.__resultCollapse" ID="CodeMetricsDialog.__resultCollapse"></a> |
|
227 <h4>CodeMetricsDialog.__resultCollapse</h4> |
|
228 <b>__resultCollapse</b>(<i></i>) |
|
229 |
|
230 <p> |
|
231 Private slot to collapse all entries of the resultlist. |
|
232 </p> |
|
233 <a NAME="CodeMetricsDialog.__resultExpand" ID="CodeMetricsDialog.__resultExpand"></a> |
|
234 <h4>CodeMetricsDialog.__resultExpand</h4> |
|
235 <b>__resultExpand</b>(<i></i>) |
|
236 |
|
237 <p> |
|
238 Private slot to expand all entries of the resultlist. |
|
239 </p> |
|
240 <a NAME="CodeMetricsDialog.__showContextMenu" ID="CodeMetricsDialog.__showContextMenu"></a> |
|
241 <h4>CodeMetricsDialog.__showContextMenu</h4> |
|
242 <b>__showContextMenu</b>(<i>coord</i>) |
|
243 |
|
244 <p> |
|
245 Private slot to show the context menu of the listview. |
|
246 </p> |
|
247 <dl> |
|
248 |
|
249 <dt><i>coord</i></dt> |
|
250 <dd> |
|
251 the position of the mouse pointer (QPoint) |
|
252 </dd> |
|
253 </dl> |
|
254 <a NAME="CodeMetricsDialog.on_buttonBox_clicked" ID="CodeMetricsDialog.on_buttonBox_clicked"></a> |
|
255 <h4>CodeMetricsDialog.on_buttonBox_clicked</h4> |
|
256 <b>on_buttonBox_clicked</b>(<i>button</i>) |
|
257 |
|
258 <p> |
|
259 Private slot called by a button of the button box clicked. |
|
260 </p> |
|
261 <dl> |
|
262 |
|
263 <dt><i>button</i></dt> |
|
264 <dd> |
|
265 button that was clicked (QAbstractButton) |
|
266 </dd> |
|
267 </dl> |
|
268 <a NAME="CodeMetricsDialog.on_startButton_clicked" ID="CodeMetricsDialog.on_startButton_clicked"></a> |
|
269 <h4>CodeMetricsDialog.on_startButton_clicked</h4> |
|
270 <b>on_startButton_clicked</b>(<i></i>) |
|
271 |
|
272 <p> |
|
273 Private slot to start a code metrics run. |
|
274 </p> |
|
275 <a NAME="CodeMetricsDialog.prepare" ID="CodeMetricsDialog.prepare"></a> |
|
276 <h4>CodeMetricsDialog.prepare</h4> |
|
277 <b>prepare</b>(<i>fileList, project</i>) |
|
278 |
|
279 <p> |
|
280 Public method to prepare the dialog with a list of filenames. |
|
281 </p> |
|
282 <dl> |
|
283 |
|
284 <dt><i>fileList</i></dt> |
|
285 <dd> |
|
286 list of filenames (list of strings) |
|
287 </dd> |
|
288 <dt><i>project</i></dt> |
|
289 <dd> |
|
290 reference to the project object (Project) |
|
291 </dd> |
|
292 </dl> |
|
293 <a NAME="CodeMetricsDialog.start" ID="CodeMetricsDialog.start"></a> |
|
294 <h4>CodeMetricsDialog.start</h4> |
|
295 <b>start</b>(<i>fn</i>) |
|
296 |
|
297 <p> |
|
298 Public slot to start the code metrics determination. |
|
299 </p> |
|
300 <dl> |
|
301 |
|
302 <dt><i>fn</i></dt> |
|
303 <dd> |
|
304 file or list of files or directory to show |
|
305 the code metrics for (string or list of strings) |
|
306 </dd> |
|
307 </dl> |
|
308 <div align="right"><a href="#top">Up</a></div> |
|
309 <hr /> |
|
310 </body></html> |