@@ -0,0 +1,175 | |||
|
1 | #!/bin/bash | |
|
2 | ||
|
3 | # | |
|
4 | # file is included into the qmake systym in the common.prf file | |
|
5 | # | |
|
6 | ||
|
7 | ||
|
8 | ||
|
9 | ||
|
10 | # | |
|
11 | # | |
|
12 | # | |
|
13 | ||
|
14 | main() { | |
|
15 | ||
|
16 | ||
|
17 | ||
|
18 | verbose=0 | |
|
19 | fix_release_lib=1 | |
|
20 | fix_debug_lib=0 | |
|
21 | ||
|
22 | # parsing command line options | |
|
23 | while getopts ":vh?dra" opt; do | |
|
24 | case $opt in | |
|
25 | h) | |
|
26 | echo "Help for osx-file-dylib -[vh] | |
|
27 | v : verbose output | |
|
28 | d : fix debug libs | |
|
29 | r : fix release libs (default) | |
|
30 | a : fix all libs | |
|
31 | " >&2 | |
|
32 | exit | |
|
33 | ;; | |
|
34 | v) | |
|
35 | echo "-v was triggered!" >&2 | |
|
36 | verbose=1 # means it is on | |
|
37 | ;; | |
|
38 | d) | |
|
39 | fix_debug_lib=1 # means it is on | |
|
40 | ;; | |
|
41 | r) | |
|
42 | fix_release_lib=1 # means it is on | |
|
43 | ;; | |
|
44 | a) | |
|
45 | fix_release_lib=1 | |
|
46 | fix_debug_lib=1 | |
|
47 | ;; | |
|
48 | \?) | |
|
49 | echo "Invalid option: -$OPTARG" >&2 | |
|
50 | ;; | |
|
51 | esac | |
|
52 | done | |
|
53 | ||
|
54 | ||
|
55 | ||
|
56 | BASEPATH=`pwd` | |
|
57 | ||
|
58 | if [ $verbose == 1 ] ; then | |
|
59 | echo "Basepath = " $BASEPATH | |
|
60 | ls -l *.dylib | |
|
61 | fi | |
|
62 | ||
|
63 | ||
|
64 | # first the release files | |
|
65 | if [ $fix_release_lib == 1 ] ; then | |
|
66 | fixit libPythonQt.1.0.0.dylib libPythonQt_QtAll.1.0.0.dylib $verbose | |
|
67 | fi | |
|
68 | ||
|
69 | # then the debug libs | |
|
70 | if [ $fix_debug_lib == 1 ] ; then | |
|
71 | fixit libPythonQt_d.1.0.0.dylib libPythonQt_QtAll_d.1.0.0.dylib $verbose | |
|
72 | fi | |
|
73 | ||
|
74 | if [ $verbose ] ; then | |
|
75 | #tput bold | |
|
76 | echo $LIBPYTHONQT | |
|
77 | #tput sgr0 | |
|
78 | otool -L $LIBPYTHONQT | |
|
79 | #install_name_tool -id $FULLLIBPYTHONQT $FULLLIBPYTHONQT | |
|
80 | #otool -L $LIBPYTHONQT | |
|
81 | ||
|
82 | #tput bold | |
|
83 | echo $LIBPYTHONQTALL | |
|
84 | #tput sgr0 | |
|
85 | otool -L $LIBPYTHONQTALL | |
|
86 | #install_name_tool -id $FULLLIBPYTHONQTALL $FULLLIBPYTHONQTALL | |
|
87 | ||
|
88 | #install_name_tool -change libPythonQt.1.dylib $FULLLIBPYTHONQT $LIBPYTHONQTALL | |
|
89 | ||
|
90 | #otool -L $LIBPYTHONQTALL | |
|
91 | fi | |
|
92 | } | |
|
93 | ||
|
94 | ||
|
95 | ||
|
96 | ||
|
97 | ||
|
98 | ||
|
99 | ||
|
100 | function fixit { | |
|
101 | # | |
|
102 | # fixit(LIBPYTHONQT, LIBPYTHONQTALL, VERBOSE) | |
|
103 | # | |
|
104 | ||
|
105 | ||
|
106 | LIBPYTHONQT=$1 | |
|
107 | LIBPYTHONQTALL=$2 | |
|
108 | VERBOSE=$3 | |
|
109 | ||
|
110 | BASEPATH=`pwd` | |
|
111 | FULLLIBPYTHONQT=$BASEPATH"/"$LIBPYTHONQT | |
|
112 | FULLLIBPYTHONQTALL=$BASEPATH"/"$LIBPYTHONQTALL | |
|
113 | ||
|
114 | ||
|
115 | if [ -e $LIBPYTHONQT ] | |
|
116 | then | |
|
117 | #tput bold | |
|
118 | echo "fixing " $LIBPYTHONQT | |
|
119 | #tput sgr0 | |
|
120 | #otool -L $LIBPYTHONQT | |
|
121 | install_name_tool -id $FULLLIBPYTHONQT $FULLLIBPYTHONQT | |
|
122 | #otool -L $LIBPYTHONQT | |
|
123 | else | |
|
124 | #tput bold | |
|
125 | echo "[Warning] " $LIBPYTHONQT " is missing here:" `pwd` | |
|
126 | #tput sgr0 | |
|
127 | fi | |
|
128 | ||
|
129 | ||
|
130 | if [ -e $LIBPYTHONQTALL ] | |
|
131 | then | |
|
132 | #tput bold | |
|
133 | echo "fixing " $LIBPYTHONQTALL | |
|
134 | #tput sgr0 | |
|
135 | #otool -L $LIBPYTHONQTALL | |
|
136 | install_name_tool -id $FULLLIBPYTHONQTALL $FULLLIBPYTHONQTALL | |
|
137 | ||
|
138 | echo "libPython:" $LIBPYTHONQT | |
|
139 | # if debug then | |
|
140 | if [[ $LIBPYTHONQTALL == *_d.*dylib ]] | |
|
141 | then | |
|
142 | LIBPYTHONQT1=libPythonQt_d.1.dylib | |
|
143 | else | |
|
144 | LIBPYTHONQT1=libPythonQt.1.dylib | |
|
145 | fi | |
|
146 | ||
|
147 | install_name_tool -change $LIBPYTHONQT1 $FULLLIBPYTHONQT $LIBPYTHONQTALL | |
|
148 | ||
|
149 | ||
|
150 | #otool -L $LIBPYTHONQTALL | |
|
151 | else | |
|
152 | #tput bold | |
|
153 | echo "[Warning] " $LIBPYTHONQTALL " is missing here:" `pwd` | |
|
154 | #tput sgr0 | |
|
155 | fi | |
|
156 | ||
|
157 | ||
|
158 | ||
|
159 | } | |
|
160 | ||
|
161 | ||
|
162 | ||
|
163 | # now we actually call main | |
|
164 | main $@ | |
|
165 | ||
|
166 | ||
|
167 | ||
|
168 | ||
|
169 | ||
|
170 | ||
|
171 | ||
|
172 | ||
|
173 | ||
|
174 | ||
|
175 |
@@ -46,7 +46,9 endif() | |||
|
46 | 46 | if("${generated_cpp_suffix}" STREQUAL "_46") |
|
47 | 47 | set(generated_cpp_suffix "_47") # Also use 4.7 wrappers for 4.6.x version |
|
48 | 48 | endif() |
|
49 | if("${generated_cpp_suffix}" STREQUAL "_51") | |
|
49 | ||
|
50 | # All 5.x use the same for now | |
|
51 | if("${QT_VERSION_MAJOR}" STREQUAL "5") | |
|
50 | 52 | set(generated_cpp_suffix "_50") |
|
51 | 53 | endif() |
|
52 | 54 |
@@ -1,5 +1,10 | |||
|
1 | 1 | TEMPLATE = subdirs |
|
2 | 2 | |
|
3 | 3 | CONFIG += ordered |
|
4 |
|
|
|
5 | SUBDIRS = src extensions generator_50 | |
|
4 | SUBDIRS = src extensions tests examples | |
|
5 | ||
|
6 | #contains(QT_MAJOR_VERSION, 5) { | |
|
7 | #SUBDIRS += generator_50 | |
|
8 | #} else { | |
|
9 | #SUBDIRS += generator | |
|
10 | #} |
@@ -58,7 +58,7 IF(Python_FIND_VERSION_EXACT) | |||
|
58 | 58 | ELSE(Python_FIND_VERSION_EXACT) |
|
59 | 59 | # Version lists |
|
60 | 60 | SET(_PYTHON_3_KNOWN_VERSIONS ${PYTHON_3_ADDITIONAL_VERSIONS} |
|
61 | "3.3" "3.2" "3.1" "3.0") | |
|
61 | "3.4" "3.3" "3.2" "3.1" "3.0") | |
|
62 | 62 | SET(_PYTHON_2_KNOWN_VERSIONS ${PYTHON_2_ADDITIONAL_VERSIONS} |
|
63 | 63 | "2.7" "2.6" "2.5" "2.4" "2.3" "2.2" "2.1" "2.0" "1.6" "1.5") |
|
64 | 64 | SET(_PYTHON_2_TEST_VERSIONS) |
@@ -1,5 +1,6 | |||
|
1 | 1 | #include <PythonQt.h> |
|
2 | 2 | #include <QtGui> |
|
3 | #include <QApplication> | |
|
3 | 4 | |
|
4 | 5 | int main (int argc, char* argv[]) { |
|
5 | 6 | QApplication app(argc, argv); |
@@ -6,8 +6,14 mac:CONFIG -= app_bundle | |||
|
6 | 6 | |
|
7 | 7 | DESTDIR = ../../lib |
|
8 | 8 | |
|
9 | contains(QT_MAJOR_VERSION, 5) { | |
|
10 | QT += widgets | |
|
11 | } | |
|
12 | ||
|
13 | ||
|
9 | 14 | include ( ../../build/common.prf ) |
|
10 | include ( ../../build/PythonQt.prf ) | |
|
15 | CONFIG+=BUILDING_QTALL | |
|
16 | include ( ../../build/pythonqt.prf ) | |
|
11 | 17 | |
|
12 | 18 | SOURCES += \ |
|
13 | 19 | CPPPyWrapperExample.cpp |
@@ -10,7 +10,8 contains(QT_MAJOR_VERSION, 5) { | |||
|
10 | 10 | mac:CONFIG-= app_bundle |
|
11 | 11 | |
|
12 | 12 |
include ( ../../build/common.prf ) |
|
13 | include ( ../../build/PythonQt.prf ) | |
|
13 | CONFIG+=BUILDING_QTALL | |
|
14 | include ( ../../build/pythonqt.prf ) | |
|
14 | 15 | include ( ../../build/PythonQt_QtAll.prf ) |
|
15 | 16 | |
|
16 | 17 |
@@ -9,8 +9,13 TEMPLATE = app | |||
|
9 | 9 | |
|
10 | 10 | DESTDIR = ../../lib |
|
11 | 11 | |
|
12 | contains(QT_MAJOR_VERSION, 5) { | |
|
13 | QT += widgets | |
|
14 | } | |
|
15 | ||
|
12 | 16 | include ( ../../build/common.prf ) |
|
13 | include ( ../../build/PythonQt.prf ) | |
|
17 | CONFIG+=BUILDING_QTALL | |
|
18 | include ( ../../build/pythonqt.prf ) | |
|
14 | 19 | |
|
15 | 20 | HEADERS += \ |
|
16 | 21 | CustomObjects.h |
@@ -9,6 +9,10 TEMPLATE = app | |||
|
9 | 9 | |
|
10 | 10 | DESTDIR = ../../lib |
|
11 | 11 | |
|
12 | contains(QT_MAJOR_VERSION, 5) { | |
|
13 | QT += widgets | |
|
14 | } | |
|
15 | ||
|
12 | 16 | include ( ../../build/common.prf ) |
|
13 | 17 | include ( ../../build/PythonQt.prf ) |
|
14 | 18 |
@@ -10,8 +10,12 TEMPLATE = app | |||
|
10 | 10 | DESTDIR = ../../lib |
|
11 | 11 | |
|
12 | 12 | include ( ../../build/common.prf ) |
|
13 | include ( ../../build/PythonQt.prf ) | |
|
13 | CONFIG+=BUILDING_QTALL | |
|
14 | include ( ../../build/pythonqt.prf ) | |
|
14 | 15 | |
|
16 | contains(QT_MAJOR_VERSION, 5) { | |
|
17 | QT += widgets | |
|
18 | } | |
|
15 | 19 | |
|
16 | 20 | HEADERS += \ |
|
17 | 21 | PyExampleDecorators.h |
@@ -89,6 +89,13 public slots: | |||
|
89 | 89 | |
|
90 | 90 | // add a method to your own CPP object |
|
91 | 91 | int doSomething(YourCPPObject* obj, int arg1) { return obj->doSomething(arg1); } |
|
92 | ||
|
93 | // add a docstring to your own CPP object | |
|
94 | QString doc_YourCPPObject() {return "A C++ Class object";} | |
|
95 | ||
|
96 | // add a docstrint to YourCPPObject::doSomething | |
|
97 | QString doc_YourCPPObject_doSomething() {return "this function does something";} | |
|
98 | ||
|
92 | 99 | }; |
|
93 | 100 | |
|
94 | 101 |
@@ -24,5 +24,11 print yourCpp.doSomething(3); | |||
|
24 | 24 | # show slots available on yourCpp |
|
25 | 25 | print dir(yourCpp) |
|
26 | 26 | |
|
27 | # show docstring of yourCpp | |
|
28 | print yourCpp.__doc__ | |
|
29 | ||
|
30 | # show docstring of yourCpp.doSomething | |
|
31 | print yourCpp.doSomething.__doc__ | |
|
32 | ||
|
27 | 33 | # destructor will be called: |
|
28 | 34 | yourCpp = None |
@@ -11,8 +11,13 DESTDIR = ../../lib | |||
|
11 | 11 | |
|
12 | 12 | CONFIG += console |
|
13 | 13 | |
|
14 | contains(QT_MAJOR_VERSION, 5) { | |
|
15 | QT += widgets | |
|
16 | } | |
|
17 | ||
|
14 | 18 | include ( ../../build/common.prf ) |
|
15 | include ( ../../build/PythonQt.prf ) | |
|
19 | CONFIG+=BUILDING_QTALL | |
|
20 | include ( ../../build/pythonqt.prf ) | |
|
16 | 21 | |
|
17 | 22 | SOURCES += \ |
|
18 | 23 | main.cpp |
@@ -11,8 +11,14 mac:CONFIG -= app_bundle | |||
|
11 | 11 | |
|
12 | 12 | DESTDIR = ../../lib |
|
13 | 13 | |
|
14 | contains(QT_MAJOR_VERSION, 5) { | |
|
15 | QT += widgets | |
|
16 | } | |
|
17 | ||
|
18 | ||
|
14 | 19 | include ( ../../build/common.prf ) |
|
15 | include ( ../../build/PythonQt.prf ) | |
|
20 | CONFIG+=BUILDING_QTALL | |
|
21 | include ( ../../build/pythonqt.prf ) | |
|
16 | 22 | include ( ../../build/PythonQt_QtAll.prf ) |
|
17 | 23 | |
|
18 | 24 | SOURCES += \ |
@@ -11,8 +11,13 mac:CONFIG -= app_bundle | |||
|
11 | 11 | |
|
12 | 12 | DESTDIR = ../../lib |
|
13 | 13 | |
|
14 | contains(QT_MAJOR_VERSION, 5) { | |
|
15 | QT += widgets | |
|
16 | } | |
|
17 | ||
|
14 | 18 | include ( ../../build/common.prf ) |
|
15 | include ( ../../build/PythonQt.prf ) | |
|
19 | CONFIG+=BUILDING_QTALL | |
|
20 | include ( ../../build/pythonqt.prf ) | |
|
16 | 21 | include ( ../../build/PythonQt_QtAll.prf ) |
|
17 | 22 | |
|
18 | 23 | SOURCES += \ |
@@ -74,7 +74,7 QMainWindow* PyExampleObject::createWind | |||
|
74 | 74 | |
|
75 | 75 | QObject* PyExampleObject::findChild(QObject* o, const QString& name) |
|
76 | 76 | { |
|
77 |
return |
|
|
77 | return o->findChild<QObject*>(name); | |
|
78 | 78 | } |
|
79 | 79 | |
|
80 | 80 | QVariantMap PyExampleObject::testMap() |
@@ -9,10 +9,15 TEMPLATE = app | |||
|
9 | 9 | |
|
10 | 10 | DESTDIR = ../../lib |
|
11 | 11 | |
|
12 | contains(QT_MAJOR_VERSION, 5) { | |
|
13 | QT += widgets | |
|
14 | } | |
|
15 | ||
|
12 | 16 | mac:CONFIG-= app_bundle |
|
13 | 17 | |
|
14 | 18 | include ( ../../build/common.prf ) |
|
15 | include ( ../../build/PythonQt.prf ) | |
|
19 | CONFIG+=BUILDING_QTALL | |
|
20 | include ( ../../build/pythonqt.prf ) | |
|
16 | 21 |
include ( ../../build/PythonQt_QtAll.prf ) |
|
17 | 22 | |
|
18 | 23 | HEADERS += \ |
@@ -6,4 +6,5 SUBDIRS = CPPPyWrapperExample \ | |||
|
6 | 6 | PyGuiExample \ |
|
7 | 7 | PyDecoratorsExample \ |
|
8 | 8 | PyScriptingConsole \ |
|
9 | PyLauncher | |
|
9 | PyLauncher \ | |
|
10 | NicePyConsole |
@@ -61,7 +61,5 namespace PythonQt_QtAll | |||
|
61 | 61 | // Does not compile yet: |
|
62 | 62 | // PythonQt_init_QtXmlPatterns(0); |
|
63 | 63 | // PythonQt_init_QtPhonon(0); |
|
64 |
} |
|
|
65 |
} |
|
|
66 | ||
|
67 | ||
|
64 | } | |
|
65 | } |
|
1 | NO CONTENT: modified file chmod 100644 => 100755 |
|
1 | NO CONTENT: modified file chmod 100644 => 100755 |
@@ -71,6 +71,14 public: | |||
|
71 | 71 | explicit pp_output_iterator(std::string &__result): |
|
72 | 72 | _M_result (__result) {} |
|
73 | 73 | |
|
74 | // this copy constructor was needed for Visual Studio 2012 release builds: | |
|
75 | inline pp_output_iterator &operator=(const pp_output_iterator& other) | |
|
76 | { | |
|
77 | *(std::iterator<std::output_iterator_tag, void, void, void, void>*)(this) = other; | |
|
78 | _M_result = other._M_result; | |
|
79 | return *this; | |
|
80 | } | |
|
81 | ||
|
74 | 82 | inline pp_output_iterator &operator=(typename _Container::const_reference __v) |
|
75 | 83 | { |
|
76 | 84 | if (_M_result.capacity () == _M_result.size ()) |
@@ -4539,6 +4539,7 PyObject* constScanLine(QImage* image, i | |||
|
4539 | 4539 | <include file-name="QImage" location="global"/> |
|
4540 | 4540 | <include file-name="QPixmap" location="global"/> |
|
4541 | 4541 | </extra-includes> |
|
4542 | <modify-function signature="event(QEvent*)" remove="all"/> | |
|
4542 | 4543 | <modify-function signature="setMimeData(QMimeData *, QClipboard::Mode)"> |
|
4543 | 4544 | <modify-argument index="1"> |
|
4544 | 4545 | <define-ownership class="java" owner="c++"/> |
@@ -46,6 +46,7 | |||
|
46 | 46 | <reference-count action="ignore"/> |
|
47 | 47 | </modify-argument> |
|
48 | 48 | </modify-function> |
|
49 | <modify-function signature="event(QEvent*)" remove="all"/> | |
|
49 | 50 | </object-type> |
|
50 | 51 | <object-type name="QWebPage::ExtensionOption"/> |
|
51 | 52 | <object-type name="QWebPage::ChooseMultipleFilesExtensionOption"/> |
|
1 | NO CONTENT: modified file chmod 100644 => 100755 |
@@ -9,6 +9,11 | |||
|
9 | 9 | <enum-type name="QGLContext::BindOption" flags="QGLContext::BindOptions"/> |
|
10 | 10 | <enum-type name="QGLShader::ShaderTypeBit" flags="QGLShader::ShaderType"/> |
|
11 | 11 | |
|
12 | <enum-type name="QGLBuffer::Access"/> | |
|
13 | <enum-type name="QGLBuffer::Type"/> | |
|
14 | <enum-type name="QGLBuffer::UsagePattern"/> | |
|
15 | <enum-type name="QGLFunctions::OpenGLFeature"/> | |
|
16 | <enum-type name="QGLFormat::OpenGLContextProfile"/> | |
|
12 | 17 | |
|
13 | 18 | <namespace-type name="QGL"> |
|
14 | 19 | <include file-name="qgl.h" location="global"/> |
@@ -27,6 +32,8 | |||
|
27 | 32 | </value-type> |
|
28 | 33 | |
|
29 | 34 | <value-type name="QGLFramebufferObjectFormat"/> |
|
35 | <object-type name="QGLFunctions"/> | |
|
36 | <object-type name="QGLBuffer"/> | |
|
30 | 37 | <object-type name="QGLShader"/> |
|
31 | 38 | <object-type name="QGLShaderProgram"> |
|
32 | 39 | <!-- Should be disambiguated later by fixing the native pointer API --> |
@@ -546,6 +546,11 PythonQtClassWrapper* PythonQtPrivate::c | |||
|
546 | 546 | PyObject* typeDict = PyDict_New(); |
|
547 | 547 | PyObject* moduleName = PyObject_GetAttrString(parentModule, "__name__"); |
|
548 | 548 | PyDict_SetItemString(typeDict, "__module__", moduleName); |
|
549 | if (!info->doc().isNull()) { | |
|
550 | PyObject* docStr = PythonQtConv::QStringToPyObject(info->doc()); | |
|
551 | PyDict_SetItemString(typeDict, "__doc__", docStr); | |
|
552 | Py_DECREF(docStr); | |
|
553 | } | |
|
549 | 554 | |
|
550 | 555 | PyObject* args = Py_BuildValue("OOO", className, baseClasses, typeDict); |
|
551 | 556 | |
@@ -1283,6 +1288,28 void PythonQtPrivate::addDecorators(QObj | |||
|
1283 | 1288 | PythonQtClassInfo* classInfo = lookupClassInfoAndCreateIfNotPresent(nameOfClass); |
|
1284 | 1289 | PythonQtSlotInfo* newSlot = new PythonQtSlotInfo(NULL, m, i, o, PythonQtSlotInfo::ClassDecorator); |
|
1285 | 1290 | classInfo->addDecoratorSlot(newSlot); |
|
1291 | } else if (signature.startsWith("doc_")) { | |
|
1292 | if ((decoTypes & DocstringDecorator) == 0) continue; | |
|
1293 | QByteArray nameOfClassAndMethod = signature.mid(4, signature.indexOf('(')-4); | |
|
1294 | QList<QByteArray> nameOfClassAndMethodAsList = nameOfClassAndMethod.split('_'); | |
|
1295 | QByteArray nameOfClass = nameOfClassAndMethodAsList.at(0); | |
|
1296 | PythonQtClassInfo* classInfo = lookupClassInfoAndCreateIfNotPresent(nameOfClass); | |
|
1297 | // TODO: make shure that the function does not take arguments and returns a QString | |
|
1298 | QString docString; | |
|
1299 | void* argList[1] = {&docString}; | |
|
1300 | o->qt_metacall(QMetaObject::InvokeMetaMethod, i, argList); | |
|
1301 | if( nameOfClassAndMethodAsList.size() == 1 ) { | |
|
1302 | // __doc__ of class itself | |
|
1303 | classInfo->setDoc(docString); | |
|
1304 | } else { | |
|
1305 | // __doc__ of class method (e.g. public slot) | |
|
1306 | QByteArray nameOfMethod = nameOfClassAndMethodAsList.at(1); | |
|
1307 | PythonQtMemberInfo member = classInfo->member(nameOfMethod); | |
|
1308 | // check if we really found a slot | |
|
1309 | if( member._type == PythonQtMemberInfo::Slot || member._type == PythonQtMemberInfo::Signal ) { | |
|
1310 | member._slot->setDoc(docString); | |
|
1311 | } | |
|
1312 | } | |
|
1286 | 1313 | } else { |
|
1287 | 1314 | if ((decoTypes & InstanceDecorator) == 0) continue; |
|
1288 | 1315 | const PythonQtMethodInfo* info = PythonQtMethodInfo::getCachedMethodInfo(m, NULL); |
@@ -569,6 +569,7 public: | |||
|
569 | 569 | ConstructorDecorator = 2, |
|
570 | 570 | DestructorDecorator = 4, |
|
571 | 571 | InstanceDecorator = 8, |
|
572 | DocstringDecorator = 16, | |
|
572 | 573 | AllDecorators = 0xffff |
|
573 | 574 | }; |
|
574 | 575 |
@@ -603,6 +603,9 QString PythonQtClassInfo::help() | |||
|
603 | 603 | QString h; |
|
604 | 604 | h += QString("--- ") + QString(className()) + QString(" ---\n"); |
|
605 | 605 | |
|
606 | if (!_doc.isNull()) | |
|
607 | h += "Description:\n" + _doc + "\n"; | |
|
608 | ||
|
606 | 609 | if (_isQObject) { |
|
607 | 610 | h += "Properties:\n"; |
|
608 | 611 |
@@ -187,6 +187,12 public: | |||
|
187 | 187 | //! clear all members that where cached as "NotFound" |
|
188 | 188 | void clearNotFoundCachedMembers(); |
|
189 | 189 | |
|
190 | //! set the python docstring (__doc__) for this class | |
|
191 | void setDoc(const QString& str) {_doc=str;} | |
|
192 | ||
|
193 | //! get the python docstring (__doc__) for this class | |
|
194 | const QString& doc() const {return _doc;} | |
|
195 | ||
|
190 | 196 | private: |
|
191 | 197 | void createEnumWrappers(); |
|
192 | 198 | void createEnumWrappers(const QMetaObject* meta); |
@@ -239,6 +245,8 private: | |||
|
239 | 245 | bool _isQObject; |
|
240 | 246 | bool _enumsCreated; |
|
241 | 247 | |
|
248 | QString _doc; | |
|
249 | ||
|
242 | 250 | }; |
|
243 | 251 | |
|
244 | 252 | //--------------------------------------------------------------- |
@@ -181,13 +181,13 static void initializeSlots(PythonQtClas | |||
|
181 | 181 | } |
|
182 | 182 | |
|
183 | 183 | if (typeSlots & PythonQt::Type_InplaceAdd) { |
|
184 | wrap->_base.as_number.nb_add = (binaryfunc)PythonQtInstanceWrapper_iadd; | |
|
184 | wrap->_base.as_number.nb_inplace_add = (binaryfunc)PythonQtInstanceWrapper_iadd; | |
|
185 | 185 | } |
|
186 | 186 | if (typeSlots & PythonQt::Type_InplaceSubtract) { |
|
187 | wrap->_base.as_number.nb_subtract = (binaryfunc)PythonQtInstanceWrapper_isub; | |
|
187 | wrap->_base.as_number.nb_inplace_subtract = (binaryfunc)PythonQtInstanceWrapper_isub; | |
|
188 | 188 | } |
|
189 | 189 | if (typeSlots & PythonQt::Type_InplaceMultiply) { |
|
190 | wrap->_base.as_number.nb_multiply = (binaryfunc)PythonQtInstanceWrapper_imul; | |
|
190 | wrap->_base.as_number.nb_inplace_multiply = (binaryfunc)PythonQtInstanceWrapper_imul; | |
|
191 | 191 | } |
|
192 | 192 | if (typeSlots & PythonQt::Type_InplaceDivide) { |
|
193 | 193 | #ifndef PY3K |
@@ -101,6 +101,12 public: | |||
|
101 | 101 | //! add an alias for a typename, e.g. QObjectList and QList<QObject*>. |
|
102 | 102 | static void addParameterTypeAlias(const QByteArray& alias, const QByteArray& name); |
|
103 | 103 | |
|
104 | //! set the docstirng | |
|
105 | void setDoc(const QString& str) {_doc = str;} | |
|
106 | ||
|
107 | //! get the docstring | |
|
108 | const QString& doc() const {return _doc; } | |
|
109 | ||
|
104 | 110 | protected: |
|
105 | 111 | static void fillParameterInfo(ParameterInfo& type, const QByteArray& name, PythonQtClassInfo* classInfo); |
|
106 | 112 | |
@@ -111,6 +117,9 public: | |||
|
111 | 117 | static QHash<QByteArray, PythonQtMethodInfo*> _cachedSignatures; |
|
112 | 118 | |
|
113 | 119 | QList<ParameterInfo> _parameters; |
|
120 | ||
|
121 | //! stores the docstring | |
|
122 | QString _doc; | |
|
114 | 123 | }; |
|
115 | 124 | |
|
116 | 125 | //! stores information about a slot, including a next pointer to overloaded slots |
@@ -413,8 +413,10 meth_dealloc(PythonQtSlotFunctionObject | |||
|
413 | 413 | } |
|
414 | 414 | |
|
415 | 415 | static PyObject * |
|
416 |
meth_get__doc__(PythonQtSlotFunctionObject * |
|
|
416 | meth_get__doc__(PythonQtSlotFunctionObject *m, void * /*closure*/) | |
|
417 | 417 | { |
|
418 | if( !m->m_ml->doc().isEmpty() ) | |
|
419 | return PythonQtConv::QStringToPyObject(m->m_ml->doc()); | |
|
418 | 420 | Py_INCREF(Py_None); |
|
419 | 421 | return Py_None; |
|
420 | 422 | } |
@@ -10,9 +10,18 TEMPLATE = lib | |||
|
10 | 10 | |
|
11 | 11 | DESTDIR = ../lib |
|
12 | 12 | |
|
13 |
CONFIG += qt |
|
|
13 | CONFIG += qt | |
|
14 | 14 | CONFIG -= flat |
|
15 | 15 | |
|
16 | ||
|
17 | # allow to choose static linking through the environment variable PYTHONQT_STATIC | |
|
18 | PYTHONQT_STATIC = $$(PYTHONQT_STATIC) | |
|
19 | isEmpty(PYTHONQT_STATIC) { | |
|
20 | CONFIG += dll | |
|
21 | } else { | |
|
22 | CONFIG += static | |
|
23 | } | |
|
24 | ||
|
16 | 25 | contains(QT_MAJOR_VERSION, 5) { |
|
17 | 26 | QT += widgets |
|
18 | 27 | } |
@@ -25,28 +34,3 include ( ../build/common.prf ) | |||
|
25 | 34 | include ( ../build/python.prf ) |
|
26 | 35 | |
|
27 | 36 | include ( src.pri ) |
|
28 | #added by Aje for install QT dirs. | |
|
29 | #Copyed from Qscintilla config ;). | |
|
30 | ||
|
31 | ||
|
32 | pythoncfg.path = $$[QT_INSTALL_PREFIX]/mkspecs/features | |
|
33 | pythoncfg.files = ../build/pythonqt.prf | |
|
34 | ||
|
35 | target.path = $$[QT_INSTALL_LIBS] | |
|
36 | isEmpty(target.path) { | |
|
37 | target.path = $(QTDIR)/lib | |
|
38 | } | |
|
39 | ||
|
40 | header.path = $$[QT_INSTALL_HEADERS]/PythonQt | |
|
41 | header.files = *.h | |
|
42 | isEmpty(header.path) { | |
|
43 | header.path = $(QTDIR)/include/PythonQt | |
|
44 | header.files = *.h | |
|
45 | } | |
|
46 | guiheader.path = $$[QT_INSTALL_HEADERS]/PythonQt/gui | |
|
47 | guiheader.files = gui/*.h | |
|
48 | isEmpty(guiheader.path) { | |
|
49 | guiheader.path = $(QTDIR)/include/PythonQt/gui | |
|
50 | guiheader.files = gui/*.h | |
|
51 | } | |
|
52 | INSTALLS += header target guiheader pythoncfg |
@@ -269,19 +269,19 void PythonQtTestSlotCalling::testCppFac | |||
|
269 | 269 | |
|
270 | 270 | } |
|
271 | 271 | |
|
272 | PQCppObject2Decorator::TestEnumFlag PQCppObject2Decorator::testEnumFlag1(PQCppObject2* obj, PQCppObject2Decorator::TestEnumFlag flag) { | |
|
272 | PQCppObject2Decorator::TestEnumFlag PQCppObject2Decorator::testEnumFlag1(PQCppObject2* /*obj*/, PQCppObject2Decorator::TestEnumFlag flag) { | |
|
273 | 273 | return flag; |
|
274 | 274 | } |
|
275 | 275 | |
|
276 | PQCppObject2::TestEnumFlag PQCppObject2Decorator::testEnumFlag2(PQCppObject2* obj, PQCppObject2::TestEnumFlag flag) { | |
|
276 | PQCppObject2::TestEnumFlag PQCppObject2Decorator::testEnumFlag2(PQCppObject2* /*obj*/, PQCppObject2::TestEnumFlag flag) { | |
|
277 | 277 | return flag; |
|
278 | 278 | } |
|
279 | 279 | |
|
280 | 280 | // with int overload |
|
281 | PQCppObject2Decorator::TestEnumFlag PQCppObject2Decorator::testEnumFlag3(PQCppObject2* obj, int flag) { | |
|
281 | PQCppObject2Decorator::TestEnumFlag PQCppObject2Decorator::testEnumFlag3(PQCppObject2* /*obj*/, int /*flag*/) { | |
|
282 | 282 | return (TestEnumFlag)-1; |
|
283 | 283 | } |
|
284 | PQCppObject2Decorator::TestEnumFlag PQCppObject2Decorator::testEnumFlag3(PQCppObject2* obj, PQCppObject2Decorator::TestEnumFlag flag) { | |
|
284 | PQCppObject2Decorator::TestEnumFlag PQCppObject2Decorator::testEnumFlag3(PQCppObject2* /*obj*/, PQCppObject2Decorator::TestEnumFlag flag) { | |
|
285 | 285 | return flag; |
|
286 | 286 | } |
|
287 | 287 | |
@@ -538,25 +538,25 void PythonQtTestApi::testQColorDecorato | |||
|
538 | 538 | QVERIFY(colorClass.call("red", QVariantList() << QColor(255,0,0)).toInt() == 255); |
|
539 | 539 | } |
|
540 | 540 | |
|
541 | QByteArray PythonQtTestApiHelper::readFileAsBytes(const QString& filename) | |
|
541 | QByteArray PythonQtTestApiHelper::readFileAsBytes(const QString& /*filename*/) | |
|
542 | 542 | { |
|
543 | 543 | QByteArray b; |
|
544 | 544 | return b; |
|
545 | 545 | } |
|
546 | 546 | |
|
547 | QByteArray PythonQtTestApiHelper::readSourceFile(const QString& filename, bool& ok) | |
|
547 | QByteArray PythonQtTestApiHelper::readSourceFile(const QString& /*filename*/, bool& ok) | |
|
548 | 548 | { |
|
549 | 549 | QByteArray b; |
|
550 | 550 | ok = true; |
|
551 | 551 | return b; |
|
552 | 552 | } |
|
553 | 553 | |
|
554 | bool PythonQtTestApiHelper::exists(const QString& filename) | |
|
554 | bool PythonQtTestApiHelper::exists(const QString& /*filename*/) | |
|
555 | 555 | { |
|
556 | 556 | return true; |
|
557 | 557 | } |
|
558 | 558 | |
|
559 | QDateTime PythonQtTestApiHelper::lastModifiedDate(const QString& filename) { | |
|
559 | QDateTime PythonQtTestApiHelper::lastModifiedDate(const QString& /*filename*/) { | |
|
560 | 560 | return QDateTime::currentDateTime(); |
|
561 | 561 | } |
|
562 | 562 |
@@ -240,10 +240,10 public slots: | |||
|
240 | 240 | PQCppObjectNoWrap* new_PQCppObjectNoWrap() { |
|
241 | 241 | return new PQCppObjectNoWrap(0); |
|
242 | 242 | } |
|
243 | PQCppObjectNoWrap* new_PQCppObjectNoWrap(const PQCppObjectNoWrap& other) { | |
|
243 | PQCppObjectNoWrap* new_PQCppObjectNoWrap(const PQCppObjectNoWrap& /*other*/) { | |
|
244 | 244 | return new PQCppObjectNoWrap(1); |
|
245 | 245 | } |
|
246 | PQCppObjectNoWrap* new_PQCppObjectNoWrap(double value) { | |
|
246 | PQCppObjectNoWrap* new_PQCppObjectNoWrap(double /*value*/) { | |
|
247 | 247 | return new PQCppObjectNoWrap(2); |
|
248 | 248 | } |
|
249 | 249 | |
@@ -352,13 +352,13 public slots: | |||
|
352 | 352 | void testNoArg() { _called = true; } |
|
353 | 353 | |
|
354 | 354 | //! overload test! |
|
355 |
void overload(bool |
|
|
356 |
void overload(float |
|
|
357 |
void overload(int |
|
|
358 |
void overload(const QString& |
|
|
359 |
void overload(const QStringList& |
|
|
360 |
void overload(QObject* |
|
|
361 |
void overload(float |
|
|
355 | void overload(bool) { _calledOverload = 0; _called = true; } | |
|
356 | void overload(float) { _calledOverload = 1; _called = true;} | |
|
357 | void overload(int) { _calledOverload = 2; _called = true;} | |
|
358 | void overload(const QString&) { _calledOverload = 3; _called = true;} | |
|
359 | void overload(const QStringList&) { _calledOverload = 4; _called = true;} | |
|
360 | void overload(QObject*) { _calledOverload = 5; _called = true;} | |
|
361 | void overload(float, int) { _calledOverload = 6; _called = true;} | |
|
362 | 362 | |
|
363 | 363 | //! POD values: |
|
364 | 364 | int getInt(int a) { _called = true; return a; } |
@@ -5,19 +5,35 | |||
|
5 | 5 | # -------------------------------------------------- |
|
6 | 6 | TARGET = PythonQtTest |
|
7 | 7 | TEMPLATE = app |
|
8 | DESTDIR = ../lib | |
|
9 | ||
|
10 | mac { | |
|
11 | CONFIG -= app_bundle | |
|
12 | } | |
|
13 | ||
|
14 | QT += testlib | |
|
15 | ||
|
16 | include ( ../build/common.prf ) | |
|
17 | CONFIG+=BUILDING_QTALL | |
|
18 | include ( ../build/pythonqt.prf ) | |
|
8 | 19 | |
|
9 | 20 | contains(QT_MAJOR_VERSION, 5) { |
|
10 |
QT += |
|
|
11 | } else { | |
|
12 | CONFIG += qtestlib | |
|
21 | QT += widgets | |
|
13 | 22 | } |
|
14 | 23 | |
|
15 | include ( ../build/common.prf ) | |
|
16 | include ( ../build/PythonQt.prf ) | |
|
17 | ||
|
18 | 24 | HEADERS += \ |
|
19 | 25 | PythonQtTests.h |
|
20 | 26 | |
|
21 | 27 | SOURCES += \ |
|
22 | 28 | PythonQtTestMain.cpp \ |
|
23 | 29 | PythonQtTests.cpp |
|
30 | ||
|
31 | # run the tests after compiling | |
|
32 | macx { | |
|
33 | QMAKE_POST_LINK = cd $${DESTDIR} && ./$${TARGET} | |
|
34 | } else:win32 { | |
|
35 | QMAKE_POST_LINK = \"$${DESTDIR}/$${TARGET}.exe\" | |
|
36 | } else:unix { | |
|
37 | # linux | |
|
38 | QMAKE_POST_LINK = cd $${DESTDIR} && LD_LIBRARY_PATH=$$(LD_LIBRARY_PATH):./ xvfb-run -a ./$${TARGET} | |
|
39 | } |
General Comments 0
You need to be logged in to leave comments.
Login now