1
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
2
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
4
<title>eric3.UI.LogView</title>
6
<body bgcolor="#FFFFFF"><a NAME="top" ID="top"></a>
7
<h1><font color="#0000FF">eric3.UI.LogView</font></h1>
9
Module implementing the log viewer widget and the log widget.
11
<h3><font color="#FF0000">Classes</font></h3>
14
<td><a href="#LogView">LogView</a></td>
15
<td>Class providing a stack of tabbed scrollable widgets.</td>
17
<td><a href="#LogViewViewport">LogViewViewport</a></td>
18
<td>Internal class representing the viewport of the scrollview.</td>
20
<td><a href="#LogViewWidget">LogViewWidget</a></td>
21
<td>Base class for widgets to be displayed by LogView.</td>
23
<td><a href="#LogWidget">LogWidget</a></td>
24
<td>A class for displaying logging messages.</td>
27
<h3><font color="#FF0000">Functions</font></h3>
29
<tr><td>None</td></tr>
32
<a NAME="LogView" ID="LogView"></a>
33
<h2><font color="#0000FF">LogView</font></h2>
35
Class providing a stack of tabbed scrollable widgets.
37
Like QTabWidget the LogView provides a stack of widgets. Different from
38
the normal QTabWidget the tabs are aligned at the bottom with QTabBar::RoundedBelow
39
style. The contents of the different widgets can be scrolled by scrollbars that are
40
on the right and bottom side. The widgets themselves must be derived from
43
LogView is not derived from QTabWidget as this would prevent the implentation
44
of the horizontal scrollbar at the side of the tabbar. The interface is similar to
45
QTabWidget to make it easy to use.
47
<h3><font color="#FF0000">Derived from</font></h3>
49
<h3><font color="#FF0000">Methods</font></h3>
52
<td><a href="#LogView.__init__">LogView</a></td>
55
<td><a href="#LogView.addTab">addTab</a></td>
58
<td><a href="#LogView.contextMenuEvent">contextMenuEvent</a></td>
59
<td>Reimplemented for custom context menu.</td>
61
<td><a href="#LogView.currentPage">currentPage</a></td>
62
<td>Public method to retrieve the current page.</td>
64
<td><a href="#LogView.getActualViewport">getActualViewport</a></td>
65
<td>Gets the actual viewport or None if there is none.</td>
67
<td><a href="#LogView.handleClearWidget">handleClearWidget</a></td>
68
<td>Private slot to handle the clear popup menu action.</td>
70
<td><a href="#LogView.handleCopyWidget">handleCopyWidget</a></td>
71
<td>Private slot to handle the copy popup menu action.</td>
73
<td><a href="#LogView.handleScrollbarValueChanged">handleScrollbarValueChanged</a></td>
74
<td>Called when the value of a scrollbar changes.</td>
76
<td><a href="#LogView.handleTabbarSelected">handleTabbarSelected</a></td>
77
<td>Called when the selection in the tabbar changes.</td>
79
<td><a href="#LogView.handleWidgetSizeChanged">handleWidgetSizeChanged</a></td>
80
<td>Recalculates the scrollbars if necessary.</td>
82
<td><a href="#LogView.nextTab">nextTab</a></td>
83
<td>Public slot used to show the next tab.</td>
85
<td><a href="#LogView.prevTab">prevTab</a></td>
86
<td>Public slot used to show the previous tab.</td>
88
<td><a href="#LogView.resizeEvent">resizeEvent</a></td>
89
<td>Reimplemented to set the scrollbar sizes.</td>
91
<td><a href="#LogView.setCurrentPage">setCurrentPage</a></td>
92
<td>Set the page at position pos as the current page.</td>
94
<td><a href="#LogView.setupScrollBars">setupScrollBars</a></td>
95
<td>Calculates the sizes of the scrollbars for the top widget.</td>
97
<td><a href="#LogView.wheelEvent">wheelEvent</a></td>
98
<td>Private method to override the wheel event.</td>
101
<p><a NAME="LogView.__init__" ID="LogView__init__"></a>
102
<h3><font color="#0000FF">LogView (Constructor)</font></h3>
103
<b>LogView</b>(<i>parent=None, name=None, flags=0</i>)
107
<dt><i>parent</i></dt>
109
parent widget (QWidget)
110
</dd><dt><i>name</i></dt>
112
name of this widget (string or QString)
113
</dd><dt><i>flags</i></dt>
117
</dl><a NAME="LogView.addTab" ID="LogViewaddTab"></a>
118
<h3><font color="#0000FF">LogView.addTab</font></h3>
119
<b>addTab</b>(<i>labelOrTabOrIconset, label = None</i>)
123
<dt><i>labelOrTabOrIconset</i></dt>
125
label, tab or icon to be shown
126
(QString, QTab or QIconSet)
127
</dd><dt><i>label</i></dt>
129
label to be displayed next to an icon (QString)
134
a tuple of the tab id and the child managed by this tab
137
</dl><a NAME="LogView.contextMenuEvent" ID="LogViewcontextMenuEvent"></a>
138
<h3><font color="#0000FF">LogView.contextMenuEvent</font></h3>
139
<b>contextMenuEvent</b>(<i>evt</i>)
141
Reimplemented for custom context menu.
145
context menu event (QContextMenuEvent)
147
</dl><a NAME="LogView.currentPage" ID="LogViewcurrentPage"></a>
148
<h3><font color="#0000FF">LogView.currentPage</font></h3>
149
<b>currentPage</b>(<i></i>)
151
Public method to retrieve the current page.
155
the current page (QWidget)
157
</dl><a NAME="LogView.getActualViewport" ID="LogViewgetActualViewport"></a>
158
<h3><font color="#0000FF">LogView.getActualViewport</font></h3>
159
<b>getActualViewport</b>(<i></i>)
161
Gets the actual viewport or None if there is none.
165
reference to the actual viewport
167
</dl><a NAME="LogView.handleClearWidget" ID="LogViewhandleClearWidget"></a>
168
<h3><font color="#0000FF">LogView.handleClearWidget</font></h3>
169
<b>handleClearWidget</b>(<i></i>)
171
Private slot to handle the clear popup menu action.
172
</p><a NAME="LogView.handleCopyWidget" ID="LogViewhandleCopyWidget"></a>
173
<h3><font color="#0000FF">LogView.handleCopyWidget</font></h3>
174
<b>handleCopyWidget</b>(<i></i>)
176
Private slot to handle the copy popup menu action.
177
</p><a NAME="LogView.handleScrollbarValueChanged" ID="LogViewhandleScrollbarValueChanged"></a>
178
<h3><font color="#0000FF">LogView.handleScrollbarValueChanged</font></h3>
179
<b>handleScrollbarValueChanged</b>(<i>value</i>)
181
Called when the value of a scrollbar changes.
183
<dt><i>value</i></dt>
185
value of the scrollbar (int) (ignored)
187
</dl><a NAME="LogView.handleTabbarSelected" ID="LogViewhandleTabbarSelected"></a>
188
<h3><font color="#0000FF">LogView.handleTabbarSelected</font></h3>
189
<b>handleTabbarSelected</b>(<i>id</i>)
191
Called when the selection in the tabbar changes.
193
The corresponding widget is activated.
197
the id of the selected tab (int)
199
</dl><a NAME="LogView.handleWidgetSizeChanged" ID="LogViewhandleWidgetSizeChanged"></a>
200
<h3><font color="#0000FF">LogView.handleWidgetSizeChanged</font></h3>
201
<b>handleWidgetSizeChanged</b>(<i>widget</i>)
203
Recalculates the scrollbars if necessary.
204
</p><a NAME="LogView.nextTab" ID="LogViewnextTab"></a>
205
<h3><font color="#0000FF">LogView.nextTab</font></h3>
206
<b>nextTab</b>(<i></i>)
208
Public slot used to show the next tab.
209
</p><a NAME="LogView.prevTab" ID="LogViewprevTab"></a>
210
<h3><font color="#0000FF">LogView.prevTab</font></h3>
211
<b>prevTab</b>(<i></i>)
213
Public slot used to show the previous tab.
214
</p><a NAME="LogView.resizeEvent" ID="LogViewresizeEvent"></a>
215
<h3><font color="#0000FF">LogView.resizeEvent</font></h3>
216
<b>resizeEvent</b>(<i>evt</i>)
218
Reimplemented to set the scrollbar sizes.
222
resize event (QResizeEvent)
224
</dl><a NAME="LogView.setCurrentPage" ID="LogViewsetCurrentPage"></a>
225
<h3><font color="#0000FF">LogView.setCurrentPage</font></h3>
226
<b>setCurrentPage</b>(<i>pos</i>)
228
Set the page at position pos as the current page.
229
</p><a NAME="LogView.setupScrollBars" ID="LogViewsetupScrollBars"></a>
230
<h3><font color="#0000FF">LogView.setupScrollBars</font></h3>
231
<b>setupScrollBars</b>(<i></i>)
233
Calculates the sizes of the scrollbars for the top widget.
234
</p><a NAME="LogView.wheelEvent" ID="LogViewwheelEvent"></a>
235
<h3><font color="#0000FF">LogView.wheelEvent</font></h3>
236
<b>wheelEvent</b>(<i>evt</i>)
238
Private method to override the wheel event.
242
wheel event (QWheelEvent)
245
<div align="right"><a href="#top">Up</a></div>
247
<a NAME="LogViewViewport" ID="LogViewViewport"></a>
248
<h2><font color="#0000FF">LogViewViewport</font></h2>
250
Internal class representing the viewport of the scrollview.
252
<h3><font color="#FF0000">Derived from</font></h3>
254
<h3><font color="#FF0000">Methods</font></h3>
257
<td><a href="#LogViewViewport.__init__">LogViewViewport</a></td>
260
<td><a href="#LogViewViewport.getChild">getChild</a></td>
263
<td><a href="#LogViewViewport.getWidget">getWidget</a></td>
264
<td>Public method returning the child widget.</td>
266
<td><a href="#LogViewViewport.getWidgetSize">getWidgetSize</a></td>
267
<td>Public method to get the size of the child widget.</td>
269
<td><a href="#LogViewViewport.setScrollOffset">setScrollOffset</a></td>
270
<td>Sets the scrolling offset for the child widget.</td>
272
<td><a href="#LogViewViewport.setScrollOffsetP">setScrollOffsetP</a></td>
273
<td>Sets the scrolling offset for the child widget.</td>
276
<p><a NAME="LogViewViewport.__init__" ID="LogViewViewport__init__"></a>
277
<h3><font color="#0000FF">LogViewViewport (Constructor)</font></h3>
278
<b>LogViewViewport</b>(<i>parent=None, name=None</i>)
282
<dt><i>parent</i></dt>
284
parent widget (QWidget)
285
</dd><dt><i>name</i></dt>
287
name of this widget (string or QString)
289
</dl><a NAME="LogViewViewport.getChild" ID="LogViewViewportgetChild"></a>
290
<h3><font color="#0000FF">LogViewViewport.getChild</font></h3>
291
<b>getChild</b>(<i></i>)
292
<a NAME="LogViewViewport.getWidget" ID="LogViewViewportgetWidget"></a>
293
<h3><font color="#0000FF">LogViewViewport.getWidget</font></h3>
294
<b>getWidget</b>(<i></i>)
296
Public method returning the child widget.
302
</dl><a NAME="LogViewViewport.getWidgetSize" ID="LogViewViewportgetWidgetSize"></a>
303
<h3><font color="#0000FF">LogViewViewport.getWidgetSize</font></h3>
304
<b>getWidgetSize</b>(<i></i>)
306
Public method to get the size of the child widget.
310
the size of the child widget (QSize)
312
</dl><a NAME="LogViewViewport.setScrollOffset" ID="LogViewViewportsetScrollOffset"></a>
313
<h3><font color="#0000FF">LogViewViewport.setScrollOffset</font></h3>
314
<b>setScrollOffset</b>(<i>x, y</i>)
316
Sets the scrolling offset for the child widget.
321
</dd><dt><i>y</i></dt>
325
</dl><a NAME="LogViewViewport.setScrollOffsetP" ID="LogViewViewportsetScrollOffsetP"></a>
326
<h3><font color="#0000FF">LogViewViewport.setScrollOffsetP</font></h3>
327
<b>setScrollOffsetP</b>(<i>point</i>)
329
Sets the scrolling offset for the child widget.
331
<dt><i>point</i></dt>
333
scrolling offset (QPoint)
336
<div align="right"><a href="#top">Up</a></div>
338
<a NAME="LogViewWidget" ID="LogViewWidget"></a>
339
<h2><font color="#0000FF">LogViewWidget</font></h2>
341
Base class for widgets to be displayed by LogView.
343
Subclasses may emit the signal sizeChanged(LogViewWidget)
344
to tell the container that a resizing may be necessary.
346
<h3><font color="#FF0000">Derived from</font></h3>
348
<h3><font color="#FF0000">Methods</font></h3>
351
<td><a href="#LogViewWidget.__init__">LogViewWidget</a></td>
354
<td><a href="#LogViewWidget.preferredBackgroundColor">preferredBackgroundColor</a></td>
355
<td>Private method setting the background colour.</td>
358
<p><a NAME="LogViewWidget.__init__" ID="LogViewWidget__init__"></a>
359
<h3><font color="#0000FF">LogViewWidget (Constructor)</font></h3>
360
<b>LogViewWidget</b>(<i>parent=None, name=None</i>)
364
<dt><i>parent</i></dt>
366
parent widget (QWidget)
367
</dd><dt><i>name</i></dt>
369
name of this widget (string or QString)
371
</dl><a NAME="LogViewWidget.preferredBackgroundColor" ID="LogViewWidgetpreferredBackgroundColor"></a>
372
<h3><font color="#0000FF">LogViewWidget.preferredBackgroundColor</font></h3>
373
<b>preferredBackgroundColor</b>(<i></i>)
375
Private method setting the background colour.
377
<div align="right"><a href="#top">Up</a></div>
379
<a NAME="LogWidget" ID="LogWidget"></a>
380
<h2><font color="#0000FF">LogWidget</font></h2>
382
A class for displaying logging messages.
384
LogWidget is a simple class to be plugged in a LogView.
385
It displays lines of text without interpretation of richtext or html tags.
386
Neither are special characters like newlines or tabs interpreted.
387
The widget can either store all the strings sent to it (the default) or
388
can limit the number of lines to store. In this case the oldest lines
389
are discarded when new lines arrive.
391
<h3><font color="#FF0000">Derived from</font></h3>
393
<h3><font color="#FF0000">Methods</font></h3>
396
<td><a href="#LogWidget.__init__">LogWidget</a></td>
399
<td><a href="#LogWidget.append">append</a></td>
400
<td>Public method to append text to the messages.</td>
402
<td><a href="#LogWidget.clear">clear</a></td>
403
<td>Public method to delete all strings from the internal buffer and clears the display.</td>
405
<td><a href="#LogWidget.copy">copy</a></td>
406
<td>Public method to copy all strings from the internal buffer to the clipboard.</td>
408
<td><a href="#LogWidget.handleSetMaxLines">handleSetMaxLines</a></td>
409
<td>Sets the maximum number of lines to be shown.</td>
411
<td><a href="#LogWidget.paintEvent">paintEvent</a></td>
412
<td>Reimplemented for custom painting.</td>
414
<td><a href="#LogWidget.preferredBackgroundColor">preferredBackgroundColor</a></td>
415
<td>Reimplemented to return colorgroup().base().</td>
418
<p><a NAME="LogWidget.__init__" ID="LogWidget__init__"></a>
419
<h3><font color="#0000FF">LogWidget (Constructor)</font></h3>
420
<b>LogWidget</b>(<i>parent=None, name=None</i>)
424
<dt><i>parent</i></dt>
426
parent widget (QWidget)
427
</dd><dt><i>name</i></dt>
429
name of this widget (string or QString)
431
</dl><a NAME="LogWidget.append" ID="LogWidgetappend"></a>
432
<h3><font color="#0000FF">LogWidget.append</font></h3>
433
<b>append</b>(<i>text</i>)
435
Public method to append text to the messages.
437
When the LogWidget is already scrolled to the bottom, it will
438
further scroll down to display the newly added line. If the
439
scrolling position is not at the end, this position is not changed.
443
text to be appended (string or QString)
445
</dl><a NAME="LogWidget.clear" ID="LogWidgetclear"></a>
446
<h3><font color="#0000FF">LogWidget.clear</font></h3>
447
<b>clear</b>(<i></i>)
449
Public method to delete all strings from the internal buffer and clears the display.
450
</p><a NAME="LogWidget.copy" ID="LogWidgetcopy"></a>
451
<h3><font color="#0000FF">LogWidget.copy</font></h3>
454
Public method to copy all strings from the internal buffer to the clipboard.
455
</p><a NAME="LogWidget.handleSetMaxLines" ID="LogWidgethandleSetMaxLines"></a>
456
<h3><font color="#0000FF">LogWidget.handleSetMaxLines</font></h3>
457
<b>handleSetMaxLines</b>(<i>val</i>)
459
Sets the maximum number of lines to be shown.
463
maximum number of lines to be displayed
464
If val is <= 0 then there will be no limit. If the maximum number
465
of lines is appended, the oldest are discarded.
467
</dl><a NAME="LogWidget.paintEvent" ID="LogWidgetpaintEvent"></a>
468
<h3><font color="#0000FF">LogWidget.paintEvent</font></h3>
469
<b>paintEvent</b>(<i>evt</i>)
471
Reimplemented for custom painting.
475
the paint event object (QPaintEvent)
477
</dl><a NAME="LogWidget.preferredBackgroundColor" ID="LogWidgetpreferredBackgroundColor"></a>
478
<h3><font color="#0000FF">LogWidget.preferredBackgroundColor</font></h3>
479
<b>preferredBackgroundColor</b>(<i></i>)
481
Reimplemented to return colorgroup().base().
485
preferred background colour (QColor)
488
<div align="right"><a href="#top">Up</a></div>
b'\\ No newline at end of file'