GeezerVison is showing mevislab.github.io — PythonQt: PythonQtPrivate Class Reference
PythonQtPrivate Class Reference
internal PythonQt details
More...
#include <PythonQt.h>
Inheritance diagram for PythonQtPrivate:
Public Member Functions |
| | PythonQtPrivate () |
| | ~PythonQtPrivate () override |
| void | setTaskDoneCallback (const PythonQtObjectPtr &callable) |
| PythonQtObjectPtr | checkAndRunCoroutine (const PythonQtObjectPtr &object) |
| | Runs the given coroutine (via asyncio), returns a scheduled task if it object is a coroutine.
|
| PythonQtObjectPtr | createAsyncioFuture () |
| | Creates a new asyncio.Future object.
|
| const QStringList & | sharedLibrarySuffixes () |
| | get the suffixes that are used for shared libraries
|
| bool | isPythonQtObjectPtrMetaId (int id) |
| | returns if the id is the id for PythonQtObjectPtr
|
| bool | isPythonQtSafeObjectPtrMetaId (int id) |
| | returns if the id is the id for PythonQtSafeObjectPtr
|
| bool | isPythonQtAnyObjectPtrMetaId (int id) |
| | returns if the id is either PythonQtObjectPtr or PythonQtSafeObjectPtr
|
| void | addWrapperPointer (void *obj, PythonQtInstanceWrapper *wrapper) |
| | add the wrapper pointer (for reuse if the same obj appears while wrapper still exists)
|
| void | removeWrapperPointer (void *obj) |
| | remove the wrapper ptr again
|
| void | shellClassDeleted (void *shellClass) |
| | called by destructor of shells to allow invalidation of the Python wrapper
|
| void * | unwrapForeignWrapper (const QByteArray &classname, PyObject *obj) |
| | try to unwrap the given object to a C++ pointer using the foreign wrapper factories
|
| bool | addParentClass (const char *typeName, const char *parentTypeName, int upcastingOffset) |
| | add parent class relation
|
| void | addPolymorphicHandler (const char *typeName, PythonQtPolymorphicHandlerCB *cb) |
| | add a handler for polymorphic downcasting
|
| PythonQtClassInfo * | lookupClassInfoAndCreateIfNotPresent (const char *typeName) |
| | lookup existing classinfo and return new if not yet present
|
| bool | addSignalHandler (QObject *sender, const char *signal, PyObject *callable) |
| | add a signal handler
|
| bool | removeSignalHandler (QObject *sender, const char *signal, PyObject *callable=nullptr) |
| | remove a signal handler for given callable (or all callables on that signal if callable is NULL)
|
| void | removeSignalReceiver (PythonQtSignalReceiver *receiver) |
| | called when a signal receiver is deleted to remove it from the hash map
|
| PyObject * | wrapQObject (QObject *obj) |
| | wrap the given QObject into a Python object (or return existing wrapper!)
|
| PyObject * | wrapPtr (void *ptr, const QByteArray &name, bool passOwnership=false) |
| void | registerClass (const QMetaObject *metaobject, const char *package=nullptr, PythonQtQObjectCreatorFunctionCB *wrapperCreator=nullptr, PythonQtShellSetInstanceWrapperCB *shell=nullptr, PyObject *module=nullptr, int typeSlots=0) |
| | registers a QObject derived class to PythonQt (this is implicitly called by addObject as well)
|
| void | registerCPPClass (const char *typeName, const char *parentTypeName=nullptr, const char *package=nullptr, PythonQtQObjectCreatorFunctionCB *wrapperCreator=nullptr, PythonQtShellSetInstanceWrapperCB *shell=nullptr, PyObject *module=nullptr, int typeSlots=0) |
| void | registerGlobalNamespace (const char *typeName, const char *package, PythonQtQObjectCreatorFunctionCB *wrapperCreator, const QMetaObject &metaObject, PyObject *module=nullptr) |
| | Same as above, but all enums of the created wrapper will also be added to the given package and to the "Qt" package.
|
| void | registerQObjectClassNames (const QStringList &names) |
| void | addDecorators (QObject *o, int decoTypes) |
| | add a decorator object
|
| PythonQtClassWrapper * | createNewPythonQtClassWrapper (PythonQtClassInfo *info, PyObject *module, const QByteArray &pythonClassName) |
| | helper method that creates a PythonQtClassWrapper object (returns a new reference)
|
| PythonQtInstanceWrapper * | createNewPythonQtInstanceWrapper (QObject *obj, PythonQtClassInfo *info, void *wrappedPtr=nullptr) |
| | helper method that creates a PythonQtInstanceWrapper object and registers it in the object map
|
| PythonQtClassInfo * | getClassInfo (const QMetaObject *meta) |
| | get the class info for a meta object (if available)
|
| PythonQtClassInfo * | getClassInfo (const QByteArray &className) |
| | get the class info for a meta object (if available)
|
| void | registerLazyClass (const QByteArray &name, const QByteArray &moduleToImport) |
| PythonQtObjectPtr | createModule (const QString &name, PyObject *pycode) |
| | creates the new module from the given pycode
|
| PythonQtClassInfo * | currentClassInfoForClassWrapperCreation () |
| | get the current class info (for the next PythonQtClassWrapper that is created) and reset it to NULL again
|
| void | handleVirtualOverloadReturnError (const char *signature, const PythonQtMethodInfo *methodInfo, PyObject *result) |
| | called by virtual overloads when a python return value can not be converted to the required Qt type
|
| PythonQtObjectPtr | pythonQtModule () const |
| | get access to the PythonQt module
|
| PythonQt::ProfilingCB * | profilingCB () const |
| | returns the profiling callback, which may be NULL
|
| QString | getSignature (PyObject *object) |
| | determines the signature of the given callable object (similar as pydoc)
|
| bool | isMethodDescriptor (PyObject *object) const |
| | returns true if the object is a method descriptor (same as inspect.ismethoddescriptor() in inspect.py)
|
| const QMetaObject * | getDynamicMetaObject (PythonQtInstanceWrapper *wrapper, const QMetaObject *prototypeMetaObject) |
| | get the dynamic meta object for the given wrapper. It will contain the signals/slots that have been added in Python
|
| const QMetaObject * | setupDynamicMetaObjectChain (PythonQtClassWrapper *type, const QMetaObject *prototypeMetaObject) |
| | recursively creates the dynamic meta object chain down to the Qt class wrapper.
|
| const QMetaObject * | buildDynamicMetaObject (PythonQtClassWrapper *type, const QMetaObject *prototypeMetaObject) |
| | builds and returns the dynamic meta object for the given type, derived from prototypeMetaObject.
|
| int | handleMetaCall (QObject *object, PythonQtInstanceWrapper *wrapper, QMetaObject::Call call, int id, void **args) |
| | redirected from shell classes, tries to call the given meta call on the Python wrapper.
|
| void | callMethodInPython (QMetaMethod &method, PythonQtInstanceWrapper *wrapper, void **args) |
| | calls the given method on Python function with same name.
|
Static Public Member Functions |
| static PyObject * | wrapMemoryAsBuffer (const void *data, Py_ssize_t size) |
| | create a read-only buffer object from the given memory
|
| static PyObject * | wrapMemoryAsBuffer (void *data, Py_ssize_t size) |
| | create a read-write buffer object from the given memory
|
| static PyObject * | createEnumValueInstance (PyObject *enumType, unsigned int enumValue) |
| | create a new instance of the given enum type with given value (returns a new reference)
|
| static PyObject * | createNewPythonQtEnumWrapper (const char *enumName, PyObject *parentObject) |
| | helper that creates a new int derived class that represents the enum of the given name (returns a new reference)
|
| static PyObject * | dummyTuple () |
| | the dummy tuple (which is empty and may be used to detected that a wrapper is called from internal wrapper creation
|
Detailed Description
Member Enumeration Documentation
◆ DecoratorTypes
| Enumerator |
|---|
| StaticDecorator | |
| ConstructorDecorator | |
| DestructorDecorator | |
| InstanceDecorator | |
| AllDecorators | |
Definition at line 678 of file PythonQt.h.
Constructor & Destructor Documentation
◆ PythonQtPrivate()
| PythonQtPrivate::PythonQtPrivate |
( |
| ) |
|
◆ ~PythonQtPrivate()
| PythonQtPrivate::~PythonQtPrivate |
( |
| ) |
|
|
override |
Member Function Documentation
◆ addDecorators()
| void PythonQtPrivate::addDecorators |
( |
QObject * | o, |
|
|
int | decoTypes ) |
◆ addParentClass()
| bool PythonQtPrivate::addParentClass |
( |
const char * | typeName, |
|
|
const char * | parentTypeName, |
|
|
int | upcastingOffset ) |
add parent class relation
◆ addPolymorphicHandler()
add a handler for polymorphic downcasting
◆ addSignalHandler()
| bool PythonQtPrivate::addSignalHandler |
( |
QObject * | sender, |
|
|
const char * | signal, |
|
|
PyObject * | callable ) |
◆ addWrapperPointer()
add the wrapper pointer (for reuse if the same obj appears while wrapper still exists)
◆ buildDynamicMetaObject()
| const QMetaObject * PythonQtPrivate::buildDynamicMetaObject |
( |
PythonQtClassWrapper * | type, |
|
|
const QMetaObject * | prototypeMetaObject ) |
builds and returns the dynamic meta object for the given type, derived from prototypeMetaObject.
◆ callMethodInPython()
calls the given method on Python function with same name.
◆ checkAndRunCoroutine()
Runs the given coroutine (via asyncio), returns a scheduled task if it object is a coroutine.
◆ createAsyncioFuture()
Creates a new asyncio.Future object.
◆ createEnumValueInstance()
| PyObject * PythonQtPrivate::createEnumValueInstance |
( |
PyObject * | enumType, |
|
|
unsigned int | enumValue ) |
|
static |
create a new instance of the given enum type with given value (returns a new reference)
◆ createModule()
creates the new module from the given pycode
◆ createNewPythonQtClassWrapper()
◆ createNewPythonQtEnumWrapper()
| PyObject * PythonQtPrivate::createNewPythonQtEnumWrapper |
( |
const char * | enumName, |
|
|
PyObject * | parentObject ) |
|
static |
helper that creates a new int derived class that represents the enum of the given name (returns a new reference)
◆ createNewPythonQtInstanceWrapper()
◆ currentClassInfoForClassWrapperCreation()
get the current class info (for the next PythonQtClassWrapper that is created) and reset it to NULL again
◆ dummyTuple()
| PyObject * PythonQtPrivate::dummyTuple |
( |
| ) |
|
|
static |
the dummy tuple (which is empty and may be used to detected that a wrapper is called from internal wrapper creation
◆ getClassInfo() [1/2]
get the class info for a meta object (if available)
◆ getClassInfo() [2/2]
◆ getDynamicMetaObject()
| const QMetaObject * PythonQtPrivate::getDynamicMetaObject |
( |
PythonQtInstanceWrapper * | wrapper, |
|
|
const QMetaObject * | prototypeMetaObject ) |
get the dynamic meta object for the given wrapper. It will contain the signals/slots that have been added in Python
◆ getSignature()
| QString PythonQtPrivate::getSignature |
( |
PyObject * | object | ) |
|
determines the signature of the given callable object (similar as pydoc)
◆ handleMetaCall()
| int PythonQtPrivate::handleMetaCall |
( |
QObject * | object, |
|
|
PythonQtInstanceWrapper * | wrapper, |
|
|
QMetaObject::Call | call, |
|
|
int | id, |
|
|
void ** | args ) |
redirected from shell classes, tries to call the given meta call on the Python wrapper.
◆ handleVirtualOverloadReturnError()
| void PythonQtPrivate::handleVirtualOverloadReturnError |
( |
const char * | signature, |
|
|
const PythonQtMethodInfo * | methodInfo, |
|
|
PyObject * | result ) |
called by virtual overloads when a python return value can not be converted to the required Qt type
◆ isMethodDescriptor()
| bool PythonQtPrivate::isMethodDescriptor |
( |
PyObject * | object | ) |
const |
returns true if the object is a method descriptor (same as inspect.ismethoddescriptor() in inspect.py)
◆ isPythonQtAnyObjectPtrMetaId()
| bool PythonQtPrivate::isPythonQtAnyObjectPtrMetaId |
( |
int | id | ) |
|
|
inline |
◆ isPythonQtObjectPtrMetaId()
| bool PythonQtPrivate::isPythonQtObjectPtrMetaId |
( |
int | id | ) |
|
|
inline |
◆ isPythonQtSafeObjectPtrMetaId()
| bool PythonQtPrivate::isPythonQtSafeObjectPtrMetaId |
( |
int | id | ) |
|
|
inline |
◆ lookupClassInfoAndCreateIfNotPresent()
| PythonQtClassInfo * PythonQtPrivate::lookupClassInfoAndCreateIfNotPresent |
( |
const char * | typeName | ) |
|
lookup existing classinfo and return new if not yet present
◆ profilingCB()
returns the profiling callback, which may be NULL
Definition at line 822 of file PythonQt.h.
822{ return _profilingCB; }
◆ pythonQtModule()
get access to the PythonQt module
Definition at line 819 of file PythonQt.h.
819{ return _pythonQtModule; }
◆ registerClass()
registers a QObject derived class to PythonQt (this is implicitly called by addObject as well)
◆ registerCPPClass()
add a wrapper object for the given QMetaType typeName, also does an addClassDecorators() to add constructors for variants (ownership of wrapper is passed to PythonQt)
Make sure that you have done a qRegisterMetaType first, if typeName is a user type!
This will add a wrapper object that is used to make calls to the given classname typeName. All slots that take a pointer to typeName as the first argument will be callable from Python on a variant object that contains such a type.
◆ registerGlobalNamespace()
| void PythonQtPrivate::registerGlobalNamespace |
( |
const char * | typeName, |
|
|
const char * | package, |
|
|
PythonQtQObjectCreatorFunctionCB * | wrapperCreator, |
|
|
const QMetaObject & | metaObject, |
|
|
PyObject * | module = nullptr ) |
Same as above, but all enums of the created wrapper will also be added to the given package and to the "Qt" package.
◆ registerLazyClass()
| void PythonQtPrivate::registerLazyClass |
( |
const QByteArray & | name, |
|
|
const QByteArray & | moduleToImport ) |
register a class name that causes lazy loading of the moduleToImport when PythonQt encounters the type
◆ registerQObjectClassNames()
| void PythonQtPrivate::registerQObjectClassNames |
( |
const QStringList & | names | ) |
|
as an alternative to registerClass, you can tell PythonQt the names of QObject derived classes and it will register the classes when it first sees a pointer to such a derived class
◆ removeSignalHandler()
| bool PythonQtPrivate::removeSignalHandler |
( |
QObject * | sender, |
|
|
const char * | signal, |
|
|
PyObject * | callable = nullptr ) |
remove a signal handler for given callable (or all callables on that signal if callable is NULL)
◆ removeSignalReceiver()
called when a signal receiver is deleted to remove it from the hash map
◆ removeWrapperPointer()
| void PythonQtPrivate::removeWrapperPointer |
( |
void * | obj | ) |
|
remove the wrapper ptr again
◆ setTaskDoneCallback()
Set a callable that is used as the argument for the add_done_callback for the Task created by checkAndRunCoroutine
◆ setupDynamicMetaObjectChain()
| const QMetaObject * PythonQtPrivate::setupDynamicMetaObjectChain |
( |
PythonQtClassWrapper * | type, |
|
|
const QMetaObject * | prototypeMetaObject ) |
recursively creates the dynamic meta object chain down to the Qt class wrapper.
◆ sharedLibrarySuffixes()
| const QStringList & PythonQtPrivate::sharedLibrarySuffixes |
( |
| ) |
|
|
inline |
get the suffixes that are used for shared libraries
Definition at line 697 of file PythonQt.h.
697{ return _sharedLibrarySuffixes; }
◆ shellClassDeleted()
| void PythonQtPrivate::shellClassDeleted |
( |
void * | shellClass | ) |
|
called by destructor of shells to allow invalidation of the Python wrapper
◆ unwrapForeignWrapper()
| void * PythonQtPrivate::unwrapForeignWrapper |
( |
const QByteArray & | classname, |
|
|
PyObject * | obj ) |
try to unwrap the given object to a C++ pointer using the foreign wrapper factories
◆ wrapMemoryAsBuffer() [1/2]
| PyObject * PythonQtPrivate::wrapMemoryAsBuffer |
( |
const void * | data, |
|
|
Py_ssize_t | size ) |
|
static |
create a read-only buffer object from the given memory
◆ wrapMemoryAsBuffer() [2/2]
| PyObject * PythonQtPrivate::wrapMemoryAsBuffer |
( |
void * | data, |
|
|
Py_ssize_t | size ) |
|
static |
create a read-write buffer object from the given memory
◆ wrapPtr()
| PyObject * PythonQtPrivate::wrapPtr |
( |
void * | ptr, |
|
|
const QByteArray & | name, |
|
|
bool | passOwnership = false ) |
wrap the given ptr into a Python object (or return existing wrapper!) if there is a known QObject of that name or a known wrapper in the factory. If passOwnership == true, the ownership is passed to PythonQt, so the object will be deleted by PythonQt when the Python wrapper goes away.
◆ wrapQObject()
| PyObject * PythonQtPrivate::wrapQObject |
( |
QObject * | obj | ) |
|
wrap the given QObject into a Python object (or return existing wrapper!)
Friends And Related Symbol Documentation
◆ PythonQt
The documentation for this class was generated from the following file:
Generated on for PythonQt by 1.15.0
|