a smart pointer that stores a PyObject pointer and that handles reference counting automatically More...
#include <PythonQtObjectPtr.h>
object
to the module
as a variable with name
(it can be removed via clearVariable)
name
of the module
, returns an invalid QVariant on error
a smart pointer that stores a PyObject pointer and that handles reference counting automatically
Definition at line 56 of file PythonQtObjectPtr.h.
◆ PythonQtObjectPtr() [1/6] PythonQtObjectPtr::PythonQtObjectPtr ( ) inline ◆ PythonQtObjectPtr() [2/6] ◆ PythonQtObjectPtr() [3/6]rvalue copy constructor, does not need any incref/decref.
Definition at line 67 of file PythonQtObjectPtr.h.
68:_object(
p.takeObject()) {
69 }
◆ PythonQtObjectPtr() [4/6]rvalue copy constructor, does not need any incref/decref.
◆ PythonQtObjectPtr() [5/6] PythonQtObjectPtr::PythonQtObjectPtr ( const QVariant & variant ) inlineIf the given variant holds a PythonQtObjectPtr, extract the value from it and hold onto the reference. This results in an increment of the reference count.
Definition at line 75 of file PythonQtObjectPtr.h.
75 :_object(nullptr) {
77 }
bool fromVariant(const QVariant &variant)
If the given variant holds a PythonQtObjectPtr, extract the value from it and hold onto the reference...
References PythonQtConvertPairToPython().
◆ PythonQtObjectPtr() [6/6] PythonQtObjectPtr::PythonQtObjectPtr ( PyObject * o ) ◆ ~PythonQtObjectPtr() PythonQtObjectPtr::~PythonQtObjectPtr ( ) ◆ addObject()add the given object
to the module
as a variable with name
(it can be removed via clearVariable)
add the given variable to the module
◆ call() [1/2]call the given python object (in the scope of the current object), returns the result converted to a QVariant
◆ call() [2/2]call the contained python object directly, returns the result converted to a QVariant
◆ evalCode()evaluates the given code and returns the result value (use Py_Compile etc. to create pycode from string) If pycode is NULL, a python error is printed.
◆ evalFile()evaluates the given code in the context
◆ evalScript()evaluates the given script code in the context of this object and returns the result value
◆ fromVariant()If the given variant holds a PythonQtObjectPtr, extract the value from it and hold onto the reference. This results in an increment of the reference count.
◆ getVariable()get the variable with the name
of the module
, returns an invalid QVariant on error
rvalue assignment operator that steals the reference from p
◆ operator==() [1/2] ◆ operator==() [2/2] ◆ removeVariable()remove the given variable
◆ setNewRef()sets the object and passes the ownership (stealing the reference, in Python slang)
◆ setObject() ◆ takeObject() PyObject * PythonQtObjectPtr::takeObject ( ) inlinetakes the object from the pointer, leaving the pointer empty. the caller has to take care about the decref of the taken object!
Definition at line 182 of file PythonQtObjectPtr.h.
182 {
184 _object = nullptr;
186 }
References PythonQtConvertPairToPython().
◆ toLocalVariant() QVariant PythonQtObjectPtr::toLocalVariant ( )Returns a PythonQtObjectPtr as a QVariant. Only use this when you know that the variant is only used locally and not stored outside of the current GIL scope.
◆ toVariant()The documentation for this class was generated from the following file:
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4