Public Member Functions | Protected Member Functions | List of all members
pqPythonLineNumberArea Class Reference

QWidget that displays line number for a QTextEdit. More...

#include <pqPythonLineNumberArea.h>

Inherits QWidget.

Public Member Functions

 pqPythonLineNumberArea (QWidget *parent, const QTextEdit &text)
 
QSize sizeHint () const override
 Return the size hint based on the number of lines present in the text. More...
 

Protected Member Functions

void paintEvent (QPaintEvent *event) override
 Paint the widget. More...
 

Detailed Description

QWidget that displays line number for a QTextEdit.

This widget is to be associated with a QTextEdit widget (stored as text) this class. It displays the number of lines inside the text and highlight the line where the cursor is.

This must be used inside a QHLayout and placed either left or right of the refered text. The paintEvent is in charge of painting this widget.

Definition at line 26 of file pqPythonLineNumberArea.h.

Constructor & Destructor Documentation

◆ pqPythonLineNumberArea()

pqPythonLineNumberArea::pqPythonLineNumberArea ( QWidget *  parent,
const QTextEdit &  text 
)
inlineexplicit

Definition at line 35 of file pqPythonLineNumberArea.h.

Member Function Documentation

◆ sizeHint()

QSize pqPythonLineNumberArea::sizeHint ( ) const
override

Return the size hint based on the number of lines present in the text.

◆ paintEvent()

void pqPythonLineNumberArea::paintEvent ( QPaintEvent *  event)
overrideprotected

Paint the widget.

This method paints the widget area by going through the visible block inside text. Are displayed the line number from the text in one color and the line containing the cursor in another color.

Parameters
eventthe pain event

The documentation for this class was generated from the following file: