A python text editor widget. More...
#include <pqPythonTextArea.h>
Inherits QWidget.
Signals | |
void | bufferErased () |
Triggered when the current text buffer is erased. More... | |
void | fileOpened (const QString &) |
Triggers after a file has been successfuly opened in the current buffer. More... | |
void | fileSaved (const QString &) |
Triggers after a successful saves of the current buffer. More... | |
void | contentChanged () |
Emitted when the buffer content has been modified. More... | |
Public Member Functions | |
pqPythonTextArea (QWidget *parent) | |
Construct a pqPythonTextArea. More... | |
const QTextEdit * | getTextEdit () const |
Returns the underlying text edit. More... | |
QTextEdit * | getTextEdit () |
Returns the underlying text edit. More... | |
const QUndoStack & | getUndoStack () const |
bool | saveOnClose () |
Returns true if the file has been saved. More... | |
bool | openFile (const QString &filename, vtkTypeUInt32 location=0x10) |
Opens a file in the editor. More... | |
void | setDefaultSaveDirectory (const QString &dir) |
Sets the default save directory. More... | |
void | connectActions (pqPythonEditorActions &actions) |
Connects this widget to the set of actions. More... | |
void | disconnectActions (pqPythonEditorActions &actions) |
Disconnect this widget from the set of actions. More... | |
const QString & | getFilename () const |
Get filename associated with this buffer. More... | |
bool | isEmpty () const |
Returns true if the buffer is empty. More... | |
bool | isDirty () const |
Returns true if the buffer has been modified but not saved. More... | |
void | setText (const QString &text) |
Override the current buffer content with the referenced string. More... | |
template<typename T > | |
void | linkTo (T *) |
Link the current text area to an arbitrary QTextEdit like object. More... | |
void | unlink () |
Removes the linked QTextEdit like object. More... | |
bool | isLinkedTo (const QObject *obj) const |
Returns true if the parameter is linked to this text area. More... | |
bool | isLinked () const |
Returns true if this text area is linked. More... | |
QString | getLinkedName () const |
Returns the linked text name. More... | |
Protected Member Functions | |
bool | eventFilter (QObject *obj, QEvent *event) override |
Filter the KeyEvent CTRL+Z. More... | |
A python text editor widget.
Displays an editable text area with syntax python highlighting and line numbering.
Definition at line 32 of file pqPythonTextArea.h.
|
explicit |
Construct a pqPythonTextArea.
parent | the parent widget for the Qt ownership |
|
inline |
Returns the underlying text edit.
Definition at line 46 of file pqPythonTextArea.h.
|
inline |
Returns the underlying text edit.
Definition at line 51 of file pqPythonTextArea.h.
|
inline |
Definition at line 53 of file pqPythonTextArea.h.
bool pqPythonTextArea::saveOnClose | ( | ) |
Returns true if the file has been saved.
bool pqPythonTextArea::openFile | ( | const QString & | filename, |
vtkTypeUInt32 | location = 0x10 |
||
) |
Opens a file in the editor.
Triggers a saving wizard if the current buffer has not beed saved on the disk.
void pqPythonTextArea::setDefaultSaveDirectory | ( | const QString & | dir | ) |
Sets the default save directory.
Only used for the directory displayed when the save popup window is shown.
void pqPythonTextArea::connectActions | ( | pqPythonEditorActions & | actions | ) |
Connects this widget to the set of actions.
void pqPythonTextArea::disconnectActions | ( | pqPythonEditorActions & | actions | ) |
Disconnect this widget from the set of actions.
const QString& pqPythonTextArea::getFilename | ( | ) | const |
Get filename associated with this buffer.
Returns an empty string if no file is associated.
bool pqPythonTextArea::isEmpty | ( | ) | const |
Returns true if the buffer is empty.
bool pqPythonTextArea::isDirty | ( | ) | const |
Returns true if the buffer has been modified but not saved.
void pqPythonTextArea::setText | ( | const QString & | text | ) |
Override the current buffer content with the referenced string.
|
inline |
Link the current text area to an arbitrary QTextEdit like object.
Definition at line 113 of file pqPythonTextArea.h.
void pqPythonTextArea::unlink | ( | ) |
Removes the linked QTextEdit like object.
|
inline |
Returns true if the parameter is linked to this text area.
Definition at line 127 of file pqPythonTextArea.h.
|
inline |
Returns true if this text area is linked.
Definition at line 132 of file pqPythonTextArea.h.
|
inline |
Returns the linked text name.
Returns an empty string if nothing is linked
Definition at line 138 of file pqPythonTextArea.h.
|
signal |
Triggered when the current text buffer is erased.
|
signal |
Triggers after a file has been successfuly opened in the current buffer.
|
signal |
Triggers after a successful saves of the current buffer.
|
signal |
Emitted when the buffer content has been modified.
|
overrideprotected |
Filter the KeyEvent CTRL+Z.
We need to filter the QTextEdit KeyEvent otherwise our undo/redo actions are not triggered.