Module implementing the log viewer widget and the log widget.
LogView | Class providing a stack of tabbed scrollable widgets. |
LogViewViewport | Internal class representing the viewport of the scrollview. |
LogViewWidget | Base class for widgets to be displayed by LogView. |
LogWidget | A class for displaying logging messages. |
None |
Class providing a stack of tabbed scrollable widgets.
Like QTabWidget the LogView provides a stack of widgets. Different from the normal QTabWidget the tabs are aligned at the bottom with QTabBar::RoundedBelow style. The contents of the different widgets can be scrolled by scrollbars that are on the right and bottom side. The widgets themselves must be derived from LogViewWidget.
LogView is not derived from QTabWidget as this would prevent the implentation of the horizontal scrollbar at the side of the tabbar. The interface is similar to QTabWidget to make it easy to use.
LogView | Constructor |
addTab | Adds a tab. |
contextMenuEvent | Reimplemented for custom context menu. |
currentPage | Public method to retrieve the current page. |
getActualViewport | Gets the actual viewport or None if there is none. |
handleClearWidget | Private slot to handle the clear popup menu action. |
handleCopyWidget | Private slot to handle the copy popup menu action. |
handleScrollbarValueChanged | Called when the value of a scrollbar changes. |
handleTabbarSelected | Called when the selection in the tabbar changes. |
handleWidgetSizeChanged | Recalculates the scrollbars if necessary. |
nextTab | Public slot used to show the next tab. |
prevTab | Public slot used to show the previous tab. |
resizeEvent | Reimplemented to set the scrollbar sizes. |
setCurrentPage | Set the page at position pos as the current page. |
setupScrollBars | Calculates the sizes of the scrollbars for the top widget. |
wheelEvent | Private method to override the wheel event. |
Constructor
Adds a tab.
Reimplemented for custom context menu.
Public method to retrieve the current page.
Gets the actual viewport or None if there is none.
Private slot to handle the clear popup menu action.
Private slot to handle the copy popup menu action.
Called when the value of a scrollbar changes.
Called when the selection in the tabbar changes.
The corresponding widget is activated.
Recalculates the scrollbars if necessary.
Public slot used to show the next tab.
Public slot used to show the previous tab.
Reimplemented to set the scrollbar sizes.
Set the page at position pos as the current page.
Calculates the sizes of the scrollbars for the top widget.
Private method to override the wheel event.
Internal class representing the viewport of the scrollview.
LogViewViewport | Constructor |
getChild | |
getWidget | Public method returning the child widget. |
getWidgetSize | Public method to get the size of the child widget. |
setScrollOffset | Sets the scrolling offset for the child widget. |
setScrollOffsetP | Sets the scrolling offset for the child widget. |
Constructor
Public method returning the child widget.
Public method to get the size of the child widget.
Sets the scrolling offset for the child widget.
Sets the scrolling offset for the child widget.
Base class for widgets to be displayed by LogView.
Subclasses may emit the signal sizeChanged(LogViewWidget) to tell the container that a resizing may be necessary.
LogViewWidget | Constructor |
preferredBackgroundColor | Private method setting the background colour. |
Constructor
Private method setting the background colour.
A class for displaying logging messages.
LogWidget is a simple class to be plugged in a LogView. It displays lines of text without interpretation of richtext or html tags. Neither are special characters like newlines or tabs interpreted. The widget can either store all the strings sent to it (the default) or can limit the number of lines to store. In this case the oldest lines are discarded when new lines arrive.
LogWidget | Constructor |
append | Public method to append text to the messages. |
clear | Public method to delete all strings from the internal buffer and clears the display. |
copy | Public method to copy all strings from the internal buffer to the clipboard. |
handleSetMaxLines | Sets the maximum number of lines to be shown. |
paintEvent | Reimplemented for custom painting. |
preferredBackgroundColor | Reimplemented to return colorgroup().base(). |
Constructor
Public method to append text to the messages.
When the LogWidget is already scrolled to the bottom, it will further scroll down to display the newly added line. If the scrolling position is not at the end, this position is not changed.
Public method to delete all strings from the internal buffer and clears the display.
Public method to copy all strings from the internal buffer to the clipboard.
Sets the maximum number of lines to be shown.
Reimplemented for custom painting.
Reimplemented to return colorgroup().base().