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

An autocomplete list Which receives it's autocomplete list from the document. More...

#include <texteditorautocompletecomponent.h>

+ Inheritance diagram for edbee::TextEditorAutoCompleteComponent:
+ Collaboration diagram for edbee::TextEditorAutoCompleteComponent:

Public Slots

void updateList ()
 
void backspacePressed ()
 processes backspaces
 
void textKeyPressed ()
 this event is called when a key pressed
 
void listItemClicked (QListWidgetItem *item)
 
void listItemDoubleClicked (QListWidgetItem *item)
 
void selectItemOnHover (QModelIndex modelIndex)
 
void showInfoTip ()
 

Public Member Functions

 TextEditorAutoCompleteComponent (TextEditorController *controller, TextEditorComponent *parent, TextMarginComponent *margin)
 
TextEditorControllercontroller () const
 Returns the current text editor controller.
 
QSize sizeHint () const
 

Protected Member Functions

bool shouldDisplayAutoComplete (TextRange &range, QString &word)
 This method check if the autocomplete should be shown this method ALSO sets the word that's display.
 
void hideInfoTip ()
 
bool fillAutoCompleteList (TextDocument *document, const TextRange &range, const QString &word)
 Fills the autocomplete list.
 
void positionWidgetForCaretOffset (int offset)
 positions the widget so it's visible.
 
bool eventFilter (QObject *obj, QEvent *event)
 we need to intercept keypresses if the widget is visible
 
void hideEvent (QHideEvent *event)
 intercepts hide() calls to inform the tooltip to hide as well
 
void insertCurrentSelectedListItem ()
 inserts the currently selected list item
 

Detailed Description

An autocomplete list Which receives it's autocomplete list from the document.

Constructor & Destructor Documentation

◆ TextEditorAutoCompleteComponent()

edbee::TextEditorAutoCompleteComponent::TextEditorAutoCompleteComponent ( TextEditorController * controller,
TextEditorComponent * parent,
TextMarginComponent * margin )
explicit

initialize the widget

Member Function Documentation

◆ backspacePressed

void edbee::TextEditorAutoCompleteComponent::backspacePressed ( )
slot

processes backspaces

◆ controller()

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

Returns the current text editor controller.

◆ eventFilter()

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

we need to intercept keypresses if the widget is visible

◆ fillAutoCompleteList()

bool edbee::TextEditorAutoCompleteComponent::fillAutoCompleteList ( TextDocument * document,
const TextRange & range,
const QString & word )
protected

Fills the autocomplete list.

◆ hideEvent()

void edbee::TextEditorAutoCompleteComponent::hideEvent ( QHideEvent * event)
protected

intercepts hide() calls to inform the tooltip to hide as well

◆ hideInfoTip()

void edbee::TextEditorAutoCompleteComponent::hideInfoTip ( )
protected

◆ insertCurrentSelectedListItem()

void edbee::TextEditorAutoCompleteComponent::insertCurrentSelectedListItem ( )
protected

inserts the currently selected list item

◆ listItemClicked

void edbee::TextEditorAutoCompleteComponent::listItemClicked ( QListWidgetItem * item)
slot

◆ listItemDoubleClicked

void edbee::TextEditorAutoCompleteComponent::listItemDoubleClicked ( QListWidgetItem * item)
slot

◆ positionWidgetForCaretOffset()

void edbee::TextEditorAutoCompleteComponent::positionWidgetForCaretOffset ( int offset)
protected

positions the widget so it's visible.

◆ selectItemOnHover

void edbee::TextEditorAutoCompleteComponent::selectItemOnHover ( QModelIndex modelIndex)
slot

◆ shouldDisplayAutoComplete()

bool edbee::TextEditorAutoCompleteComponent::shouldDisplayAutoComplete ( TextRange & range,
QString & word )
protected

This method check if the autocomplete should be shown this method ALSO sets the word that's display.

◆ showInfoTip

void edbee::TextEditorAutoCompleteComponent::showInfoTip ( )
slot

◆ sizeHint()

QSize edbee::TextEditorAutoCompleteComponent::sizeHint ( ) const

◆ textKeyPressed

void edbee::TextEditorAutoCompleteComponent::textKeyPressed ( )
slot

this event is called when a key pressed

◆ updateList

void edbee::TextEditorAutoCompleteComponent::updateList ( )
slot

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