Documentation/Source/eric6.WebBrowser.Bookmarks.BookmarksModel.html

changeset 4918
71caf42a13d8
child 5015
ca1d44f0f6b2
equal deleted inserted replaced
4917:682750cc7bd5 4918:71caf42a13d8
1 <!DOCTYPE html>
2 <html><head>
3 <title>eric6.WebBrowser.Bookmarks.BookmarksModel</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.WebBrowser.Bookmarks.BookmarksModel</h1>
23 <p>
24 Module implementing the bookmark model class.
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="#BookmarksModel">BookmarksModel</a></td>
34 <td>Class implementing the bookmark model.</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="BookmarksModel" ID="BookmarksModel"></a>
43 <h2>BookmarksModel</h2>
44 <p>
45 Class implementing the bookmark model.
46 </p>
47 <h3>Derived from</h3>
48 QAbstractItemModel
49 <h3>Class Attributes</h3>
50 <table>
51 <tr><td>MIMETYPE</td></tr><tr><td>SeparatorRole</td></tr><tr><td>TypeRole</td></tr><tr><td>UrlRole</td></tr><tr><td>UrlStringRole</td></tr>
52 </table>
53 <h3>Class Methods</h3>
54 <table>
55 <tr><td>None</td></tr>
56 </table>
57 <h3>Methods</h3>
58 <table>
59 <tr>
60 <td><a href="#BookmarksModel.__init__">BookmarksModel</a></td>
61 <td>Constructor</td>
62 </tr><tr>
63 <td><a href="#BookmarksModel.bookmarksManager">bookmarksManager</a></td>
64 <td>Public method to get a reference to the bookmarks manager.</td>
65 </tr><tr>
66 <td><a href="#BookmarksModel.columnCount">columnCount</a></td>
67 <td>Public method to get the number of columns.</td>
68 </tr><tr>
69 <td><a href="#BookmarksModel.data">data</a></td>
70 <td>Public method to get data from the model.</td>
71 </tr><tr>
72 <td><a href="#BookmarksModel.dropMimeData">dropMimeData</a></td>
73 <td>Public method to accept the mime data of a drop action.</td>
74 </tr><tr>
75 <td><a href="#BookmarksModel.entryAdded">entryAdded</a></td>
76 <td>Public slot to add a bookmark node.</td>
77 </tr><tr>
78 <td><a href="#BookmarksModel.entryChanged">entryChanged</a></td>
79 <td>Public method to change a node.</td>
80 </tr><tr>
81 <td><a href="#BookmarksModel.entryRemoved">entryRemoved</a></td>
82 <td>Public slot to remove a bookmark node.</td>
83 </tr><tr>
84 <td><a href="#BookmarksModel.flags">flags</a></td>
85 <td>Public method to get flags for a node cell.</td>
86 </tr><tr>
87 <td><a href="#BookmarksModel.hasChildren">hasChildren</a></td>
88 <td>Public method to check, if a parent node has some children.</td>
89 </tr><tr>
90 <td><a href="#BookmarksModel.headerData">headerData</a></td>
91 <td>Public method to get the header data.</td>
92 </tr><tr>
93 <td><a href="#BookmarksModel.index">index</a></td>
94 <td>Public method to get a model index for a node cell.</td>
95 </tr><tr>
96 <td><a href="#BookmarksModel.mimeData">mimeData</a></td>
97 <td>Public method to return the mime data.</td>
98 </tr><tr>
99 <td><a href="#BookmarksModel.mimeTypes">mimeTypes</a></td>
100 <td>Public method to report the supported mime types.</td>
101 </tr><tr>
102 <td><a href="#BookmarksModel.node">node</a></td>
103 <td>Public method to get a bookmark node given its index.</td>
104 </tr><tr>
105 <td><a href="#BookmarksModel.nodeIndex">nodeIndex</a></td>
106 <td>Public method to get a model index.</td>
107 </tr><tr>
108 <td><a href="#BookmarksModel.parent">parent</a></td>
109 <td>Public method to get the index of the parent node.</td>
110 </tr><tr>
111 <td><a href="#BookmarksModel.removeRows">removeRows</a></td>
112 <td>Public method to remove bookmarks from the model.</td>
113 </tr><tr>
114 <td><a href="#BookmarksModel.rowCount">rowCount</a></td>
115 <td>Public method to determine the number of rows.</td>
116 </tr><tr>
117 <td><a href="#BookmarksModel.setData">setData</a></td>
118 <td>Public method to set the data of a node cell.</td>
119 </tr><tr>
120 <td><a href="#BookmarksModel.supportedDropActions">supportedDropActions</a></td>
121 <td>Public method to report the supported drop actions.</td>
122 </tr>
123 </table>
124 <h3>Static Methods</h3>
125 <table>
126 <tr><td>None</td></tr>
127 </table>
128 <a NAME="BookmarksModel.__init__" ID="BookmarksModel.__init__"></a>
129 <h4>BookmarksModel (Constructor)</h4>
130 <b>BookmarksModel</b>(<i>manager, parent=None</i>)
131 <p>
132 Constructor
133 </p><dl>
134 <dt><i>manager</i></dt>
135 <dd>
136 reference to the bookmark manager object
137 (BookmarksManager)
138 </dd><dt><i>parent</i></dt>
139 <dd>
140 reference to the parent object (QObject)
141 </dd>
142 </dl><a NAME="BookmarksModel.bookmarksManager" ID="BookmarksModel.bookmarksManager"></a>
143 <h4>BookmarksModel.bookmarksManager</h4>
144 <b>bookmarksManager</b>(<i></i>)
145 <p>
146 Public method to get a reference to the bookmarks manager.
147 </p><dl>
148 <dt>Returns:</dt>
149 <dd>
150 reference to the bookmarks manager object (BookmarksManager)
151 </dd>
152 </dl><a NAME="BookmarksModel.columnCount" ID="BookmarksModel.columnCount"></a>
153 <h4>BookmarksModel.columnCount</h4>
154 <b>columnCount</b>(<i>parent=QModelIndex()</i>)
155 <p>
156 Public method to get the number of columns.
157 </p><dl>
158 <dt><i>parent</i></dt>
159 <dd>
160 index of parent (QModelIndex)
161 </dd>
162 </dl><dl>
163 <dt>Returns:</dt>
164 <dd>
165 number of columns (integer)
166 </dd>
167 </dl><a NAME="BookmarksModel.data" ID="BookmarksModel.data"></a>
168 <h4>BookmarksModel.data</h4>
169 <b>data</b>(<i>index, role=Qt.DisplayRole</i>)
170 <p>
171 Public method to get data from the model.
172 </p><dl>
173 <dt><i>index</i></dt>
174 <dd>
175 index of bookmark to get data for (QModelIndex)
176 </dd><dt><i>role</i></dt>
177 <dd>
178 data role (integer)
179 </dd>
180 </dl><dl>
181 <dt>Returns:</dt>
182 <dd>
183 bookmark data
184 </dd>
185 </dl><a NAME="BookmarksModel.dropMimeData" ID="BookmarksModel.dropMimeData"></a>
186 <h4>BookmarksModel.dropMimeData</h4>
187 <b>dropMimeData</b>(<i>data, action, row, column, parent</i>)
188 <p>
189 Public method to accept the mime data of a drop action.
190 </p><dl>
191 <dt><i>data</i></dt>
192 <dd>
193 reference to the mime data (QMimeData)
194 </dd><dt><i>action</i></dt>
195 <dd>
196 drop action requested (Qt.DropAction)
197 </dd><dt><i>row</i></dt>
198 <dd>
199 row number (integer)
200 </dd><dt><i>column</i></dt>
201 <dd>
202 column number (integer)
203 </dd><dt><i>parent</i></dt>
204 <dd>
205 index of the parent node (QModelIndex)
206 </dd>
207 </dl><dl>
208 <dt>Returns:</dt>
209 <dd>
210 flag indicating successful acceptance of the data (boolean)
211 </dd>
212 </dl><a NAME="BookmarksModel.entryAdded" ID="BookmarksModel.entryAdded"></a>
213 <h4>BookmarksModel.entryAdded</h4>
214 <b>entryAdded</b>(<i>node</i>)
215 <p>
216 Public slot to add a bookmark node.
217 </p><dl>
218 <dt><i>node</i></dt>
219 <dd>
220 reference to the bookmark node to add (BookmarkNode)
221 </dd>
222 </dl><a NAME="BookmarksModel.entryChanged" ID="BookmarksModel.entryChanged"></a>
223 <h4>BookmarksModel.entryChanged</h4>
224 <b>entryChanged</b>(<i>node</i>)
225 <p>
226 Public method to change a node.
227 </p><dl>
228 <dt><i>node</i></dt>
229 <dd>
230 reference to the bookmark node to change (BookmarkNode)
231 </dd>
232 </dl><a NAME="BookmarksModel.entryRemoved" ID="BookmarksModel.entryRemoved"></a>
233 <h4>BookmarksModel.entryRemoved</h4>
234 <b>entryRemoved</b>(<i>parent, row, node</i>)
235 <p>
236 Public slot to remove a bookmark node.
237 </p><dl>
238 <dt><i>parent</i></dt>
239 <dd>
240 reference to the parent bookmark node (BookmarkNode)
241 </dd><dt><i>row</i></dt>
242 <dd>
243 row number of the node (integer)
244 </dd><dt><i>node</i></dt>
245 <dd>
246 reference to the bookmark node to remove (BookmarkNode)
247 </dd>
248 </dl><a NAME="BookmarksModel.flags" ID="BookmarksModel.flags"></a>
249 <h4>BookmarksModel.flags</h4>
250 <b>flags</b>(<i>index</i>)
251 <p>
252 Public method to get flags for a node cell.
253 </p><dl>
254 <dt><i>index</i></dt>
255 <dd>
256 index of the node cell (QModelIndex)
257 </dd>
258 </dl><dl>
259 <dt>Returns:</dt>
260 <dd>
261 flags (Qt.ItemFlags)
262 </dd>
263 </dl><a NAME="BookmarksModel.hasChildren" ID="BookmarksModel.hasChildren"></a>
264 <h4>BookmarksModel.hasChildren</h4>
265 <b>hasChildren</b>(<i>parent=QModelIndex()</i>)
266 <p>
267 Public method to check, if a parent node has some children.
268 </p><dl>
269 <dt><i>parent</i></dt>
270 <dd>
271 index of the parent node (QModelIndex)
272 </dd>
273 </dl><dl>
274 <dt>Returns:</dt>
275 <dd>
276 flag indicating the presence of children (boolean)
277 </dd>
278 </dl><a NAME="BookmarksModel.headerData" ID="BookmarksModel.headerData"></a>
279 <h4>BookmarksModel.headerData</h4>
280 <b>headerData</b>(<i>section, orientation, role=Qt.DisplayRole</i>)
281 <p>
282 Public method to get the header data.
283 </p><dl>
284 <dt><i>section</i></dt>
285 <dd>
286 section number (integer)
287 </dd><dt><i>orientation</i></dt>
288 <dd>
289 header orientation (Qt.Orientation)
290 </dd><dt><i>role</i></dt>
291 <dd>
292 data role (integer)
293 </dd>
294 </dl><dl>
295 <dt>Returns:</dt>
296 <dd>
297 header data
298 </dd>
299 </dl><a NAME="BookmarksModel.index" ID="BookmarksModel.index"></a>
300 <h4>BookmarksModel.index</h4>
301 <b>index</b>(<i>row, column, parent=QModelIndex()</i>)
302 <p>
303 Public method to get a model index for a node cell.
304 </p><dl>
305 <dt><i>row</i></dt>
306 <dd>
307 row number (integer)
308 </dd><dt><i>column</i></dt>
309 <dd>
310 column number (integer)
311 </dd><dt><i>parent</i></dt>
312 <dd>
313 index of the parent (QModelIndex)
314 </dd>
315 </dl><dl>
316 <dt>Returns:</dt>
317 <dd>
318 index (QModelIndex)
319 </dd>
320 </dl><a NAME="BookmarksModel.mimeData" ID="BookmarksModel.mimeData"></a>
321 <h4>BookmarksModel.mimeData</h4>
322 <b>mimeData</b>(<i>indexes</i>)
323 <p>
324 Public method to return the mime data.
325 </p><dl>
326 <dt><i>indexes</i></dt>
327 <dd>
328 list of indexes (QModelIndexList)
329 </dd>
330 </dl><dl>
331 <dt>Returns:</dt>
332 <dd>
333 mime data (QMimeData)
334 </dd>
335 </dl><a NAME="BookmarksModel.mimeTypes" ID="BookmarksModel.mimeTypes"></a>
336 <h4>BookmarksModel.mimeTypes</h4>
337 <b>mimeTypes</b>(<i></i>)
338 <p>
339 Public method to report the supported mime types.
340 </p><dl>
341 <dt>Returns:</dt>
342 <dd>
343 supported mime types (list of strings)
344 </dd>
345 </dl><a NAME="BookmarksModel.node" ID="BookmarksModel.node"></a>
346 <h4>BookmarksModel.node</h4>
347 <b>node</b>(<i>index</i>)
348 <p>
349 Public method to get a bookmark node given its index.
350 </p><dl>
351 <dt><i>index</i></dt>
352 <dd>
353 index of the node (QModelIndex)
354 </dd>
355 </dl><dl>
356 <dt>Returns:</dt>
357 <dd>
358 bookmark node (BookmarkNode)
359 </dd>
360 </dl><a NAME="BookmarksModel.nodeIndex" ID="BookmarksModel.nodeIndex"></a>
361 <h4>BookmarksModel.nodeIndex</h4>
362 <b>nodeIndex</b>(<i>node</i>)
363 <p>
364 Public method to get a model index.
365 </p><dl>
366 <dt><i>node</i></dt>
367 <dd>
368 reference to the node to get the index for (BookmarkNode)
369 </dd>
370 </dl><dl>
371 <dt>Returns:</dt>
372 <dd>
373 model index (QModelIndex)
374 </dd>
375 </dl><a NAME="BookmarksModel.parent" ID="BookmarksModel.parent"></a>
376 <h4>BookmarksModel.parent</h4>
377 <b>parent</b>(<i>index=QModelIndex()</i>)
378 <p>
379 Public method to get the index of the parent node.
380 </p><dl>
381 <dt><i>index</i></dt>
382 <dd>
383 index of the child node (QModelIndex)
384 </dd>
385 </dl><dl>
386 <dt>Returns:</dt>
387 <dd>
388 index of the parent node (QModelIndex)
389 </dd>
390 </dl><a NAME="BookmarksModel.removeRows" ID="BookmarksModel.removeRows"></a>
391 <h4>BookmarksModel.removeRows</h4>
392 <b>removeRows</b>(<i>row, count, parent=QModelIndex()</i>)
393 <p>
394 Public method to remove bookmarks from the model.
395 </p><dl>
396 <dt><i>row</i></dt>
397 <dd>
398 row of the first bookmark to remove (integer)
399 </dd><dt><i>count</i></dt>
400 <dd>
401 number of bookmarks to remove (integer)
402 </dd><dt><i>parent</i></dt>
403 <dd>
404 index of the parent bookmark node (QModelIndex)
405 </dd>
406 </dl><dl>
407 <dt>Returns:</dt>
408 <dd>
409 flag indicating successful removal (boolean)
410 </dd>
411 </dl><a NAME="BookmarksModel.rowCount" ID="BookmarksModel.rowCount"></a>
412 <h4>BookmarksModel.rowCount</h4>
413 <b>rowCount</b>(<i>parent=QModelIndex()</i>)
414 <p>
415 Public method to determine the number of rows.
416 </p><dl>
417 <dt><i>parent</i></dt>
418 <dd>
419 index of parent (QModelIndex)
420 </dd>
421 </dl><dl>
422 <dt>Returns:</dt>
423 <dd>
424 number of rows (integer)
425 </dd>
426 </dl><a NAME="BookmarksModel.setData" ID="BookmarksModel.setData"></a>
427 <h4>BookmarksModel.setData</h4>
428 <b>setData</b>(<i>index, value, role=Qt.EditRole</i>)
429 <p>
430 Public method to set the data of a node cell.
431 </p><dl>
432 <dt><i>index</i></dt>
433 <dd>
434 index of the node cell (QModelIndex)
435 </dd><dt><i>value</i></dt>
436 <dd>
437 value to be set
438 </dd><dt><i>role</i></dt>
439 <dd>
440 role of the data (integer)
441 </dd>
442 </dl><dl>
443 <dt>Returns:</dt>
444 <dd>
445 flag indicating success (boolean)
446 </dd>
447 </dl><a NAME="BookmarksModel.supportedDropActions" ID="BookmarksModel.supportedDropActions"></a>
448 <h4>BookmarksModel.supportedDropActions</h4>
449 <b>supportedDropActions</b>(<i></i>)
450 <p>
451 Public method to report the supported drop actions.
452 </p><dl>
453 <dt>Returns:</dt>
454 <dd>
455 supported drop actions (Qt.DropAction)
456 </dd>
457 </dl>
458 <div align="right"><a href="#top">Up</a></div>
459 <hr />
460 </body></html>

eric ide

mercurial