@@ -1,103 +1,103 | |||||
1 | #ifndef _PYTHONQTSTDDECORATORS_H |
|
1 | #ifndef _PYTHONQTSTDDECORATORS_H | |
2 | #define _PYTHONQTSTDDECORATORS_H |
|
2 | #define _PYTHONQTSTDDECORATORS_H | |
3 |
|
3 | |||
4 | /* |
|
4 | /* | |
5 | * |
|
5 | * | |
6 | * Copyright (C) 2006 MeVis Research GmbH All Rights Reserved. |
|
6 | * Copyright (C) 2006 MeVis Research GmbH All Rights Reserved. | |
7 | * |
|
7 | * | |
8 | * This library is free software; you can redistribute it and/or |
|
8 | * This library is free software; you can redistribute it and/or | |
9 | * modify it under the terms of the GNU Lesser General Public |
|
9 | * modify it under the terms of the GNU Lesser General Public | |
10 | * License as published by the Free Software Foundation; either |
|
10 | * License as published by the Free Software Foundation; either | |
11 | * version 2.1 of the License, or (at your option) any later version. |
|
11 | * version 2.1 of the License, or (at your option) any later version. | |
12 | * |
|
12 | * | |
13 | * This library is distributed in the hope that it will be useful, |
|
13 | * This library is distributed in the hope that it will be useful, | |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
16 | * Lesser General Public License for more details. |
|
16 | * Lesser General Public License for more details. | |
17 | * |
|
17 | * | |
18 | * Further, this software is distributed without any warranty that it is |
|
18 | * Further, this software is distributed without any warranty that it is | |
19 | * free of the rightful claim of any third person regarding infringement |
|
19 | * free of the rightful claim of any third person regarding infringement | |
20 | * or the like. Any license provided herein, whether implied or |
|
20 | * or the like. Any license provided herein, whether implied or | |
21 | * otherwise, applies only to this software file. Patent licenses, if |
|
21 | * otherwise, applies only to this software file. Patent licenses, if | |
22 | * any, provided herein do not apply to combinations of this program with |
|
22 | * any, provided herein do not apply to combinations of this program with | |
23 | * other software, or any other product whatsoever. |
|
23 | * other software, or any other product whatsoever. | |
24 | * |
|
24 | * | |
25 | * You should have received a copy of the GNU Lesser General Public |
|
25 | * You should have received a copy of the GNU Lesser General Public | |
26 | * License along with this library; if not, write to the Free Software |
|
26 | * License along with this library; if not, write to the Free Software | |
27 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
27 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
28 | * |
|
28 | * | |
29 | * Contact information: MeVis Research GmbH, Universitaetsallee 29, |
|
29 | * Contact information: MeVis Research GmbH, Universitaetsallee 29, | |
30 | * 28359 Bremen, Germany or: |
|
30 | * 28359 Bremen, Germany or: | |
31 | * |
|
31 | * | |
32 | * http://www.mevis.de |
|
32 | * http://www.mevis.de | |
33 | * |
|
33 | * | |
34 | */ |
|
34 | */ | |
35 |
|
35 | |||
36 | //---------------------------------------------------------------------------------- |
|
36 | //---------------------------------------------------------------------------------- | |
37 | /*! |
|
37 | /*! | |
38 | // \file PythonQtStdDecorators.h |
|
38 | // \file PythonQtStdDecorators.h | |
39 | // \author Florian Link |
|
39 | // \author Florian Link | |
40 | // \author Last changed by $Author: florian $ |
|
40 | // \author Last changed by $Author: florian $ | |
41 | // \date 2007-04 |
|
41 | // \date 2007-04 | |
42 | */ |
|
42 | */ | |
43 | //---------------------------------------------------------------------------------- |
|
43 | //---------------------------------------------------------------------------------- | |
44 |
|
44 | |||
45 | #include "PythonQtSystem.h" |
|
45 | #include "PythonQtSystem.h" | |
46 | #include <Python.h> |
|
46 | #include <Python.h> | |
47 | #include <QObject> |
|
47 | #include <QObject> | |
48 | #include <QVariantList> |
|
48 | #include <QVariantList> | |
49 | #include <QTextDocument> |
|
49 | #include <QTextDocument> | |
50 | #include <QColor> |
|
50 | #include <QColor> | |
51 | #include <QDateTime> |
|
51 | #include <QDateTime> | |
52 | #include <QDate> |
|
52 | #include <QDate> | |
53 | #include <QTime> |
|
53 | #include <QTime> | |
54 |
|
54 | |||
55 | class PYTHONQT_EXPORT PythonQtStdDecorators : public QObject |
|
55 | class PYTHONQT_EXPORT PythonQtStdDecorators : public QObject | |
56 | { |
|
56 | { | |
57 | Q_OBJECT |
|
57 | Q_OBJECT | |
58 |
|
58 | |||
59 | public slots: |
|
59 | public slots: | |
60 | bool connect(QObject* sender, const QByteArray& signal, PyObject* callable); |
|
60 | bool connect(QObject* sender, const QByteArray& signal, PyObject* callable); | |
61 | bool connect(QObject* sender, const QByteArray& signal, QObject* receiver, const QByteArray& slot); |
|
61 | bool connect(QObject* sender, const QByteArray& signal, QObject* receiver, const QByteArray& slot); | |
62 | bool disconnect(QObject* sender, const QByteArray& signal, PyObject* callable); |
|
62 | bool disconnect(QObject* sender, const QByteArray& signal, PyObject* callable); | |
63 | bool disconnect(QObject* sender, const QByteArray& signal, QObject* receiver, const QByteArray& slot); |
|
63 | bool disconnect(QObject* sender, const QByteArray& signal, QObject* receiver, const QByteArray& slot); | |
64 |
|
64 | |||
65 | #undef emit |
|
65 | #undef emit | |
66 | void emit(QObject* sender, const QByteArray& signal, PyObject* arg1 = NULL,PyObject* arg2 = NULL, |
|
66 | void emit(QObject* sender, const QByteArray& signal, PyObject* arg1 = NULL,PyObject* arg2 = NULL, | |
67 | PyObject* arg3 = NULL,PyObject* arg4 = NULL,PyObject* arg5 = NULL,PyObject* arg6 = NULL,PyObject* arg7 = NULL); |
|
67 | PyObject* arg3 = NULL,PyObject* arg4 = NULL,PyObject* arg5 = NULL,PyObject* arg6 = NULL,PyObject* arg7 = NULL); | |
68 | #define emit |
|
68 | #define emit | |
69 |
|
69 | |||
70 | QObject* parent(QObject* o); |
|
70 | QObject* parent(QObject* o); | |
71 | void setParent(QObject* o, QObject* parent); |
|
71 | void setParent(QObject* o, QObject* parent); | |
72 |
|
72 | |||
73 | QVariantList children(QObject* o); |
|
73 | QVariantList children(QObject* o); | |
74 |
|
74 | |||
75 | double static_Qt_qAbs(double a) { return qAbs(a); } |
|
75 | double static_Qt_qAbs(double a) { return qAbs(a); } | |
76 | double static_Qt_qBound(double a,double b,double c) { return qBound(a,b,c); } |
|
76 | double static_Qt_qBound(double a,double b,double c) { return qBound(a,b,c); } | |
77 | void static_Qt_qDebug(const QByteArray& msg) { qDebug(msg.constData()); } |
|
77 | void static_Qt_qDebug(const QByteArray& msg) { qDebug(msg.constData()); } | |
78 | // TODO: multi arg qDebug... |
|
78 | // TODO: multi arg qDebug... | |
79 | void static_Qt_qWarning(const QByteArray& msg) { qWarning(msg.constData()); } |
|
79 | void static_Qt_qWarning(const QByteArray& msg) { qWarning(msg.constData()); } | |
80 | // TODO: multi arg qWarning... |
|
80 | // TODO: multi arg qWarning... | |
81 | void static_Qt_qCritical(const QByteArray& msg) { qCritical(msg.constData()); } |
|
81 | void static_Qt_qCritical(const QByteArray& msg) { qCritical(msg.constData()); } | |
82 | // TODO: multi arg qCritical... |
|
82 | // TODO: multi arg qCritical... | |
83 | void static_Qt_qFatal(const QByteArray& msg) { qFatal(msg.constData()); } |
|
83 | void static_Qt_qFatal(const QByteArray& msg) { qFatal(msg.constData()); } | |
84 | // TODO: multi arg qFatal... |
|
84 | // TODO: multi arg qFatal... | |
85 | bool static_Qt_qFuzzyCompare(double a, double b) { return qFuzzyCompare(a, b); } |
|
85 | bool static_Qt_qFuzzyCompare(double a, double b) { return qFuzzyCompare(a, b); } | |
86 | double static_Qt_qMax(double a, double b) { return qMax(a, b); } |
|
86 | double static_Qt_qMax(double a, double b) { return qMax(a, b); } | |
87 | double static_Qt_qMin(double a, double b) { return qMin(a, b); } |
|
87 | double static_Qt_qMin(double a, double b) { return qMin(a, b); } | |
88 | int static_Qt_qRound(double a) { return qRound(a); } |
|
88 | int static_Qt_qRound(double a) { return qRound(a); } | |
89 | qint64 static_Qt_qRound64(double a) { return qRound64(a); } |
|
89 | qint64 static_Qt_qRound64(double a) { return qRound64(a); } | |
90 | const char* static_Qt_qVersion() { return qVersion(); } |
|
90 | const char* static_Qt_qVersion() { return qVersion(); } | |
91 | int static_Qt_qrand() { return qrand(); } |
|
91 | int static_Qt_qrand() { return qrand(); } | |
92 | void static_Qt_qsrand(uint a) { qsrand(a); } |
|
92 | void static_Qt_qsrand(uint a) { qsrand(a); } | |
93 |
|
93 | |||
94 |
QString tr(QObject* obj, const QByteArray& text, const QByteArray& |
|
94 | QString tr(QObject* obj, const QByteArray& text, const QByteArray& ambig = QByteArray(), int n = -1); | |
95 |
|
95 | |||
96 | QByteArray static_Qt_SIGNAL(const QByteArray& s) { return QByteArray("2") + s; } |
|
96 | QByteArray static_Qt_SIGNAL(const QByteArray& s) { return QByteArray("2") + s; } | |
97 | QByteArray static_Qt_SLOT(const QByteArray& s) { return QByteArray("1") + s; } |
|
97 | QByteArray static_Qt_SLOT(const QByteArray& s) { return QByteArray("1") + s; } | |
98 |
|
98 | |||
99 | //TODO: add findChild/findChildren/children/... |
|
99 | //TODO: add findChild/findChildren/children/... | |
100 | }; |
|
100 | }; | |
101 |
|
101 | |||
102 |
|
102 | |||
103 | #endif |
|
103 | #endif |
General Comments 0
You need to be logged in to leave comments.
Login now