QPy
Python-Qt dynamic bindings
All Classes Namespaces Files Functions
Public Member Functions
qpy::NoPyArgConstructor Class Reference

Use this type to specify that no Qt -> Python conversion exists for a type when registering types through PyContext. More...

#include <PyArgConstructor.h>

Inheritance diagram for qpy::NoPyArgConstructor:
Inheritance graph
[legend]
Collaboration diagram for qpy::NoPyArgConstructor:
Collaboration graph
[legend]

List of all members.

Public Member Functions

PyObject * Create (void *) const
 Create PyObject from parameter passed to Python callback from Qt when signal triggered.
PyObject * Create () const
 Create PyObject from value returned from QObject method.
NoPyArgConstructorClone () const
 Return copy of object.
QMetaType::Type Type () const
 Return type of constructed data.
bool IsQObjectPtr () const
 Return true if type is a pointer to a QObject-derived object.

Detailed Description

Use this type to specify that no Qt -> Python conversion exists for a type when registering types through PyContext.

e.g.

 RegisterType< VoidStarQArgConstructor,
               NoPyArgConstructor >( QMetaType::VoidStar );

Member Function Documentation

bool qpy::NoPyArgConstructor::IsQObjectPtr ( ) const [inline, virtual]

Return true if type is a pointer to a QObject-derived object.

This is required to have the QPy run-time add the passed QObject into the Python context. The other option is to have PyArgConstructors::Create receive a reference to a PyContext which introduces a two-way dependency between PyArgConstructor and PyContext; this would also augment PyQArgConstructor requirements with the added responsibility of having to add instances to Python. Note that it is not enough to simply check the PyArgConstructor returned Type(), because in the case of custom registered types derived from QObject the returned type is not QObjectStar.

Implements qpy::PyArgConstructor.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions