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

This is the general edbee widget The core functionality of this widget is divided in several separate components. (TextEditorComponent: the main editor, TextMarginComponent: the sidebar with line numbers) More...

#include <texteditorwidget.h>

+ Inheritance diagram for edbee::TextEditorWidget:
+ Collaboration diagram for edbee::TextEditorWidget:

Public Slots

void scrollTopToLine (int line)
 this method scrolls the top position to the given line
 
virtual void updateLineAtOffset (int offset)
 updates the given line so it will be repainted @Param offset the offset of the line that needs repainting
 
virtual void updateAreaAroundOffset (int offset, int width=8)
 updates the character before and at the given offset
 
virtual void updateLine (int line, int length=1)
 This method repaints the given lines.
 
virtual void updateComponents ()
 Calls update on all components.
 
virtual void updateGeometryComponents ()
 Updates the geometry for all components.
 
virtual void updateRendererViewport ()
 Updates the renderer viewport.
 

Signals

void focusIn (QWidget *event)
 
void focusOut (QWidget *event)
 
void verticalScrollBarChanged (QScrollBar *newScrollBar)
 
void horizontalScrollBarChanged (QScrollBar *newScrollBar)
 

Public Member Functions

 TextEditorWidget (TextEditorController *controller, QWidget *parent=0)
 The default TextEditor widget constructor.
 
 TextEditorWidget (TextDocument *document, QWidget *parent=0)
 
 TextEditorWidget (TextEditorConfig *config, QWidget *parent=0)
 
 TextEditorWidget (QWidget *parent=0)
 
virtual ~TextEditorWidget ()
 The editor constructor.
 
void scrollPositionVisible (int xPosIn, int yPosIn)
 This method makes sure the given position is visible.
 
TextEditorControllercontroller () const
 returns the controller for this editor
 
TextEditorConfigconfig () const
 Returns the configuration object for this widget.
 
TextEditorCommandMapcommandMap () const
 Return the associated commandmap.
 
TextEditorKeyMapkeyMap () const
 return the associated keymap
 
TextDocumenttextDocument () const
 Returns the textdocument for this widget.
 
TextRenderertextRenderer () const
 Returns the text-renderer.
 
TextSelectiontextSelection () const
 Return the textselection.
 
TextEditorComponenttextEditorComponent () const
 Returns the editor component-part of the editor.
 
TextMarginComponenttextMarginComponent () const
 Returns the active margin component.
 
TextEditorScrollAreatextScrollArea () const
 Returns the active scroll area.
 
void resetCaretTime ()
 This method resets the caret time.
 
void fullUpdate ()
 This method performs a full update. Which means it calibrates the scrollbars invalidates all caches, redraws the screen and updates the scrollbars.
 
QScrollBar * horizontalScrollBar () const
 Return the horizontal scrollbar.
 
QScrollBar * verticalScrollBar () const
 returns the vertical scrollbar
 
void setVerticalScrollBar (QScrollBar *scrollBar)
 Use this method to change a scrollbar. By using this method listeners of the scrollbar well be informed the scrollbar has been changed.
 
void setHorizontalScrollBar (QScrollBar *scrollBar)
 Use this method to change the horizontal scrollbar. By using this method listeners of the scrollbar well be informed the scrollbar has been changed.
 
int autoScrollMargin () const
 Returns the auto scroll margin.
 
void setAutoScrollMargin (int amount=50)
 Sets the auto scrollmargin.
 
void setPlaceholderText (const QString &text)
 
virtual bool readonly () const
 Return the readonly status.
 
void setReadonly (bool readonly)
 Set the readonly status.
 

Protected Slots

void connectVerticalScrollBar ()
 Connects the vertical scrollbar so it updates the rendering viewport.
 
void connectHorizontalScrollBar ()
 Connects the horizontal scrollbar so it updates the rendering viewport.
 

Protected Member Functions

virtual void resizeEvent (QResizeEvent *event)
 This method is called when a resize happens.
 
bool eventFilter (QObject *obj, QEvent *event)
 a basic event-filter for receiving focus-events of the editor
 

Detailed Description

This is the general edbee widget The core functionality of this widget is divided in several separate components. (TextEditorComponent: the main editor, TextMarginComponent: the sidebar with line numbers)

Constructor & Destructor Documentation

◆ TextEditorWidget() [1/4]

edbee::TextEditorWidget::TextEditorWidget ( TextEditorController * controller,
QWidget * parent = 0 )
explicit

The default TextEditor widget constructor.

Todo
: Check if this works.. It could be possible the layout screws this If I add this before the setLayout everything hangs :S ...

◆ TextEditorWidget() [2/4]

edbee::TextEditorWidget::TextEditorWidget ( TextDocument * document,
QWidget * parent = 0 )
explicit

◆ TextEditorWidget() [3/4]

edbee::TextEditorWidget::TextEditorWidget ( TextEditorConfig * config,
QWidget * parent = 0 )
explicit

◆ TextEditorWidget() [4/4]

edbee::TextEditorWidget::TextEditorWidget ( QWidget * parent = 0)
explicit

◆ ~TextEditorWidget()

edbee::TextEditorWidget::~TextEditorWidget ( )
virtual

The editor constructor.

Member Function Documentation

◆ autoScrollMargin()

int edbee::TextEditorWidget::autoScrollMargin ( ) const

Returns the auto scroll margin.

◆ commandMap()

TextEditorCommandMap * edbee::TextEditorWidget::commandMap ( ) const

Return the associated commandmap.

◆ config()

TextEditorConfig * edbee::TextEditorWidget::config ( ) const

Returns the configuration object for this widget.

◆ connectHorizontalScrollBar

void edbee::TextEditorWidget::connectHorizontalScrollBar ( )
protectedslot

Connects the horizontal scrollbar so it updates the rendering viewport.

◆ connectVerticalScrollBar

void edbee::TextEditorWidget::connectVerticalScrollBar ( )
protectedslot

Connects the vertical scrollbar so it updates the rendering viewport.

◆ controller()

TextEditorController * edbee::TextEditorWidget::controller ( ) const

returns the controller for this editor

Returns
the active TextEditorController

◆ eventFilter()

bool edbee::TextEditorWidget::eventFilter ( QObject * obj,
QEvent * event )
protected

a basic event-filter for receiving focus-events of the editor

Parameters
objthe object to filter the events for
eventthe event to filter

◆ focusIn

void edbee::TextEditorWidget::focusIn ( QWidget * event)
signal

◆ focusOut

void edbee::TextEditorWidget::focusOut ( QWidget * event)
signal

◆ fullUpdate()

void edbee::TextEditorWidget::fullUpdate ( )

This method performs a full update. Which means it calibrates the scrollbars invalidates all caches, redraws the screen and updates the scrollbars.

◆ horizontalScrollBar()

QScrollBar * edbee::TextEditorWidget::horizontalScrollBar ( ) const

Return the horizontal scrollbar.

◆ horizontalScrollBarChanged

void edbee::TextEditorWidget::horizontalScrollBarChanged ( QScrollBar * newScrollBar)
signal

◆ keyMap()

TextEditorKeyMap * edbee::TextEditorWidget::keyMap ( ) const

return the associated keymap

◆ readonly()

bool edbee::TextEditorWidget::readonly ( ) const
virtual

Return the readonly status.

◆ resetCaretTime()

void edbee::TextEditorWidget::resetCaretTime ( )

This method resets the caret time.

◆ resizeEvent()

void edbee::TextEditorWidget::resizeEvent ( QResizeEvent * event)
protectedvirtual

This method is called when a resize happens.

Parameters
eventthe event of the editor widget

◆ scrollPositionVisible()

void edbee::TextEditorWidget::scrollPositionVisible ( int xPosIn,
int yPosIn )

This method makes sure the given position is visible.

Parameters
xposInthe position in text-editor 'coordinates'
yPosInthe position in text-editor 'coordinates'

◆ scrollTopToLine

void edbee::TextEditorWidget::scrollTopToLine ( int line)
slot

this method scrolls the top position to the given line

Parameters
linethe line to scroll to

◆ setAutoScrollMargin()

void edbee::TextEditorWidget::setAutoScrollMargin ( int amount = 50)

Sets the auto scrollmargin.

◆ setHorizontalScrollBar()

void edbee::TextEditorWidget::setHorizontalScrollBar ( QScrollBar * scrollBar)

Use this method to change the horizontal scrollbar. By using this method listeners of the scrollbar well be informed the scrollbar has been changed.

Parameters
scrollBarthe scrollbar to use

◆ setPlaceholderText()

void edbee::TextEditorWidget::setPlaceholderText ( const QString & text)

◆ setReadonly()

void edbee::TextEditorWidget::setReadonly ( bool readonly)

Set the readonly status.

◆ setVerticalScrollBar()

void edbee::TextEditorWidget::setVerticalScrollBar ( QScrollBar * scrollBar)

Use this method to change a scrollbar. By using this method listeners of the scrollbar well be informed the scrollbar has been changed.

Parameters
scrollBarthe scrollbar to use

◆ textDocument()

TextDocument * edbee::TextEditorWidget::textDocument ( ) const

Returns the textdocument for this widget.

◆ textEditorComponent()

TextEditorComponent * edbee::TextEditorWidget::textEditorComponent ( ) const

Returns the editor component-part of the editor.

◆ textMarginComponent()

TextMarginComponent * edbee::TextEditorWidget::textMarginComponent ( ) const

Returns the active margin component.

◆ textRenderer()

TextRenderer * edbee::TextEditorWidget::textRenderer ( ) const

Returns the text-renderer.

◆ textScrollArea()

TextEditorScrollArea * edbee::TextEditorWidget::textScrollArea ( ) const

Returns the active scroll area.

◆ textSelection()

TextSelection * edbee::TextEditorWidget::textSelection ( ) const

Return the textselection.

◆ updateAreaAroundOffset

void edbee::TextEditorWidget::updateAreaAroundOffset ( int offset,
int width = 8 )
virtualslot

updates the character before and at the given offset

Parameters
offsetthe offset of the area to repaint.
widththe width of the area to update (default is 8 pixels)

◆ updateComponents

void edbee::TextEditorWidget::updateComponents ( )
virtualslot

Calls update on all components.

◆ updateGeometryComponents

void edbee::TextEditorWidget::updateGeometryComponents ( )
virtualslot

Updates the geometry for all components.

◆ updateLine

void edbee::TextEditorWidget::updateLine ( int line,
int length = 1 )
virtualslot

This method repaints the given lines.

Parameters
linethe line that updates the given line
lengththe number of lines to update. (default is 1 line)

◆ updateLineAtOffset

void edbee::TextEditorWidget::updateLineAtOffset ( int offset)
virtualslot

updates the given line so it will be repainted @Param offset the offset of the line that needs repainting

◆ updateRendererViewport

void edbee::TextEditorWidget::updateRendererViewport ( )
virtualslot

Updates the renderer viewport.

◆ verticalScrollBar()

QScrollBar * edbee::TextEditorWidget::verticalScrollBar ( ) const

returns the vertical scrollbar

◆ verticalScrollBarChanged

void edbee::TextEditorWidget::verticalScrollBarChanged ( QScrollBar * newScrollBar)
signal

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