4.49. umbra.ui.widgets.codeEditor_QPlainTextEdit

codeEditor_QPlainTextEdit.py

Platform:
Windows, Linux, Mac Os X.
Description:
This module defines the LinesNumbers_QWidget and CodeEditor_QPlainTextEdit classes.
Those objects provides the basics building blocks of a code editor widget.
Others:
Portions of the code from codeeditor.py by Roberto Alsina: http://lateral.netmanagers.com.ar/weblog/posts/BB832.html, KhtEditor.py by Benoit Hervier: http://khertan.net/khteditor, Ninja IDE: http://ninja-ide.org/ and Prymatex: https://github.com/D3f0/prymatex/

4.49.1. Module Attributes

umbra.ui.widgets.codeEditor_QPlainTextEdit.LOGGER

4.49.2. Classes

class umbra.ui.widgets.codeEditor_QPlainTextEdit.LinesNumbers_QWidget(parent, *args, **kwargs)[source]

Bases: PyQt4.QtGui.QWidget

This class is a QWidget subclass providing a lines numbers widget.

Parameters:
  • parent – Object parent. ( QObject )
  • *args – Arguments. ( * )
  • **kwargs – Keywords arguments. ( ** )
editor[source]

This method is the property for self.__editor attribute.

Returns:self.__editor. ( QWidget )
margin[source]

This method is the property for self.__margin attribute.

Returns:self.__margin. ( Integer )
separatorWidth[source]

This method is the property for self.__separatorWidth attribute.

Returns:self.__separatorWidth. ( Integer )
backgroundColor[source]

This method is the property for self.__backgroundColor attribute.

Returns:self.__backgroundColor. ( QColor )
color[source]

This method is the property for self.__color attribute.

Returns:self.__color. ( QColor )
separatorColor[source]

This method is the property for self.__separatorColor attribute.

Returns:self.__separatorColor. ( QColor )
sizeHint()[source]

This method reimplements the QWidget.sizeHint() method.

Returns:Size hint. ( QSize )
paintEvent(event)[source]

This method reimplements the QWidget.paintEvent() method.

Parameters:event – Event. ( QEvent )
getWidth()[source]

This method returns the Widget target width.

Returns:Widget target width. ( Integer )
setEditorViewportMargins(newBlocksCount)[source]

This method sets the editor viewport margins.

Parameters:newBlocksCount – Updated editor blocks count. ( Integer )
Returns:Method success. ( Boolean )
updateRectangle(rectangle, scrollY)[source]

This method updates the given widget rectangle.

Parameters:
  • rectangle – Rectangle to update. ( QRect )
  • scrollY – Amount of pixels the viewport was scrolled. ( Integer )
Returns:

Method success. ( Boolean )

updateGeometry()[source]

This method updates the widget geometry.

Returns:Method success. ( Boolean )
class umbra.ui.widgets.codeEditor_QPlainTextEdit.CodeEditor_QPlainTextEdit(parent=None, indentMarker='t', indentWidth=4, commentMarker='#', *args, **kwargs)[source]

Bases: umbra.ui.widgets.basic_QPlainTextEdit.Basic_QPlainTextEdit

This class provides a code editor base class.

Parameters:
  • parent – Widget parent. ( QObject )
  • indentMarker – Indentation marker. ( String )
  • indentWidth – Indentation spaces count. ( Integer )
  • commentMarker – Comment marker. ( String )
  • *args – Arguments. ( * )
  • **kwargs – Keywords arguments. ( ** )
indentMarker[source]

This method is the property for self.__indentMarker attribute.

Returns:self.__indentMarker. ( String )
indentWidth[source]

This method is the property for self.__indentWidth attribute.

Returns:self.__indentWidth. ( Integer )
commentMarker[source]

This method is the property for self.__commentMarker attribute.

Returns:self.__commentMarker. ( String )
marginArea_LinesNumbers_widget[source]

This method is the property for self.__marginArea_LinesNumbers_widget attribute.

Returns:self.__marginArea_LinesNumbers_widget. ( LinesNumbers_QWidget )
highlighter[source]

This method is the property for self.__highlighter attribute.

Returns:self.__highlighter. ( QSyntaxHighlighter )
completer[source]

This method is the property for self.__completer attribute.

Returns:self.__completer. ( QCompleter )
preInputAccelerators[source]

This method is the property for self.__preInputAccelerators attribute.

Returns:self.__preInputAccelerators. ( Tuple / List )
postInputAccelerators[source]

This method is the property for self.__postInputAccelerators attribute.

Returns:self.__postInputAccelerators. ( Tuple / List )
visualAccelerators[source]

This method is the property for self.__visualAccelerators attribute.

Returns:self.__visualAccelerators. ( Tuple / List )
resizeEvent(event)[source]

This method reimplements the Basic_QPlainTextEdit.resizeEvent() method.

Parameters:event – Event. ( QEvent )
keyPressEvent(event)[source]

This method reimplements the Basic_QPlainTextEdit.keyPressEvent() method.

Parameters:event – Event. ( QEvent )
setHighlighter(highlighter)[source]

This method sets given highlighter as the current document highlighter.

Parameters:highlighter – Highlighter. ( QSyntaxHighlighter )
Returns:Method success. ( Boolean )
removeHighlighter()[source]

This method removes current highlighter.

Returns:Method success. ( Boolean )
setCompleter(completer)[source]

This method sets given completer as the current completer.

Parameters:completer – Completer. ( QCompleter )
Returns:Method success. ( Boolean )
removeCompleter()[source]

This method removes current completer.

Returns:Method success. ( Boolean )
getMatchingSymbolsPairs(cursor, openingSymbol, closingSymbol, backward=False)[source]

This method returns the cursor for matching given symbols pairs.

Parameters:
  • cursor – Cursor to match from. ( QTextCursor )
  • openingSymbol – Opening symbol. ( String )
  • closingSymbol – Closing symbol to match. ( String )
Returns:

Matching cursor. ( QTextCursor )

indent()[source]

This method indents the document text under cursor.

Returns:Method success. ( Boolean )
unindent()[source]

This method unindents the document text under cursor.

Returns:Method success. ( Boolean )
toggleComments()[source]

This method toggles comments on the document selected lines.

Returns:Method success. ( Boolean )
removeTrailingWhiteSpaces()[source]

This method removes document trailing white spaces.

Returns:Method success. ( Boolean )
convertIndentationToTabs()[source]

This method converts document indentation to tabs.

Returns:Method success. ( Boolean )
convertIndentationToSpaces()[source]

This method converts document indentation to spaces.

Returns:Method success. ( Boolean )

Table Of Contents

Previous topic

4.48. umbra.ui.widgets.basic_QPlainTextEdit

Next topic

4.50. umbra.ui.widgets.delayed_QSplashScreen

This Page