usdmanager.linenumbers module

Line numbers widget for optimized display of line numbers on the left side of a text widget.

class usdmanager.linenumbers.LineNumbers(parent)[source]

Bases: usdmanager.linenumbers.PlainTextLineNumbers

Line number widget for QTextBrowser and QTextEdit widgets. Currently does not support QPlainTextEdit widgets.

blockCount()[source]
connectSignals()[source]

Connect relevant QTextBrowser or QTextEdit signals.

highlightCurrentLine()[source]

Make sure the active line number is redrawn in bold by calling update.

paintEvent(event)[source]

Draw line numbers.

resizeAndUpdate(*args)[source]

Resize bar if needed.

class usdmanager.linenumbers.PlainTextLineNumbers(parent)[source]

Bases: sphinx.ext.autodoc.importer._MockObject

Line number widget for QPlainTextEdit widgets.

blockCount()[source]
connectSignals()[source]

Connect signals from the text widget that affect line numbers.

highlightCurrentLine()[source]

Highlight the line the cursor is on.

Returns:If highlighting was enabled or not.
Rtype:bool
lineWidth(count=0)[source]

Calculate the width of the widget based on the block count.

Parameters:
count : int

Block count. Defaults to current block count.

mouseMoveEvent(event)[source]

Track mouse movement to select more lines if press is active.

Parameters:
event : QMouseEvent

Mouse move event

mousePressEvent(event)[source]

Select the line that was clicked. If moved while pressed, select multiple lines as the mouse moves.

Parameters:
event : QMouseEvent

Mouse press event

onEditorResize()[source]

Adjust line numbers size if the text widget is resized.

paintEvent(event)[source]

Draw the visible line numbers.

setVisible(visible)[source]
sizeHint()[source]
updateLineNumbers(rect, dY)[source]

Scroll the line numbers or repaint the visible numbers.

updateLineWidth(count=0)[source]

Adjust display of text widget to account for the widget of the line numbers.

Parameters:
count : int

Block count of document.