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

This is the main texteditor-component (which is the true editor) This is the QWidget that recieves the keypresses, mouse presses etc. More...

#include <texteditorcomponent.h>

+ Inheritance diagram for edbee::TextEditorComponent:
+ Collaboration diagram for edbee::TextEditorComponent:

Public Slots

void repaintCarets ()
 This method repaints 'all' carets.
 
virtual void updateLineAtOffset (int offset)
 updates the given line so it will be repainted
 
virtual void updateAreaAroundOffset (int offset, int width=8)
 updates the character before and at the given offset
 
virtual void updateLine (int line, int length)
 This method invalidates the given lines.
 

Signals

void textKeyPressed ()
 

Public Member Functions

 TextEditorComponent (TextEditorController *controller, QWidget *parent=0)
 The default texteditor compenent constructor.
 
virtual ~TextEditorComponent ()
 The destructor of the the component.
 
TextEditorCommandMapcommandMap ()
 Returns the active commandmap.
 
TextEditorConfigconfig () const
 Returns the active configuration.
 
TextDocumenttextDocument () const
 Returns the active textdocument.
 
TextEditorKeyMapkeyMap ()
 Returns the current keymap.
 
TextEditorControllercontroller ()
 Returns the active texteditor controller.
 
TextSelectiontextSelection ()
 Returns the texselection range.
 
TextEditorRenderertextEditorRenderer ()
 
void giveTextEditorRenderer (TextEditorRenderer *renderer)
 
void resetCaretTime ()
 This method resets the caret timer The caret time is used for blinking carets When resetting the timer the caret is displayed directly.
 
void fullUpdate ()
 A slow and full update of the control.
 
virtual QSize sizeHint () const
 returns the size hint. This is the total size of the editor-area
 

Protected Member Functions

virtual void paintEvent (QPaintEvent *paintEvent)
 paint the editor
 
virtual void moveEvent (QMoveEvent *moveEvent)
 
virtual void hideEvent (QHideEvent *hideEvent)
 
virtual bool event (QEvent *event)
 This method is used to FORCE the interception of tab events.
 
virtual void keyPressEvent (QKeyEvent *event)
 handle keypresses
 
virtual void keyReleaseEvent (QKeyEvent *event)
 the key release event
 
void inputMethodEvent (QInputMethodEvent *m)
 input method event
 
QVariant inputMethodQuery (Qt::InputMethodQuery p) const
 currently unused ?!
 
void registerClickEvent ()
 registers a click event and modifies the clickcount and last-click moment
 
virtual void mousePressEvent (QMouseEvent *event)
 A mouse press happens.
 
virtual void mouseReleaseEvent (QMouseEvent *event)
 A mouse release happens.
 
virtual void mouseDoubleClickEvent (QMouseEvent *event)
 A mouse double click happens.
 
virtual void mouseMoveEvent (QMouseEvent *event)
 A mouse move event.
 
virtual void focusInEvent (QFocusEvent *event)
 A focus in event occured.
 
virtual void focusOutEvent (QFocusEvent *event)
 The focus is lost, we must STOP coalescing of undo-events!
 
virtual void contextMenuEvent (QContextMenuEvent *event)
 The default context menu is requested Add the default menu actions.
 

Detailed Description

This is the main texteditor-component (which is the true editor) This is the QWidget that recieves the keypresses, mouse presses etc.

Constructor & Destructor Documentation

◆ TextEditorComponent()

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

The default texteditor compenent constructor.

Parameters
controllerthe active controller for this editor
parentthe parent QObject

◆ ~TextEditorComponent()

edbee::TextEditorComponent::~TextEditorComponent ( )
virtual

The destructor of the the component.

Member Function Documentation

◆ commandMap()

TextEditorCommandMap * edbee::TextEditorComponent::commandMap ( )

Returns the active commandmap.

◆ config()

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

Returns the active configuration.

◆ contextMenuEvent()

void edbee::TextEditorComponent::contextMenuEvent ( QContextMenuEvent * event)
protectedvirtual

The default context menu is requested Add the default menu actions.

◆ controller()

TextEditorController * edbee::TextEditorComponent::controller ( )

Returns the active texteditor controller.

◆ event()

bool edbee::TextEditorComponent::event ( QEvent * event)
protectedvirtual

This method is used to FORCE the interception of tab events.

Parameters
eventthe event filter

◆ focusInEvent()

void edbee::TextEditorComponent::focusInEvent ( QFocusEvent * event)
protectedvirtual

A focus in event occured.

◆ focusOutEvent()

void edbee::TextEditorComponent::focusOutEvent ( QFocusEvent * event)
protectedvirtual

The focus is lost, we must STOP coalescing of undo-events!

◆ fullUpdate()

void edbee::TextEditorComponent::fullUpdate ( )

A slow and full update of the control.

◆ giveTextEditorRenderer()

void edbee::TextEditorComponent::giveTextEditorRenderer ( TextEditorRenderer * renderer)

◆ hideEvent()

void edbee::TextEditorComponent::hideEvent ( QHideEvent * hideEvent)
protectedvirtual

◆ inputMethodEvent()

void edbee::TextEditorComponent::inputMethodEvent ( QInputMethodEvent * m)
protected

input method event

Todo
: https://doc.qt.io/qt-5/qinputmethodevent.html Analyize how to implement this. The preeditString should NOT alter the undo-buffer

◆ inputMethodQuery()

QVariant edbee::TextEditorComponent::inputMethodQuery ( Qt::InputMethodQuery p) const
protected

currently unused ?!

◆ keyMap()

TextEditorKeyMap * edbee::TextEditorComponent::keyMap ( )

Returns the current keymap.

◆ keyPressEvent()

void edbee::TextEditorComponent::keyPressEvent ( QKeyEvent * event)
protectedvirtual

handle keypresses

◆ keyReleaseEvent()

void edbee::TextEditorComponent::keyReleaseEvent ( QKeyEvent * event)
protectedvirtual

the key release event

◆ mouseDoubleClickEvent()

void edbee::TextEditorComponent::mouseDoubleClickEvent ( QMouseEvent * event)
protectedvirtual

A mouse double click happens.

Parameters
eventthe mouse double click that occured

◆ mouseMoveEvent()

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

A mouse move event.

Parameters
eventthe mouse event

◆ mousePressEvent()

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

A mouse press happens.

The normal operation is to move the caret to the character under the given mouse position. When shift is pressed, the selection is extended to the given position

If the controller modifier is used a new caret is added to character at the given position

Parameters
eventthe mouse event

◆ mouseReleaseEvent()

void edbee::TextEditorComponent::mouseReleaseEvent ( QMouseEvent * event)
protectedvirtual

A mouse release happens.

Only used to copy selection to selection clipboard for X11 / linux systems

Parameters
eventthe mouse event

◆ moveEvent()

void edbee::TextEditorComponent::moveEvent ( QMoveEvent * moveEvent)
protectedvirtual

◆ paintEvent()

void edbee::TextEditorComponent::paintEvent ( QPaintEvent * paintEvent)
protectedvirtual

paint the editor

Parameters
paintEventthe paint event that occured

◆ registerClickEvent()

void edbee::TextEditorComponent::registerClickEvent ( )
protected

registers a click event and modifies the clickcount and last-click moment

◆ repaintCarets

void edbee::TextEditorComponent::repaintCarets ( )
slot

This method repaints 'all' carets.

Todo
: Optimize so only blinks visible carets

◆ resetCaretTime()

void edbee::TextEditorComponent::resetCaretTime ( )

This method resets the caret timer The caret time is used for blinking carets When resetting the timer the caret is displayed directly.

◆ sizeHint()

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

returns the size hint. This is the total size of the editor-area

◆ textDocument()

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

Returns the active textdocument.

◆ textEditorRenderer()

TextEditorRenderer * edbee::TextEditorComponent::textEditorRenderer ( )
inline

◆ textKeyPressed

void edbee::TextEditorComponent::textKeyPressed ( )
signal

◆ textSelection()

TextSelection * edbee::TextEditorComponent::textSelection ( )

Returns the texselection range.

◆ updateAreaAroundOffset

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

updates the character before and at the given offset

◆ updateLine

void edbee::TextEditorComponent::updateLine ( int line,
int length )
virtualslot

This method invalidates the given lines.

Parameters
linethe first line to update
lengththe number of lines to update

◆ updateLineAtOffset

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

updates the given line so it will be repainted


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