basic_QPlainTextEdit.py
Handles edit blocks undo states.
| Parameters: | object (object) – Object to decorate. |
|---|---|
| Returns: | Object. |
| Return type: | object |
Bases: PyQt4.QtGui.QPlainTextEdit
Defines a QPlainTextEdit subclass providing a basic editor base class.
Initializes the class.
| Parameters: |
|
|---|
This signal is emited by the Basic_QPlainTextEdit class when patterns have been replaced. ( pyqtSignal )
| Returns: | Replaced patterns. |
|---|---|
| Return type: | list |
Property for self.__searchPattern attribute.
| Returns: | self.__searchPattern. |
|---|---|
| Return type: | unicode |
Property for self.__minimumFontPointSize attribute.
| Returns: | self.__minimumFontPointSize. |
|---|---|
| Return type: | int |
Property for self.__maximumFontPointSize attribute.
| Returns: | self.__maximumFontPointSize. |
|---|---|
| Return type: | int |
Reimplements the QPlainTextEdit.wheelEvent() method.
| Parameters: | event (QEvent) – Event. |
|---|
Returns current document selected text metrics.
| Returns: | Selected text metrics. |
|---|---|
| Return type: | tuple |
Returns default text option.
| Returns: | Default text options. |
|---|---|
| Return type: | QTextOption |
Sets default text option using given flag.
| Parameters: | textOption (QTextOption) – Text option. |
|---|---|
| Returns: | Method success. |
| Return type: | bool |
Stores the document cursor anchor.
| Returns: | Method success. |
|---|---|
| Return type: | bool |
Restores the document cursor anchor.
| Returns: | Method success. |
|---|---|
| Return type: | bool |
Returns the document cursor column.
| Returns: | Cursor column. |
|---|---|
| Return type: | int |
Returns the character before the cursor.
| Returns: | Previous cursor character. |
|---|---|
| Return type: | QString |
Returns the character after the cursor.
| Returns: | Next cursor character. |
|---|---|
| Return type: | QString |
Returns the document text under cursor.
| Returns: | Text under cursor. |
|---|---|
| Return type: | QString |
Returns the document word under cursor ( Using Qt legacy “QTextCursor.WordUnderCursor” ).
| Returns: | Word under cursor. |
|---|---|
| Return type: | QString |
Returns the document word under cursor.
| Returns: | Word under cursor. |
|---|---|
| Return type: | QString |
Returns the document partial word under cursor ( From word start to cursor position ).
| Returns: | Partial word under cursor. |
|---|---|
| Return type: | QString |
Returns if the document is modified.
| Returns: | Document modified state. |
|---|---|
| Return type: | bool |
Sets the document modified state.
| Parameters: | state (bool) – Modified state. |
|---|---|
| Returns: | Method success. |
| Return type: | bool |
Sets document with given content while providing undo capability.
| Parameters: | content (list) – Content to set. |
|---|---|
| Returns: | Method success. |
| Return type: | bool |
Deletes the document lines under cursor.
| Returns: | Method success. |
|---|---|
| Return type: | bool |
Duplicates the document lines under cursor.
| Returns: | Method success. |
|---|---|
| Return type: | bool |
Moves the document lines under cursor.
| Parameters: | direction – Move direction ( QTextCursor.Down / QTextCursor.Up ). ( QTextCursor.MoveOperation ) |
|---|---|
| Returns: | Method success. |
| Return type: | bool |
Moves up the document lines under cursor.
| Returns: | Method success. |
|---|---|
| Return type: | bool |
Moves down the document lines under cursor.
| Returns: | Method success. |
|---|---|
| Return type: | bool |
Searchs given pattern text in the document.
Usage:
>>> scriptEditor = Umbra.componentsManager.getInterface("factory.scriptEditor")
True
>>> codeEditor = scriptEditor.getCurrentEditor()
True
>>> codeEditor.search(searchPattern, caseSensitive=True, wholeWord=True, regularExpressions=True, backwardSearch=True, wrapAround=True)
True
| Parameters: | |
|---|---|
| Returns: | Method success. |
| Return type: | bool |
Searchs the next search pattern in the document.
| Returns: | Method success. |
|---|---|
| Return type: | bool |
Searchs the previous search pattern in the document.
| Returns: | Method success. |
|---|---|
| Return type: | bool |
Replaces current given pattern occurence in the document with the replacement pattern.
Usage:
>>> scriptEditor = Umbra.componentsManager.getInterface("factory.scriptEditor")
True
>>> codeEditor = scriptEditor.getCurrentEditor()
True
>>> codeEditor.replace(searchPattern, replacementPattern, caseSensitive=True, wholeWord=True, regularExpressions=True, backwardSearch=True, wrapAround=True)
True
| Parameters: | |
|---|---|
| Returns: | Method success. |
| Return type: | bool |
Warning
Initializing wrapAround keyword to True leads to infinite recursion loop if the search pattern and the replacementPattern are the same.
| Parameters: | |
|---|---|
| Returns: | Method success. |
| Return type: | bool |
Moves the text cursor to given line.
| Parameters: | line (int) – Line to go to. |
|---|---|
| Returns: | Method success. |
| Return type: | bool |
Moves the text cursor to given column.
| Parameters: | column (int) – Column to go to. |
|---|---|
| Returns: | Method success. |
| Return type: | bool |
Moves the text cursor to given position.
| Parameters: | position (int) – Position to go to. |
|---|---|
| Returns: | Method success. |
| Return type: | bool |
Toggles document white spaces display.
| Returns: | Method success. |
|---|---|
| Return type: | bool |