edbee - Qt Editor Library v0.11.1
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
edbee::TextMarginComponent Class Reference

The margin/line-number component This class is used for rendering line-numbers etc. More...

#include <textmargincomponent.h>

+ Inheritance diagram for edbee::TextMarginComponent:
+ Collaboration diagram for edbee::TextMarginComponent:

Public Member Functions

 TextMarginComponent (TextEditorWidget *editorWidget, QWidget *parent)
 Constructs the textmarginc compnonent.
 
virtual ~TextMarginComponent ()
 The margin component destructor.
 
void init ()
 initalizes this component
 
void updateMarginFont ()
 Updates the margin font.
 
int widthHint () const
 Returns the required width for this control.
 
virtual QSize sizeHint () const
 This method returns the size hint.
 
bool isGeometryChangeRequired ()
 This emthod is called when the text is changed.
 
void fullUpdate ()
 A slow and full update of the control.
 
TextEditorWidgeteditorWidget () const
 
TextRendererrenderer () const
 Returns the renderer.
 
TextMarginComponentDelegatedelegate () const
 
void setDelegate (TextMarginComponentDelegate *delegate)
 This method sets the delegate.
 
void giveDelegate (TextMarginComponentDelegate *delegate)
 
virtual void updateLineAtOffset (int offset)
 updates the given line so it will be repainted
 
virtual void updateLine (int line, int length)
 This method repaints the given lines.
 

Protected Slots

virtual void topChanged (int value)
 
virtual void connectScrollBar ()
 You must reconnect the scrollbars when scrollbars are changed.
 
virtual void updateFont ()
 

Protected Member Functions

virtual void paintEvent (QPaintEvent *event)
 
virtual void renderCaretMarkers (QPainter *painter, int startLine, int endLine, int width)
 Renders the caret markers in the sidebar.
 
virtual void renderLineNumber (QPainter *painter, int startLine, int endLine, int width)
 Renders the line number in the sidebar.
 
virtual void mouseMoveEvent (QMouseEvent *event)
 Can be used to track mouse events This method sends the the mouse movement events to the delegate.
 
virtual void mousePressEvent (QMouseEvent *event)
 Can be used to track mouse events This method sends the the mouse movement events to the delegate.
 
virtual void mouseDoubleClickEvent (QMouseEvent *)
 A double click.
 
virtual void leaveEvent (QEvent *event)
 The mouse leave.
 
virtual void wheelEvent (QWheelEvent *event)
 forward the mouse wheel event to the scrollbar so you can use the mouse wheel on this component
 

Detailed Description

The margin/line-number component This class is used for rendering line-numbers etc.

Constructor & Destructor Documentation

◆ TextMarginComponent()

edbee::TextMarginComponent::TextMarginComponent ( TextEditorWidget * editor,
QWidget * parent )

Constructs the textmarginc compnonent.

Parameters
editorthe editor this component is connceted to
parentthe parent widget

◆ ~TextMarginComponent()

edbee::TextMarginComponent::~TextMarginComponent ( )
virtual

The margin component destructor.

Member Function Documentation

◆ connectScrollBar

void edbee::TextMarginComponent::connectScrollBar ( )
protectedvirtualslot

You must reconnect the scrollbars when scrollbars are changed.

◆ delegate()

TextMarginComponentDelegate * edbee::TextMarginComponent::delegate ( ) const
inline

◆ editorWidget()

TextEditorWidget * edbee::TextMarginComponent::editorWidget ( ) const
inline

◆ fullUpdate()

void edbee::TextMarginComponent::fullUpdate ( )

A slow and full update of the control.

◆ giveDelegate()

void edbee::TextMarginComponent::giveDelegate ( TextMarginComponentDelegate * delegate)

◆ init()

void edbee::TextMarginComponent::init ( )

initalizes this component

◆ isGeometryChangeRequired()

bool edbee::TextMarginComponent::isGeometryChangeRequired ( )

This emthod is called when the text is changed.

◆ leaveEvent()

void edbee::TextMarginComponent::leaveEvent ( QEvent * event)
protectedvirtual

The mouse leave.

◆ mouseDoubleClickEvent()

void edbee::TextMarginComponent::mouseDoubleClickEvent ( QMouseEvent * )
protectedvirtual

A double click.

◆ mouseMoveEvent()

void edbee::TextMarginComponent::mouseMoveEvent ( QMouseEvent * event)
protectedvirtual

Can be used to track mouse events This method sends the the mouse movement events to the delegate.

◆ mousePressEvent()

void edbee::TextMarginComponent::mousePressEvent ( QMouseEvent * event)
protectedvirtual

Can be used to track mouse events This method sends the the mouse movement events to the delegate.

◆ paintEvent()

void edbee::TextMarginComponent::paintEvent ( QPaintEvent * event)
protectedvirtual

◆ renderCaretMarkers()

void edbee::TextMarginComponent::renderCaretMarkers ( QPainter * painter,
int startLine,
int endLine,
int width )
protectedvirtual

Renders the caret markers in the sidebar.

Parameters
painterthe Qt Painting context
startLinethe first line to render
endLinethe last line to render
widththe width for rendering

◆ renderer()

TextRenderer * edbee::TextMarginComponent::renderer ( ) const

Returns the renderer.

◆ renderLineNumber()

void edbee::TextMarginComponent::renderLineNumber ( QPainter * painter,
int startLine,
int endLine,
int width )
protectedvirtual

Renders the line number in the sidebar.

Parameters
painterthe Qt Painting context
startLinethe first line to render
endLinethe last line to render
widththe width for rendering

◆ setDelegate()

void edbee::TextMarginComponent::setDelegate ( TextMarginComponentDelegate * delegate)

This method sets the delegate.

◆ sizeHint()

QSize edbee::TextMarginComponent::sizeHint ( ) const
virtual

This method returns the size hint.

◆ topChanged

void edbee::TextMarginComponent::topChanged ( int value)
protectedvirtualslot

◆ updateFont

void edbee::TextMarginComponent::updateFont ( )
protectedvirtualslot

◆ updateLine()

void edbee::TextMarginComponent::updateLine ( int line,
int length )
virtual

This method repaints the given lines.

◆ updateLineAtOffset()

void edbee::TextMarginComponent::updateLineAtOffset ( int offset)
virtual

updates the given line so it will be repainted

◆ updateMarginFont()

void edbee::TextMarginComponent::updateMarginFont ( )

Updates the margin font.

◆ wheelEvent()

void edbee::TextMarginComponent::wheelEvent ( QWheelEvent * event)
protectedvirtual

forward the mouse wheel event to the scrollbar so you can use the mouse wheel on this component

◆ widthHint()

int edbee::TextMarginComponent::widthHint ( ) const

Returns the required width for this control.


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