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

Homemade REPL (Read Print Eval Loop) More...

#include <PythonRepl.h>

Inheritance diagram for PythonRepl:
Collaboration diagram for PythonRepl:

Public Member Functions

 PythonRepl (PythonInterpreter *interpreter, QMainWindow *parent=nullptr)
 
void executeCode (const QString &pythonCode)
 
 PythonRepl (const PythonRepl &)=delete
 
 PythonRepl (PythonRepl &&)=delete
 
PythonReploperator= (const PythonRepl &)=delete
 
PythonReploperator= (PythonRepl &&)=delete
 
 ~PythonRepl () noexcept override
 

Protected Member Functions

QPlainTextEdit * codeEdit ()
 
QListWidget * outputDisplay ()
 
void reset ()
 
void importNeededPackages ()
 
void setupUI ()
 

Detailed Description

Homemade REPL (Read Print Eval Loop)

Definition at line 58 of file PythonRepl.h.

Constructor & Destructor Documentation

◆ PythonRepl() [1/3]

PythonRepl::PythonRepl ( PythonInterpreter interpreter,
QMainWindow *  parent = nullptr 
)
explicit

Definition at line 137 of file PythonRepl.cpp.

References importNeededPackages(), and setupUI().

◆ PythonRepl() [2/3]

PythonRepl::PythonRepl ( const PythonRepl )
delete

◆ PythonRepl() [3/3]

PythonRepl::PythonRepl ( PythonRepl &&  )
delete

◆ ~PythonRepl()

PythonRepl::~PythonRepl ( )
overridenoexcept

Definition at line 146 of file PythonRepl.cpp.

Member Function Documentation

◆ codeEdit()

QPlainTextEdit * PythonRepl::codeEdit ( )
protected

Definition at line 151 of file PythonRepl.cpp.

Referenced by KeyPressEater::eventFilter(), executeCode(), and setupUI().

◆ executeCode()

void PythonRepl::executeCode ( const QString &  pythonCode)

Our raw input contains the ">>> " and "... " and is a QString convert it to std::string while filtering out non needed chars

Definition at line 197 of file PythonRepl.cpp.

References codeEdit(), continuationDots(), PythonInterpreter::executeStatementWithState(), outputDisplay(), and replArrows().

Referenced by KeyPressEater::eventFilter(), and importNeededPackages().

◆ importNeededPackages()

void PythonRepl::importNeededPackages ( )
protected

Definition at line 190 of file PythonRepl.cpp.

References executeCode(), and replArrows().

Referenced by PythonRepl(), and reset().

◆ operator=() [1/2]

PythonRepl& PythonRepl::operator= ( const PythonRepl )
delete

◆ operator=() [2/2]

PythonRepl& PythonRepl::operator= ( PythonRepl &&  )
delete

◆ outputDisplay()

QListWidget * PythonRepl::outputDisplay ( )
protected

Definition at line 156 of file PythonRepl.cpp.

Referenced by executeCode().

◆ reset()

void PythonRepl::reset ( void  )
protected

Definition at line 183 of file PythonRepl.cpp.

References importNeededPackages().

Referenced by setupUI().

◆ setupUI()

void PythonRepl::setupUI ( )
protected

Definition at line 161 of file PythonRepl.cpp.

References codeEdit(), height, QTCOMPAT_FONTMETRICS_WIDTH, qtCompatSetTabStopWidth(), reset(), and width.

Referenced by PythonRepl().


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