A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mevislab.github.io/pythonqt/classPythonQtObjectPtr.html below:

PythonQt: PythonQtObjectPtr Class Reference

a smart pointer that stores a PyObject pointer and that handles reference counting automatically More...

#include <PythonQtObjectPtr.h>

  PythonQtObjectPtr ()     PythonQtObjectPtr (const PythonQtObjectPtr &p)     PythonQtObjectPtr (PythonQtObjectPtr &&p) noexcept   rvalue copy constructor, does not need any incref/decref.
    PythonQtObjectPtr (PythonQtSafeObjectPtr &&p)   rvalue copy constructor, does not need any incref/decref.
    PythonQtObjectPtr (const QVariant &variant)   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.
    PythonQtObjectPtr (PyObject *o)     ~PythonQtObjectPtr ()   bool  fromVariant (const QVariant &variant)   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.
  QVariant  toVariant ()   Returns a PythonQtSafeObjectPtr as a QVariant. It does not return a PythonQtObjectPtr, because that would be unsafe regarding the GIL.
  QVariant  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.
  PythonQtObjectPtroperator= (const PythonQtObjectPtr &p)   PythonQtObjectPtroperator= (PythonQtObjectPtr &&p) noexcept   rvalue assignment operator that steals the reference from p
  PythonQtObjectPtroperator= (PythonQtSafeObjectPtr &&p)   rvalue assignment operator that steals the reference from p
  PythonQtObjectPtroperator= (PyObject *o)   PythonQtObjectPtroperator= (const QVariant &variant)   bool  operator== (const PythonQtObjectPtr &p) const   bool  operator!= (const PythonQtObjectPtr &p) const   bool  operator== (PyObject *p) const   bool  operator!= (PyObject *p) const   bool  isNull () const   PyObjectoperator-> () const   PyObjectoperator* () const     operator PyObject * () const   void  setNewRef (PyObject *o)   sets the object and passes the ownership (stealing the reference, in Python slang)
  PyObjectobject () const   QVariant  evalScript (const QString &script, int start=Py_file_input)   evaluates the given script code in the context of this object and returns the result value
  QVariant  evalCode (PyObject *pycode)   void  evalFile (const QString &filename)   evaluates the given code in the context
  void  addObject (const QString &name, QObject *object)   add the given object to the module as a variable with name (it can be removed via clearVariable)
  void  addVariable (const QString &name, const QVariant &v)   add the given variable to the module
  void  removeVariable (const QString &name)   remove the given variable
  QVariant  getVariable (const QString &name)   get the variable with the name of the module, returns an invalid QVariant on error
  QVariant  call (const QString &callable, const QVariantList &args=QVariantList(), const QVariantMap &kwargs=QVariantMap())   call the given python object (in the scope of the current object), returns the result converted to a QVariant
  QVariant  call (const QVariantList &args=QVariantList(), const QVariantMap &kwargs=QVariantMap())   call the contained python object directly, returns the result converted to a QVariant
  PyObjecttakeObject ()  

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 QVariantvariant ) inline

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.

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 ( PyObjecto ) ◆ ~PythonQtObjectPtr() PythonQtObjectPtr::~PythonQtObjectPtr ( ) ◆ addObject()

add the given object to the module as a variable with name (it can be removed via clearVariable)

◆ addVariable()

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

◆ isNull() bool PythonQtObjectPtr::isNull ( ) const inline ◆ object() PyObject * PythonQtObjectPtr::object ( ) const inline ◆ operator PyObject *() PythonQtObjectPtr::operator PyObject * ( ) const inline ◆ operator!=() [1/2] ◆ operator!=() [2/2] ◆ operator*() PyObject & PythonQtObjectPtr::operator* ( ) const inline ◆ operator->() PyObject * PythonQtObjectPtr::operator-> ( ) const inline ◆ operator=() [1/5] ◆ operator=() [2/5] ◆ operator=() [3/5] ◆ operator=() [4/5] ◆ operator=() [5/5]

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 ( ) inline

takes 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