spinetoolbox.widgets.custom_qtextbrowser

Class for a custom QTextBrowser for showing the logs and tool output.

author
  1. Savolainen (VTT)

date

6.2.2018

Module Contents

Classes

SignedTextDocument

param owner

The item that owns the document.

CustomQTextBrowser

Custom QTextBrowser class.

MonoSpaceFontTextBrowser

Custom QTextBrowser class.

class spinetoolbox.widgets.custom_qtextbrowser.SignedTextDocument(owner=None)[source]

Bases: PySide2.QtGui.QTextDocument

Parameters

owner (ProjectItem, optional) – The item that owns the document.

class spinetoolbox.widgets.custom_qtextbrowser.CustomQTextBrowser(parent)[source]

Bases: PySide2.QtWidgets.QTextBrowser

Custom QTextBrowser class.

Parameters

parent (QWidget) – Parent widget

set_override_document(self, document)[source]

Sets the given document as the current document.

Parameters

document (QTextDocument) –

restore_original_document(self)[source]

Restores the original document

scroll_to_bottom(self)[source]
append(self, text)[source]

Appends new text block to the end of the original document.

If the document contains more text blocks after the addition than a set limit, blocks are deleted at the start of the contents.

Parameters

text (str) – text to add

contextMenuEvent(self, event)[source]

Reimplemented method to add a clear action into the default context menu.

Parameters

event (QContextMenuEvent) – Received event

property max_blocks(self)[source]

int: the upper limit of text blocks that can be appended to the widget.

class spinetoolbox.widgets.custom_qtextbrowser.MonoSpaceFontTextBrowser(parent)[source]

Bases: CustomQTextBrowser

Custom QTextBrowser class.

Parameters

parent (QWidget) – Parent widget