eric6/Documentation/Source/eric6.UI.Browser.html

branch
maintenance
changeset 6989
8b8cadf8d7e9
parent 6987
3371a03ed0a7
child 7273
391d6b7b1eff
equal deleted inserted replaced
6938:7926553b7509 6989:8b8cadf8d7e9
1 <!DOCTYPE html>
2 <html><head>
3 <title>eric6.UI.Browser</title>
4 <meta charset="UTF-8">
5 <style>
6 body {
7 background: #EDECE6;
8 margin: 0em 1em 10em 1em;
9 color: black;
10 }
11
12 h1 { color: white; background: #85774A; }
13 h2 { color: white; background: #85774A; }
14 h3 { color: white; background: #9D936E; }
15 h4 { color: white; background: #9D936E; }
16
17 a { color: #BA6D36; }
18
19 </style>
20 </head>
21 <body><a NAME="top" ID="top"></a>
22 <h1>eric6.UI.Browser</h1>
23 <p>
24 Module implementing a browser with class browsing capabilities.
25 </p>
26 <h3>Global Attributes</h3>
27 <table>
28 <tr><td>None</td></tr>
29 </table>
30 <h3>Classes</h3>
31 <table>
32 <tr>
33 <td><a href="#Browser">Browser</a></td>
34 <td>Class used to display a file system tree.</td>
35 </tr>
36 </table>
37 <h3>Functions</h3>
38 <table>
39 <tr><td>None</td></tr>
40 </table>
41 <hr /><hr />
42 <a NAME="Browser" ID="Browser"></a>
43 <h2>Browser</h2>
44 <p>
45 Class used to display a file system tree.
46 </p><p>
47 Via the context menu that
48 is displayed by a right click the user can select various actions on
49 the selected file.
50 </p><h3>Signals</h3>
51 <dl>
52 <dt>binaryFile(filename)</dt>
53 <dd>
54 emitted to open a file as binary (str)
55 </dd><dt>designerFile(filename)</dt>
56 <dd>
57 emitted to open a Qt-Designer file (str)
58 </dd><dt>linguistFile(filename)</dt>
59 <dd>
60 emitted to open a Qt-Linguist (*.ts)
61 file (str)
62 </dd><dt>multiProjectFile(filename)</dt>
63 <dd>
64 emitted to open an eric multi project
65 file (str)
66 </dd><dt>pixmapEditFile(filename)</dt>
67 <dd>
68 emitted to edit a pixmap file (str)
69 </dd><dt>pixmapFile(filename)</dt>
70 <dd>
71 emitted to open a pixmap file (str)
72 </dd><dt>projectFile(filename)</dt>
73 <dd>
74 emitted to open an eric project file (str)
75 </dd><dt>sourceFile(filename)</dt>
76 <dd>
77 emitted to open a Python file at a line (str)
78 </dd><dt>sourceFile(filename, lineno)</dt>
79 <dd>
80 emitted to open a Python file at a
81 line (str, int)
82 </dd><dt>sourceFile(filename, lineno, type)</dt>
83 <dd>
84 emitted to open a Python file
85 at a line giving an explicit file type (str, int, str)
86 </dd><dt>sourceFile(filename, linenos)</dt>
87 <dd>
88 emitted to open a Python file giving
89 a list of lines(str, list)
90 </dd><dt>svgFile(filename)</dt>
91 <dd>
92 emitted to open a SVG file (str)
93 </dd><dt>trpreview(filenames)</dt>
94 <dd>
95 emitted to preview Qt-Linguist (*.qm)
96 files (list of str)
97 </dd><dt>trpreview(filenames, ignore)</dt>
98 <dd>
99 emitted to preview Qt-Linguist (*.qm)
100 files indicating whether non-existent files shall be ignored
101 (list of str, bool)
102 </dd><dt>unittestOpen(filename)</dt>
103 <dd>
104 emitted to open a Python file for a
105 unit test (str)
106 </dd>
107 </dl>
108 <h3>Derived from</h3>
109 QTreeView
110 <h3>Class Attributes</h3>
111 <table>
112 <tr><td>None</td></tr>
113 </table>
114 <h3>Class Methods</h3>
115 <table>
116 <tr><td>None</td></tr>
117 </table>
118 <h3>Methods</h3>
119 <table>
120 <tr>
121 <td><a href="#Browser.__init__">Browser</a></td>
122 <td>Constructor</td>
123 </tr><tr>
124 <td><a href="#Browser.__addAsToplevelDir">__addAsToplevelDir</a></td>
125 <td>Private slot to handle the Add as toplevel directory popup menu entry.</td>
126 </tr><tr>
127 <td><a href="#Browser.__createPopupMenus">__createPopupMenus</a></td>
128 <td>Private method to generate the various popup menus.</td>
129 </tr><tr>
130 <td><a href="#Browser.__findInDirectory">__findInDirectory</a></td>
131 <td>Private slot to handle the Find in directory popup menu entry.</td>
132 </tr><tr>
133 <td><a href="#Browser.__newToplevelDir">__newToplevelDir</a></td>
134 <td>Private slot to handle the New toplevel directory popup menu entry.</td>
135 </tr><tr>
136 <td><a href="#Browser.__refreshDirectory">__refreshDirectory</a></td>
137 <td>Private slot to refresh a directory entry.</td>
138 </tr><tr>
139 <td><a href="#Browser.__removeToplevel">__removeToplevel</a></td>
140 <td>Private slot to handle the Remove from toplevel popup menu entry.</td>
141 </tr><tr>
142 <td><a href="#Browser.__replaceInDirectory">__replaceInDirectory</a></td>
143 <td>Private slot to handle the Find&Replace in directory popup menu entry.</td>
144 </tr><tr>
145 <td><a href="#Browser.__showMimeType">__showMimeType</a></td>
146 <td>Private slot to show the mime type of the selected entry.</td>
147 </tr><tr>
148 <td><a href="#Browser._contextMenuRequested">_contextMenuRequested</a></td>
149 <td>Protected slot to show the context menu of the listview.</td>
150 </tr><tr>
151 <td><a href="#Browser._copyToClipboard">_copyToClipboard</a></td>
152 <td>Protected method to copy the text shown for an entry to the clipboard.</td>
153 </tr><tr>
154 <td><a href="#Browser._editPixmap">_editPixmap</a></td>
155 <td>Protected slot to handle the open in icon editor popup menu entry.</td>
156 </tr><tr>
157 <td><a href="#Browser._gotoAttribute">_gotoAttribute</a></td>
158 <td>Protected slot to handle the selection of the goto menu.</td>
159 </tr><tr>
160 <td><a href="#Browser._init">_init</a></td>
161 <td>Protected method to perform initialization tasks common to this base class and all derived classes.</td>
162 </tr><tr>
163 <td><a href="#Browser._keyboardSearchType">_keyboardSearchType</a></td>
164 <td>Protected method to check, if the item is of the correct type.</td>
165 </tr><tr>
166 <td><a href="#Browser._openHexEditor">_openHexEditor</a></td>
167 <td>Protected slot to handle the open in hex editor popup menu entry.</td>
168 </tr><tr>
169 <td><a href="#Browser._openItem">_openItem</a></td>
170 <td>Protected slot to handle the open popup menu entry.</td>
171 </tr><tr>
172 <td><a href="#Browser._resizeColumns">_resizeColumns</a></td>
173 <td>Protected slot to resize the view when items get expanded or collapsed.</td>
174 </tr><tr>
175 <td><a href="#Browser._resort">_resort</a></td>
176 <td>Protected slot to resort the tree.</td>
177 </tr><tr>
178 <td><a href="#Browser._showGotoMenu">_showGotoMenu</a></td>
179 <td>Protected slot to prepare the goto submenu of the attribute menu.</td>
180 </tr><tr>
181 <td><a href="#Browser.getSelectedItems">getSelectedItems</a></td>
182 <td>Public method to get the selected items.</td>
183 </tr><tr>
184 <td><a href="#Browser.getSelectedItemsCount">getSelectedItemsCount</a></td>
185 <td>Public method to get the count of items selected.</td>
186 </tr><tr>
187 <td><a href="#Browser.getSelectedItemsCountCategorized">getSelectedItemsCountCategorized</a></td>
188 <td>Public method to get a categorized count of selected items.</td>
189 </tr><tr>
190 <td><a href="#Browser.handleInterpreterChanged">handleInterpreterChanged</a></td>
191 <td>Public slot to handle a change of the debug client's interpreter.</td>
192 </tr><tr>
193 <td><a href="#Browser.handlePreferencesChanged">handlePreferencesChanged</a></td>
194 <td>Public slot used to handle the preferencesChanged signal.</td>
195 </tr><tr>
196 <td><a href="#Browser.handleProgramChange">handleProgramChange</a></td>
197 <td>Public slot to handle the programChange signal.</td>
198 </tr><tr>
199 <td><a href="#Browser.handleUnittest">handleUnittest</a></td>
200 <td>Public slot to handle the unittest popup menu entry.</td>
201 </tr><tr>
202 <td><a href="#Browser.keyboardSearch">keyboardSearch</a></td>
203 <td>Public function to search the tree via the keyboard.</td>
204 </tr><tr>
205 <td><a href="#Browser.layoutDisplay">layoutDisplay</a></td>
206 <td>Public slot to perform a layout operation.</td>
207 </tr><tr>
208 <td><a href="#Browser.mouseDoubleClickEvent">mouseDoubleClickEvent</a></td>
209 <td>Protected method of QAbstractItemView.</td>
210 </tr><tr>
211 <td><a href="#Browser.saveToplevelDirs">saveToplevelDirs</a></td>
212 <td>Public slot to save the toplevel directories.</td>
213 </tr><tr>
214 <td><a href="#Browser.wantedItem">wantedItem</a></td>
215 <td>Public method to check type of an item.</td>
216 </tr>
217 </table>
218 <h3>Static Methods</h3>
219 <table>
220 <tr><td>None</td></tr>
221 </table>
222 <a NAME="Browser.__init__" ID="Browser.__init__"></a>
223 <h4>Browser (Constructor)</h4>
224 <b>Browser</b>(<i>parent=None</i>)
225 <p>
226 Constructor
227 </p><dl>
228 <dt><i>parent</i></dt>
229 <dd>
230 parent widget (QWidget)
231 </dd>
232 </dl><a NAME="Browser.__addAsToplevelDir" ID="Browser.__addAsToplevelDir"></a>
233 <h4>Browser.__addAsToplevelDir</h4>
234 <b>__addAsToplevelDir</b>(<i></i>)
235 <p>
236 Private slot to handle the Add as toplevel directory popup menu entry.
237 </p><a NAME="Browser.__createPopupMenus" ID="Browser.__createPopupMenus"></a>
238 <h4>Browser.__createPopupMenus</h4>
239 <b>__createPopupMenus</b>(<i></i>)
240 <p>
241 Private method to generate the various popup menus.
242 </p><a NAME="Browser.__findInDirectory" ID="Browser.__findInDirectory"></a>
243 <h4>Browser.__findInDirectory</h4>
244 <b>__findInDirectory</b>(<i></i>)
245 <p>
246 Private slot to handle the Find in directory popup menu entry.
247 </p><a NAME="Browser.__newToplevelDir" ID="Browser.__newToplevelDir"></a>
248 <h4>Browser.__newToplevelDir</h4>
249 <b>__newToplevelDir</b>(<i></i>)
250 <p>
251 Private slot to handle the New toplevel directory popup menu entry.
252 </p><a NAME="Browser.__refreshDirectory" ID="Browser.__refreshDirectory"></a>
253 <h4>Browser.__refreshDirectory</h4>
254 <b>__refreshDirectory</b>(<i></i>)
255 <p>
256 Private slot to refresh a directory entry.
257 </p><a NAME="Browser.__removeToplevel" ID="Browser.__removeToplevel"></a>
258 <h4>Browser.__removeToplevel</h4>
259 <b>__removeToplevel</b>(<i></i>)
260 <p>
261 Private slot to handle the Remove from toplevel popup menu entry.
262 </p><a NAME="Browser.__replaceInDirectory" ID="Browser.__replaceInDirectory"></a>
263 <h4>Browser.__replaceInDirectory</h4>
264 <b>__replaceInDirectory</b>(<i></i>)
265 <p>
266 Private slot to handle the Find&Replace in directory popup menu entry.
267 </p><a NAME="Browser.__showMimeType" ID="Browser.__showMimeType"></a>
268 <h4>Browser.__showMimeType</h4>
269 <b>__showMimeType</b>(<i></i>)
270 <p>
271 Private slot to show the mime type of the selected entry.
272 </p><a NAME="Browser._contextMenuRequested" ID="Browser._contextMenuRequested"></a>
273 <h4>Browser._contextMenuRequested</h4>
274 <b>_contextMenuRequested</b>(<i>coord</i>)
275 <p>
276 Protected slot to show the context menu of the listview.
277 </p><dl>
278 <dt><i>coord</i></dt>
279 <dd>
280 the position of the mouse pointer (QPoint)
281 </dd>
282 </dl><a NAME="Browser._copyToClipboard" ID="Browser._copyToClipboard"></a>
283 <h4>Browser._copyToClipboard</h4>
284 <b>_copyToClipboard</b>(<i></i>)
285 <p>
286 Protected method to copy the text shown for an entry to the clipboard.
287 </p><a NAME="Browser._editPixmap" ID="Browser._editPixmap"></a>
288 <h4>Browser._editPixmap</h4>
289 <b>_editPixmap</b>(<i></i>)
290 <p>
291 Protected slot to handle the open in icon editor popup menu entry.
292 </p><a NAME="Browser._gotoAttribute" ID="Browser._gotoAttribute"></a>
293 <h4>Browser._gotoAttribute</h4>
294 <b>_gotoAttribute</b>(<i>act</i>)
295 <p>
296 Protected slot to handle the selection of the goto menu.
297 </p><dl>
298 <dt><i>act</i></dt>
299 <dd>
300 reference to the action (E5Action)
301 </dd>
302 </dl><a NAME="Browser._init" ID="Browser._init"></a>
303 <h4>Browser._init</h4>
304 <b>_init</b>(<i></i>)
305 <p>
306 Protected method to perform initialization tasks common to this
307 base class and all derived classes.
308 </p><a NAME="Browser._keyboardSearchType" ID="Browser._keyboardSearchType"></a>
309 <h4>Browser._keyboardSearchType</h4>
310 <b>_keyboardSearchType</b>(<i>item</i>)
311 <p>
312 Protected method to check, if the item is of the correct type.
313 </p><dl>
314 <dt><i>item</i> (BrowserItem)</dt>
315 <dd>
316 reference to the item
317 </dd>
318 </dl><dl>
319 <dt>Returns:</dt>
320 <dd>
321 flag indicating a correct type
322 </dd>
323 </dl><dl>
324 <dt>Return Type:</dt>
325 <dd>
326 bool
327 </dd>
328 </dl><a NAME="Browser._openHexEditor" ID="Browser._openHexEditor"></a>
329 <h4>Browser._openHexEditor</h4>
330 <b>_openHexEditor</b>(<i></i>)
331 <p>
332 Protected slot to handle the open in hex editor popup menu entry.
333 </p><a NAME="Browser._openItem" ID="Browser._openItem"></a>
334 <h4>Browser._openItem</h4>
335 <b>_openItem</b>(<i></i>)
336 <p>
337 Protected slot to handle the open popup menu entry.
338 </p><a NAME="Browser._resizeColumns" ID="Browser._resizeColumns"></a>
339 <h4>Browser._resizeColumns</h4>
340 <b>_resizeColumns</b>(<i>index</i>)
341 <p>
342 Protected slot to resize the view when items get expanded or collapsed.
343 </p><dl>
344 <dt><i>index</i></dt>
345 <dd>
346 index of item (QModelIndex)
347 </dd>
348 </dl><a NAME="Browser._resort" ID="Browser._resort"></a>
349 <h4>Browser._resort</h4>
350 <b>_resort</b>(<i></i>)
351 <p>
352 Protected slot to resort the tree.
353 </p><a NAME="Browser._showGotoMenu" ID="Browser._showGotoMenu"></a>
354 <h4>Browser._showGotoMenu</h4>
355 <b>_showGotoMenu</b>(<i></i>)
356 <p>
357 Protected slot to prepare the goto submenu of the attribute menu.
358 </p><a NAME="Browser.getSelectedItems" ID="Browser.getSelectedItems"></a>
359 <h4>Browser.getSelectedItems</h4>
360 <b>getSelectedItems</b>(<i>filterList=None</i>)
361 <p>
362 Public method to get the selected items.
363 </p><dl>
364 <dt><i>filterList</i></dt>
365 <dd>
366 list of classes to check against
367 </dd>
368 </dl><dl>
369 <dt>Returns:</dt>
370 <dd>
371 list of selected items (list of BroweserItem)
372 </dd>
373 </dl><a NAME="Browser.getSelectedItemsCount" ID="Browser.getSelectedItemsCount"></a>
374 <h4>Browser.getSelectedItemsCount</h4>
375 <b>getSelectedItemsCount</b>(<i>filterList=None</i>)
376 <p>
377 Public method to get the count of items selected.
378 </p><dl>
379 <dt><i>filterList</i></dt>
380 <dd>
381 list of classes to check against
382 </dd>
383 </dl><dl>
384 <dt>Returns:</dt>
385 <dd>
386 count of items selected (integer)
387 </dd>
388 </dl><a NAME="Browser.getSelectedItemsCountCategorized" ID="Browser.getSelectedItemsCountCategorized"></a>
389 <h4>Browser.getSelectedItemsCountCategorized</h4>
390 <b>getSelectedItemsCountCategorized</b>(<i>filterList=None</i>)
391 <p>
392 Public method to get a categorized count of selected items.
393 </p><dl>
394 <dt><i>filterList</i></dt>
395 <dd>
396 list of classes to check against
397 </dd>
398 </dl><dl>
399 <dt>Returns:</dt>
400 <dd>
401 a dictionary containing the counts of items belonging
402 to the individual filter classes. The keys of the dictionary
403 are the string representation of the classes given in the
404 filter (i.e. str(filterClass)). The dictionary contains
405 an additional entry with key "sum", that stores the sum of
406 all selected entries fulfilling the filter criteria.
407 </dd>
408 </dl><a NAME="Browser.handleInterpreterChanged" ID="Browser.handleInterpreterChanged"></a>
409 <h4>Browser.handleInterpreterChanged</h4>
410 <b>handleInterpreterChanged</b>(<i>interpreter</i>)
411 <p>
412 Public slot to handle a change of the debug client's interpreter.
413 </p><dl>
414 <dt><i>interpreter</i></dt>
415 <dd>
416 interpreter of the debug client (string)
417 </dd>
418 </dl><a NAME="Browser.handlePreferencesChanged" ID="Browser.handlePreferencesChanged"></a>
419 <h4>Browser.handlePreferencesChanged</h4>
420 <b>handlePreferencesChanged</b>(<i></i>)
421 <p>
422 Public slot used to handle the preferencesChanged signal.
423 </p><a NAME="Browser.handleProgramChange" ID="Browser.handleProgramChange"></a>
424 <h4>Browser.handleProgramChange</h4>
425 <b>handleProgramChange</b>(<i>fn</i>)
426 <p>
427 Public slot to handle the programChange signal.
428 </p><dl>
429 <dt><i>fn</i></dt>
430 <dd>
431 file name (string)
432 </dd>
433 </dl><a NAME="Browser.handleUnittest" ID="Browser.handleUnittest"></a>
434 <h4>Browser.handleUnittest</h4>
435 <b>handleUnittest</b>(<i></i>)
436 <p>
437 Public slot to handle the unittest popup menu entry.
438 </p><a NAME="Browser.keyboardSearch" ID="Browser.keyboardSearch"></a>
439 <h4>Browser.keyboardSearch</h4>
440 <b>keyboardSearch</b>(<i>search</i>)
441 <p>
442 Public function to search the tree via the keyboard.
443 </p><dl>
444 <dt><i>search</i> (str)</dt>
445 <dd>
446 the character entered via the keyboard
447 </dd>
448 </dl><a NAME="Browser.layoutDisplay" ID="Browser.layoutDisplay"></a>
449 <h4>Browser.layoutDisplay</h4>
450 <b>layoutDisplay</b>(<i></i>)
451 <p>
452 Public slot to perform a layout operation.
453 </p><a NAME="Browser.mouseDoubleClickEvent" ID="Browser.mouseDoubleClickEvent"></a>
454 <h4>Browser.mouseDoubleClickEvent</h4>
455 <b>mouseDoubleClickEvent</b>(<i>mouseEvent</i>)
456 <p>
457 Protected method of QAbstractItemView.
458 </p><p>
459 Reimplemented to disable expanding/collapsing of items when
460 double-clicking. Instead the double-clicked entry is opened.
461 </p><dl>
462 <dt><i>mouseEvent</i></dt>
463 <dd>
464 the mouse event (QMouseEvent)
465 </dd>
466 </dl><a NAME="Browser.saveToplevelDirs" ID="Browser.saveToplevelDirs"></a>
467 <h4>Browser.saveToplevelDirs</h4>
468 <b>saveToplevelDirs</b>(<i></i>)
469 <p>
470 Public slot to save the toplevel directories.
471 </p><a NAME="Browser.wantedItem" ID="Browser.wantedItem"></a>
472 <h4>Browser.wantedItem</h4>
473 <b>wantedItem</b>(<i>itm, filterList=None</i>)
474 <p>
475 Public method to check type of an item.
476 </p><dl>
477 <dt><i>itm</i></dt>
478 <dd>
479 the item to check (BrowserItem)
480 </dd><dt><i>filterList</i></dt>
481 <dd>
482 list of classes to check against
483 </dd>
484 </dl><dl>
485 <dt>Returns:</dt>
486 <dd>
487 flag indicating item is a valid type (boolean)
488 </dd>
489 </dl>
490 <div align="right"><a href="#top">Up</a></div>
491 <hr />
492 </body></html>

eric ide

mercurial