MIRA
Public Slots | Signals | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
QConsole Class Reference

An abstract Qt console. More...

#include <widgets/QConsole.h>

Inheritance diagram for QConsole:
Inheritance graph
[legend]

Public Slots

void cut ()
 
void displayPrompt ()
 
void onCursorPositionChanged ()
 

Signals

void commandExecuted (const QString &command)
 

Public Member Functions

 QConsole (QWidget *parent=NULL, const QString &welcomeText="")
 
void setPrompt (const QString &prompt, bool display=true)
 
bool execCommand (const QString &command, bool writeCommand=true, bool showPrompt=true, QString *result=NULL)
 
void clear ()
 
void reset (const QString &welcomeText="")
 
void setCompletionColor (QColor c)
 
QColor cmdColor () const
 get/set command color More...
 
void setCmdColor (QColor c)
 
QColor errColor () const
 get/set error color More...
 
void setErrColor (QColor c)
 
QColor outColor () const
 get/set output color More...
 
void setOutColor (QColor c)
 
void setFont (const QFont &f)
 get set font More...
 
QFont font () const
 

Protected Member Functions

void setFormat (QColor color, bool bold=false, bool italic=false)
 
void setFormat (bool bold=false, bool italic=false)
 
void println (const QString &s)
 
void println (const std::string &s)
 
void println (const char *s)
 
void keyPressEvent (QKeyEvent *e)
 
void contextMenuEvent (QContextMenuEvent *event)
 
virtual bool isCommandComplete (const QString &command)
 
QString getCurrentCommand ()
 
void replaceCurrentCommand (const QString &newCommand)
 
bool isInEditionZone ()
 
bool isInEditionZone (int pos)
 
bool isSelectionInEditionZone ()
 
void insertFromMimeData (const QMimeData *)
 
virtual void dragEnterEvent (QDragEnterEvent *e)
 
virtual void dragLeaveEvent (QDragLeaveEvent *e)
 
virtual void dragMoveEvent (QDragMoveEvent *e)
 
virtual void dropEvent (QDropEvent *e)
 
void mousePressEvent (QMouseEvent *)
 
void mouseReleaseEvent (QMouseEvent *)
 
virtual QString interpretCommand (const QString &command, int *res)
 
virtual QStringList suggestCommand (const QString &cmd, QString &prefix)
 
virtual MIRA_EXTENSIBLE_ENUM_DECLARE(SearchMode, ExtensibleEnum< SearchMode >, SEARCH_NONE, SEARCH_HISTORY) protected void enterSearchMode (const SearchMode &mode)
 
virtual QString getSearchModeDescriptor ()
 
virtual QStringList getSearchList ()
 
virtual std::multimap< QString, QString > getExtendedSearchList ()
 

Protected Attributes

QColor cmdColor_
 
QColor errColor_
 
QColor outColor_
 
QColor completionColor
 
int oldPosition
 
int promptLength
 
QString prompt
 
QStringList history
 
int historyIndex
 
int promptPosition
 
SearchMode currentSearchMode
 

Detailed Description

An abstract Qt console.

Author
Houssem BDIOUI

Constructor & Destructor Documentation

◆ QConsole()

QConsole ( QWidget *  parent = NULL,
const QString &  welcomeText = "" 
)

Member Function Documentation

◆ setPrompt()

void setPrompt ( const QString &  prompt,
bool  display = true 
)

◆ execCommand()

bool execCommand ( const QString &  command,
bool  writeCommand = true,
bool  showPrompt = true,
QString *  result = NULL 
)

◆ clear()

void clear ( )

◆ reset()

void reset ( const QString &  welcomeText = "")

◆ cmdColor()

QColor cmdColor ( ) const
inline

get/set command color

◆ setCmdColor()

void setCmdColor ( QColor  c)
inline

◆ errColor()

QColor errColor ( ) const
inline

get/set error color

◆ setErrColor()

void setErrColor ( QColor  c)
inline

◆ outColor()

QColor outColor ( ) const
inline

get/set output color

◆ setOutColor()

void setOutColor ( QColor  c)
inline

◆ setCompletionColor()

void setCompletionColor ( QColor  c)
inline

◆ setFont()

void setFont ( const QFont &  f)

get set font

◆ font()

QFont font ( ) const
inline

◆ setFormat() [1/2]

void setFormat ( QColor  color,
bool  bold = false,
bool  italic = false 
)
protected

◆ setFormat() [2/2]

void setFormat ( bool  bold = false,
bool  italic = false 
)
protected

◆ println() [1/3]

void println ( const QString &  s)
protected

◆ println() [2/3]

void println ( const std::string &  s)
protected

◆ println() [3/3]

void println ( const char *  s)
protected

◆ keyPressEvent()

void keyPressEvent ( QKeyEvent *  e)
protected

◆ contextMenuEvent()

void contextMenuEvent ( QContextMenuEvent *  event)
protected

◆ isCommandComplete()

virtual bool isCommandComplete ( const QString &  command)
protectedvirtual

◆ getCurrentCommand()

QString getCurrentCommand ( )
protected

◆ replaceCurrentCommand()

void replaceCurrentCommand ( const QString &  newCommand)
protected

◆ isInEditionZone() [1/2]

bool isInEditionZone ( )
protected

◆ isInEditionZone() [2/2]

bool isInEditionZone ( int  pos)
protected

◆ isSelectionInEditionZone()

bool isSelectionInEditionZone ( )
protected

◆ insertFromMimeData()

void insertFromMimeData ( const QMimeData *  )
protected

◆ dragEnterEvent()

virtual void dragEnterEvent ( QDragEnterEvent *  e)
protectedvirtual

◆ dragLeaveEvent()

virtual void dragLeaveEvent ( QDragLeaveEvent *  e)
protectedvirtual

◆ dragMoveEvent()

virtual void dragMoveEvent ( QDragMoveEvent *  e)
protectedvirtual

◆ dropEvent()

virtual void dropEvent ( QDropEvent *  e)
protectedvirtual

◆ mousePressEvent()

void mousePressEvent ( QMouseEvent *  )
protected

◆ mouseReleaseEvent()

void mouseReleaseEvent ( QMouseEvent *  )
protected

◆ interpretCommand()

virtual QString interpretCommand ( const QString &  command,
int *  res 
)
protectedvirtual

◆ suggestCommand()

virtual QStringList suggestCommand ( const QString &  cmd,
QString &  prefix 
)
protectedvirtual

◆ cut

void cut ( )
slot

◆ displayPrompt

void displayPrompt ( )
slot

◆ onCursorPositionChanged

void onCursorPositionChanged ( )
slot

◆ commandExecuted

void commandExecuted ( const QString &  command)
signal

◆ enterSearchMode()

virtual MIRA_EXTENSIBLE_ENUM_DECLARE (SearchMode, ExtensibleEnum<SearchMode>, SEARCH_NONE, SEARCH_HISTORY) protected void enterSearchMode ( const SearchMode &  mode)
protectedvirtual

◆ getSearchModeDescriptor()

virtual QString getSearchModeDescriptor ( )
protectedvirtual

◆ getSearchList()

virtual QStringList getSearchList ( )
protectedvirtual

◆ getExtendedSearchList()

virtual std::multimap<QString, QString> getExtendedSearchList ( )
protectedvirtual

Member Data Documentation

◆ cmdColor_

QColor cmdColor_
protected

◆ errColor_

QColor errColor_
protected

◆ outColor_

QColor outColor_
protected

◆ completionColor

QColor completionColor
protected

◆ oldPosition

int oldPosition
protected

◆ promptLength

int promptLength
protected

◆ prompt

QString prompt
protected

◆ history

QStringList history
protected

◆ historyIndex

int historyIndex
protected

◆ promptPosition

int promptPosition
protected

◆ currentSearchMode

SearchMode currentSearchMode
protected

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