1 #ifndef _PYTHONQTSTDDECORATORS_H
2 #define _PYTHONQTSTDDECORATORS_H
50 #include <QVariantList>
51 #include <QTextDocument>
58 #include <QMetaMethod>
60 #include <QMetaProperty>
68 bool connect(QObject* sender,
const QByteArray& signal, QObject* receiver,
const QByteArray& slot, Qt::ConnectionType type = Qt::AutoConnection);
69 bool connect(QObject* receiver, QObject* sender,
const QByteArray& signal,
const QByteArray& slot, Qt::ConnectionType type = Qt::AutoConnection) {
return connect(sender, signal, receiver, slot, type); }
71 bool static_QObject_connect(QObject* sender,
const QByteArray& signal, QObject* receiver,
const QByteArray& slot, Qt::ConnectionType type = Qt::AutoConnection) {
return connect(sender, signal, receiver, slot, type); }
73 bool disconnect(QObject* sender,
const QByteArray& signal, QObject* receiver,
const QByteArray& slot);
75 bool static_QObject_disconnect(QObject* sender,
const QByteArray& signal, QObject* receiver,
const QByteArray& slot) {
return disconnect(sender, signal, receiver, slot); }
87 bool setProperty(QObject* o,
const char* name,
const QVariant& value);
88 QVariant
property(QObject* o,
const char* name);
109 QString
tr(QObject* obj,
const QString& text,
const QString& ambig = QString(),
int n = -1);
117 QObject* findChild(QObject* parent,
const char*
typeName,
const QMetaObject* meta,
const QString& name);
118 int findChildren(QObject* parent,
const char*
typeName,
const QMetaObject* meta,
const QString& name, QList<QObject*>& list);
119 int findChildren(QObject* parent,
const char*
typeName,
const QMetaObject* meta,
const QRegExp& regExp, QList<QObject*>& list);
141 const char *
getClassName(QMetaObject* obj)
const {
return obj->className(); }
142 const QMetaObject *
superClass(QMetaObject* obj)
const {
return obj->superClass(); }
144 int methodOffset(QMetaObject* obj)
const {
return obj->methodOffset(); }
150 int methodCount(QMetaObject* obj)
const {
return obj->methodCount(); }
157 int indexOfSignal(QMetaObject* obj,
const char *signal)
const {
return obj->indexOfSignal(signal); }
158 int indexOfSlot(QMetaObject* obj,
const char *slot)
const {
return obj->indexOfSlot(slot); }
159 int indexOfEnumerator(QMetaObject* obj,
const char *name)
const {
return obj->indexOfEnumerator(name); }
160 int indexOfProperty(QMetaObject* obj,
const char *name)
const {
return obj->indexOfProperty(name); }
161 int indexOfClassInfo(QMetaObject* obj,
const char *name)
const {
return obj->indexOfClassInfo(name); }
163 QMetaMethod
constructor(QMetaObject* obj,
int index)
const {
return obj->constructor(index); }
164 QMetaMethod
method(QMetaObject* obj,
int index)
const {
return obj->method(index); }
165 QMetaEnum
enumerator(QMetaObject* obj,
int index)
const {
return obj->enumerator(index); }
166 QMetaProperty
property(QMetaObject* obj,
int index)
const {
return obj->property(index); }
167 QMetaClassInfo
classInfo(QMetaObject* obj,
int index)
const {
return obj->classInfo(index); }
168 QMetaProperty
userProperty(QMetaObject* obj)
const {
return obj->userProperty(); }
Some helper methods that allow testing of the ownership.
bool isDerivedShellInstance(PyObject *object)
Returns if the C++ object is an instance of a Python class that derives a C++ class.
bool isOwnedByPython(PyObject *object)
Returns if the C++ object is owned by PythonQt and will be deleted when the reference goes away.
PythonQtDebugAPI(QObject *parent)
bool isPythonQtClassWrapper(PyObject *object)
Returns if the given object is a PythonQt class wrapper (or derived class)
bool isPythonQtInstanceWrapper(PyObject *object)
Returns if the given object is a PythonQt instance wrapper (or derived class)
bool passOwnershipToPython(PyObject *object)
Pass the ownership of the given object to Python (so that the C++ object will be deleted when the Pyt...
bool passOwnershipToCPP(PyObject *object)
Pass the ownership of the given object to CPP (so that it will not be deleted by Python if the refere...
bool hasExtraShellRefCount(PyObject *object)
Returns if the shell instance has an extra ref count from the C++ side.
a smart pointer that stores a PyObject pointer and that handles reference counting automatically
PythonQtSingleShotTimer(int msec, const PythonQtObjectPtr &callable)
bool static_QObject_disconnect(QObject *sender, const QByteArray &signal, PyObject *callable=NULL)
QList< QObject * > findChildren(QObject *parent, PyObject *type, const QRegExp ®Exp)
double static_Qt_qMin(double a, double b)
void static_Qt_qDebug(const QByteArray &msg)
double static_Qt_qMax(double a, double b)
bool connect(QObject *receiver, QObject *sender, const QByteArray &signal, const QByteArray &slot, Qt::ConnectionType type=Qt::AutoConnection)
void static_QTimer_singleShot(int msec, PyObject *callable)
void static_Qt_qCritical(const QByteArray &msg)
double static_Qt_qAbs(double a)
int static_Qt_qRound(double a)
QObject * parent(QObject *o)
void static_Qt_qWarning(const QByteArray &msg)
QObject * findChild(QObject *parent, PyObject *type, const QString &name=QString())
const QMetaObject * metaObject(QObject *obj)
QString tr(QObject *obj, const QString &text, const QString &ambig=QString(), int n=-1)
QString static_Qt_SIGNAL(const QString &s)
bool connect(QObject *sender, const QByteArray &signal, PyObject *callable)
const char * static_Qt_qVersion()
bool static_QObject_disconnect(QObject *sender, const QByteArray &signal, QObject *receiver, const QByteArray &slot)
QString static_Qt_SLOT(const QString &s)
void static_Qt_qFatal(const QByteArray &msg)
double static_Qt_qBound(double a, double b, double c)
qint64 static_Qt_qRound64(double a)
bool static_QObject_connect(QObject *sender, const QByteArray &signal, QObject *receiver, const QByteArray &slot, Qt::ConnectionType type=Qt::AutoConnection)
void setParent(QObject *o, PythonQtNewOwnerOfThis< QObject * > parent)
bool static_Qt_qFuzzyCompare(double a, double b)
bool static_QObject_connect(QObject *sender, const QByteArray &signal, PyObject *callable)
void static_Qt_qsrand(uint a)
bool disconnect(QObject *sender, const QByteArray &signal, QObject *receiver, const QByteArray &slot)
const QObjectList * children(QObject *o)
bool disconnect(QObject *sender, const QByteArray &signal, PyObject *callable=NULL)
QList< QObject * > findChildren(QObject *parent, PyObject *type, const QString &name=QString())
bool connect(QObject *sender, const QByteArray &signal, QObject *receiver, const QByteArray &slot, Qt::ConnectionType type=Qt::AutoConnection)
QVariant property(QObject *o, const char *name)
bool setProperty(QObject *o, const char *name, const QVariant &value)
QByteArray typeName(const QMetaMethod &method)