Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
qSlicerWebPythonProxy Class Reference

#include <Base/QTGUI/qSlicerWebPythonProxy.h>

Inheritance diagram for qSlicerWebPythonProxy:
Collaboration diagram for qSlicerWebPythonProxy:

Public Types

enum  EvalPythonMode { EvalInput = 0 , FileInput , SingleInput }
 
typedef QObject Superclass
 

Properties

bool verbose
 

Public Slots

QString evalPython (const QString &python, int mode=FileInput)
 

Public Member Functions

 Q_ENUMS (EvalPythonMode)
 
 qSlicerWebPythonProxy (QObject *parent=nullptr)
 Constructor.
 
void setVerbose (bool value)
 
bool verbose () const
 Enabled detailed logging during Python evaluation.
 
virtual ~qSlicerWebPythonProxy ()
 

Protected Member Functions

 qSlicerWebPythonProxy (qSlicerWebPythonProxyPrivate *pimpl)
 

Protected Attributes

QScopedPointer< qSlicerWebPythonProxyPrivate > d_ptr
 

Detailed Description

Definition at line 32 of file qSlicerWebPythonProxy.h.

Member Typedef Documentation

◆ Superclass

Definition at line 39 of file qSlicerWebPythonProxy.h.

Member Enumeration Documentation

◆ EvalPythonMode

This enum maps to ctkAbstractPythonManager execution modes Py_eval_input, Py_file_input and Py_single_input.

See also
https://docs.python.org/3/c-api/veryhigh.html#Py_eval_input
https://docs.python.org/3/c-api/veryhigh.html#Py_file_input
https://docs.python.org/3/c-api/veryhigh.html#Py_single_input
ctkAbstractPythonManager::ExecuteStringMode
Enumerator
EvalInput 
FileInput 
SingleInput 

Definition at line 53 of file qSlicerWebPythonProxy.h.

Property Documentation

◆ verbose

bool qSlicerWebPythonProxy::verbose
readwrite

Definition at line 36 of file qSlicerWebPythonProxy.h.

Constructor & Destructor Documentation

◆ qSlicerWebPythonProxy() [1/2]

qSlicerWebPythonProxy::qSlicerWebPythonProxy ( QObject * parent = nullptr)
explicit

Constructor.

◆ ~qSlicerWebPythonProxy()

virtual qSlicerWebPythonProxy::~qSlicerWebPythonProxy ( )
virtual

◆ qSlicerWebPythonProxy() [2/2]

qSlicerWebPythonProxy::qSlicerWebPythonProxy ( qSlicerWebPythonProxyPrivate * pimpl)
protected

Member Function Documentation

◆ evalPython

QString qSlicerWebPythonProxy::evalPython ( const QString & python,
int mode = FileInput )
slot

Convenient function to execute python code from the JavaScript (when an instance of this class is registered with the WebChannel).

Internally Slicer's python manager is used to execute the passed code, and the resulting QVariant is returned as a string.

As a precaution, the user is prompted to allow or disallow running python code from web pages.

See also
qSlicerWebWidget::initializeWebEngineProfile

◆ Q_ENUMS()

qSlicerWebPythonProxy::Q_ENUMS ( EvalPythonMode )

◆ setVerbose()

void qSlicerWebPythonProxy::setVerbose ( bool value)

◆ verbose()

bool qSlicerWebPythonProxy::verbose ( ) const

Enabled detailed logging during Python evaluation.

Member Data Documentation

◆ d_ptr

QScopedPointer<qSlicerWebPythonProxyPrivate> qSlicerWebPythonProxy::d_ptr
protected

Definition at line 83 of file qSlicerWebPythonProxy.h.


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