|
PythonQt
|
stores information about a slot, including a next pointer to overloaded slots More...
#include <PythonQtMethodInfo.h>
Public Types | |
| enum | Type { MemberSlot , InstanceDecorator , ClassDecorator } |
| Public Types inherited from PythonQtMethodInfo | |
| enum | ParameterType { Unknown = -1 , Variant = -2 } |
Public Member Functions | |
| PythonQtSlotInfo (const PythonQtSlotInfo &info) | |
| PythonQtSlotInfo (PythonQtClassInfo *classInfo, const QMetaMethod &meta, int slotIndex, QObject *decorator=nullptr, Type type=MemberSlot) | |
| QList< ParameterInfo > | arguments () const |
| get the parameter infos for the arguments, without return type and instance decorator. | |
| void | deleteOverloadsAndThis () |
| const QMetaMethod * | metaMethod () const |
| void | setUpcastingOffset (int upcastingOffset) |
| int | upcastingOffset () const |
| int | slotIndex () const |
| get the index of the slot (needed for qt_metacall) | |
| PythonQtSlotInfo * | nextInfo () const |
| get next overloaded slot (which has the same name) | |
| void | setNextInfo (PythonQtSlotInfo *next) |
| set the next overloaded slot | |
| bool | isInstanceDecorator () const |
| returns if the slot is a decorator slot | |
| bool | isClassDecorator () const |
| returns if the slot is a constructor slot | |
| QObject * | decorator () const |
| QString | fullSignature (bool skipReturnValue=false, int optionalArgsIndex=-1) const |
| get the full signature including return type | |
| QByteArray | signature () const |
| get the Qt signature of the slot | |
| QByteArray | slotName (bool removeDecorators=false) const |
| get the short slot name | |
| QStringList | overloads (bool skipReturnValue=false) const |
| QByteArray | getImplementingClassName () const |
| Public Member Functions inherited from PythonQtMethodInfo | |
| PythonQtMethodInfo () | |
| ~PythonQtMethodInfo () | |
| PythonQtMethodInfo (const QMetaMethod &meta, PythonQtClassInfo *classInfo) | |
| PythonQtMethodInfo (const QByteArray &typeName, const QList< QByteArray > &args) | |
| PythonQtMethodInfo (const PythonQtMethodInfo &other) | |
| int | parameterCount () const |
| returns the number of parameters including the return value | |
| const QList< ParameterInfo > & | parameters () const |
| get the parameter infos | |
| bool | shouldAllowThreads () const |
Static Public Member Functions | |
| static void | invokeQtMethod (QObject *obj, PythonQtSlotInfo *slot, void **argList) |
| Invoke the given slot on obj, save/restore thread state if needed. | |
| static void | setGlobalShouldAllowThreads (bool flag) |
| Sets if calling slots should release the GIL to allow other Python threads while being inside of C++. | |
| static bool | getGlobalShouldAllowThreads () |
| Returns if calling slots should release the GIL to allow Python threads while being inside of C++. | |
| Static Public Member Functions inherited from PythonQtMethodInfo | |
| static const PythonQtMethodInfo * | getCachedMethodInfo (const QMetaMethod &method, PythonQtClassInfo *classInfo) |
| static const PythonQtMethodInfo * | getCachedMethodInfoFromArgumentList (int numArgs, const char **args) |
| get the cached method info using the passed in list of return value and arguments, return value needs to be passed as first arg | |
| static void | cleanupCachedMethodInfos () |
| cleanup the cache | |
| static int | nameToType (const char *name) |
| returns the id for the given type (using an internal dictionary) | |
| static void | addParameterTypeAlias (const QByteArray &alias, const QByteArray &name) |
| add an alias for a typename, e.g. QObjectList and QList<QObject*>. | |
| static void | fillParameterInfo (ParameterInfo &type, const QByteArray &name, PythonQtClassInfo *classInfo=nullptr) |
| fill the parameter info for the given type name | |
| static const ParameterInfo & | getParameterInfoForMetaType (int type) |
| returns a parameter info for the given metatype (and creates and caches one if it is not yet present) | |
| static int | getInnerTemplateMetaType (const QByteArray &typeName) |
| returns the inner type id of a simple template of the form SomeObject<InnerType> | |
| static QByteArray | getInnerTemplateTypeName (const QByteArray &typeName) |
| returns the inner type name of a simple template of the form SomeObject<InnerType> | |
| static QByteArray | getInnerListTypeName (const QByteArray &typeName) |
| returns the inner type name of a simple template or the typename without appended "List". | |
Additional Inherited Members | |
| Protected Member Functions inherited from PythonQtMethodInfo | |
| void | setupAllowThreads () |
| Protected Attributes inherited from PythonQtMethodInfo | |
| QList< ParameterInfo > | _parameters |
| bool | _shouldAllowThreads |
| Static Protected Attributes inherited from PythonQtMethodInfo | |
| static QHash< QByteArray, int > | _parameterTypeDict |
| static QHash< QByteArray, QByteArray > | _parameterNameAliases |
| static QHash< QByteArray, PythonQtMethodInfo * > | _cachedSignatures |
| stores the cached signatures of methods to speedup mapping from Qt to Python types | |
| static QHash< int, ParameterInfo > | _cachedParameterInfos |
stores information about a slot, including a next pointer to overloaded slots
Definition at line 147 of file PythonQtMethodInfo.h.
| Enumerator | |
|---|---|
| MemberSlot | |
| InstanceDecorator | |
| ClassDecorator | |
Definition at line 150 of file PythonQtMethodInfo.h.
|
inline |
Definition at line 152 of file PythonQtMethodInfo.h.
References PythonQtMethodInfo::_parameters, PythonQtMethodInfo::_shouldAllowThreads, PythonQtMethodInfo::PythonQtMethodInfo(), and PythonQtSlotInfo().
Referenced by getGlobalShouldAllowThreads(), invokeQtMethod(), nextInfo(), PythonQtSlotInfo(), and setNextInfo().
|
inline |
Definition at line 165 of file PythonQtMethodInfo.h.
References PythonQtMethodInfo::_parameters, PythonQtMethodInfo::_shouldAllowThreads, decorator(), PythonQtMethodInfo::getCachedMethodInfo(), MemberSlot, PythonQtMethodInfo::parameters(), PythonQtMethodInfo::PythonQtMethodInfo(), PythonQtMethodInfo::shouldAllowThreads(), and slotIndex().
| QList< ParameterInfo > PythonQtSlotInfo::arguments | ( | ) | const |
get the parameter infos for the arguments, without return type and instance decorator.
|
inline |
Definition at line 207 of file PythonQtMethodInfo.h.
Referenced by PythonQtSlotInfo().
| void PythonQtSlotInfo::deleteOverloadsAndThis | ( | ) |
| QString PythonQtSlotInfo::fullSignature | ( | bool | skipReturnValue = false, |
| int | optionalArgsIndex = -1 ) const |
get the full signature including return type
|
static |
Returns if calling slots should release the GIL to allow Python threads while being inside of C++.
References PythonQtSlotInfo().
| QByteArray PythonQtSlotInfo::getImplementingClassName | ( | ) | const |
Returns the class name that originally implements this method, regardless where the wrapper is located/implemented.
|
static |
Invoke the given slot on obj, save/restore thread state if needed.
References PythonQtSlotInfo().
|
inline |
returns if the slot is a constructor slot
Definition at line 205 of file PythonQtMethodInfo.h.
References ClassDecorator.
|
inline |
returns if the slot is a decorator slot
Definition at line 202 of file PythonQtMethodInfo.h.
References InstanceDecorator.
|
inline |
Definition at line 186 of file PythonQtMethodInfo.h.
|
inline |
get next overloaded slot (which has the same name)
Definition at line 196 of file PythonQtMethodInfo.h.
References PythonQtSlotInfo().
| QStringList PythonQtSlotInfo::overloads | ( | bool | skipReturnValue = false | ) | const |
gets a list of all overload signatures. Signatures which only differ because of default values are joined using "[]" to indicate the optional arguments.
|
static |
Sets if calling slots should release the GIL to allow other Python threads while being inside of C++.
|
inline |
set the next overloaded slot
Definition at line 199 of file PythonQtMethodInfo.h.
References PythonQtSlotInfo().
|
inline |
Definition at line 188 of file PythonQtMethodInfo.h.
References upcastingOffset().
| QByteArray PythonQtSlotInfo::signature | ( | ) | const |
get the Qt signature of the slot
|
inline |
get the index of the slot (needed for qt_metacall)
Definition at line 193 of file PythonQtMethodInfo.h.
Referenced by PythonQtSlotInfo().
| QByteArray PythonQtSlotInfo::slotName | ( | bool | removeDecorators = false | ) | const |
get the short slot name
|
inline |
Definition at line 190 of file PythonQtMethodInfo.h.
Referenced by setUpcastingOffset().