ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
KeyPressEater Class Referencefinal

Class used by the REPL to handle key presses. More...

#include <PythonRepl.h>

Inheritance diagram for KeyPressEater:
Collaboration diagram for KeyPressEater:

Public Member Functions

 KeyPressEater (PythonRepl *repl, QObject *parent=nullptr)
 

Protected Member Functions

bool eventFilter (QObject *obj, QEvent *event) override
 

Detailed Description

Class used by the REPL to handle key presses.

Definition at line 44 of file PythonRepl.h.

Constructor & Destructor Documentation

◆ KeyPressEater()

KeyPressEater::KeyPressEater ( PythonRepl repl,
QObject *  parent = nullptr 
)
explicit

Definition at line 135 of file PythonRepl.cpp.

Member Function Documentation

◆ eventFilter()

bool KeyPressEater::eventFilter ( QObject *  obj,
QEvent *  event 
)
overrideprotected

Handles key presses on the REPL window.

It does a few things:

  • maps up/down arrow keys to history navigation
  • blocks movements/deletions/edits of the cursor when it would erase the REPL special characters

Definition at line 33 of file PythonRepl.cpp.

References History::add(), PythonRepl::codeEdit(), continuationDots(), History::empty(), event, PythonRepl::executeCode(), PythonInterpreter::isExecuting(), History::newer(), History::older(), and replArrows().


The documentation for this class was generated from the following files: