|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' |
|
3 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'> |
|
4 <html><head> |
|
5 <title>eric5.UI.Browser</title> |
|
6 <style> |
|
7 b'body {\n background:white;\n margin: 0em 1em 10em 1em;\n color: black;\n}\n\nh1 { color: white; background: #4FA4FF; }\nh2 { color: white; background: #4FA4FF; }\nh3 { color: white; background: #00557F; }\nh4 { color: white; background: #00557F; }\n \na { color: #AA5500; }\n' |
|
8 </style> |
|
9 </head> |
|
10 <body><a NAME="top" ID="top"></a> |
|
11 <h1>eric5.UI.Browser</h1> |
|
12 <p> |
|
13 Module implementing a browser with class browsing capabilities. |
|
14 </p> |
|
15 <h3>Global Attributes</h3> |
|
16 <table> |
|
17 <tr><td>None</td></tr> |
|
18 </table> |
|
19 <h3>Classes</h3> |
|
20 <table> |
|
21 <tr> |
|
22 <td><a href="#Browser">Browser</a></td> |
|
23 <td>Class used to display a file system tree.</td> |
|
24 </tr> |
|
25 </table> |
|
26 <h3>Functions</h3> |
|
27 <table> |
|
28 <tr><td>None</td></tr> |
|
29 </table> |
|
30 <hr /><hr /> |
|
31 <a NAME="Browser" ID="Browser"></a> |
|
32 <h2>Browser</h2> |
|
33 <p> |
|
34 Class used to display a file system tree. |
|
35 </p><p> |
|
36 Via the context menu that |
|
37 is displayed by a right click the user can select various actions on |
|
38 the selected file. |
|
39 </p><h4>Signals</h4> |
|
40 <dl> |
|
41 <dt>designerFile(string)</dt> |
|
42 <dd> |
|
43 emitted to open a Qt-Designer file |
|
44 </dd><dt>linguistFile(string)</dt> |
|
45 <dd> |
|
46 emitted to open a Qt-Linguist (*.ts) file |
|
47 </dd><dt>multiProjectFile(string)</dt> |
|
48 <dd> |
|
49 emitted to open an eric4/5 multi project file |
|
50 </dd><dt>pixmapEditFile(string)</dt> |
|
51 <dd> |
|
52 emitted to edit a pixmap file |
|
53 </dd><dt>pixmapFile(string)</dt> |
|
54 <dd> |
|
55 emitted to open a pixmap file |
|
56 </dd><dt>projectFile(string)</dt> |
|
57 <dd> |
|
58 emitted to open an eric4/5 project file |
|
59 </dd><dt>sourceFile(string, int, string)</dt> |
|
60 <dd> |
|
61 emitted to open a Python file at a line |
|
62 </dd><dt>svgFile(string)</dt> |
|
63 <dd> |
|
64 emitted to open a SVG file |
|
65 </dd><dt>trpreview(string list)</dt> |
|
66 <dd> |
|
67 emitted to preview a Qt-Linguist (*.qm) file |
|
68 </dd><dt>unittestOpen(string)</dt> |
|
69 <dd> |
|
70 emitted to open a Python file for a unittest |
|
71 </dd> |
|
72 </dl> |
|
73 <h3>Derived from</h3> |
|
74 QTreeView |
|
75 <h3>Class Attributes</h3> |
|
76 <table> |
|
77 <tr><td>None</td></tr> |
|
78 </table> |
|
79 <h3>Methods</h3> |
|
80 <table> |
|
81 <tr> |
|
82 <td><a href="#Browser.__init__">Browser</a></td> |
|
83 <td>Constructor</td> |
|
84 </tr><tr> |
|
85 <td><a href="#Browser.__addAsToplevelDir">__addAsToplevelDir</a></td> |
|
86 <td>Private slot to handle the Add as toplevel directory popup menu entry.</td> |
|
87 </tr><tr> |
|
88 <td><a href="#Browser.__configure">__configure</a></td> |
|
89 <td>Private method to open the configuration dialog.</td> |
|
90 </tr><tr> |
|
91 <td><a href="#Browser.__createPopupMenus">__createPopupMenus</a></td> |
|
92 <td>Private method to generate the various popup menus.</td> |
|
93 </tr><tr> |
|
94 <td><a href="#Browser.__findInDirectory">__findInDirectory</a></td> |
|
95 <td>Private slot to handle the Find in directory popup menu entry.</td> |
|
96 </tr><tr> |
|
97 <td><a href="#Browser.__newToplevelDir">__newToplevelDir</a></td> |
|
98 <td>Private slot to handle the New toplevel directory popup menu entry.</td> |
|
99 </tr><tr> |
|
100 <td><a href="#Browser.__removeToplevel">__removeToplevel</a></td> |
|
101 <td>Private slot to handle the Remove from toplevel popup menu entry.</td> |
|
102 </tr><tr> |
|
103 <td><a href="#Browser.__replaceInDirectory">__replaceInDirectory</a></td> |
|
104 <td>Private slot to handle the Find&Replace in directory popup menu entry.</td> |
|
105 </tr><tr> |
|
106 <td><a href="#Browser._contextMenuRequested">_contextMenuRequested</a></td> |
|
107 <td>Protected slot to show the context menu of the listview.</td> |
|
108 </tr><tr> |
|
109 <td><a href="#Browser._copyToClipboard">_copyToClipboard</a></td> |
|
110 <td>Protected method to copy the text shown for an entry to the clipboard.</td> |
|
111 </tr><tr> |
|
112 <td><a href="#Browser._editPixmap">_editPixmap</a></td> |
|
113 <td>Protected slot to handle the open in icon editor popup menu entry.</td> |
|
114 </tr><tr> |
|
115 <td><a href="#Browser._init">_init</a></td> |
|
116 <td>Protected method to perform initialization tasks common to this base class and all derived classes.</td> |
|
117 </tr><tr> |
|
118 <td><a href="#Browser._openItem">_openItem</a></td> |
|
119 <td>Protected slot to handle the open popup menu entry.</td> |
|
120 </tr><tr> |
|
121 <td><a href="#Browser._resizeColumns">_resizeColumns</a></td> |
|
122 <td>Protected slot to resize the view when items get expanded or collapsed.</td> |
|
123 </tr><tr> |
|
124 <td><a href="#Browser._resort">_resort</a></td> |
|
125 <td>Protected slot to resort the tree.</td> |
|
126 </tr><tr> |
|
127 <td><a href="#Browser.getSelectedItems">getSelectedItems</a></td> |
|
128 <td>Public method to get the selected items.</td> |
|
129 </tr><tr> |
|
130 <td><a href="#Browser.getSelectedItemsCount">getSelectedItemsCount</a></td> |
|
131 <td>Public method to get the count of items selected.</td> |
|
132 </tr><tr> |
|
133 <td><a href="#Browser.getSelectedItemsCountCategorized">getSelectedItemsCountCategorized</a></td> |
|
134 <td>Public method to get a categorized count of selected items.</td> |
|
135 </tr><tr> |
|
136 <td><a href="#Browser.handlePreferencesChanged">handlePreferencesChanged</a></td> |
|
137 <td>Public slot used to handle the preferencesChanged signal.</td> |
|
138 </tr><tr> |
|
139 <td><a href="#Browser.handleProgramChange">handleProgramChange</a></td> |
|
140 <td>Public slot to handle the programChange signal.</td> |
|
141 </tr><tr> |
|
142 <td><a href="#Browser.handleUnittest">handleUnittest</a></td> |
|
143 <td>Public slot to handle the unittest popup menu entry.</td> |
|
144 </tr><tr> |
|
145 <td><a href="#Browser.layoutDisplay">layoutDisplay</a></td> |
|
146 <td>Public slot to perform a layout operation.</td> |
|
147 </tr><tr> |
|
148 <td><a href="#Browser.mouseDoubleClickEvent">mouseDoubleClickEvent</a></td> |
|
149 <td>Protected method of QAbstractItemView.</td> |
|
150 </tr><tr> |
|
151 <td><a href="#Browser.saveToplevelDirs">saveToplevelDirs</a></td> |
|
152 <td>Public slot to save the toplevel directories.</td> |
|
153 </tr><tr> |
|
154 <td><a href="#Browser.wantedItem">wantedItem</a></td> |
|
155 <td>Public method to check type of an item.</td> |
|
156 </tr> |
|
157 </table> |
|
158 <a NAME="Browser.__init__" ID="Browser.__init__"></a> |
|
159 <h4>Browser (Constructor)</h4> |
|
160 <b>Browser</b>(<i>parent = None</i>) |
|
161 <p> |
|
162 Constructor |
|
163 </p><dl> |
|
164 <dt><i>parent</i></dt> |
|
165 <dd> |
|
166 parent widget (QWidget) |
|
167 </dd> |
|
168 </dl><a NAME="Browser.__addAsToplevelDir" ID="Browser.__addAsToplevelDir"></a> |
|
169 <h4>Browser.__addAsToplevelDir</h4> |
|
170 <b>__addAsToplevelDir</b>(<i></i>) |
|
171 <p> |
|
172 Private slot to handle the Add as toplevel directory popup menu entry. |
|
173 </p><a NAME="Browser.__configure" ID="Browser.__configure"></a> |
|
174 <h4>Browser.__configure</h4> |
|
175 <b>__configure</b>(<i></i>) |
|
176 <p> |
|
177 Private method to open the configuration dialog. |
|
178 </p><a NAME="Browser.__createPopupMenus" ID="Browser.__createPopupMenus"></a> |
|
179 <h4>Browser.__createPopupMenus</h4> |
|
180 <b>__createPopupMenus</b>(<i></i>) |
|
181 <p> |
|
182 Private method to generate the various popup menus. |
|
183 </p><a NAME="Browser.__findInDirectory" ID="Browser.__findInDirectory"></a> |
|
184 <h4>Browser.__findInDirectory</h4> |
|
185 <b>__findInDirectory</b>(<i></i>) |
|
186 <p> |
|
187 Private slot to handle the Find in directory popup menu entry. |
|
188 </p><a NAME="Browser.__newToplevelDir" ID="Browser.__newToplevelDir"></a> |
|
189 <h4>Browser.__newToplevelDir</h4> |
|
190 <b>__newToplevelDir</b>(<i></i>) |
|
191 <p> |
|
192 Private slot to handle the New toplevel directory popup menu entry. |
|
193 </p><a NAME="Browser.__removeToplevel" ID="Browser.__removeToplevel"></a> |
|
194 <h4>Browser.__removeToplevel</h4> |
|
195 <b>__removeToplevel</b>(<i></i>) |
|
196 <p> |
|
197 Private slot to handle the Remove from toplevel popup menu entry. |
|
198 </p><a NAME="Browser.__replaceInDirectory" ID="Browser.__replaceInDirectory"></a> |
|
199 <h4>Browser.__replaceInDirectory</h4> |
|
200 <b>__replaceInDirectory</b>(<i></i>) |
|
201 <p> |
|
202 Private slot to handle the Find&Replace in directory popup menu entry. |
|
203 </p><a NAME="Browser._contextMenuRequested" ID="Browser._contextMenuRequested"></a> |
|
204 <h4>Browser._contextMenuRequested</h4> |
|
205 <b>_contextMenuRequested</b>(<i>coord</i>) |
|
206 <p> |
|
207 Protected slot to show the context menu of the listview. |
|
208 </p><dl> |
|
209 <dt><i>coord</i></dt> |
|
210 <dd> |
|
211 the position of the mouse pointer (QPoint) |
|
212 </dd> |
|
213 </dl><a NAME="Browser._copyToClipboard" ID="Browser._copyToClipboard"></a> |
|
214 <h4>Browser._copyToClipboard</h4> |
|
215 <b>_copyToClipboard</b>(<i></i>) |
|
216 <p> |
|
217 Protected method to copy the text shown for an entry to the clipboard. |
|
218 </p><a NAME="Browser._editPixmap" ID="Browser._editPixmap"></a> |
|
219 <h4>Browser._editPixmap</h4> |
|
220 <b>_editPixmap</b>(<i></i>) |
|
221 <p> |
|
222 Protected slot to handle the open in icon editor popup menu entry. |
|
223 </p><a NAME="Browser._init" ID="Browser._init"></a> |
|
224 <h4>Browser._init</h4> |
|
225 <b>_init</b>(<i></i>) |
|
226 <p> |
|
227 Protected method to perform initialization tasks common to this |
|
228 base class and all derived classes. |
|
229 </p><a NAME="Browser._openItem" ID="Browser._openItem"></a> |
|
230 <h4>Browser._openItem</h4> |
|
231 <b>_openItem</b>(<i></i>) |
|
232 <p> |
|
233 Protected slot to handle the open popup menu entry. |
|
234 </p><a NAME="Browser._resizeColumns" ID="Browser._resizeColumns"></a> |
|
235 <h4>Browser._resizeColumns</h4> |
|
236 <b>_resizeColumns</b>(<i>index</i>) |
|
237 <p> |
|
238 Protected slot to resize the view when items get expanded or collapsed. |
|
239 </p><dl> |
|
240 <dt><i>index</i></dt> |
|
241 <dd> |
|
242 index of item (QModelIndex) |
|
243 </dd> |
|
244 </dl><a NAME="Browser._resort" ID="Browser._resort"></a> |
|
245 <h4>Browser._resort</h4> |
|
246 <b>_resort</b>(<i></i>) |
|
247 <p> |
|
248 Protected slot to resort the tree. |
|
249 </p><a NAME="Browser.getSelectedItems" ID="Browser.getSelectedItems"></a> |
|
250 <h4>Browser.getSelectedItems</h4> |
|
251 <b>getSelectedItems</b>(<i>filter=None</i>) |
|
252 <p> |
|
253 Public method to get the selected items. |
|
254 </p><dl> |
|
255 <dt><i>filter</i></dt> |
|
256 <dd> |
|
257 list of classes to check against |
|
258 </dd> |
|
259 </dl><dl> |
|
260 <dt>Returns:</dt> |
|
261 <dd> |
|
262 list of selected items (list of BroweserItem) |
|
263 </dd> |
|
264 </dl><a NAME="Browser.getSelectedItemsCount" ID="Browser.getSelectedItemsCount"></a> |
|
265 <h4>Browser.getSelectedItemsCount</h4> |
|
266 <b>getSelectedItemsCount</b>(<i>filter=None</i>) |
|
267 <p> |
|
268 Public method to get the count of items selected. |
|
269 </p><dl> |
|
270 <dt><i>filter</i></dt> |
|
271 <dd> |
|
272 list of classes to check against |
|
273 </dd> |
|
274 </dl><dl> |
|
275 <dt>Returns:</dt> |
|
276 <dd> |
|
277 count of items selected (integer) |
|
278 </dd> |
|
279 </dl><a NAME="Browser.getSelectedItemsCountCategorized" ID="Browser.getSelectedItemsCountCategorized"></a> |
|
280 <h4>Browser.getSelectedItemsCountCategorized</h4> |
|
281 <b>getSelectedItemsCountCategorized</b>(<i>filter=None</i>) |
|
282 <p> |
|
283 Public method to get a categorized count of selected items. |
|
284 </p><dl> |
|
285 <dt><i>filter</i></dt> |
|
286 <dd> |
|
287 list of classes to check against |
|
288 </dd> |
|
289 </dl><dl> |
|
290 <dt>Returns:</dt> |
|
291 <dd> |
|
292 a dictionary containing the counts of items belonging |
|
293 to the individual filter classes. The keys of the dictionary |
|
294 are the unicode representation of the classes given in the |
|
295 filter (i.e. unicode(filterClass)). The dictionary contains |
|
296 an additional entry with key "sum", that stores the sum of |
|
297 all selected entries fulfilling the filter criteria. |
|
298 </dd> |
|
299 </dl><a NAME="Browser.handlePreferencesChanged" ID="Browser.handlePreferencesChanged"></a> |
|
300 <h4>Browser.handlePreferencesChanged</h4> |
|
301 <b>handlePreferencesChanged</b>(<i></i>) |
|
302 <p> |
|
303 Public slot used to handle the preferencesChanged signal. |
|
304 </p><a NAME="Browser.handleProgramChange" ID="Browser.handleProgramChange"></a> |
|
305 <h4>Browser.handleProgramChange</h4> |
|
306 <b>handleProgramChange</b>(<i>fn</i>) |
|
307 <p> |
|
308 Public slot to handle the programChange signal. |
|
309 </p><a NAME="Browser.handleUnittest" ID="Browser.handleUnittest"></a> |
|
310 <h4>Browser.handleUnittest</h4> |
|
311 <b>handleUnittest</b>(<i></i>) |
|
312 <p> |
|
313 Public slot to handle the unittest popup menu entry. |
|
314 </p><a NAME="Browser.layoutDisplay" ID="Browser.layoutDisplay"></a> |
|
315 <h4>Browser.layoutDisplay</h4> |
|
316 <b>layoutDisplay</b>(<i></i>) |
|
317 <p> |
|
318 Public slot to perform a layout operation. |
|
319 </p><a NAME="Browser.mouseDoubleClickEvent" ID="Browser.mouseDoubleClickEvent"></a> |
|
320 <h4>Browser.mouseDoubleClickEvent</h4> |
|
321 <b>mouseDoubleClickEvent</b>(<i>mouseEvent</i>) |
|
322 <p> |
|
323 Protected method of QAbstractItemView. |
|
324 </p><p> |
|
325 Reimplemented to disable expanding/collapsing |
|
326 of items when double-clicking. Instead the double-clicked entry is opened. |
|
327 </p><dl> |
|
328 <dt><i>mouseEvent</i></dt> |
|
329 <dd> |
|
330 the mouse event (QMouseEvent) |
|
331 </dd> |
|
332 </dl><a NAME="Browser.saveToplevelDirs" ID="Browser.saveToplevelDirs"></a> |
|
333 <h4>Browser.saveToplevelDirs</h4> |
|
334 <b>saveToplevelDirs</b>(<i></i>) |
|
335 <p> |
|
336 Public slot to save the toplevel directories. |
|
337 </p><a NAME="Browser.wantedItem" ID="Browser.wantedItem"></a> |
|
338 <h4>Browser.wantedItem</h4> |
|
339 <b>wantedItem</b>(<i>itm, filter=None</i>) |
|
340 <p> |
|
341 Public method to check type of an item. |
|
342 </p><dl> |
|
343 <dt><i>itm</i></dt> |
|
344 <dd> |
|
345 the item to check (BrowserItem) |
|
346 </dd><dt><i>filter</i></dt> |
|
347 <dd> |
|
348 list of classes to check against |
|
349 </dd> |
|
350 </dl><dl> |
|
351 <dt>Returns:</dt> |
|
352 <dd> |
|
353 flag indicating item is a valid type (boolean) |
|
354 </dd> |
|
355 </dl> |
|
356 <div align="right"><a href="#top">Up</a></div> |
|
357 <hr /> |
|
358 </body></html> |