SourceForge.net Logo
PythonQt
Public Types | Public Member Functions | List of all members
PythonQtSlotInfo Class Reference

stores information about a slot, including a next pointer to overloaded slots More...

#include <PythonQtMethodInfo.h>

Inheritance diagram for PythonQtSlotInfo:
PythonQtMethodInfo

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=NULL, Type type=MemberSlot)
 
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) More...
 
PythonQtSlotInfonextInfo () const
 get next overloaded slot (which has the same name) More...
 
void setNextInfo (PythonQtSlotInfo *next)
 set the next overloaded slot More...
 
bool isInstanceDecorator ()
 returns if the slot is a decorator slot More...
 
bool isClassDecorator ()
 returns if the slot is a constructor slot More...
 
QObject * decorator ()
 
QString fullSignature ()
 get the full signature including return type More...
 
QByteArray signature () const
 get the Qt signature of the slot More...
 
QByteArray slotName () const
 get the short slot name More...
 
- 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 More...
 
const QList< ParameterInfo > & parameters () const
 get the parameter infos More...
 

Additional Inherited Members

- Static Public Member Functions inherited from PythonQtMethodInfo
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...
 
- Protected Attributes inherited from PythonQtMethodInfo
QList< ParameterInfo_parameters
 
- 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 More...
 
static QHash< int, ParameterInfo_cachedParameterInfos
 

Detailed Description

stores information about a slot, including a next pointer to overloaded slots

Definition at line 133 of file PythonQtMethodInfo.h.

Member Enumeration Documentation

Enumerator
MemberSlot 
InstanceDecorator 
ClassDecorator 

Definition at line 136 of file PythonQtMethodInfo.h.

136  {
138  };

Constructor & Destructor Documentation

PythonQtSlotInfo::PythonQtSlotInfo ( const PythonQtSlotInfo info)
inline

Definition at line 140 of file PythonQtMethodInfo.h.

References PythonQtMethodInfo::_parameters.

140  :PythonQtMethodInfo() {
141  _meta = info._meta;
142  _parameters = info._parameters;
143  _slotIndex = info._slotIndex;
144  _next = NULL;
145  _decorator = info._decorator;
146  _type = info._type;
147  _upcastingOffset = 0;
148  }
PythonQtSlotInfo::PythonQtSlotInfo ( PythonQtClassInfo classInfo,
const QMetaMethod &  meta,
int  slotIndex,
QObject *  decorator = NULL,
Type  type = MemberSlot 
)
inline

Definition at line 150 of file PythonQtMethodInfo.h.

References PythonQtMethodInfo::_parameters, decorator(), PythonQtMethodInfo::getCachedMethodInfo(), PythonQtMethodInfo::parameters(), and slotIndex().

151  {
152  const PythonQtMethodInfo* info = getCachedMethodInfo(meta, classInfo);
153  _meta = meta;
154  _parameters = info->parameters();
155  _slotIndex = slotIndex;
156  _next = NULL;
157  _decorator = decorator;
158  _type = type;
159  _upcastingOffset = 0;
160  }

Member Function Documentation

QObject* PythonQtSlotInfo::decorator ( )
inline

Definition at line 188 of file PythonQtMethodInfo.h.

Referenced by PythonQtSlotInfo().

188 { return _decorator; }
void PythonQtSlotInfo::deleteOverloadsAndThis ( )
QString PythonQtSlotInfo::fullSignature ( )

get the full signature including return type

bool PythonQtSlotInfo::isClassDecorator ( )
inline

returns if the slot is a constructor slot

Definition at line 186 of file PythonQtMethodInfo.h.

References ClassDecorator.

186 { return _decorator!=NULL && _type == ClassDecorator; }
bool PythonQtSlotInfo::isInstanceDecorator ( )
inline

returns if the slot is a decorator slot

Definition at line 183 of file PythonQtMethodInfo.h.

References InstanceDecorator.

183 { return _decorator!=NULL && _type == InstanceDecorator; }
const QMetaMethod* PythonQtSlotInfo::metaMethod ( ) const
inline

Definition at line 167 of file PythonQtMethodInfo.h.

167 { return &_meta; }
PythonQtSlotInfo* PythonQtSlotInfo::nextInfo ( ) const
inline

get next overloaded slot (which has the same name)

Definition at line 177 of file PythonQtMethodInfo.h.

177 { return _next; }
void PythonQtSlotInfo::setNextInfo ( PythonQtSlotInfo next)
inline

set the next overloaded slot

Definition at line 180 of file PythonQtMethodInfo.h.

180 { _next = next; }
void PythonQtSlotInfo::setUpcastingOffset ( int  upcastingOffset)
inline

Definition at line 169 of file PythonQtMethodInfo.h.

References upcastingOffset().

169 { _upcastingOffset = upcastingOffset; }
QByteArray PythonQtSlotInfo::signature ( ) const

get the Qt signature of the slot

int PythonQtSlotInfo::slotIndex ( ) const
inline

get the index of the slot (needed for qt_metacall)

Definition at line 174 of file PythonQtMethodInfo.h.

Referenced by PythonQtSlotInfo().

174 { return _slotIndex; }
QByteArray PythonQtSlotInfo::slotName ( ) const

get the short slot name

int PythonQtSlotInfo::upcastingOffset ( ) const
inline

Definition at line 171 of file PythonQtMethodInfo.h.

Referenced by setUpcastingOffset().

171 { return _upcastingOffset; }

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