SourceForge.net Logo
PythonQt
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | Static Protected Attributes | List of all members
PythonQtMethodInfo Class Reference

stores information about a specific signal/slot/method More...

#include <PythonQtMethodInfo.h>

Inheritance diagram for PythonQtMethodInfo:
PythonQtSlotInfo

Classes

struct  ParameterInfo
 stores various informations about a parameter/type name More...
 

Public Types

enum  ParameterType { Unknown = -1, Variant = -2 }
 

Public Member Functions

 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 More...
 
const QList< ParameterInfo > & parameters () const
 get the parameter infos More...
 

Static Public Member Functions

static const PythonQtMethodInfogetCachedMethodInfo (const QMetaMethod &method, PythonQtClassInfo *classInfo)
 
static const PythonQtMethodInfogetCachedMethodInfoFromArgumentList (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 More...
 
static void cleanupCachedMethodInfos ()
 cleanup the cache More...
 
static int nameToType (const char *name)
 returns the id for the given type (using an internal dictionary) More...
 
static void addParameterTypeAlias (const QByteArray &alias, const QByteArray &name)
 add an alias for a typename, e.g. QObjectList and QList<QObject*>. More...
 
static void fillParameterInfo (ParameterInfo &type, const QByteArray &name, PythonQtClassInfo *classInfo=NULL)
 fill the parameter info for the given type name More...
 
static const ParameterInfogetParameterInfoForMetaType (int type)
 returns a parameter info for the given metatype (and creates and caches one if it is not yet present) More...
 
static int getInnerTemplateMetaType (const QByteArray &typeName)
 returns the inner type id of a simple template of the form SomeObject<InnerType> More...
 
static QByteArray getInnerTemplateTypeName (const QByteArray &typeName)
 returns the inner type name of a simple template of the form SomeObject<InnerType> More...
 
static QByteArray getInnerListTypeName (const QByteArray &typeName)
 returns the inner type name of a simple template or the typename without appended "List". More...
 

Protected Attributes

QList< ParameterInfo_parameters
 

Static Protected Attributes

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 More...
 
static QHash< int, ParameterInfo_cachedParameterInfos
 

Detailed Description

stores information about a specific signal/slot/method

Definition at line 57 of file PythonQtMethodInfo.h.

Member Enumeration Documentation

Enumerator
Unknown 
Variant 

Definition at line 60 of file PythonQtMethodInfo.h.

Constructor & Destructor Documentation

PythonQtMethodInfo::PythonQtMethodInfo ( )
inline

Definition at line 81 of file PythonQtMethodInfo.h.

81 {};
PythonQtMethodInfo::~PythonQtMethodInfo ( )
inline

Definition at line 82 of file PythonQtMethodInfo.h.

82 {};
PythonQtMethodInfo::PythonQtMethodInfo ( const QMetaMethod &  meta,
PythonQtClassInfo classInfo 
)
PythonQtMethodInfo::PythonQtMethodInfo ( const QByteArray &  typeName,
const QList< QByteArray > &  args 
)
PythonQtMethodInfo::PythonQtMethodInfo ( const PythonQtMethodInfo other)
inline

Definition at line 85 of file PythonQtMethodInfo.h.

References _parameters.

85  {
86  _parameters = other._parameters;
87  }
QList< ParameterInfo > _parameters

Member Function Documentation

static void PythonQtMethodInfo::addParameterTypeAlias ( const QByteArray &  alias,
const QByteArray &  name 
)
static

add an alias for a typename, e.g. QObjectList and QList<QObject*>.

static void PythonQtMethodInfo::cleanupCachedMethodInfos ( )
static

cleanup the cache

static void PythonQtMethodInfo::fillParameterInfo ( ParameterInfo type,
const QByteArray &  name,
PythonQtClassInfo classInfo = NULL 
)
static

fill the parameter info for the given type name

static const PythonQtMethodInfo* PythonQtMethodInfo::getCachedMethodInfo ( const QMetaMethod &  method,
PythonQtClassInfo classInfo 
)
static

returns the method info of the signature, uses a cache internally to speed up multiple requests for the same method, classInfo is passed to allow local enum resolution (if NULL is passed, no local enums are recognized)

Referenced by PythonQtSlotInfo::PythonQtSlotInfo().

static const PythonQtMethodInfo* PythonQtMethodInfo::getCachedMethodInfoFromArgumentList ( int  numArgs,
const char **  args 
)
static

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 QByteArray PythonQtMethodInfo::getInnerListTypeName ( const QByteArray &  typeName)
static

returns the inner type name of a simple template or the typename without appended "List".

Referenced by PythonQtConvertListOfKnownClassToPythonList(), and PythonQtConvertPythonListToListOfKnownClass().

static int PythonQtMethodInfo::getInnerTemplateMetaType ( const QByteArray &  typeName)
static
static QByteArray PythonQtMethodInfo::getInnerTemplateTypeName ( const QByteArray &  typeName)
static

returns the inner type name of a simple template of the form SomeObject<InnerType>

Referenced by PythonQtConvertIntegerMapToPython(), PythonQtConvertPairToPython(), PythonQtConvertPythonToIntegerMap(), and PythonQtConvertPythonToPair().

static const ParameterInfo& PythonQtMethodInfo::getParameterInfoForMetaType ( int  type)
static

returns a parameter info for the given metatype (and creates and caches one if it is not yet present)

static int PythonQtMethodInfo::nameToType ( const char *  name)
static

returns the id for the given type (using an internal dictionary)

int PythonQtMethodInfo::parameterCount ( ) const
inline

returns the number of parameters including the return value

Definition at line 100 of file PythonQtMethodInfo.h.

100 { return _parameters.size(); };
QList< ParameterInfo > _parameters
const QList<ParameterInfo>& PythonQtMethodInfo::parameters ( ) const
inline

get the parameter infos

Definition at line 106 of file PythonQtMethodInfo.h.

Referenced by PythonQtSlotInfo::PythonQtSlotInfo().

106 { return _parameters; }
QList< ParameterInfo > _parameters

Member Data Documentation

QHash<int, ParameterInfo> PythonQtMethodInfo::_cachedParameterInfos
staticprotected

Definition at line 134 of file PythonQtMethodInfo.h.

QHash<QByteArray, PythonQtMethodInfo*> PythonQtMethodInfo::_cachedSignatures
staticprotected

stores the cached signatures of methods to speedup mapping from Qt to Python types

Definition at line 132 of file PythonQtMethodInfo.h.

QHash<QByteArray, QByteArray> PythonQtMethodInfo::_parameterNameAliases
staticprotected

Definition at line 129 of file PythonQtMethodInfo.h.

QList<ParameterInfo> PythonQtMethodInfo::_parameters
protected

Definition at line 136 of file PythonQtMethodInfo.h.

Referenced by PythonQtMethodInfo(), and PythonQtSlotInfo::PythonQtSlotInfo().

QHash<QByteArray, int> PythonQtMethodInfo::_parameterTypeDict
staticprotected

Definition at line 128 of file PythonQtMethodInfo.h.


The documentation for this class was generated from the following file: