te::qt::widgets::IOWidget Class Reference

#include <IOWidget.h>

Inheritance diagram for te::qt::widgets::IOWidget:

Public Slots

void addPrompt ()
 addPrompt Adds the prompt to the text edit and unlocks the widget for input More...
 
void append (QString text)
 append Appends the given text to the text edit and locks the widget for input More...
 

Signals

void command (QString command)
 command Signal emitted when input is entered. More...
 

Public Member Functions

 IOWidget (QWidget *parent=0)
 
QString prompt () const
 prompt Retrieves the current prompt. More...
 
void setPrompt (const QString &prompt)
 setPrompt Sets a new prompt from a given string. More...
 

Protected Member Functions

void keyPressEvent (QKeyEvent *e)
 

Private Member Functions

void clearLine ()
 clearLine Clears the line under the cursor. More...
 
QString getCommand () const
 getCommand Gets the input from the user. More...
 
int getIndex (const QTextCursor &cursor)
 getIndex Gets the index of a given cursor. More...
 
void handleEnter ()
 handleEnter Handles Enter and Return key press. More...
 
void handleHome ()
 handleHome Handles Home key press. More...
 
void handleLeft (QKeyEvent *event)
 handleLeft Handles Left arrow key press. More...
 
bool isWritable (const QTextCursor &cursor)
 isWritable Checks if a given cursor is at a writable position. More...
 

Private Attributes

int lastIndex
 lastIndex The index of the last character. More...
 
bool locked
 locked False if the text edit can receive input, true otherwise. More...
 
QString userPrompt
 userPrompt prompt to indicate that the text edit is waiting for input More...
 

Detailed Description

Definition at line 46 of file IOWidget.h.

Constructor & Destructor Documentation

te::qt::widgets::IOWidget::IOWidget ( QWidget *  parent = 0)

Member Function Documentation

void te::qt::widgets::IOWidget::addPrompt ( )
slot

addPrompt Adds the prompt to the text edit and unlocks the widget for input

void te::qt::widgets::IOWidget::append ( QString  text)
slot

append Appends the given text to the text edit and locks the widget for input

Parameters
textString to be appended
void te::qt::widgets::IOWidget::clearLine ( )
private

clearLine Clears the line under the cursor.

void te::qt::widgets::IOWidget::command ( QString  command)
signal

command Signal emitted when input is entered.

Parameters
commandString to be emitted.
QString te::qt::widgets::IOWidget::getCommand ( ) const
private

getCommand Gets the input from the user.

int te::qt::widgets::IOWidget::getIndex ( const QTextCursor &  cursor)
private

getIndex Gets the index of a given cursor.

Parameters
cursorCursor used to retrieve the index.
void te::qt::widgets::IOWidget::handleEnter ( )
private

handleEnter Handles Enter and Return key press.

void te::qt::widgets::IOWidget::handleHome ( )
private

handleHome Handles Home key press.

void te::qt::widgets::IOWidget::handleLeft ( QKeyEvent *  event)
private

handleLeft Handles Left arrow key press.

Parameters
eventThe received event.
bool te::qt::widgets::IOWidget::isWritable ( const QTextCursor &  cursor)
private

isWritable Checks if a given cursor is at a writable position.

Parameters
cursorCursor that will be checked.
void te::qt::widgets::IOWidget::keyPressEvent ( QKeyEvent *  e)
protected
QString te::qt::widgets::IOWidget::prompt ( ) const

prompt Retrieves the current prompt.

void te::qt::widgets::IOWidget::setPrompt ( const QString &  prompt)

setPrompt Sets a new prompt from a given string.

Parameters
promptString of the new prompt

Member Data Documentation

int te::qt::widgets::IOWidget::lastIndex
private

lastIndex The index of the last character.

Definition at line 121 of file IOWidget.h.

bool te::qt::widgets::IOWidget::locked
private

locked False if the text edit can receive input, true otherwise.

Definition at line 116 of file IOWidget.h.

QString te::qt::widgets::IOWidget::userPrompt
private

userPrompt prompt to indicate that the text edit is waiting for input

Definition at line 110 of file IOWidget.h.


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