00001 #ifndef _PYTHONQTSTDDECORATORS_H
00002 #define _PYTHONQTSTDDECORATORS_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00043
00044
00045 #include "PythonQtSystem.h"
00046 #include <Python.h>
00047 #include <QObject>
00048 #include <QVariantList>
00049 #include <QTextDocument>
00050 #include <QColor>
00051 #include <QDateTime>
00052 #include <QDate>
00053 #include <QTime>
00054
00055 class PYTHONQT_EXPORT PythonQtStdDecorators : public QObject
00056 {
00057 Q_OBJECT
00058
00059 public slots:
00060 bool connect(QObject* sender, const QByteArray& signal, PyObject* callable);
00061 bool connect(QObject* sender, const QByteArray& signal, QObject* receiver, const QByteArray& slot);
00062 bool disconnect(QObject* sender, const QByteArray& signal, PyObject* callable);
00063 bool disconnect(QObject* sender, const QByteArray& signal, QObject* receiver, const QByteArray& slot);
00064
00065 #undef emit
00066 void emit(QObject* sender, const QByteArray& signal, PyObject* arg1 = NULL,PyObject* arg2 = NULL,
00067 PyObject* arg3 = NULL,PyObject* arg4 = NULL,PyObject* arg5 = NULL,PyObject* arg6 = NULL,PyObject* arg7 = NULL);
00068 #define emit
00069
00070 QObject* parent(QObject* o);
00071 void setParent(QObject* o, QObject* parent);
00072
00073 const QObjectList* children(QObject* o);
00074 QObject* findChild(QObject* parent, PyObject* type, const QString& name = QString());
00075 QList<QObject*> findChildren(QObject* parent, PyObject* type, const QString& name= QString());
00076 QList<QObject*> findChildren(QObject* parent, PyObject* type, const QRegExp& regExp);
00077
00078 bool setProperty(QObject* o, const char* name, const QVariant& value);
00079 QVariant property(QObject* o, const char* name);
00080
00081 double static_Qt_qAbs(double a) { return qAbs(a); }
00082 double static_Qt_qBound(double a,double b,double c) { return qBound(a,b,c); }
00083 void static_Qt_qDebug(const QByteArray& msg) { qDebug(msg.constData()); }
00084
00085 void static_Qt_qWarning(const QByteArray& msg) { qWarning(msg.constData()); }
00086
00087 void static_Qt_qCritical(const QByteArray& msg) { qCritical(msg.constData()); }
00088
00089 void static_Qt_qFatal(const QByteArray& msg) { qFatal(msg.constData()); }
00090
00091 bool static_Qt_qFuzzyCompare(double a, double b) { return qFuzzyCompare(a, b); }
00092 double static_Qt_qMax(double a, double b) { return qMax(a, b); }
00093 double static_Qt_qMin(double a, double b) { return qMin(a, b); }
00094 int static_Qt_qRound(double a) { return qRound(a); }
00095 qint64 static_Qt_qRound64(double a) { return qRound64(a); }
00096 const char* static_Qt_qVersion() { return qVersion(); }
00097 int static_Qt_qrand() { return qrand(); }
00098 void static_Qt_qsrand(uint a) { qsrand(a); }
00099
00100 QString tr(QObject* obj, const QByteArray& text, const QByteArray& ambig = QByteArray(), int n = -1);
00101
00102 QByteArray static_Qt_SIGNAL(const QByteArray& s) { return QByteArray("2") + s; }
00103 QByteArray static_Qt_SLOT(const QByteArray& s) { return QByteArray("1") + s; }
00104
00105 private:
00106 QObject* findChild(QObject* parent, const char* typeName, const QMetaObject* meta, const QString& name);
00107 int findChildren(QObject* parent, const char* typeName, const QMetaObject* meta, const QString& name, QList<QObject*>& list);
00108 int findChildren(QObject* parent, const char* typeName, const QMetaObject* meta, const QRegExp& regExp, QList<QObject*>& list);
00109 };
00110
00111
00112 #endif