Console class reference
[Base module]

Declaration  

#include <QtLua/Console>

namespace QtLua {
class Console;
};

This class is a member of the QtLua namespace.

This class is declared in QtLua/qtluaconsole.hh source file, line 56.

Description  

This class provides an easy to use console widget for use in QtLua based applications.

This widget is a general purpose console widget with history and completion capabilities.

The qtlua interpreter uses this widget.

When used with a State lua interpreter object, it only needs a few signals connections to get a working lua based shell:

// code from examples/cpp/console/console.cc:25

MainWindow::MainWindow()
: QMainWindow()
{
state = new QtLua::State();
console = new QtLua::Console();

setCentralWidget(console);

connect(console, SIGNAL(line_validate(const QString&)),
state, SLOT(exec(const QString&)));

connect(console, SIGNAL(get_completion_list(const QString &, QStringList &, int &)),
state, SLOT(fill_completion_list(const QString &, QStringList &, int &)));

connect(state, SIGNAL(output(const QString&)),
console, SLOT(print(const QString&)));
}

Members  

Functions  

Private functions  

Slot  

  • void print(const QString &str)

Signals  

Private fields  

Members detail  

Console(QWidget *parent = 0, const QString &prompt = QString("$"), const QStringList &history = QStringList())  

This constructor is declared in QtLua/qtluaconsole.hh source file, line 68.

Create a console widget and restore history

QRegExp _complete_re  

This variable is declared in QtLua/qtluaconsole.hh source file, line 151.

This member access is private.

int _complete_start  

This variable is declared in QtLua/qtluaconsole.hh source file, line 142.

This member access is private.

int _cursor_pos  

This variable is declared in QtLua/qtluaconsole.hh source file, line 150.

This member access is private.

This variable is declared in QtLua/qtluaconsole.hh source file, line 141.

This member access is private.

This variable is declared in QtLua/qtluaconsole.hh source file, line 147.

This member access is private.

int _history_ndx  

This variable is declared in QtLua/qtluaconsole.hh source file, line 148.

This member access is private.

int _history_size  

This variable is declared in QtLua/qtluaconsole.hh source file, line 149.

This member access is private.

int _line_start  

This variable is declared in QtLua/qtluaconsole.hh source file, line 144.

This member access is private.

int _mark  

This variable is declared in QtLua/qtluaconsole.hh source file, line 145.

This member access is private.

QString _print_buffer  

This variable is declared in QtLua/qtluaconsole.hh source file, line 154.

This member access is private.

int _print_timer  

This variable is declared in QtLua/qtluaconsole.hh source file, line 155.

This member access is private.

QString _prompt  

This variable is declared in QtLua/qtluaconsole.hh source file, line 146.

This member access is private.

int _prompt_start  

This variable is declared in QtLua/qtluaconsole.hh source file, line 143.

This member access is private.

int _scroll_back  

This variable is declared in QtLua/qtluaconsole.hh source file, line 156.

This member access is private.

int _text_height  

This variable is declared in QtLua/qtluaconsole.hh source file, line 153.

This member access is private.

int _text_width  

This variable is declared in QtLua/qtluaconsole.hh source file, line 152.

This member access is private.

void action_end()  

This function is declared in QtLua/qtluaconsole.hh source file, line 170.

This member access is private.

void action_history_down()  

This function is declared in QtLua/qtluaconsole.hh source file, line 165.

This member access is private.

void action_history_find(int direction)  

This function is declared in QtLua/qtluaconsole.hh source file, line 166.

This member access is private.

void action_history_up()  

This function is declared in QtLua/qtluaconsole.hh source file, line 164.

This member access is private.

void action_home()  

This function is declared in QtLua/qtluaconsole.hh source file, line 169.

This member access is private.

void action_key_complete()  

This function is declared in QtLua/qtluaconsole.hh source file, line 162.

This member access is private.

void action_key_enter()  

This function is declared in QtLua/qtluaconsole.hh source file, line 163.

This member access is private.

void delete_completion_list()  

This function is declared in QtLua/qtluaconsole.hh source file, line 168.

This member access is private.

void display_prompt()  

This function is declared in QtLua/qtluaconsole.hh source file, line 167.

This member access is private.

void get_completion_list(const QString &prefix, QStringList &list, int &cursor_offset)  

This Qt signal is declared in QtLua/qtluaconsole.hh source file, line 132.

This member is a Qt signal.

Signal emited to query completion list.

Parameters list:

  • prefix: text extracted before cursor.
  • list: must be filled with completion matches by completion slot function.
  • cursor_offset: may be decreased by completion slot function to move cursor backward on completed text. (only used on single match)

const QStringList & get_history() const  

This function is declared in QtLua/qtluaconsole.hh source file, line 98.

Get current history.

int get_history_size() const  

This function is declared in QtLua/qtluaconsole.hh source file, line 88.

Get console max history entries count

const QString & get_prompt() const  

This function is declared in QtLua/qtluaconsole.hh source file, line 73.

Get console prompt.

int get_scroll_back() const  

This function is declared in QtLua/qtluaconsole.hh source file, line 95.

Get number of lines in the scrollback buffer.

int get_text_height() const  

This function is declared in QtLua/qtluaconsole.hh source file, line 83.

Get console height in character count

int get_text_width() const  

This function is declared in QtLua/qtluaconsole.hh source file, line 78.

Get console width in character count

void init()  

This function is declared in QtLua/qtluaconsole.hh source file, line 160.

This member access is private.

void keyPressEvent(QKeyEvent *e)  

This function is declared in QtLua/qtluaconsole.hh source file, line 180.

This member access is private.

void line_validate(const QString &str)  

This Qt signal is declared in QtLua/qtluaconsole.hh source file, line 124.

This member is a Qt signal.

Signal emited when text line is validated with enter key

void load_history(QSettings &s, const QString &key = "qtlua_console_history")  

This function is declared in QtLua/qtluaconsole.hh source file, line 105.

Load history from QSettings object and keep a QPointer to QSettings for subsequent call to the Console::save_history function.

void mouseDoubleClickEvent(QMouseEvent *e)  

This function is declared in QtLua/qtluaconsole.hh source file, line 176.

This member access is private.

void mousePressEvent(QMouseEvent *e)  

This function is declared in QtLua/qtluaconsole.hh source file, line 174.

This member access is private.

void mouseReleaseEvent(QMouseEvent *e)  

This function is declared in QtLua/qtluaconsole.hh source file, line 175.

This member access is private.

void print(const QString &str)  

This Qt slot is declared in QtLua/qtluaconsole.hh source file, line 137.

This member is a Qt slot.

Display text on the console

void print_flush()  

This function is declared in QtLua/qtluaconsole.hh source file, line 171.

This member access is private.

void save_history(QSettings &s, const QString &key = "qtlua_console_history") const  

This function is declared in QtLua/qtluaconsole.hh source file, line 109.

Save history using QSettings object previously passed to Console::load_history function.

void set_completion_regexp(const QRegExp &regexp)  

This function is declared in QtLua/qtluaconsole.hh source file, line 119.

Set Qt regular expression used to extract text before cursor to pass to completion signal.

The default regexp [_.:a-zA-Z0-9]+$ is suited to extract lua identifiers and table member access statements.

void set_history(const QStringList &h)  

This function is declared in QtLua/qtluaconsole.hh source file, line 101.

Set current history.

void set_history_size(int history_size)  

This function is declared in QtLua/qtluaconsole.hh source file, line 86.

Set console max history entries count

void set_prompt(const QString &p)  

This function is declared in QtLua/qtluaconsole.hh source file, line 71.

Set console prompt.

void set_scroll_back(int scroll_back)  

This function is declared in QtLua/qtluaconsole.hh source file, line 93.

Set number of lines in the scrollback buffer. Changes will take effect next time a line is entered or a Console::print is performed. Default value is 1000.

void set_text_height(int height)  

This function is declared in QtLua/qtluaconsole.hh source file, line 81.

Set console height in character count

void set_text_width(int width)  

This function is declared in QtLua/qtluaconsole.hh source file, line 76.

Set console width in character count

QSize sizeHint() const  

This function is declared in QtLua/qtluaconsole.hh source file, line 158.

This member access is private.

void timerEvent(QTimerEvent *event)  

This function is declared in QtLua/qtluaconsole.hh source file, line 177.

This member access is private.

Valid XHTML 1.0 StrictGenerated by diaxen on Sat Mar 30 16:23:02 2013 using MkDoc