pyqt_reactive.widgets.editors.simple_code_editor

Simple Code Editor Service for PyQt GUI.

Provides modular text editing with QScintilla (default) or external program launch. No threading complications - keeps it simple and direct.

Classes

CodeEditorDialog(parent, initial_content, title)

Fallback Qt native code editor dialog using QTextEdit.

QScintillaCodeEditorDialog(parent, ...[, ...])

Professional code editor dialog using QScintilla.

SimpleCodeEditorService(parent_widget)

Simple, modular code editor service.

class pyqt_reactive.widgets.editors.simple_code_editor.SimpleCodeEditorService(parent_widget)[source]

Simple, modular code editor service.

Uses QScintilla for professional Python editing (default) or external programs. Falls back to QTextEdit if QScintilla is not available. No threading - keeps it simple and reliable.

__init__(parent_widget)[source]

Initialize the code editor service.

Parameters:

parent_widget – Parent widget for dialogs

edit_code(initial_content: str, title: str = 'Edit Code', callback: Callable[[str], None] | None = None, use_external: bool = False, code_type: str = None, code_data: dict = None) None[source]

Edit code using either Qt native editor or external program.

Parameters:
  • initial_content – Initial code content

  • title – Editor window title

  • callback – Callback function called with edited content

  • use_external – If True, use external editor; if False, use Qt native

  • code_type – Type of code being edited (‘orchestrator’, ‘pipeline’, ‘function’, None)

  • code_data – Data needed to regenerate code (for clean mode toggle)

class pyqt_reactive.widgets.editors.simple_code_editor.QScintillaCodeEditorDialog(parent, initial_content: str, title: str, callback: Callable[[str], None] | None = None, code_type: str = None, code_data: dict = None, initial_line: int = None)[source]

Professional code editor dialog using QScintilla.

Provides Python syntax highlighting, code folding, line numbers, and more. Integrates with ColorScheme for consistent theming. Supports clean mode toggle for orchestrator/pipeline/function code.

__init__(parent, initial_content: str, title: str, callback: Callable[[str], None] | None = None, code_type: str = None, code_data: dict = None, initial_line: int = None)[source]

Initialize code editor dialog.

Parameters:
  • parent – Parent widget

  • initial_content – Initial code content

  • title – Window title

  • callback – Callback function called with edited content on successful save

  • code_type – Type of code being edited (‘orchestrator’, ‘pipeline’, ‘function’, None)

  • code_data – Data needed to regenerate code (for clean mode toggle)

  • initial_line – Line number to position cursor at (1-based, None for start)

eventFilter(obj, event)[source]

Filter events to trigger Jedi autocomplete on ‘.’

get_content() str[source]

Get the edited content.

class pyqt_reactive.widgets.editors.simple_code_editor.CodeEditorDialog(parent, initial_content: str, title: str)[source]

Fallback Qt native code editor dialog using QTextEdit.

Used when QScintilla is not available.

__init__(parent, initial_content: str, title: str)[source]
get_content() str[source]

Get the edited content.