eric6/Documentation/Source/eric6.Project.QuickFindFileDialog.html

changeset 7273
391d6b7b1eff
parent 6942
2602857055c5
child 7989
a21d673a8f99
equal deleted inserted replaced
7272:1779dc278077 7273:391d6b7b1eff
16 16
17 a { color: #BA6D36; } 17 a { color: #BA6D36; }
18 18
19 </style> 19 </style>
20 </head> 20 </head>
21 <body><a NAME="top" ID="top"></a> 21 <body>
22 <a NAME="top" ID="top"></a>
22 <h1>eric6.Project.QuickFindFileDialog</h1> 23 <h1>eric6.Project.QuickFindFileDialog</h1>
24
23 <p> 25 <p>
24 Module implementing a quick search for files. 26 Module implementing a quick search for files.
25 </p><p> 27 </p>
28 <p>
26 This is basically the FindFileNameDialog modified to support faster 29 This is basically the FindFileNameDialog modified to support faster
27 interactions. 30 interactions.
28 </p> 31 </p>
29 <h3>Global Attributes</h3> 32 <h3>Global Attributes</h3>
33
30 <table> 34 <table>
31 <tr><td>None</td></tr> 35 <tr><td>None</td></tr>
32 </table> 36 </table>
33 <h3>Classes</h3> 37 <h3>Classes</h3>
34 <table> 38
39 <table>
40
35 <tr> 41 <tr>
36 <td><a href="#QuickFindFileDialog">QuickFindFileDialog</a></td> 42 <td><a href="#QuickFindFileDialog">QuickFindFileDialog</a></td>
37 <td>Class implementing the Quick Find File by Name Dialog.</td> 43 <td>Class implementing the Quick Find File by Name Dialog.</td>
38 </tr> 44 </tr>
39 </table> 45 </table>
40 <h3>Functions</h3> 46 <h3>Functions</h3>
41 <table> 47
42 <tr><td>None</td></tr> 48 <table>
43 </table> 49 <tr><td>None</td></tr>
44 <hr /><hr /> 50 </table>
51 <hr />
52 <hr />
45 <a NAME="QuickFindFileDialog" ID="QuickFindFileDialog"></a> 53 <a NAME="QuickFindFileDialog" ID="QuickFindFileDialog"></a>
46 <h2>QuickFindFileDialog</h2> 54 <h2>QuickFindFileDialog</h2>
55
47 <p> 56 <p>
48 Class implementing the Quick Find File by Name Dialog. 57 Class implementing the Quick Find File by Name Dialog.
49 </p><p> 58 </p>
59 <p>
50 This dialog provides a slightly more streamlined behaviour 60 This dialog provides a slightly more streamlined behaviour
51 than the standard FindFileNameDialog in that it tries to 61 than the standard FindFileNameDialog in that it tries to
52 match any name in the project against (fragmentary) bits of 62 match any name in the project against (fragmentary) bits of
53 file names. 63 file names.
54 </p><h3>Signals</h3> 64 </p>
55 <dl> 65 <h3>Signals</h3>
66 <dl>
67
56 <dt>designerFile(str)</dt> 68 <dt>designerFile(str)</dt>
57 <dd> 69 <dd>
58 emitted to open a Qt-Designer file 70 emitted to open a Qt-Designer file
59 </dd><dt>linguistFile(str)</dt> 71 </dd>
72 <dt>linguistFile(str)</dt>
60 <dd> 73 <dd>
61 emitted to open a Qt translation file 74 emitted to open a Qt translation file
62 </dd><dt>sourceFile(str)</dt> 75 </dd>
76 <dt>sourceFile(str)</dt>
63 <dd> 77 <dd>
64 emitted to open a file in the editor 78 emitted to open a file in the editor
65 </dd> 79 </dd>
66 </dl> 80 </dl>
67 <h3>Derived from</h3> 81 <h3>Derived from</h3>
68 QWidget, Ui_QuickFindFile 82 QWidget, Ui_QuickFindFile
69 <h3>Class Attributes</h3> 83 <h3>Class Attributes</h3>
84
70 <table> 85 <table>
71 <tr><td>None</td></tr> 86 <tr><td>None</td></tr>
72 </table> 87 </table>
73 <h3>Class Methods</h3> 88 <h3>Class Methods</h3>
89
74 <table> 90 <table>
75 <tr><td>None</td></tr> 91 <tr><td>None</td></tr>
76 </table> 92 </table>
77 <h3>Methods</h3> 93 <h3>Methods</h3>
78 <table> 94
95 <table>
96
79 <tr> 97 <tr>
80 <td><a href="#QuickFindFileDialog.__init__">QuickFindFileDialog</a></td> 98 <td><a href="#QuickFindFileDialog.__init__">QuickFindFileDialog</a></td>
81 <td>Constructor</td> 99 <td>Constructor</td>
82 </tr><tr> 100 </tr>
101 <tr>
83 <td><a href="#QuickFindFileDialog.__generateLocations">__generateLocations</a></td> 102 <td><a href="#QuickFindFileDialog.__generateLocations">__generateLocations</a></td>
84 <td>Private method to generate a set of locations that can be searched.</td> 103 <td>Private method to generate a set of locations that can be searched.</td>
85 </tr><tr> 104 </tr>
105 <tr>
86 <td><a href="#QuickFindFileDialog.__openFile">__openFile</a></td> 106 <td><a href="#QuickFindFileDialog.__openFile">__openFile</a></td>
87 <td>Private slot to open a file.</td> 107 <td>Private slot to open a file.</td>
88 </tr><tr> 108 </tr>
109 <tr>
89 <td><a href="#QuickFindFileDialog.__searchFile">__searchFile</a></td> 110 <td><a href="#QuickFindFileDialog.__searchFile">__searchFile</a></td>
90 <td>Private slot to handle the search.</td> 111 <td>Private slot to handle the search.</td>
91 </tr><tr> 112 </tr>
113 <tr>
92 <td><a href="#QuickFindFileDialog.__sortedMatches">__sortedMatches</a></td> 114 <td><a href="#QuickFindFileDialog.__sortedMatches">__sortedMatches</a></td>
93 <td>Private method to find the subset of items which match a search term.</td> 115 <td>Private method to find the subset of items which match a search term.</td>
94 </tr><tr> 116 </tr>
117 <tr>
95 <td><a href="#QuickFindFileDialog.eventFilter">eventFilter</a></td> 118 <td><a href="#QuickFindFileDialog.eventFilter">eventFilter</a></td>
96 <td>Public method to handle event for another object.</td> 119 <td>Public method to handle event for another object.</td>
97 </tr><tr> 120 </tr>
121 <tr>
98 <td><a href="#QuickFindFileDialog.on_buttonBox_clicked">on_buttonBox_clicked</a></td> 122 <td><a href="#QuickFindFileDialog.on_buttonBox_clicked">on_buttonBox_clicked</a></td>
99 <td>Private slot called by a button of the button box clicked.</td> 123 <td>Private slot called by a button of the button box clicked.</td>
100 </tr><tr> 124 </tr>
125 <tr>
101 <td><a href="#QuickFindFileDialog.on_fileList_currentItemChanged">on_fileList_currentItemChanged</a></td> 126 <td><a href="#QuickFindFileDialog.on_fileList_currentItemChanged">on_fileList_currentItemChanged</a></td>
102 <td>Private slot handling a change of the current item.</td> 127 <td>Private slot handling a change of the current item.</td>
103 </tr><tr> 128 </tr>
129 <tr>
104 <td><a href="#QuickFindFileDialog.on_fileList_itemActivated">on_fileList_itemActivated</a></td> 130 <td><a href="#QuickFindFileDialog.on_fileList_itemActivated">on_fileList_itemActivated</a></td>
105 <td>Private slot to handle the double click on a file item.</td> 131 <td>Private slot to handle the double click on a file item.</td>
106 </tr><tr> 132 </tr>
133 <tr>
107 <td><a href="#QuickFindFileDialog.on_fileNameEdit_returnPressed">on_fileNameEdit_returnPressed</a></td> 134 <td><a href="#QuickFindFileDialog.on_fileNameEdit_returnPressed">on_fileNameEdit_returnPressed</a></td>
108 <td>Private slot to handle enter being pressed on the file name edit box.</td> 135 <td>Private slot to handle enter being pressed on the file name edit box.</td>
109 </tr><tr> 136 </tr>
137 <tr>
110 <td><a href="#QuickFindFileDialog.on_fileNameEdit_textChanged">on_fileNameEdit_textChanged</a></td> 138 <td><a href="#QuickFindFileDialog.on_fileNameEdit_textChanged">on_fileNameEdit_textChanged</a></td>
111 <td>Private slot to handle the textChanged signal of the file name edit.</td> 139 <td>Private slot to handle the textChanged signal of the file name edit.</td>
112 </tr><tr> 140 </tr>
141 <tr>
113 <td><a href="#QuickFindFileDialog.show">show</a></td> 142 <td><a href="#QuickFindFileDialog.show">show</a></td>
114 <td>Public method to enable/disable the project checkbox.</td> 143 <td>Public method to enable/disable the project checkbox.</td>
115 </tr> 144 </tr>
116 </table> 145 </table>
117 <h3>Static Methods</h3> 146 <h3>Static Methods</h3>
118 <table> 147
119 <tr><td>None</td></tr> 148 <table>
120 </table> 149 <tr><td>None</td></tr>
150 </table>
151
121 <a NAME="QuickFindFileDialog.__init__" ID="QuickFindFileDialog.__init__"></a> 152 <a NAME="QuickFindFileDialog.__init__" ID="QuickFindFileDialog.__init__"></a>
122 <h4>QuickFindFileDialog (Constructor)</h4> 153 <h4>QuickFindFileDialog (Constructor)</h4>
123 <b>QuickFindFileDialog</b>(<i>project, parent=None</i>) 154 <b>QuickFindFileDialog</b>(<i>project, parent=None</i>)
155
124 <p> 156 <p>
125 Constructor 157 Constructor
126 </p><dl> 158 </p>
159 <dl>
160
127 <dt><i>project</i> (Project)</dt> 161 <dt><i>project</i> (Project)</dt>
128 <dd> 162 <dd>
129 reference to the project object 163 reference to the project object
130 </dd><dt><i>parent</i> (QWidget)</dt> 164 </dd>
165 <dt><i>parent</i> (QWidget)</dt>
131 <dd> 166 <dd>
132 parent widget of this dialog 167 parent widget of this dialog
133 </dd> 168 </dd>
134 </dl><a NAME="QuickFindFileDialog.__generateLocations" ID="QuickFindFileDialog.__generateLocations"></a> 169 </dl>
170 <a NAME="QuickFindFileDialog.__generateLocations" ID="QuickFindFileDialog.__generateLocations"></a>
135 <h4>QuickFindFileDialog.__generateLocations</h4> 171 <h4>QuickFindFileDialog.__generateLocations</h4>
136 <b>__generateLocations</b>(<i></i>) 172 <b>__generateLocations</b>(<i></i>)
173
137 <p> 174 <p>
138 Private method to generate a set of locations that can be searched. 175 Private method to generate a set of locations that can be searched.
139 </p><dl> 176 </p>
177 <dl>
140 <dt>Returns:</dt> 178 <dt>Returns:</dt>
141 <dd> 179 <dd>
142 yields set of files in our project... 180 yields set of files in our project...
143 </dd> 181 </dd>
144 </dl><dl> 182 </dl>
183 <dl>
145 <dt>Return Type:</dt> 184 <dt>Return Type:</dt>
146 <dd> 185 <dd>
147 str 186 str
148 </dd> 187 </dd>
149 </dl><a NAME="QuickFindFileDialog.__openFile" ID="QuickFindFileDialog.__openFile"></a> 188 </dl>
189 <a NAME="QuickFindFileDialog.__openFile" ID="QuickFindFileDialog.__openFile"></a>
150 <h4>QuickFindFileDialog.__openFile</h4> 190 <h4>QuickFindFileDialog.__openFile</h4>
151 <b>__openFile</b>(<i>itm=None</i>) 191 <b>__openFile</b>(<i>itm=None</i>)
192
152 <p> 193 <p>
153 Private slot to open a file. 194 Private slot to open a file.
154 </p><p> 195 </p>
196 <p>
155 It emits the signal sourceFile or designerFile depending on the 197 It emits the signal sourceFile or designerFile depending on the
156 file extension. 198 file extension.
157 </p><dl> 199 </p>
200 <dl>
201
158 <dt><i>itm</i> (QTreeWidgetItem)</dt> 202 <dt><i>itm</i> (QTreeWidgetItem)</dt>
159 <dd> 203 <dd>
160 item to be opened 204 item to be opened
161 </dd> 205 </dd>
162 </dl><dl> 206 </dl>
207 <dl>
163 <dt>Returns:</dt> 208 <dt>Returns:</dt>
164 <dd> 209 <dd>
165 flag indicating a file was opened 210 flag indicating a file was opened
166 </dd> 211 </dd>
167 </dl><dl> 212 </dl>
213 <dl>
168 <dt>Return Type:</dt> 214 <dt>Return Type:</dt>
169 <dd> 215 <dd>
170 bool 216 bool
171 </dd> 217 </dd>
172 </dl><a NAME="QuickFindFileDialog.__searchFile" ID="QuickFindFileDialog.__searchFile"></a> 218 </dl>
219 <a NAME="QuickFindFileDialog.__searchFile" ID="QuickFindFileDialog.__searchFile"></a>
173 <h4>QuickFindFileDialog.__searchFile</h4> 220 <h4>QuickFindFileDialog.__searchFile</h4>
174 <b>__searchFile</b>(<i></i>) 221 <b>__searchFile</b>(<i></i>)
222
175 <p> 223 <p>
176 Private slot to handle the search. 224 Private slot to handle the search.
177 </p><a NAME="QuickFindFileDialog.__sortedMatches" ID="QuickFindFileDialog.__sortedMatches"></a> 225 </p>
226 <a NAME="QuickFindFileDialog.__sortedMatches" ID="QuickFindFileDialog.__sortedMatches"></a>
178 <h4>QuickFindFileDialog.__sortedMatches</h4> 227 <h4>QuickFindFileDialog.__sortedMatches</h4>
179 <b>__sortedMatches</b>(<i>items, searchTerm</i>) 228 <b>__sortedMatches</b>(<i>items, searchTerm</i>)
229
180 <p> 230 <p>
181 Private method to find the subset of items which match a search term. 231 Private method to find the subset of items which match a search term.
182 </p><dl> 232 </p>
233 <dl>
234
183 <dt><i>items</i> (list of str)</dt> 235 <dt><i>items</i> (list of str)</dt>
184 <dd> 236 <dd>
185 list of items to be scanned for the search term 237 list of items to be scanned for the search term
186 </dd><dt><i>searchTerm</i> (str)</dt> 238 </dd>
239 <dt><i>searchTerm</i> (str)</dt>
187 <dd> 240 <dd>
188 search term to be searched for 241 search term to be searched for
189 </dd> 242 </dd>
190 </dl><dl> 243 </dl>
244 <dl>
191 <dt>Returns:</dt> 245 <dt>Returns:</dt>
192 <dd> 246 <dd>
193 sorted subset of items which match searchTerm in 247 sorted subset of items which match searchTerm in
194 relevance order (i.e. the most likely match first) 248 relevance order (i.e. the most likely match first)
195 </dd> 249 </dd>
196 </dl><dl> 250 </dl>
251 <dl>
197 <dt>Return Type:</dt> 252 <dt>Return Type:</dt>
198 <dd> 253 <dd>
199 list of tuple of bool, int and str 254 list of tuple of bool, int and str
200 </dd> 255 </dd>
201 </dl><a NAME="QuickFindFileDialog.eventFilter" ID="QuickFindFileDialog.eventFilter"></a> 256 </dl>
257 <a NAME="QuickFindFileDialog.eventFilter" ID="QuickFindFileDialog.eventFilter"></a>
202 <h4>QuickFindFileDialog.eventFilter</h4> 258 <h4>QuickFindFileDialog.eventFilter</h4>
203 <b>eventFilter</b>(<i>source, event</i>) 259 <b>eventFilter</b>(<i>source, event</i>)
260
204 <p> 261 <p>
205 Public method to handle event for another object. 262 Public method to handle event for another object.
206 </p><dl> 263 </p>
264 <dl>
265
207 <dt><i>source</i> (QObject)</dt> 266 <dt><i>source</i> (QObject)</dt>
208 <dd> 267 <dd>
209 object to handle events for 268 object to handle events for
210 </dd><dt><i>event</i> (QEvent)</dt> 269 </dd>
270 <dt><i>event</i> (QEvent)</dt>
211 <dd> 271 <dd>
212 event to handle 272 event to handle
213 </dd> 273 </dd>
214 </dl><dl> 274 </dl>
275 <dl>
215 <dt>Returns:</dt> 276 <dt>Returns:</dt>
216 <dd> 277 <dd>
217 flag indicating that the event was handled 278 flag indicating that the event was handled
218 </dd> 279 </dd>
219 </dl><dl> 280 </dl>
281 <dl>
220 <dt>Return Type:</dt> 282 <dt>Return Type:</dt>
221 <dd> 283 <dd>
222 bool 284 bool
223 </dd> 285 </dd>
224 </dl><a NAME="QuickFindFileDialog.on_buttonBox_clicked" ID="QuickFindFileDialog.on_buttonBox_clicked"></a> 286 </dl>
287 <a NAME="QuickFindFileDialog.on_buttonBox_clicked" ID="QuickFindFileDialog.on_buttonBox_clicked"></a>
225 <h4>QuickFindFileDialog.on_buttonBox_clicked</h4> 288 <h4>QuickFindFileDialog.on_buttonBox_clicked</h4>
226 <b>on_buttonBox_clicked</b>(<i>button</i>) 289 <b>on_buttonBox_clicked</b>(<i>button</i>)
290
227 <p> 291 <p>
228 Private slot called by a button of the button box clicked. 292 Private slot called by a button of the button box clicked.
229 </p><dl> 293 </p>
294 <dl>
295
230 <dt><i>button</i></dt> 296 <dt><i>button</i></dt>
231 <dd> 297 <dd>
232 button that was clicked (QAbstractButton) 298 button that was clicked (QAbstractButton)
233 </dd> 299 </dd>
234 </dl><a NAME="QuickFindFileDialog.on_fileList_currentItemChanged" ID="QuickFindFileDialog.on_fileList_currentItemChanged"></a> 300 </dl>
301 <a NAME="QuickFindFileDialog.on_fileList_currentItemChanged" ID="QuickFindFileDialog.on_fileList_currentItemChanged"></a>
235 <h4>QuickFindFileDialog.on_fileList_currentItemChanged</h4> 302 <h4>QuickFindFileDialog.on_fileList_currentItemChanged</h4>
236 <b>on_fileList_currentItemChanged</b>(<i>current, previous</i>) 303 <b>on_fileList_currentItemChanged</b>(<i>current, previous</i>)
304
237 <p> 305 <p>
238 Private slot handling a change of the current item. 306 Private slot handling a change of the current item.
239 </p><dl> 307 </p>
308 <dl>
309
240 <dt><i>current</i></dt> 310 <dt><i>current</i></dt>
241 <dd> 311 <dd>
242 current item (QTreeWidgetItem) 312 current item (QTreeWidgetItem)
243 </dd><dt><i>previous</i></dt> 313 </dd>
314 <dt><i>previous</i></dt>
244 <dd> 315 <dd>
245 prevoius current item (QTreeWidgetItem) 316 prevoius current item (QTreeWidgetItem)
246 </dd> 317 </dd>
247 </dl><a NAME="QuickFindFileDialog.on_fileList_itemActivated" ID="QuickFindFileDialog.on_fileList_itemActivated"></a> 318 </dl>
319 <a NAME="QuickFindFileDialog.on_fileList_itemActivated" ID="QuickFindFileDialog.on_fileList_itemActivated"></a>
248 <h4>QuickFindFileDialog.on_fileList_itemActivated</h4> 320 <h4>QuickFindFileDialog.on_fileList_itemActivated</h4>
249 <b>on_fileList_itemActivated</b>(<i>itm, column</i>) 321 <b>on_fileList_itemActivated</b>(<i>itm, column</i>)
322
250 <p> 323 <p>
251 Private slot to handle the double click on a file item. 324 Private slot to handle the double click on a file item.
252 </p><p> 325 </p>
326 <p>
253 It emits the signal sourceFile or designerFile depending on the 327 It emits the signal sourceFile or designerFile depending on the
254 file extension. 328 file extension.
255 </p><dl> 329 </p>
330 <dl>
331
256 <dt><i>itm</i></dt> 332 <dt><i>itm</i></dt>
257 <dd> 333 <dd>
258 the double clicked listview item (QTreeWidgetItem) 334 the double clicked listview item (QTreeWidgetItem)
259 </dd><dt><i>column</i></dt> 335 </dd>
336 <dt><i>column</i></dt>
260 <dd> 337 <dd>
261 column that was double clicked (integer) (ignored) 338 column that was double clicked (integer) (ignored)
262 </dd> 339 </dd>
263 </dl><a NAME="QuickFindFileDialog.on_fileNameEdit_returnPressed" ID="QuickFindFileDialog.on_fileNameEdit_returnPressed"></a> 340 </dl>
341 <a NAME="QuickFindFileDialog.on_fileNameEdit_returnPressed" ID="QuickFindFileDialog.on_fileNameEdit_returnPressed"></a>
264 <h4>QuickFindFileDialog.on_fileNameEdit_returnPressed</h4> 342 <h4>QuickFindFileDialog.on_fileNameEdit_returnPressed</h4>
265 <b>on_fileNameEdit_returnPressed</b>(<i></i>) 343 <b>on_fileNameEdit_returnPressed</b>(<i></i>)
344
266 <p> 345 <p>
267 Private slot to handle enter being pressed on the file name edit box. 346 Private slot to handle enter being pressed on the file name edit box.
268 </p><a NAME="QuickFindFileDialog.on_fileNameEdit_textChanged" ID="QuickFindFileDialog.on_fileNameEdit_textChanged"></a> 347 </p>
348 <a NAME="QuickFindFileDialog.on_fileNameEdit_textChanged" ID="QuickFindFileDialog.on_fileNameEdit_textChanged"></a>
269 <h4>QuickFindFileDialog.on_fileNameEdit_textChanged</h4> 349 <h4>QuickFindFileDialog.on_fileNameEdit_textChanged</h4>
270 <b>on_fileNameEdit_textChanged</b>(<i>text</i>) 350 <b>on_fileNameEdit_textChanged</b>(<i>text</i>)
351
271 <p> 352 <p>
272 Private slot to handle the textChanged signal of the file name edit. 353 Private slot to handle the textChanged signal of the file name edit.
273 </p><dl> 354 </p>
355 <dl>
356
274 <dt><i>text</i></dt> 357 <dt><i>text</i></dt>
275 <dd> 358 <dd>
276 (ignored) 359 (ignored)
277 </dd> 360 </dd>
278 </dl><a NAME="QuickFindFileDialog.show" ID="QuickFindFileDialog.show"></a> 361 </dl>
362 <a NAME="QuickFindFileDialog.show" ID="QuickFindFileDialog.show"></a>
279 <h4>QuickFindFileDialog.show</h4> 363 <h4>QuickFindFileDialog.show</h4>
280 <b>show</b>(<i></i>) 364 <b>show</b>(<i></i>)
365
281 <p> 366 <p>
282 Public method to enable/disable the project checkbox. 367 Public method to enable/disable the project checkbox.
283 </p> 368 </p>
284 <div align="right"><a href="#top">Up</a></div> 369 <div align="right"><a href="#top">Up</a></div>
285 <hr /> 370 <hr />

eric ide

mercurial