TreeFrogFramework  2.8
Public Member Functions | Friends | List of all members
TJSModule Class Reference

#include <tjsmodule.h>

Inheritance diagram for TJSModule:
Inheritance graph
[legend]
Collaboration diagram for TJSModule:
Collaboration graph
[legend]

Public Member Functions

 TJSModule (QObject *parent=nullptr)
 
virtual ~TJSModule ()
 
QJSValue evaluate (const QString &program, const QString &fileName=QString(), int lineNumber=1)
 
QJSValue call (const QString &func, const QJSValue &arg)
 
QJSValue call (const QString &func, const QJSValueList &args=QJSValueList())
 
TJSInstance callAsConstructor (const QString &constructorName, const QJSValue &arg)
 
TJSInstance callAsConstructor (const QString &constructorName, const QJSValueList &args=QJSValueList())
 
QString modulePath () const
 
QJSValue import (const QString &moduleName)
 
QJSValue import (const QString &defaultMember, const QString &moduleName)
 

Friends

class TJSLoader
 
class TReactComponent
 

Detailed Description

The TJSModule class represents a module for evaluating JavaScript code.

See also
https://doc.qt.io/qt-6/qjsengine.html

Constructor & Destructor Documentation

◆ TJSModule()

TJSModule::TJSModule ( QObject *  parent = nullptr)

◆ ~TJSModule()

TJSModule::~TJSModule ( )
virtual

Member Function Documentation

◆ call() [1/2]

QJSValue TJSModule::call ( const QString &  func,
const QJSValue &  arg 
)

◆ call() [2/2]

QJSValue TJSModule::call ( const QString &  func,
const QJSValueList &  args = QJSValueList() 
)

◆ callAsConstructor() [1/2]

TJSInstance TJSModule::callAsConstructor ( const QString &  constructorName,
const QJSValue &  arg 
)

◆ callAsConstructor() [2/2]

TJSInstance TJSModule::callAsConstructor ( const QString &  constructorName,
const QJSValueList &  args = QJSValueList() 
)

◆ evaluate()

QJSValue TJSModule::evaluate ( const QString &  program,
const QString &  fileName = QString(),
int  lineNumber = 1 
)

◆ import() [1/2]

QJSValue TJSModule::import ( const QString &  defaultMember,
const QString &  moduleName 
)

◆ import() [2/2]

QJSValue TJSModule::import ( const QString &  moduleName)

◆ modulePath()

QString TJSModule::modulePath ( ) const
inline

Friends And Related Function Documentation

◆ TJSLoader

friend class TJSLoader
friend

◆ TReactComponent

friend class TReactComponent
friend

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