Kross::Object
#include <object.h>

Public Types | |
typedef QExplicitlySharedDataPointer< Object > | Ptr |
Public Member Functions | |
Object () | |
Object (const Object &other) | |
virtual | ~Object () |
virtual QVariant | callMethod (const QString &name, const QVariantList &args=QVariantList()) |
virtual QStringList | methodNames () |
virtual void | virtual_hook (int id, void *ptr) |
![]() | |
QSharedData (const QSharedData &) | |
![]() | |
ErrorInterface () | |
void | clearError () |
long | errorLineNo () const |
const QString | errorMessage () const |
const QString | errorTrace () const |
bool | hadError () const |
void | setError (const QString &errormessage, const QString &tracemessage=QString(), long lineno=-1) |
void | setError (ErrorInterface *error) |
Detailed Description
The class Object does provide us scripting objects like class instances to the C++ world.
This class implements reference counting for shared objects. So, no need to take care of freeing objects.
Sample that does use the Object functionality to pass a Javascript classinstance to C++ code which then calls a method the classinstance provides.
- Since
- 4.1
Member Typedef Documentation
◆ Ptr
Constructor & Destructor Documentation
◆ Object() [1/2]
|
explicit |
Default constructor.
Definition at line 29 of file object.cpp.
◆ Object() [2/2]
Object::Object | ( | const Object & | other | ) |
Copy constructor.
Definition at line 36 of file object.cpp.
◆ ~Object()
|
virtual |
Destructor.
Definition at line 44 of file object.cpp.
Member Function Documentation
◆ callMethod()
|
virtual |
Pass a call to the object and evaluated it.
- Parameters
-
name Each call has a name that says what should be called. args The optional list of arguments passed to the call.
- Returns
- The call-result as QVariant.
Definition at line 49 of file object.cpp.
◆ methodNames()
|
virtual |
Return a list of supported callable objects.
- Returns
- List of supported calls.
Definition at line 56 of file object.cpp.
◆ virtual_hook()
|
virtual |
used virtual hook to easier the job to keep binary compatibility.
Definition at line 61 of file object.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Oct 1 2023 03:59:34 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.