PyArgConstructor implementation for float
type.
More...
#include <PyDefaultArguments.h>
Public Member Functions | |
PyObject * | Create (void *p) 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. | |
FloatPyArgConstructor * | Clone () const |
Return copy of object. | |
bool | IsQObjectPtr () const |
Return true if type is a pointer to a QObject-derived object. | |
QMetaType::Type | Type () const |
Return type of constructed data. |
PyArgConstructor implementation for float
type.
bool qpy::FloatPyArgConstructor::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.