edbee - Qt Editor Library
Public Member Functions | Protected Slots | Protected Member Functions | List of all members
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. More...
 
virtual ~TextMarginComponent ()
 The margin component destructor. More...
 
void init ()
 initalizes this component More...
 
int widthHint () const
 Returns the required width for this control. More...
 
virtual QSize sizeHint () const
 This method returns the size hint. More...
 
bool isGeometryChangeRequired ()
 This emthod is called when the text is changed. More...
 
void fullUpdate ()
 A slow and full update of the control. More...
 
TextEditorWidgeteditorWidget () const
 
TextRendererrenderer () const
 Returns the renderer. More...
 
TextMarginComponentDelegatedelegate () const
 
void setDelegate (TextMarginComponentDelegate *delegate)
 This method sets the delegate. More...
 
void giveDelegate (TextMarginComponentDelegate *delegate)
 
virtual void updateLineAtOffset (int offset)
 updates the given line so it will be repainted More...
 
virtual void updateLine (int line, int length)
 This method repaints the given lines. More...
 

Protected Slots

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

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

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

◆ 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

◆ 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: