1 #ifndef _PYTHONQTMISC_H
2 #define _PYTHONQTMISC_H
49 #define PYTHONQT_MAX_ARGS 32
51 #define PythonQtArgumentFrame_ADD_VALUE(store, type, value, ptr) \
52 { type* item = (type*)store->nextPODPtr(); \
57 #define PythonQtArgumentFrame_ADD_VALUE_IF_NEEDED(alreadyAllocatedPtr,store, type, value, ptr) \
59 type* item = (type*)(alreadyAllocatedPtr?alreadyAllocatedPtr:store->nextPODPtr()); \
64 #define PythonQtArgumentFrame_ADD_VARIANT_VALUE(store, value, ptr) \
65 { QVariant* item = store->nextVariantPtr(); \
70 #if QT_VERSION >= 0x060000
72 #define PythonQtArgumentFrame_ADD_VARIANT_VALUE_BY_ID(store, id, ptr) \
73 PythonQtArgumentFrame_ADD_VARIANT_VALUE(store, QVariant(QMetaType(id)), ptr)
77 #define PythonQtArgumentFrame_ADD_VARIANT_VALUE_BY_ID(store, id, ptr) \
78 PythonQtArgumentFrame_ADD_VARIANT_VALUE(store, QVariant::Type(id), ptr)
82 #define PythonQtArgumentFrame_ADD_VARIANT_VALUE_IF_NEEDED(alreadyAllocatedPtr,store, value, ptr) \
84 QVariant* item = (QVariant*)(alreadyAllocatedPtr?alreadyAllocatedPtr:store->nextVariantPtr()); \
89 #if QT_VERSION >= 0x060000
91 #define PythonQtArgumentFrame_ADD_VARIANT_VALUE_BY_ID_IF_NEEDED(alreadyAllocatedPtr,store, id, ptr) \
92 PythonQtArgumentFrame_ADD_VARIANT_VALUE_IF_NEEDED(alreadyAllocatedPtr,store, QVariant(QMetaType(id)), ptr)
96 #define PythonQtArgumentFrame_ADD_VARIANT_VALUE_BY_ID_IF_NEEDED(alreadyAllocatedPtr,store, id, ptr) \
97 PythonQtArgumentFrame_ADD_VARIANT_VALUE_IF_NEEDED(alreadyAllocatedPtr,store, QVariant::Type(id), ptr)
125 std::vector<quint64> _podArgs;
126 std::vector<QVariant> _variantArgs;
Stores C++ arguments for a qt_metacall (which are created when converting data from Python to C++)
static void deleteFrame(PythonQtArgumentFrame *frame)
Frees the frame (resetting it and putting it back to the freelist)
QVariant * nextVariantPtr()
Get next pointer to a variant.
static void cleanupFreeList()
Frees all PythonQtArgumentFrame frames that are stored.
void reset()
Resets the pod and variant argument lists to empty lists.
quint64 * nextPODPtr()
Get next pointer to a POD.
static PythonQtArgumentFrame * newFrame()
Create a new (empty) frame (which is typically reused from a freelist)