Python console widget.
#include <PyConsole_Console.h>

Public Types | |
| enum | { CopyId = 0x01, PasteId = 0x02, ClearId = 0x04, SelectAllId = 0x08, DumpCommandsId = 0x16, All = CopyId | PasteId | ClearId | SelectAllId | DumpCommandsId } |
Context popup menu actions flags. More... | |
Public Member Functions | |
| PyConsole_Console (QWidget *parent, PyConsole_Interp *interp=0) | |
| Constructor. | |
| virtual | ~PyConsole_Console () |
| Destructor. | |
| PyConsole_Interp * | getInterp () |
| Get python interperter. | |
| QFont | font () const |
| Get python console font. | |
| virtual void | setFont (const QFont &) |
| Change the python console's font. | |
| bool | isSync () const |
| Get synchronous mode flag value. | |
| void | setIsSync (const bool) |
| Set synchronous mode flag value. | |
| bool | isSuppressOutput () const |
| Get suppress output flag value. | |
| void | setIsSuppressOutput (const bool) |
| Set suppress output flag value. | |
| bool | isShowBanner () const |
| Get 'show banner' flag value. | |
| void | setIsShowBanner (const bool) |
| Set 'show banner' flag value. | |
| void | exec (const QString &) |
| Execute python command in the interpreter. | |
| void | execAndWait (const QString &) |
| Execute python command in the interpreter and wait until it is finished. | |
| virtual bool | eventFilter (QObject *, QEvent *) |
| Event handler. | |
| virtual QString | popupClientType () const |
| Get popup client symbolic name. | |
| virtual void | contextMenuPopup (QMenu *) |
| Create the context popup menu. | |
| void | setMenuActions (const int) |
| Set actions to be visible in the context popup menu. | |
| int | menuActions () const |
| Get menu actions which are currently visible in the context popup menu. | |
| bool | connectPopupRequest (QObject *reciever, const char *slot) |
| bool | disconnectPopupRequest (QObject *reciever, const char *slot) |
Protected Member Functions | |
| void | contextMenuRequest (QContextMenuEvent *e) |
Private Member Functions | |
| void | createActions () |
| Create menu actions. | |
| void | updateActions () |
| Update menu actions. | |
Private Attributes | |
| PyConsole_Interp * | myInterp |
| python interpreter | |
| PyConsole_Editor * | myEditor |
| python console editor widget | |
| QMap< int, QAction * > | myActions |
| menu actions list | |
| anonymous enum |
| PyConsole_Console::PyConsole_Console | ( | QWidget * | parent, |
| PyConsole_Interp * | interp = 0 |
||
| ) |
Creates new python console widget.
| parent | parent widget |
| interp | python interpreter |
References createActions(), PyInterp_Interp.initialize(), myEditor, and myInterp.
| PyConsole_Console::~PyConsole_Console | ( | ) | [virtual] |
Does nothing for the moment.
| PyConsole_Interp* PyConsole_Console.getInterp | ( | ) |
| QFont PyConsole_Console::font | ( | ) | const |
References myEditor.
| void PyConsole_Console::setFont | ( | const QFont & | f | ) | [virtual] |
| f | new font |
References myEditor.
| bool PyConsole_Console::isSync | ( | ) | const |
References PyConsole_Editor.isSync(), and myEditor.
| void PyConsole_Console::setIsSync | ( | const bool | on | ) |
In synhronous mode the Python commands are executed in the GUI thread and the GUI is blocked until the command is finished. In the asynchronous mode each Python command is executed in the separate thread that does not block the main GUI loop.
| on | synhronous mode flag |
References myEditor, and PyConsole_Editor.setIsSync().
| bool PyConsole_Console::isSuppressOutput | ( | ) | const |
References PyConsole_Editor.isSuppressOutput(), and myEditor.
| void PyConsole_Console::setIsSuppressOutput | ( | const bool | on | ) |
In case if suppress output flag is true, the python console output suppressed.
| on | suppress output flag |
References myEditor, and PyConsole_Editor.setIsSuppressOutput().
| bool PyConsole_Console::isShowBanner | ( | ) | const |
true if python console shows banner References PyConsole_Editor.isShowBanner(), and myEditor.
| void PyConsole_Console::setIsShowBanner | ( | const bool | on | ) |
The banner is shown in the top of the python console window.
| on | 'show banner' flag |
References myEditor, and PyConsole_Editor.setIsShowBanner().
| void PyConsole_Console::exec | ( | const QString & | command | ) |
| command | string with command and arguments |
References PyConsole_Editor.exec(), and myEditor.
| void PyConsole_Console::execAndWait | ( | const QString & | command | ) |
Block execution of main application until the python command is executed.
| command | string with command and arguments |
References PyConsole_Editor.execAndWait(), and myEditor.
Handles context menu request event.
| o | object |
| e | event |
References SUIT_PopupClient.contextMenuRequest(), and myEditor.
| virtual QString PyConsole_Console.popupClientType | ( | ) | const [virtual] |
Implements SUIT_PopupClient.
| void PyConsole_Console::contextMenuPopup | ( | QMenu * | menu | ) | [virtual] |
Fill in the popup menu with the commands.
| menu | context popup menu |
Reimplemented from SUIT_PopupClient.
References ClearId, CopyId, DumpCommandsId, myActions, myEditor, PasteId, SelectAllId, Qtx.simplifySeparators(), and updateActions().
| void PyConsole_Console::setMenuActions | ( | const int | flags | ) |
Actions, which IDs are set in flags parameter, will be shown in the context popup menu. Other actions will not be shown.
| flags | ORed together actions flags |
References ClearId, CopyId, DumpCommandsId, myActions, PasteId, and SelectAllId.
| int PyConsole_Console::menuActions | ( | ) | const |
References ClearId, CopyId, DumpCommandsId, myActions, PasteId, TestSalomeApp.ret, and SelectAllId.
| void PyConsole_Console::createActions | ( | ) | [private] |
Create context popup menu actions.
References test_table.a, ClearId, CopyId, DumpCommandsId, myActions, myEditor, PasteId, and SelectAllId.
| void PyConsole_Console::updateActions | ( | ) | [private] |
Update context popup menu action state.
References CopyId, myActions, myEditor, PasteId, and SelectAllId.
| bool SUIT_PopupClient::connectPopupRequest | ( | QObject * | reciever, |
| const char * | slot | ||
| ) | [inherited] |
Connect popup request.
References SUIT_PopupClient.contextMenuRequest(), and SUIT_PopupClient.mySignal.
| bool SUIT_PopupClient::disconnectPopupRequest | ( | QObject * | reciever, |
| const char * | slot | ||
| ) | [inherited] |
Disconnect popup request.
References SUIT_PopupClient.contextMenuRequest(), and SUIT_PopupClient.mySignal.
| void SUIT_PopupClient::contextMenuRequest | ( | QContextMenuEvent * | e | ) | [protected, inherited] |
Send signal on context menu request.
References SUIT_PopupClient.mySignal, and SUIT_PopupClient.Signal.sendSignal().
PyConsole_Interp* PyConsole_Console.myInterp [private] |
PyConsole_Editor* PyConsole_Console.myEditor [private] |
QMap<int, QAction*> PyConsole_Console.myActions [private] |