madgui.widget.edit module¶
Provides an editor control with line numbers.
Classes
|
Widget that displays line numbers for a QPlainTextEdit. |
|
Text edit dialog with line numbers. |
-
class
madgui.widget.edit.
LineNumberBar
(edit)[source]¶ Bases:
PyQt5.QtWidgets.QWidget
Widget that displays line numbers for a QPlainTextEdit.
Methods
adjustWidth
(count)calc_width
(count)Calculate the widget width in pixels required to hold line numbers up to the given
count
.draw_block
(painter, rect, block, first)Draw the info corresponding to a given block (text line) of the text document.
paintEvent
(self, QPaintEvent)updateContents
(rect, scroll)-
calc_width
(count)[source]¶ Calculate the widget width in pixels required to hold line numbers up to the given
count
.
-
draw_block
(painter, rect, block, first)[source]¶ Draw the info corresponding to a given block (text line) of the text document.
This method can be overriden by subclasses (with care).
- Parameters
painter (QPainter) – painter for the current widget
rect (QRect) – clipping rect for the text to be drawn
block (QTextBlock) – associated text block in the text edit
first (bool) – indicates the topmost visible block on screen
-