Public Slots | Signals | Public Member Functions | Friends | List of all members
pqConsoleWidget Class Reference

Qt widget that provides an interactive console - you can send text to the console by calling printString() and receive user input by connecting to the executeCommand() slot. More...

#include <pqConsoleWidget.h>

Inherits QWidget.

Public Slots

void printString (const QString &Text)
 Writes the supplied text to the console. More...
 
void printCommand (const QString &cmd)
 Updates the current command. More...
 
QString text ()
 Get the text in the console. More...
 
void clear ()
 Clears the contents of the console. More...
 
void prompt (const QString &text)
 Puts out an input accepting prompt. More...
 
void insertCompletion (const QString &text)
 Inserts the given completion string at the cursor. More...
 
void takeFocus ()
 This method can be called to make the internal QTextEdit take focus. More...
 

Signals

void executeCommand (const QString &Command)
 Signal emitted whenever the user enters a command. More...
 
void consoleFocusInEvent ()
 Fired to indicate to the application that the console has focus. More...
 

Public Member Functions

 pqConsoleWidget (QWidget *parent=nullptr)
 
 ~pqConsoleWidget () override
 
QTextCharFormat getFormat ()
 Returns the current formatting that will be used by printString. More...
 
void setFormat (const QTextCharFormat &Format)
 Sets formatting that will be used by printString. More...
 
void setCompleter (pqConsoleWidgetCompleter *completer)
 Set a completer for this console widget. More...
 
QPoint getCursorPosition ()
 
void setFontSize (int size)
 Set the size of the font to use. More...
 

Friends

class pqImplementation
 
class pqConsoleWidgetEventPlayer
 

Detailed Description

Qt widget that provides an interactive console - you can send text to the console by calling printString() and receive user input by connecting to the executeCommand() slot.

See also
pqPythonShell

Definition at line 51 of file pqConsoleWidget.h.

Constructor & Destructor Documentation

◆ pqConsoleWidget()

pqConsoleWidget::pqConsoleWidget ( QWidget *  parent = nullptr)

◆ ~pqConsoleWidget()

pqConsoleWidget::~pqConsoleWidget ( )
override

Member Function Documentation

◆ getFormat()

QTextCharFormat pqConsoleWidget::getFormat ( )

Returns the current formatting that will be used by printString.

◆ setFormat()

void pqConsoleWidget::setFormat ( const QTextCharFormat &  Format)

Sets formatting that will be used by printString.

◆ setCompleter()

void pqConsoleWidget::setCompleter ( pqConsoleWidgetCompleter completer)

Set a completer for this console widget.

◆ getCursorPosition()

QPoint pqConsoleWidget::getCursorPosition ( )

◆ setFontSize()

void pqConsoleWidget::setFontSize ( int  size)

Set the size of the font to use.

Size is measured in points.

◆ executeCommand

void pqConsoleWidget::executeCommand ( const QString &  Command)
signal

Signal emitted whenever the user enters a command.

◆ consoleFocusInEvent

void pqConsoleWidget::consoleFocusInEvent ( )
signal

Fired to indicate to the application that the console has focus.

◆ printString

void pqConsoleWidget::printString ( const QString &  Text)
slot

Writes the supplied text to the console.

◆ printCommand

void pqConsoleWidget::printCommand ( const QString &  cmd)
slot

Updates the current command.

Unlike printString, this will affect the current command being typed.

◆ text

QString pqConsoleWidget::text ( )
slot

Get the text in the console.

◆ clear

void pqConsoleWidget::clear ( )
slot

Clears the contents of the console.

◆ prompt

void pqConsoleWidget::prompt ( const QString &  text)
slot

Puts out an input accepting prompt.

It is recommended that one uses prompt instead of printString() to print an input prompt since this call ensures that the prompt is shown on a new line.

◆ insertCompletion

void pqConsoleWidget::insertCompletion ( const QString &  text)
slot

Inserts the given completion string at the cursor.

This will replace the current word that the cursor is touching with the given text. Determines the word using QTextCursor::StartOfWord, EndOfWord.

◆ takeFocus

void pqConsoleWidget::takeFocus ( )
slot

This method can be called to make the internal QTextEdit take focus.

Friends And Related Function Documentation

◆ pqImplementation

friend class pqImplementation
friend

Definition at line 141 of file pqConsoleWidget.h.

◆ pqConsoleWidgetEventPlayer

friend class pqConsoleWidgetEventPlayer
friend

Definition at line 143 of file pqConsoleWidget.h.


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