##// END OF EJS Templates
Start Python 3.x Port...
Orochimarufan -
r206:316b4928f53f
parent child
Show More
@@ -1,139 +1,138
1 1 project(PythonQt)
2 2 cmake_minimum_required(VERSION 2.8.10)
3 3
4 4 include(CTestUseLaunchers OPTIONAL)
5 5
6 6 set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
7 7
8 8 #-----------------------------------------------------------------------------
9 9 # Debug
10 10 option(PythonQt_DEBUG "Enable/Disable PythonQt debug output" OFF)
11 11 if(PythonQt_DEBUG)
12 12 add_definitions(-DPYTHONQT_DEBUG)
13 13 else()
14 14 remove_definitions(-DPYTHONQT_DEBUG)
15 15 endif()
16 16
17 17 #-----------------------------------------------------------------------------
18 18 # Qt
19 19 option(PythonQt_Qt5 "Use Qt 5.x (5.1+)" OFF)
20 20 if(PythonQt_Qt5)
21 21 include(PythonQt_Qt_5x)
22 22 else(PythonQt_Qt5)
23 23 include(PythonQt_Qt_4x)
24 24 endif(PythonQt_Qt5)
25 25
26 26 #-----------------------------------------------------------------------------
27 27 # The variable "generated_cpp_suffix" allows to conditionnally compile the generated wrappers
28 28 # associated with the Qt version being used.
29 29 if(PythonQt_Qt5)
30 30 set(generated_cpp_suffix "_${Qt5Core_VERSION_MAJOR}${Qt5Core_VERSION_MINOR}")
31 31 else()
32 32 set(generated_cpp_suffix "_${QT_VERSION_MAJOR}${QT_VERSION_MINOR}")
33 33 endif()
34 34
35 35 if("${generated_cpp_suffix}" STREQUAL "_48")
36 36 set(generated_cpp_suffix "")
37 37 endif()
38 38 if("${generated_cpp_suffix}" STREQUAL "_46")
39 39 set(generated_cpp_suffix "_47") # Also use 4.7 wrappers for 4.6.x version
40 40 endif()
41 41 if("${generated_cpp_suffix}" STREQUAL "_51")
42 42 set(generated_cpp_suffix "_50")
43 43 endif()
44 44
45 45 #-----------------------------------------------------------------------------
46 46 # Generator
47 #if(PythonQt_Qt5)
48 # add_subdirectory(generator_50 EXCLUDE_FROM_ALL)
49 # add_custom_target(generator)
50 # add_dependencies(generator pythonqt_generator)
51 #endif()
47 if(PythonQt_Qt5)
48 add_subdirectory(generator_50 EXCLUDE_FROM_ALL)
49 add_custom_target(generator)
50 add_dependencies(generator pythonqt_generator)
51 endif()
52 52
53 53 # TODO
54 54
55 55 #-----------------------------------------------------------------------------
56 56 # Build options
57 57
58 58 #option(PythonQt_Wrap_QtAll "Make all Qt components available in python" OFF)
59 59 #
60 60 #set(qtlibs core gui network opengl sql svg uitools webkit xml xmlpatterns)
61 61 #foreach(qtlib ${qtlibs})
62 62 # OPTION(PythonQt_Wrap_Qt${qtlib} "Make all of Qt${qtlib} available in python" OFF)
63 63 #endforeach()
64 64
65 65 # Force option if it applies
66 66 #if(PythonQt_Wrap_QtAll)
67 67 # list(REMOVE_ITEM qtlibs xmlpatterns) # xmlpatterns wrapper does *NOT* build at all :(
68 68 # foreach(qtlib ${qtlibs})
69 69 # if(NOT ${PythonQt_Wrap_Qt${qtlib}})
70 70 # set(PythonQt_Wrap_Qt${qtlib} ON CACHE BOOL "Make all of Qt${qtlib} available in python" FORCE)
71 71 # message(STATUS "Enabling [PythonQt_Wrap_Qt${qtlib}] because of [PythonQt_Wrap_QtAll] evaluates to True")
72 72 # endif()
73 73 # endforeach()
74 74 #endif()
75 75
76 76 #-----------------------------------------------------------------------------
77 77 # Add extra sources
78 78 #foreach(qtlib core gui network opengl sql svg uitools webkit xml xmlpatterns)
79 79 #
80 80 # if (${PythonQt_Wrap_Qt${qtlib}})
81 81 #
82 82 # ADD_DEFINITIONS(-DPYTHONQT_WRAP_Qt${qtlib})
83 83 #
84 84 # set(file_prefix generated_cpp${generated_cpp_suffix}/com_trolltech_qt_${qtlib}/com_trolltech_qt_${qtlib})
85 85 #
86 86 # foreach(index RANGE 0 11)
87 87 #
88 88 # # Source files
89 89 # if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file_prefix}${index}.cpp)
90 90 # list(APPEND sources ${file_prefix}${index}.cpp)
91 91 # endif()
92 92 #
93 93 # # Headers that should run through moc
94 94 # if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file_prefix}${index}.h)
95 95 # list(APPEND moc_sources ${file_prefix}${index}.h)
96 96 # endif()
97 97 #
98 98 # endforeach()
99 99 #
100 100 # list(APPEND sources ${file_prefix}_init.cpp)
101 101 #
102 102 # endif()
103 103 #endforeach()
104 104
105 105 #-----------------------------------------------------------------------------
106 106 # Find Python
107 107 option(PythonQt_Python3 "Use Python 3.x (3.3+)" OFF)
108 108 if(PythonQt_Python3)
109 109 set(PythonQt_PythonMin 3.3)
110 add_definitions(PYTHON3K)
111 110 else(PythonQt_Python3)
112 111 set(PythonQt_PythonMin 2.6)
113 112 endif()
114 113
115 114 find_package(Python ${PythonQt_PythonMin} REQUIRED)
116 115 include_directories(${PYTHON_INCLUDE_DIRS})
117 116 add_definitions(-DPYTHONQT_USE_RELEASE_PYTHON_FALLBACK)
118 117
119 118 add_subdirectory(src)
120 119
121 120 #-----------------------------------------------------------------------------
122 121 # Tests
123 122 add_subdirectory(tests EXCLUDE_FROM_ALL)
124 123 # test alias
125 124 add_custom_target(test COMMAND tests/PythonQtTest WORKING_DIRECTORY ${CURRENT_BINARY_DIR})
126 125 add_dependencies(test PythonQtTest)
127 126
128 127 #-----------------------------------------------------------------------------
129 128 # Extenseions (QtAll)
130 129 add_subdirectory(extensions EXCLUDE_FROM_ALL)
131 130 # QtAll alias
132 131 add_custom_target(QtAll)
133 132 add_dependencies(QtAll PythonQt_QtAll)
134 133
135 134 #-----------------------------------------------------------------------------
136 135 # Examples
137 136 include_directories(src)
138 137 include_directories(extensions/PythonQt_QtAll)
139 138 add_subdirectory(examples EXCLUDE_FROM_ALL)
@@ -1,1063 +1,1067
1 1 #include <PythonQt.h>
2 2 #include <QDate>
3 3 #include <QGesture>
4 4 #include <QNoImplicitBoolCast>
5 5 #include <QObject>
6 6 #include <QStringList>
7 7 #include <QTextDocument>
8 8 #include <QVariant>
9 9 #include <qbitarray.h>
10 10 #include <qbytearray.h>
11 11 #include <qdatetime.h>
12 12 #include <qlist.h>
13 13 #include <qlocale.h>
14 14 #include <qmatrix.h>
15 15 #include <qmatrix4x4.h>
16 16 #include <qnamespace.h>
17 17 #include <qpoint.h>
18 18 #include <qrect.h>
19 19 #include <qregexp.h>
20 20 #include <qsize.h>
21 21 #include <qstringlist.h>
22 22 #include <qtransform.h>
23 23 #include <qurl.h>
24 24
25 25
26 26
27 27 class PythonQtWrapper_QBitArray : public QObject
28 28 { Q_OBJECT
29 29 public:
30 30 public slots:
31 31 QBitArray* new_QBitArray();
32 32 QBitArray* new_QBitArray(const QBitArray& other);
33 33 QBitArray* new_QBitArray(int size, bool val = false);
34 34 void delete_QBitArray(QBitArray* obj) { delete obj; }
35 35 bool at(QBitArray* theWrappedObject, int i) const;
36 36 void clear(QBitArray* theWrappedObject);
37 37 void clearBit(QBitArray* theWrappedObject, int i);
38 38 int count(QBitArray* theWrappedObject) const;
39 39 int count(QBitArray* theWrappedObject, bool on) const;
40 40 void fill(QBitArray* theWrappedObject, bool val, int first, int last);
41 41 bool fill(QBitArray* theWrappedObject, bool val, int size = -1);
42 42 bool isEmpty(QBitArray* theWrappedObject) const;
43 43 bool isNull(QBitArray* theWrappedObject) const;
44 44 bool __ne__(QBitArray* theWrappedObject, const QBitArray& other) const;
45 45 QBitArray __and__(QBitArray* theWrappedObject, const QBitArray& arg__2);
46 46 QBitArray* __iand__(QBitArray* theWrappedObject, const QBitArray& arg__1);
47 47 QBitArray* operator_assign(QBitArray* theWrappedObject, const QBitArray& other);
48 48 bool __eq__(QBitArray* theWrappedObject, const QBitArray& other) const;
49 49 QBitArray __xor__(QBitArray* theWrappedObject, const QBitArray& arg__2);
50 50 QBitArray* __ixor__(QBitArray* theWrappedObject, const QBitArray& arg__1);
51 51 QBitArray __or__(QBitArray* theWrappedObject, const QBitArray& arg__2);
52 52 QBitArray* __ior__(QBitArray* theWrappedObject, const QBitArray& arg__1);
53 53 QBitArray __invert__(QBitArray* theWrappedObject) const;
54 54 void resize(QBitArray* theWrappedObject, int size);
55 55 void setBit(QBitArray* theWrappedObject, int i);
56 56 void setBit(QBitArray* theWrappedObject, int i, bool val);
57 57 int size(QBitArray* theWrappedObject) const;
58 58 void swap(QBitArray* theWrappedObject, QBitArray& other);
59 59 bool testBit(QBitArray* theWrappedObject, int i) const;
60 60 bool toggleBit(QBitArray* theWrappedObject, int i);
61 61 void truncate(QBitArray* theWrappedObject, int pos);
62 62 QString py_toString(QBitArray*);
63 63 bool __nonzero__(QBitArray* obj) { return !obj->isNull(); }
64 64 };
65 65
66 66
67 67
68 68
69 69
70 70 class PythonQtWrapper_QByteArray : public QObject
71 71 { Q_OBJECT
72 72 public:
73 73 public slots:
74 74 QByteArray* new_QByteArray();
75 75 QByteArray* new_QByteArray(const QByteArray& arg__1);
76 76 QByteArray* new_QByteArray(int size, char c);
77 77 void delete_QByteArray(QByteArray* obj) { delete obj; }
78 78 QByteArray* append(QByteArray* theWrappedObject, char c);
79 79 QByteArray* append(QByteArray* theWrappedObject, const QByteArray& a);
80 80 QByteArray* append(QByteArray* theWrappedObject, const QString& s);
81 81 QByteArray* append(QByteArray* theWrappedObject, const char* s, int len);
82 82 char at(QByteArray* theWrappedObject, int i) const;
83 83 int capacity(QByteArray* theWrappedObject) const;
84 84 const char* cbegin(QByteArray* theWrappedObject) const;
85 85 const char* cend(QByteArray* theWrappedObject) const;
86 86 void chop(QByteArray* theWrappedObject, int n);
87 87 void clear(QByteArray* theWrappedObject);
88 88 int count(QByteArray* theWrappedObject, char c) const;
89 89 int count(QByteArray* theWrappedObject, const QByteArray& a) const;
90 90 bool endsWith(QByteArray* theWrappedObject, char c) const;
91 91 bool endsWith(QByteArray* theWrappedObject, const QByteArray& a) const;
92 92 QByteArray* fill(QByteArray* theWrappedObject, char c, int size = -1);
93 93 QByteArray static_QByteArray_fromBase64(const QByteArray& base64);
94 94 QByteArray static_QByteArray_fromHex(const QByteArray& hexEncoded);
95 95 QByteArray static_QByteArray_fromPercentEncoding(const QByteArray& pctEncoded, char percent = '%');
96 96 int indexOf(QByteArray* theWrappedObject, char c, int from = 0) const;
97 97 int indexOf(QByteArray* theWrappedObject, const QByteArray& a, int from = 0) const;
98 98 int indexOf(QByteArray* theWrappedObject, const QString& s, int from = 0) const;
99 99 QByteArray* insert(QByteArray* theWrappedObject, int i, char c);
100 100 QByteArray* insert(QByteArray* theWrappedObject, int i, const QByteArray& a);
101 101 QByteArray* insert(QByteArray* theWrappedObject, int i, const QString& s);
102 102 QByteArray* insert(QByteArray* theWrappedObject, int i, const char* s, int len);
103 103 bool isEmpty(QByteArray* theWrappedObject) const;
104 104 bool isNull(QByteArray* theWrappedObject) const;
105 105 bool isSharedWith(QByteArray* theWrappedObject, const QByteArray& other) const;
106 106 int lastIndexOf(QByteArray* theWrappedObject, char c, int from = -1) const;
107 107 int lastIndexOf(QByteArray* theWrappedObject, const QByteArray& a, int from = -1) const;
108 108 int lastIndexOf(QByteArray* theWrappedObject, const QString& s, int from = -1) const;
109 109 QByteArray left(QByteArray* theWrappedObject, int len) const;
110 110 QByteArray leftJustified(QByteArray* theWrappedObject, int width, char fill = ' ', bool truncate = false) const;
111 111 int length(QByteArray* theWrappedObject) const;
112 112 QByteArray mid(QByteArray* theWrappedObject, int index, int len = -1) const;
113 113 QByteArray static_QByteArray_number(double arg__1, char f = 'g', int prec = 6);
114 114 QByteArray static_QByteArray_number(int arg__1, int base = 10);
115 115 QByteArray static_QByteArray_number(qlonglong arg__1, int base = 10);
116 116 bool __ne__(QByteArray* theWrappedObject, const QString& s2) const;
117 117 const QByteArray __add__(QByteArray* theWrappedObject, char a2);
118 118 const QByteArray __add__(QByteArray* theWrappedObject, const QByteArray& a2);
119 119 const QString __add__(QByteArray* theWrappedObject, const QString& s);
120 120 const QByteArray __add__(QByteArray* theWrappedObject, const char* a2);
121 121 bool __lt__(QByteArray* theWrappedObject, const QByteArray& a2);
122 122 bool __lt__(QByteArray* theWrappedObject, const QString& s2) const;
123 123 bool __le__(QByteArray* theWrappedObject, const QByteArray& a2);
124 124 bool __le__(QByteArray* theWrappedObject, const QString& s2) const;
125 125 QByteArray* operator_assign(QByteArray* theWrappedObject, const QByteArray& arg__1);
126 126 bool __eq__(QByteArray* theWrappedObject, const QByteArray& a2);
127 127 bool __eq__(QByteArray* theWrappedObject, const QString& s2) const;
128 128 bool __gt__(QByteArray* theWrappedObject, const QByteArray& a2);
129 129 bool __gt__(QByteArray* theWrappedObject, const QString& s2) const;
130 130 bool __ge__(QByteArray* theWrappedObject, const QByteArray& a2);
131 131 bool __ge__(QByteArray* theWrappedObject, const QString& s2) const;
132 132 QByteArray* prepend(QByteArray* theWrappedObject, char c);
133 133 QByteArray* prepend(QByteArray* theWrappedObject, const QByteArray& a);
134 134 QByteArray* prepend(QByteArray* theWrappedObject, const char* s, int len);
135 135 QByteArray* remove(QByteArray* theWrappedObject, int index, int len);
136 136 QByteArray repeated(QByteArray* theWrappedObject, int times) const;
137 137 QByteArray* replace(QByteArray* theWrappedObject, char before, char after);
138 138 QByteArray* replace(QByteArray* theWrappedObject, char before, const QByteArray& after);
139 139 QByteArray* replace(QByteArray* theWrappedObject, char c, const QString& after);
140 140 QByteArray* replace(QByteArray* theWrappedObject, const QByteArray& before, const QByteArray& after);
141 141 QByteArray* replace(QByteArray* theWrappedObject, const QString& before, const QByteArray& after);
142 142 QByteArray* replace(QByteArray* theWrappedObject, const char* before, int bsize, const char* after, int asize);
143 143 QByteArray* replace(QByteArray* theWrappedObject, int index, int len, const QByteArray& s);
144 144 QByteArray* replace(QByteArray* theWrappedObject, int index, int len, const char* s, int alen);
145 145 void reserve(QByteArray* theWrappedObject, int size);
146 146 void resize(QByteArray* theWrappedObject, int size);
147 147 QByteArray right(QByteArray* theWrappedObject, int len) const;
148 148 QByteArray rightJustified(QByteArray* theWrappedObject, int width, char fill = ' ', bool truncate = false) const;
149 149 QByteArray* setNum(QByteArray* theWrappedObject, double arg__1, char f = 'g', int prec = 6);
150 150 QByteArray* setNum(QByteArray* theWrappedObject, float arg__1, char f = 'g', int prec = 6);
151 151 QByteArray* setNum(QByteArray* theWrappedObject, int arg__1, int base = 10);
152 152 QByteArray* setNum(QByteArray* theWrappedObject, qlonglong arg__1, int base = 10);
153 153 QByteArray* setNum(QByteArray* theWrappedObject, short arg__1, int base = 10);
154 154 QByteArray* setRawData(QByteArray* theWrappedObject, const char* a, uint n);
155 155 QByteArray simplified(QByteArray* theWrappedObject) const;
156 156 int size(QByteArray* theWrappedObject) const;
157 157 QList<QByteArray > split(QByteArray* theWrappedObject, char sep) const;
158 158 void squeeze(QByteArray* theWrappedObject);
159 159 bool startsWith(QByteArray* theWrappedObject, char c) const;
160 160 bool startsWith(QByteArray* theWrappedObject, const QByteArray& a) const;
161 161 void swap(QByteArray* theWrappedObject, QByteArray& other);
162 162 QByteArray toBase64(QByteArray* theWrappedObject) const;
163 163 double toDouble(QByteArray* theWrappedObject, bool* ok = 0) const;
164 164 float toFloat(QByteArray* theWrappedObject, bool* ok = 0) const;
165 165 QByteArray toHex(QByteArray* theWrappedObject) const;
166 166 int toInt(QByteArray* theWrappedObject, bool* ok = 0, int base = 10) const;
167 167 QByteArray toLower(QByteArray* theWrappedObject) const;
168 168 QByteArray toPercentEncoding(QByteArray* theWrappedObject, const QByteArray& exclude = QByteArray(), const QByteArray& include = QByteArray(), char percent = '%') const;
169 169 ushort toUShort(QByteArray* theWrappedObject, bool* ok = 0, int base = 10) const;
170 170 QByteArray toUpper(QByteArray* theWrappedObject) const;
171 171 QByteArray trimmed(QByteArray* theWrappedObject) const;
172 172 void truncate(QByteArray* theWrappedObject, int pos);
173 173 bool __nonzero__(QByteArray* obj) { return !obj->isNull(); }
174 174
175 175 PyObject* data(QByteArray* b) {
176 176 if (b->data()) {
177 #ifdef PY3K
178 return PyUnicode_FromStringAndSize(b->data(), b->size());
179 #else
177 180 return PyString_FromStringAndSize(b->data(), b->size());
181 #endif
178 182 } else {
179 183 Py_INCREF(Py_None);
180 184 return Py_None;
181 185 }
182 186 }
183 187
184 188 };
185 189
186 190
187 191
188 192
189 193
190 194 class PythonQtWrapper_QDate : public QObject
191 195 { Q_OBJECT
192 196 public:
193 197 Q_ENUMS(MonthNameType )
194 198 enum MonthNameType{
195 199 DateFormat = QDate::DateFormat, StandaloneFormat = QDate::StandaloneFormat};
196 200 public slots:
197 201 QDate* new_QDate();
198 202 QDate* new_QDate(int y, int m, int d);
199 203 QDate* new_QDate(const QDate& other) {
200 204 QDate* a = new QDate();
201 205 *((QDate*)a) = other;
202 206 return a; }
203 207 void delete_QDate(QDate* obj) { delete obj; }
204 208 QDate addDays(QDate* theWrappedObject, qint64 days) const;
205 209 QDate addMonths(QDate* theWrappedObject, int months) const;
206 210 QDate addYears(QDate* theWrappedObject, int years) const;
207 211 QDate static_QDate_currentDate();
208 212 int day(QDate* theWrappedObject) const;
209 213 int dayOfWeek(QDate* theWrappedObject) const;
210 214 int dayOfYear(QDate* theWrappedObject) const;
211 215 int daysInMonth(QDate* theWrappedObject) const;
212 216 int daysInYear(QDate* theWrappedObject) const;
213 217 qint64 daysTo(QDate* theWrappedObject, const QDate& arg__1) const;
214 218 QDate static_QDate_fromJulianDay(qint64 jd);
215 219 QDate static_QDate_fromString(const QString& s, Qt::DateFormat f = Qt::TextDate);
216 220 QDate static_QDate_fromString(const QString& s, const QString& format);
217 221 void getDate(QDate* theWrappedObject, int* year, int* month, int* day);
218 222 bool static_QDate_isLeapYear(int year);
219 223 bool isNull(QDate* theWrappedObject) const;
220 224 bool isValid(QDate* theWrappedObject) const;
221 225 bool static_QDate_isValid(int y, int m, int d);
222 226 QString static_QDate_longDayName(int weekday, QDate::MonthNameType type = QDate::DateFormat);
223 227 QString static_QDate_longMonthName(int month, QDate::MonthNameType type = QDate::DateFormat);
224 228 int month(QDate* theWrappedObject) const;
225 229 bool __ne__(QDate* theWrappedObject, const QDate& other) const;
226 230 bool __lt__(QDate* theWrappedObject, const QDate& other) const;
227 231 bool __le__(QDate* theWrappedObject, const QDate& other) const;
228 232 bool __eq__(QDate* theWrappedObject, const QDate& other) const;
229 233 bool __gt__(QDate* theWrappedObject, const QDate& other) const;
230 234 bool __ge__(QDate* theWrappedObject, const QDate& other) const;
231 235 bool setDate(QDate* theWrappedObject, int year, int month, int day);
232 236 QString static_QDate_shortDayName(int weekday, QDate::MonthNameType type = QDate::DateFormat);
233 237 QString static_QDate_shortMonthName(int month, QDate::MonthNameType type = QDate::DateFormat);
234 238 qint64 toJulianDay(QDate* theWrappedObject) const;
235 239 QString toString(QDate* theWrappedObject, Qt::DateFormat f = Qt::TextDate) const;
236 240 QString toString(QDate* theWrappedObject, const QString& format) const;
237 241 int weekNumber(QDate* theWrappedObject, int* yearNum = 0) const;
238 242 int year(QDate* theWrappedObject) const;
239 243 QString py_toString(QDate*);
240 244 bool __nonzero__(QDate* obj) { return !obj->isNull(); }
241 245 };
242 246
243 247
244 248
245 249
246 250
247 251 class PythonQtWrapper_QDateTime : public QObject
248 252 { Q_OBJECT
249 253 public:
250 254 public slots:
251 255 QDateTime* new_QDateTime();
252 256 QDateTime* new_QDateTime(const QDate& arg__1);
253 257 QDateTime* new_QDateTime(const QDate& arg__1, const QTime& arg__2, Qt::TimeSpec spec = Qt::LocalTime);
254 258 QDateTime* new_QDateTime(const QDateTime& other);
255 259 void delete_QDateTime(QDateTime* obj) { delete obj; }
256 260 QDateTime addDays(QDateTime* theWrappedObject, qint64 days) const;
257 261 QDateTime addMSecs(QDateTime* theWrappedObject, qint64 msecs) const;
258 262 QDateTime addMonths(QDateTime* theWrappedObject, int months) const;
259 263 QDateTime addSecs(QDateTime* theWrappedObject, qint64 secs) const;
260 264 QDateTime addYears(QDateTime* theWrappedObject, int years) const;
261 265 QDateTime static_QDateTime_currentDateTime();
262 266 QDateTime static_QDateTime_currentDateTimeUtc();
263 267 qint64 static_QDateTime_currentMSecsSinceEpoch();
264 268 QDate date(QDateTime* theWrappedObject) const;
265 269 qint64 daysTo(QDateTime* theWrappedObject, const QDateTime& arg__1) const;
266 270 QDateTime static_QDateTime_fromMSecsSinceEpoch(qint64 msecs);
267 271 QDateTime static_QDateTime_fromString(const QString& s, Qt::DateFormat f = Qt::TextDate);
268 272 QDateTime static_QDateTime_fromString(const QString& s, const QString& format);
269 273 QDateTime static_QDateTime_fromTime_t(uint secsSince1Jan1970UTC);
270 274 bool isNull(QDateTime* theWrappedObject) const;
271 275 bool isValid(QDateTime* theWrappedObject) const;
272 276 qint64 msecsTo(QDateTime* theWrappedObject, const QDateTime& arg__1) const;
273 277 bool __ne__(QDateTime* theWrappedObject, const QDateTime& other) const;
274 278 bool __lt__(QDateTime* theWrappedObject, const QDateTime& other) const;
275 279 bool __le__(QDateTime* theWrappedObject, const QDateTime& other) const;
276 280 bool __eq__(QDateTime* theWrappedObject, const QDateTime& other) const;
277 281 bool __gt__(QDateTime* theWrappedObject, const QDateTime& other) const;
278 282 bool __ge__(QDateTime* theWrappedObject, const QDateTime& other) const;
279 283 qint64 secsTo(QDateTime* theWrappedObject, const QDateTime& arg__1) const;
280 284 void setDate(QDateTime* theWrappedObject, const QDate& date);
281 285 void setMSecsSinceEpoch(QDateTime* theWrappedObject, qint64 msecs);
282 286 void setTime(QDateTime* theWrappedObject, const QTime& time);
283 287 void setTimeSpec(QDateTime* theWrappedObject, Qt::TimeSpec spec);
284 288 void setTime_t(QDateTime* theWrappedObject, uint secsSince1Jan1970UTC);
285 289 void setUtcOffset(QDateTime* theWrappedObject, int seconds);
286 290 void swap(QDateTime* theWrappedObject, QDateTime& other);
287 291 QTime time(QDateTime* theWrappedObject) const;
288 292 Qt::TimeSpec timeSpec(QDateTime* theWrappedObject) const;
289 293 QDateTime toLocalTime(QDateTime* theWrappedObject) const;
290 294 qint64 toMSecsSinceEpoch(QDateTime* theWrappedObject) const;
291 295 QString toString(QDateTime* theWrappedObject, Qt::DateFormat f = Qt::TextDate) const;
292 296 QString toString(QDateTime* theWrappedObject, const QString& format) const;
293 297 QDateTime toTimeSpec(QDateTime* theWrappedObject, Qt::TimeSpec spec) const;
294 298 uint toTime_t(QDateTime* theWrappedObject) const;
295 299 QDateTime toUTC(QDateTime* theWrappedObject) const;
296 300 int utcOffset(QDateTime* theWrappedObject) const;
297 301 QString py_toString(QDateTime*);
298 302 bool __nonzero__(QDateTime* obj) { return !obj->isNull(); }
299 303 };
300 304
301 305
302 306
303 307
304 308
305 309 class PythonQtWrapper_QLocale : public QObject
306 310 { Q_OBJECT
307 311 public:
308 312 Q_ENUMS(FormatType CurrencySymbolFormat QuotationStyle Language Script NumberOption Country MeasurementSystem )
309 313 Q_FLAGS(NumberOptions )
310 314 enum FormatType{
311 315 LongFormat = QLocale::LongFormat, ShortFormat = QLocale::ShortFormat, NarrowFormat = QLocale::NarrowFormat};
312 316 enum CurrencySymbolFormat{
313 317 CurrencyIsoCode = QLocale::CurrencyIsoCode, CurrencySymbol = QLocale::CurrencySymbol, CurrencyDisplayName = QLocale::CurrencyDisplayName};
314 318 enum QuotationStyle{
315 319 StandardQuotation = QLocale::StandardQuotation, AlternateQuotation = QLocale::AlternateQuotation};
316 320 enum Language{
317 321 AnyLanguage = QLocale::AnyLanguage, C = QLocale::C, Abkhazian = QLocale::Abkhazian, Oromo = QLocale::Oromo, Afar = QLocale::Afar, Afrikaans = QLocale::Afrikaans, Albanian = QLocale::Albanian, Amharic = QLocale::Amharic, Arabic = QLocale::Arabic, Armenian = QLocale::Armenian, Assamese = QLocale::Assamese, Aymara = QLocale::Aymara, Azerbaijani = QLocale::Azerbaijani, Bashkir = QLocale::Bashkir, Basque = QLocale::Basque, Bengali = QLocale::Bengali, Dzongkha = QLocale::Dzongkha, Bihari = QLocale::Bihari, Bislama = QLocale::Bislama, Breton = QLocale::Breton, Bulgarian = QLocale::Bulgarian, Burmese = QLocale::Burmese, Belarusian = QLocale::Belarusian, Khmer = QLocale::Khmer, Catalan = QLocale::Catalan, Chinese = QLocale::Chinese, Corsican = QLocale::Corsican, Croatian = QLocale::Croatian, Czech = QLocale::Czech, Danish = QLocale::Danish, Dutch = QLocale::Dutch, English = QLocale::English, Esperanto = QLocale::Esperanto, Estonian = QLocale::Estonian, Faroese = QLocale::Faroese, Fijian = QLocale::Fijian, Finnish = QLocale::Finnish, French = QLocale::French, WesternFrisian = QLocale::WesternFrisian, Gaelic = QLocale::Gaelic, Galician = QLocale::Galician, Georgian = QLocale::Georgian, German = QLocale::German, Greek = QLocale::Greek, Greenlandic = QLocale::Greenlandic, Guarani = QLocale::Guarani, Gujarati = QLocale::Gujarati, Hausa = QLocale::Hausa, Hebrew = QLocale::Hebrew, Hindi = QLocale::Hindi, Hungarian = QLocale::Hungarian, Icelandic = QLocale::Icelandic, Indonesian = QLocale::Indonesian, Interlingua = QLocale::Interlingua, Interlingue = QLocale::Interlingue, Inuktitut = QLocale::Inuktitut, Inupiak = QLocale::Inupiak, Irish = QLocale::Irish, Italian = QLocale::Italian, Japanese = QLocale::Japanese, Javanese = QLocale::Javanese, Kannada = QLocale::Kannada, Kashmiri = QLocale::Kashmiri, Kazakh = QLocale::Kazakh, Kinyarwanda = QLocale::Kinyarwanda, Kirghiz = QLocale::Kirghiz, Korean = QLocale::Korean, Kurdish = QLocale::Kurdish, Rundi = QLocale::Rundi, Lao = QLocale::Lao, Latin = QLocale::Latin, Latvian = QLocale::Latvian, Lingala = QLocale::Lingala, Lithuanian = QLocale::Lithuanian, Macedonian = QLocale::Macedonian, Malagasy = QLocale::Malagasy, Malay = QLocale::Malay, Malayalam = QLocale::Malayalam, Maltese = QLocale::Maltese, Maori = QLocale::Maori, Marathi = QLocale::Marathi, Marshallese = QLocale::Marshallese, Mongolian = QLocale::Mongolian, NauruLanguage = QLocale::NauruLanguage, Nepali = QLocale::Nepali, NorwegianBokmal = QLocale::NorwegianBokmal, Occitan = QLocale::Occitan, Oriya = QLocale::Oriya, Pashto = QLocale::Pashto, Persian = QLocale::Persian, Polish = QLocale::Polish, Portuguese = QLocale::Portuguese, Punjabi = QLocale::Punjabi, Quechua = QLocale::Quechua, Romansh = QLocale::Romansh, Romanian = QLocale::Romanian, Russian = QLocale::Russian, Samoan = QLocale::Samoan, Sango = QLocale::Sango, Sanskrit = QLocale::Sanskrit, Serbian = QLocale::Serbian, Ossetic = QLocale::Ossetic, SouthernSotho = QLocale::SouthernSotho, Tswana = QLocale::Tswana, Shona = QLocale::Shona, Sindhi = QLocale::Sindhi, Sinhala = QLocale::Sinhala, Swati = QLocale::Swati, Slovak = QLocale::Slovak, Slovenian = QLocale::Slovenian, Somali = QLocale::Somali, Spanish = QLocale::Spanish, Sundanese = QLocale::Sundanese, Swahili = QLocale::Swahili, Swedish = QLocale::Swedish, Sardinian = QLocale::Sardinian, Tajik = QLocale::Tajik, Tamil = QLocale::Tamil, Tatar = QLocale::Tatar, Telugu = QLocale::Telugu, Thai = QLocale::Thai, Tibetan = QLocale::Tibetan, Tigrinya = QLocale::Tigrinya, Tongan = QLocale::Tongan, Tsonga = QLocale::Tsonga, Turkish = QLocale::Turkish, Turkmen = QLocale::Turkmen, Tahitian = QLocale::Tahitian, Uigur = QLocale::Uigur, Ukrainian = QLocale::Ukrainian, Urdu = QLocale::Urdu, Uzbek = QLocale::Uzbek, Vietnamese = QLocale::Vietnamese, Volapuk = QLocale::Volapuk, Welsh = QLocale::Welsh, Wolof = QLocale::Wolof, Xhosa = QLocale::Xhosa, Yiddish = QLocale::Yiddish, Yoruba = QLocale::Yoruba, Zhuang = QLocale::Zhuang, Zulu = QLocale::Zulu, NorwegianNynorsk = QLocale::NorwegianNynorsk, Bosnian = QLocale::Bosnian, Divehi = QLocale::Divehi, Manx = QLocale::Manx, Cornish = QLocale::Cornish, Akan = QLocale::Akan, Konkani = QLocale::Konkani, Ga = QLocale::Ga, Igbo = QLocale::Igbo, Kamba = QLocale::Kamba, Syriac = QLocale::Syriac, Blin = QLocale::Blin, Geez = QLocale::Geez, Koro = QLocale::Koro, Sidamo = QLocale::Sidamo, Atsam = QLocale::Atsam, Tigre = QLocale::Tigre, Jju = QLocale::Jju, Friulian = QLocale::Friulian, Venda = QLocale::Venda, Ewe = QLocale::Ewe, Walamo = QLocale::Walamo, Hawaiian = QLocale::Hawaiian, Tyap = QLocale::Tyap, Nyanja = QLocale::Nyanja, Filipino = QLocale::Filipino, SwissGerman = QLocale::SwissGerman, SichuanYi = QLocale::SichuanYi, Kpelle = QLocale::Kpelle, LowGerman = QLocale::LowGerman, SouthNdebele = QLocale::SouthNdebele, NorthernSotho = QLocale::NorthernSotho, NorthernSami = QLocale::NorthernSami, Taroko = QLocale::Taroko, Gusii = QLocale::Gusii, Taita = QLocale::Taita, Fulah = QLocale::Fulah, Kikuyu = QLocale::Kikuyu, Samburu = QLocale::Samburu, Sena = QLocale::Sena, NorthNdebele = QLocale::NorthNdebele, Rombo = QLocale::Rombo, Tachelhit = QLocale::Tachelhit, Kabyle = QLocale::Kabyle, Nyankole = QLocale::Nyankole, Bena = QLocale::Bena, Vunjo = QLocale::Vunjo, Bambara = QLocale::Bambara, Embu = QLocale::Embu, Cherokee = QLocale::Cherokee, Morisyen = QLocale::Morisyen, Makonde = QLocale::Makonde, Langi = QLocale::Langi, Ganda = QLocale::Ganda, Bemba = QLocale::Bemba, Kabuverdianu = QLocale::Kabuverdianu, Meru = QLocale::Meru, Kalenjin = QLocale::Kalenjin, Nama = QLocale::Nama, Machame = QLocale::Machame, Colognian = QLocale::Colognian, Masai = QLocale::Masai, Soga = QLocale::Soga, Luyia = QLocale::Luyia, Asu = QLocale::Asu, Teso = QLocale::Teso, Saho = QLocale::Saho, KoyraChiini = QLocale::KoyraChiini, Rwa = QLocale::Rwa, Luo = QLocale::Luo, Chiga = QLocale::Chiga, CentralMoroccoTamazight = QLocale::CentralMoroccoTamazight, KoyraboroSenni = QLocale::KoyraboroSenni, Shambala = QLocale::Shambala, Bodo = QLocale::Bodo, Avaric = QLocale::Avaric, Chamorro = QLocale::Chamorro, Chechen = QLocale::Chechen, Church = QLocale::Church, Chuvash = QLocale::Chuvash, Cree = QLocale::Cree, Haitian = QLocale::Haitian, Herero = QLocale::Herero, HiriMotu = QLocale::HiriMotu, Kanuri = QLocale::Kanuri, Komi = QLocale::Komi, Kongo = QLocale::Kongo, Kwanyama = QLocale::Kwanyama, Limburgish = QLocale::Limburgish, LubaKatanga = QLocale::LubaKatanga, Luxembourgish = QLocale::Luxembourgish, Navaho = QLocale::Navaho, Ndonga = QLocale::Ndonga, Ojibwa = QLocale::Ojibwa, Pali = QLocale::Pali, Walloon = QLocale::Walloon, Aghem = QLocale::Aghem, Basaa = QLocale::Basaa, Zarma = QLocale::Zarma, Duala = QLocale::Duala, JolaFonyi = QLocale::JolaFonyi, Ewondo = QLocale::Ewondo, Bafia = QLocale::Bafia, MakhuwaMeetto = QLocale::MakhuwaMeetto, Mundang = QLocale::Mundang, Kwasio = QLocale::Kwasio, Nuer = QLocale::Nuer, Sakha = QLocale::Sakha, Sangu = QLocale::Sangu, CongoSwahili = QLocale::CongoSwahili, Tasawaq = QLocale::Tasawaq, Vai = QLocale::Vai, Walser = QLocale::Walser, Yangben = QLocale::Yangben, Avestan = QLocale::Avestan, Asturian = QLocale::Asturian, Ngomba = QLocale::Ngomba, Kako = QLocale::Kako, Meta = QLocale::Meta, Ngiemboon = QLocale::Ngiemboon, Norwegian = QLocale::Norwegian, Moldavian = QLocale::Moldavian, SerboCroatian = QLocale::SerboCroatian, Tagalog = QLocale::Tagalog, Twi = QLocale::Twi, Afan = QLocale::Afan, Byelorussian = QLocale::Byelorussian, Bhutani = QLocale::Bhutani, Cambodian = QLocale::Cambodian, Kurundi = QLocale::Kurundi, RhaetoRomance = QLocale::RhaetoRomance, Chewa = QLocale::Chewa, Frisian = QLocale::Frisian, LastLanguage = QLocale::LastLanguage};
318 322 enum Script{
319 323 AnyScript = QLocale::AnyScript, ArabicScript = QLocale::ArabicScript, CyrillicScript = QLocale::CyrillicScript, DeseretScript = QLocale::DeseretScript, GurmukhiScript = QLocale::GurmukhiScript, SimplifiedHanScript = QLocale::SimplifiedHanScript, TraditionalHanScript = QLocale::TraditionalHanScript, LatinScript = QLocale::LatinScript, MongolianScript = QLocale::MongolianScript, TifinaghScript = QLocale::TifinaghScript, ArmenianScript = QLocale::ArmenianScript, BengaliScript = QLocale::BengaliScript, CherokeeScript = QLocale::CherokeeScript, DevanagariScript = QLocale::DevanagariScript, EthiopicScript = QLocale::EthiopicScript, GeorgianScript = QLocale::GeorgianScript, GreekScript = QLocale::GreekScript, GujaratiScript = QLocale::GujaratiScript, HebrewScript = QLocale::HebrewScript, JapaneseScript = QLocale::JapaneseScript, KhmerScript = QLocale::KhmerScript, KannadaScript = QLocale::KannadaScript, KoreanScript = QLocale::KoreanScript, LaoScript = QLocale::LaoScript, MalayalamScript = QLocale::MalayalamScript, MyanmarScript = QLocale::MyanmarScript, OriyaScript = QLocale::OriyaScript, TamilScript = QLocale::TamilScript, TeluguScript = QLocale::TeluguScript, ThaanaScript = QLocale::ThaanaScript, ThaiScript = QLocale::ThaiScript, TibetanScript = QLocale::TibetanScript, SinhalaScript = QLocale::SinhalaScript, SyriacScript = QLocale::SyriacScript, YiScript = QLocale::YiScript, VaiScript = QLocale::VaiScript, SimplifiedChineseScript = QLocale::SimplifiedChineseScript, TraditionalChineseScript = QLocale::TraditionalChineseScript, LastScript = QLocale::LastScript};
320 324 enum NumberOption{
321 325 OmitGroupSeparator = QLocale::OmitGroupSeparator, RejectGroupSeparator = QLocale::RejectGroupSeparator};
322 326 enum Country{
323 327 AnyCountry = QLocale::AnyCountry, Afghanistan = QLocale::Afghanistan, Albania = QLocale::Albania, Algeria = QLocale::Algeria, AmericanSamoa = QLocale::AmericanSamoa, Andorra = QLocale::Andorra, Angola = QLocale::Angola, Anguilla = QLocale::Anguilla, Antarctica = QLocale::Antarctica, AntiguaAndBarbuda = QLocale::AntiguaAndBarbuda, Argentina = QLocale::Argentina, Armenia = QLocale::Armenia, Aruba = QLocale::Aruba, Australia = QLocale::Australia, Austria = QLocale::Austria, Azerbaijan = QLocale::Azerbaijan, Bahamas = QLocale::Bahamas, Bahrain = QLocale::Bahrain, Bangladesh = QLocale::Bangladesh, Barbados = QLocale::Barbados, Belarus = QLocale::Belarus, Belgium = QLocale::Belgium, Belize = QLocale::Belize, Benin = QLocale::Benin, Bermuda = QLocale::Bermuda, Bhutan = QLocale::Bhutan, Bolivia = QLocale::Bolivia, BosniaAndHerzegowina = QLocale::BosniaAndHerzegowina, Botswana = QLocale::Botswana, BouvetIsland = QLocale::BouvetIsland, Brazil = QLocale::Brazil, BritishIndianOceanTerritory = QLocale::BritishIndianOceanTerritory, Brunei = QLocale::Brunei, Bulgaria = QLocale::Bulgaria, BurkinaFaso = QLocale::BurkinaFaso, Burundi = QLocale::Burundi, Cambodia = QLocale::Cambodia, Cameroon = QLocale::Cameroon, Canada = QLocale::Canada, CapeVerde = QLocale::CapeVerde, CaymanIslands = QLocale::CaymanIslands, CentralAfricanRepublic = QLocale::CentralAfricanRepublic, Chad = QLocale::Chad, Chile = QLocale::Chile, China = QLocale::China, ChristmasIsland = QLocale::ChristmasIsland, CocosIslands = QLocale::CocosIslands, Colombia = QLocale::Colombia, Comoros = QLocale::Comoros, CongoKinshasa = QLocale::CongoKinshasa, CongoBrazzaville = QLocale::CongoBrazzaville, CookIslands = QLocale::CookIslands, CostaRica = QLocale::CostaRica, IvoryCoast = QLocale::IvoryCoast, Croatia = QLocale::Croatia, Cuba = QLocale::Cuba, Cyprus = QLocale::Cyprus, CzechRepublic = QLocale::CzechRepublic, Denmark = QLocale::Denmark, Djibouti = QLocale::Djibouti, Dominica = QLocale::Dominica, DominicanRepublic = QLocale::DominicanRepublic, EastTimor = QLocale::EastTimor, Ecuador = QLocale::Ecuador, Egypt = QLocale::Egypt, ElSalvador = QLocale::ElSalvador, EquatorialGuinea = QLocale::EquatorialGuinea, Eritrea = QLocale::Eritrea, Estonia = QLocale::Estonia, Ethiopia = QLocale::Ethiopia, FalklandIslands = QLocale::FalklandIslands, FaroeIslands = QLocale::FaroeIslands, Fiji = QLocale::Fiji, Finland = QLocale::Finland, France = QLocale::France, Guernsey = QLocale::Guernsey, FrenchGuiana = QLocale::FrenchGuiana, FrenchPolynesia = QLocale::FrenchPolynesia, FrenchSouthernTerritories = QLocale::FrenchSouthernTerritories, Gabon = QLocale::Gabon, Gambia = QLocale::Gambia, Georgia = QLocale::Georgia, Germany = QLocale::Germany, Ghana = QLocale::Ghana, Gibraltar = QLocale::Gibraltar, Greece = QLocale::Greece, Greenland = QLocale::Greenland, Grenada = QLocale::Grenada, Guadeloupe = QLocale::Guadeloupe, Guam = QLocale::Guam, Guatemala = QLocale::Guatemala, Guinea = QLocale::Guinea, GuineaBissau = QLocale::GuineaBissau, Guyana = QLocale::Guyana, Haiti = QLocale::Haiti, HeardAndMcDonaldIslands = QLocale::HeardAndMcDonaldIslands, Honduras = QLocale::Honduras, HongKong = QLocale::HongKong, Hungary = QLocale::Hungary, Iceland = QLocale::Iceland, India = QLocale::India, Indonesia = QLocale::Indonesia, Iran = QLocale::Iran, Iraq = QLocale::Iraq, Ireland = QLocale::Ireland, Israel = QLocale::Israel, Italy = QLocale::Italy, Jamaica = QLocale::Jamaica, Japan = QLocale::Japan, Jordan = QLocale::Jordan, Kazakhstan = QLocale::Kazakhstan, Kenya = QLocale::Kenya, Kiribati = QLocale::Kiribati, NorthKorea = QLocale::NorthKorea, SouthKorea = QLocale::SouthKorea, Kuwait = QLocale::Kuwait, Kyrgyzstan = QLocale::Kyrgyzstan, Laos = QLocale::Laos, Latvia = QLocale::Latvia, Lebanon = QLocale::Lebanon, Lesotho = QLocale::Lesotho, Liberia = QLocale::Liberia, Libya = QLocale::Libya, Liechtenstein = QLocale::Liechtenstein, Lithuania = QLocale::Lithuania, Luxembourg = QLocale::Luxembourg, Macau = QLocale::Macau, Macedonia = QLocale::Macedonia, Madagascar = QLocale::Madagascar, Malawi = QLocale::Malawi, Malaysia = QLocale::Malaysia, Maldives = QLocale::Maldives, Mali = QLocale::Mali, Malta = QLocale::Malta, MarshallIslands = QLocale::MarshallIslands, Martinique = QLocale::Martinique, Mauritania = QLocale::Mauritania, Mauritius = QLocale::Mauritius, Mayotte = QLocale::Mayotte, Mexico = QLocale::Mexico, Micronesia = QLocale::Micronesia, Moldova = QLocale::Moldova, Monaco = QLocale::Monaco, Mongolia = QLocale::Mongolia, Montserrat = QLocale::Montserrat, Morocco = QLocale::Morocco, Mozambique = QLocale::Mozambique, Myanmar = QLocale::Myanmar, Namibia = QLocale::Namibia, NauruCountry = QLocale::NauruCountry, Nepal = QLocale::Nepal, Netherlands = QLocale::Netherlands, CuraSao = QLocale::CuraSao, NewCaledonia = QLocale::NewCaledonia, NewZealand = QLocale::NewZealand, Nicaragua = QLocale::Nicaragua, Niger = QLocale::Niger, Nigeria = QLocale::Nigeria, Niue = QLocale::Niue, NorfolkIsland = QLocale::NorfolkIsland, NorthernMarianaIslands = QLocale::NorthernMarianaIslands, Norway = QLocale::Norway, Oman = QLocale::Oman, Pakistan = QLocale::Pakistan, Palau = QLocale::Palau, PalestinianTerritories = QLocale::PalestinianTerritories, Panama = QLocale::Panama, PapuaNewGuinea = QLocale::PapuaNewGuinea, Paraguay = QLocale::Paraguay, Peru = QLocale::Peru, Philippines = QLocale::Philippines, Pitcairn = QLocale::Pitcairn, Poland = QLocale::Poland, Portugal = QLocale::Portugal, PuertoRico = QLocale::PuertoRico, Qatar = QLocale::Qatar, Reunion = QLocale::Reunion, Romania = QLocale::Romania, Russia = QLocale::Russia, Rwanda = QLocale::Rwanda, SaintKittsAndNevis = QLocale::SaintKittsAndNevis, SaintLucia = QLocale::SaintLucia, SaintVincentAndTheGrenadines = QLocale::SaintVincentAndTheGrenadines, Samoa = QLocale::Samoa, SanMarino = QLocale::SanMarino, SaoTomeAndPrincipe = QLocale::SaoTomeAndPrincipe, SaudiArabia = QLocale::SaudiArabia, Senegal = QLocale::Senegal, Seychelles = QLocale::Seychelles, SierraLeone = QLocale::SierraLeone, Singapore = QLocale::Singapore, Slovakia = QLocale::Slovakia, Slovenia = QLocale::Slovenia, SolomonIslands = QLocale::SolomonIslands, Somalia = QLocale::Somalia, SouthAfrica = QLocale::SouthAfrica, SouthGeorgiaAndTheSouthSandwichIslands = QLocale::SouthGeorgiaAndTheSouthSandwichIslands, Spain = QLocale::Spain, SriLanka = QLocale::SriLanka, SaintHelena = QLocale::SaintHelena, SaintPierreAndMiquelon = QLocale::SaintPierreAndMiquelon, Sudan = QLocale::Sudan, Suriname = QLocale::Suriname, SvalbardAndJanMayenIslands = QLocale::SvalbardAndJanMayenIslands, Swaziland = QLocale::Swaziland, Sweden = QLocale::Sweden, Switzerland = QLocale::Switzerland, Syria = QLocale::Syria, Taiwan = QLocale::Taiwan, Tajikistan = QLocale::Tajikistan, Tanzania = QLocale::Tanzania, Thailand = QLocale::Thailand, Togo = QLocale::Togo, Tokelau = QLocale::Tokelau, Tonga = QLocale::Tonga, TrinidadAndTobago = QLocale::TrinidadAndTobago, Tunisia = QLocale::Tunisia, Turkey = QLocale::Turkey, Turkmenistan = QLocale::Turkmenistan, TurksAndCaicosIslands = QLocale::TurksAndCaicosIslands, Tuvalu = QLocale::Tuvalu, Uganda = QLocale::Uganda, Ukraine = QLocale::Ukraine, UnitedArabEmirates = QLocale::UnitedArabEmirates, UnitedKingdom = QLocale::UnitedKingdom, UnitedStates = QLocale::UnitedStates, UnitedStatesMinorOutlyingIslands = QLocale::UnitedStatesMinorOutlyingIslands, Uruguay = QLocale::Uruguay, Uzbekistan = QLocale::Uzbekistan, Vanuatu = QLocale::Vanuatu, VaticanCityState = QLocale::VaticanCityState, Venezuela = QLocale::Venezuela, Vietnam = QLocale::Vietnam, BritishVirginIslands = QLocale::BritishVirginIslands, UnitedStatesVirginIslands = QLocale::UnitedStatesVirginIslands, WallisAndFutunaIslands = QLocale::WallisAndFutunaIslands, WesternSahara = QLocale::WesternSahara, Yemen = QLocale::Yemen, CanaryIslands = QLocale::CanaryIslands, Zambia = QLocale::Zambia, Zimbabwe = QLocale::Zimbabwe, ClippertonIsland = QLocale::ClippertonIsland, Montenegro = QLocale::Montenegro, Serbia = QLocale::Serbia, SaintBarthelemy = QLocale::SaintBarthelemy, SaintMartin = QLocale::SaintMartin, LatinAmericaAndTheCaribbean = QLocale::LatinAmericaAndTheCaribbean, AscensionIsland = QLocale::AscensionIsland, AlandIslands = QLocale::AlandIslands, DiegoGarcia = QLocale::DiegoGarcia, CeutaAndMelilla = QLocale::CeutaAndMelilla, IsleOfMan = QLocale::IsleOfMan, Jersey = QLocale::Jersey, TristanDaCunha = QLocale::TristanDaCunha, SouthSudan = QLocale::SouthSudan, Bonaire = QLocale::Bonaire, SintMaarten = QLocale::SintMaarten, DemocraticRepublicOfCongo = QLocale::DemocraticRepublicOfCongo, PeoplesRepublicOfCongo = QLocale::PeoplesRepublicOfCongo, DemocraticRepublicOfKorea = QLocale::DemocraticRepublicOfKorea, RepublicOfKorea = QLocale::RepublicOfKorea, RussianFederation = QLocale::RussianFederation, SyrianArabRepublic = QLocale::SyrianArabRepublic, LastCountry = QLocale::LastCountry};
324 328 enum MeasurementSystem{
325 329 MetricSystem = QLocale::MetricSystem, ImperialUSSystem = QLocale::ImperialUSSystem, ImperialUKSystem = QLocale::ImperialUKSystem, ImperialSystem = QLocale::ImperialSystem};
326 330 Q_DECLARE_FLAGS(NumberOptions, NumberOption)
327 331 public slots:
328 332 QLocale* new_QLocale();
329 333 QLocale* new_QLocale(QLocale::Language language, QLocale::Country country = QLocale::AnyCountry);
330 334 QLocale* new_QLocale(QLocale::Language language, QLocale::Script script, QLocale::Country country);
331 335 QLocale* new_QLocale(const QLocale& other);
332 336 QLocale* new_QLocale(const QString& name);
333 337 void delete_QLocale(QLocale* obj) { delete obj; }
334 338 QString amText(QLocale* theWrappedObject) const;
335 339 QString bcp47Name(QLocale* theWrappedObject) const;
336 340 QLocale static_QLocale_c();
337 341 QList<QLocale::Country > static_QLocale_countriesForLanguage(QLocale::Language lang);
338 342 QLocale::Country country(QLocale* theWrappedObject) const;
339 343 QString static_QLocale_countryToString(QLocale::Country country);
340 344 QString createSeparatedList(QLocale* theWrappedObject, const QStringList& strl) const;
341 345 QString currencySymbol(QLocale* theWrappedObject, QLocale::CurrencySymbolFormat arg__1 = QLocale::CurrencySymbol) const;
342 346 QString dateFormat(QLocale* theWrappedObject, QLocale::FormatType format = QLocale::LongFormat) const;
343 347 QString dateTimeFormat(QLocale* theWrappedObject, QLocale::FormatType format = QLocale::LongFormat) const;
344 348 QString dayName(QLocale* theWrappedObject, int arg__1, QLocale::FormatType format = QLocale::LongFormat) const;
345 349 QChar decimalPoint(QLocale* theWrappedObject) const;
346 350 QChar exponential(QLocale* theWrappedObject) const;
347 351 Qt::DayOfWeek firstDayOfWeek(QLocale* theWrappedObject) const;
348 352 QChar groupSeparator(QLocale* theWrappedObject) const;
349 353 QLocale::Language language(QLocale* theWrappedObject) const;
350 354 QString static_QLocale_languageToString(QLocale::Language language);
351 355 QList<QLocale > static_QLocale_matchingLocales(QLocale::Language language, QLocale::Script script, QLocale::Country country);
352 356 QLocale::MeasurementSystem measurementSystem(QLocale* theWrappedObject) const;
353 357 QString monthName(QLocale* theWrappedObject, int arg__1, QLocale::FormatType format = QLocale::LongFormat) const;
354 358 QString name(QLocale* theWrappedObject) const;
355 359 QString nativeCountryName(QLocale* theWrappedObject) const;
356 360 QString nativeLanguageName(QLocale* theWrappedObject) const;
357 361 QChar negativeSign(QLocale* theWrappedObject) const;
358 362 QLocale::NumberOptions numberOptions(QLocale* theWrappedObject) const;
359 363 bool __ne__(QLocale* theWrappedObject, const QLocale& other) const;
360 364 bool __eq__(QLocale* theWrappedObject, const QLocale& other) const;
361 365 QChar percent(QLocale* theWrappedObject) const;
362 366 QString pmText(QLocale* theWrappedObject) const;
363 367 QChar positiveSign(QLocale* theWrappedObject) const;
364 368 QString quoteString(QLocale* theWrappedObject, const QString& str, QLocale::QuotationStyle style = QLocale::StandardQuotation) const;
365 369 QString quoteString(QLocale* theWrappedObject, const QStringRef& str, QLocale::QuotationStyle style = QLocale::StandardQuotation) const;
366 370 QLocale::Script script(QLocale* theWrappedObject) const;
367 371 QString static_QLocale_scriptToString(QLocale::Script script);
368 372 void static_QLocale_setDefault(const QLocale& locale);
369 373 void setNumberOptions(QLocale* theWrappedObject, QLocale::NumberOptions options);
370 374 QString standaloneDayName(QLocale* theWrappedObject, int arg__1, QLocale::FormatType format = QLocale::LongFormat) const;
371 375 QString standaloneMonthName(QLocale* theWrappedObject, int arg__1, QLocale::FormatType format = QLocale::LongFormat) const;
372 376 QLocale static_QLocale_system();
373 377 Qt::LayoutDirection textDirection(QLocale* theWrappedObject) const;
374 378 QString timeFormat(QLocale* theWrappedObject, QLocale::FormatType format = QLocale::LongFormat) const;
375 379 QString toCurrencyString(QLocale* theWrappedObject, double arg__1, const QString& symbol = QString()) const;
376 380 QString toCurrencyString(QLocale* theWrappedObject, float arg__1, const QString& symbol = QString()) const;
377 381 QString toCurrencyString(QLocale* theWrappedObject, int arg__1, const QString& symbol = QString()) const;
378 382 QString toCurrencyString(QLocale* theWrappedObject, qlonglong arg__1, const QString& symbol = QString()) const;
379 383 QString toCurrencyString(QLocale* theWrappedObject, qulonglong arg__1, const QString& symbol = QString()) const;
380 384 QString toCurrencyString(QLocale* theWrappedObject, short arg__1, const QString& symbol = QString()) const;
381 385 QString toCurrencyString(QLocale* theWrappedObject, uint arg__1, const QString& symbol = QString()) const;
382 386 QString toCurrencyString(QLocale* theWrappedObject, ushort arg__1, const QString& symbol = QString()) const;
383 387 QDate toDate(QLocale* theWrappedObject, const QString& string, QLocale::FormatType arg__2 = QLocale::LongFormat) const;
384 388 QDate toDate(QLocale* theWrappedObject, const QString& string, const QString& format) const;
385 389 QDateTime toDateTime(QLocale* theWrappedObject, const QString& string, QLocale::FormatType format = QLocale::LongFormat) const;
386 390 QDateTime toDateTime(QLocale* theWrappedObject, const QString& string, const QString& format) const;
387 391 double toDouble(QLocale* theWrappedObject, const QString& s, bool* ok = 0) const;
388 392 float toFloat(QLocale* theWrappedObject, const QString& s, bool* ok = 0) const;
389 393 int toInt(QLocale* theWrappedObject, const QString& s, bool* ok = 0) const;
390 394 qlonglong toLongLong(QLocale* theWrappedObject, const QString& s, bool* ok = 0) const;
391 395 QString toLower(QLocale* theWrappedObject, const QString& str) const;
392 396 short toShort(QLocale* theWrappedObject, const QString& s, bool* ok = 0) const;
393 397 QString toString(QLocale* theWrappedObject, const QDate& date, QLocale::FormatType format = QLocale::LongFormat) const;
394 398 QString toString(QLocale* theWrappedObject, const QDate& date, const QString& formatStr) const;
395 399 QString toString(QLocale* theWrappedObject, const QDateTime& dateTime, QLocale::FormatType format = QLocale::LongFormat) const;
396 400 QString toString(QLocale* theWrappedObject, const QDateTime& dateTime, const QString& format) const;
397 401 QString toString(QLocale* theWrappedObject, const QTime& time, QLocale::FormatType format = QLocale::LongFormat) const;
398 402 QString toString(QLocale* theWrappedObject, const QTime& time, const QString& formatStr) const;
399 403 QString toString(QLocale* theWrappedObject, double i, char f = 'g', int prec = 6) const;
400 404 QString toString(QLocale* theWrappedObject, float i, char f = 'g', int prec = 6) const;
401 405 QString toString(QLocale* theWrappedObject, int i) const;
402 406 QString toString(QLocale* theWrappedObject, qulonglong i) const;
403 407 QString toString(QLocale* theWrappedObject, short i) const;
404 408 QTime toTime(QLocale* theWrappedObject, const QString& string, QLocale::FormatType arg__2 = QLocale::LongFormat) const;
405 409 QTime toTime(QLocale* theWrappedObject, const QString& string, const QString& format) const;
406 410 uint toUInt(QLocale* theWrappedObject, const QString& s, bool* ok = 0) const;
407 411 qulonglong toULongLong(QLocale* theWrappedObject, const QString& s, bool* ok = 0) const;
408 412 ushort toUShort(QLocale* theWrappedObject, const QString& s, bool* ok = 0) const;
409 413 QString toUpper(QLocale* theWrappedObject, const QString& str) const;
410 414 QStringList uiLanguages(QLocale* theWrappedObject) const;
411 415 QList<Qt::DayOfWeek > weekdays(QLocale* theWrappedObject) const;
412 416 QChar zeroDigit(QLocale* theWrappedObject) const;
413 417 QString py_toString(QLocale*);
414 418 };
415 419
416 420
417 421
418 422
419 423
420 424 class PythonQtWrapper_QPoint : public QObject
421 425 { Q_OBJECT
422 426 public:
423 427 public slots:
424 428 QPoint* new_QPoint();
425 429 QPoint* new_QPoint(int xpos, int ypos);
426 430 QPoint* new_QPoint(const QPoint& other) {
427 431 QPoint* a = new QPoint();
428 432 *((QPoint*)a) = other;
429 433 return a; }
430 434 void delete_QPoint(QPoint* obj) { delete obj; }
431 435 bool isNull(QPoint* theWrappedObject) const;
432 436 int manhattanLength(QPoint* theWrappedObject) const;
433 437 QPoint __mul__(QPoint* theWrappedObject, const QMatrix& m);
434 438 QPoint __mul__(QPoint* theWrappedObject, const QMatrix4x4& matrix);
435 439 QPoint __mul__(QPoint* theWrappedObject, const QTransform& m);
436 440 const QPoint __mul__(QPoint* theWrappedObject, double factor);
437 441 const QPoint __mul__(QPoint* theWrappedObject, float factor);
438 442 const QPoint __mul__(QPoint* theWrappedObject, int factor);
439 443 QPoint* __imul__(QPoint* theWrappedObject, double factor);
440 444 QPoint* __imul__(QPoint* theWrappedObject, float factor);
441 445 QPoint* __imul__(QPoint* theWrappedObject, int factor);
442 446 const QPoint __add__(QPoint* theWrappedObject, const QPoint& p2);
443 447 QPoint* __iadd__(QPoint* theWrappedObject, const QPoint& p);
444 448 const QPoint __sub__(QPoint* theWrappedObject, const QPoint& p2);
445 449 QPoint* __isub__(QPoint* theWrappedObject, const QPoint& p);
446 450 const QPoint __div__(QPoint* theWrappedObject, qreal c);
447 451 QPoint* __idiv__(QPoint* theWrappedObject, qreal divisor);
448 452 bool __eq__(QPoint* theWrappedObject, const QPoint& p2);
449 453 void setX(QPoint* theWrappedObject, int x);
450 454 void setY(QPoint* theWrappedObject, int y);
451 455 int x(QPoint* theWrappedObject) const;
452 456 int y(QPoint* theWrappedObject) const;
453 457 QString py_toString(QPoint*);
454 458 bool __nonzero__(QPoint* obj) { return !obj->isNull(); }
455 459 };
456 460
457 461
458 462
459 463
460 464
461 465 class PythonQtWrapper_QPointF : public QObject
462 466 { Q_OBJECT
463 467 public:
464 468 public slots:
465 469 QPointF* new_QPointF();
466 470 QPointF* new_QPointF(const QPoint& p);
467 471 QPointF* new_QPointF(qreal xpos, qreal ypos);
468 472 QPointF* new_QPointF(const QPointF& other) {
469 473 QPointF* a = new QPointF();
470 474 *((QPointF*)a) = other;
471 475 return a; }
472 476 void delete_QPointF(QPointF* obj) { delete obj; }
473 477 bool isNull(QPointF* theWrappedObject) const;
474 478 qreal manhattanLength(QPointF* theWrappedObject) const;
475 479 QPointF __mul__(QPointF* theWrappedObject, const QMatrix& m);
476 480 QPointF __mul__(QPointF* theWrappedObject, const QMatrix4x4& matrix);
477 481 QPointF __mul__(QPointF* theWrappedObject, const QTransform& m);
478 482 const QPointF __mul__(QPointF* theWrappedObject, qreal c);
479 483 QPointF* __imul__(QPointF* theWrappedObject, qreal c);
480 484 const QPointF __add__(QPointF* theWrappedObject, const QPointF& p2);
481 485 QPointF* __iadd__(QPointF* theWrappedObject, const QPointF& p);
482 486 const QPointF __sub__(QPointF* theWrappedObject, const QPointF& p2);
483 487 QPointF* __isub__(QPointF* theWrappedObject, const QPointF& p);
484 488 const QPointF __div__(QPointF* theWrappedObject, qreal divisor);
485 489 QPointF* __idiv__(QPointF* theWrappedObject, qreal c);
486 490 bool __eq__(QPointF* theWrappedObject, const QPointF& p2);
487 491 void setX(QPointF* theWrappedObject, qreal x);
488 492 void setY(QPointF* theWrappedObject, qreal y);
489 493 QPoint toPoint(QPointF* theWrappedObject) const;
490 494 qreal x(QPointF* theWrappedObject) const;
491 495 qreal y(QPointF* theWrappedObject) const;
492 496 QString py_toString(QPointF*);
493 497 bool __nonzero__(QPointF* obj) { return !obj->isNull(); }
494 498 };
495 499
496 500
497 501
498 502
499 503
500 504 class PythonQtWrapper_QRect : public QObject
501 505 { Q_OBJECT
502 506 public:
503 507 public slots:
504 508 QRect* new_QRect();
505 509 QRect* new_QRect(const QPoint& topleft, const QPoint& bottomright);
506 510 QRect* new_QRect(const QPoint& topleft, const QSize& size);
507 511 QRect* new_QRect(int left, int top, int width, int height);
508 512 QRect* new_QRect(const QRect& other) {
509 513 QRect* a = new QRect();
510 514 *((QRect*)a) = other;
511 515 return a; }
512 516 void delete_QRect(QRect* obj) { delete obj; }
513 517 void adjust(QRect* theWrappedObject, int x1, int y1, int x2, int y2);
514 518 QRect adjusted(QRect* theWrappedObject, int x1, int y1, int x2, int y2) const;
515 519 int bottom(QRect* theWrappedObject) const;
516 520 QPoint bottomLeft(QRect* theWrappedObject) const;
517 521 QPoint bottomRight(QRect* theWrappedObject) const;
518 522 QPoint center(QRect* theWrappedObject) const;
519 523 bool contains(QRect* theWrappedObject, const QPoint& p, bool proper = false) const;
520 524 bool contains(QRect* theWrappedObject, const QRect& r, bool proper = false) const;
521 525 bool contains(QRect* theWrappedObject, int x, int y) const;
522 526 bool contains(QRect* theWrappedObject, int x, int y, bool proper) const;
523 527 int height(QRect* theWrappedObject) const;
524 528 QRect intersected(QRect* theWrappedObject, const QRect& other) const;
525 529 bool intersects(QRect* theWrappedObject, const QRect& r) const;
526 530 bool isEmpty(QRect* theWrappedObject) const;
527 531 bool isNull(QRect* theWrappedObject) const;
528 532 bool isValid(QRect* theWrappedObject) const;
529 533 int left(QRect* theWrappedObject) const;
530 534 void moveBottom(QRect* theWrappedObject, int pos);
531 535 void moveBottomLeft(QRect* theWrappedObject, const QPoint& p);
532 536 void moveBottomRight(QRect* theWrappedObject, const QPoint& p);
533 537 void moveCenter(QRect* theWrappedObject, const QPoint& p);
534 538 void moveLeft(QRect* theWrappedObject, int pos);
535 539 void moveRight(QRect* theWrappedObject, int pos);
536 540 void moveTo(QRect* theWrappedObject, const QPoint& p);
537 541 void moveTo(QRect* theWrappedObject, int x, int t);
538 542 void moveTop(QRect* theWrappedObject, int pos);
539 543 void moveTopLeft(QRect* theWrappedObject, const QPoint& p);
540 544 void moveTopRight(QRect* theWrappedObject, const QPoint& p);
541 545 QRect normalized(QRect* theWrappedObject) const;
542 546 bool __eq__(QRect* theWrappedObject, const QRect& arg__2);
543 547 int right(QRect* theWrappedObject) const;
544 548 void setBottom(QRect* theWrappedObject, int pos);
545 549 void setBottomLeft(QRect* theWrappedObject, const QPoint& p);
546 550 void setBottomRight(QRect* theWrappedObject, const QPoint& p);
547 551 void setCoords(QRect* theWrappedObject, int x1, int y1, int x2, int y2);
548 552 void setHeight(QRect* theWrappedObject, int h);
549 553 void setLeft(QRect* theWrappedObject, int pos);
550 554 void setRect(QRect* theWrappedObject, int x, int y, int w, int h);
551 555 void setRight(QRect* theWrappedObject, int pos);
552 556 void setSize(QRect* theWrappedObject, const QSize& s);
553 557 void setTop(QRect* theWrappedObject, int pos);
554 558 void setTopLeft(QRect* theWrappedObject, const QPoint& p);
555 559 void setTopRight(QRect* theWrappedObject, const QPoint& p);
556 560 void setWidth(QRect* theWrappedObject, int w);
557 561 void setX(QRect* theWrappedObject, int x);
558 562 void setY(QRect* theWrappedObject, int y);
559 563 QSize size(QRect* theWrappedObject) const;
560 564 int top(QRect* theWrappedObject) const;
561 565 QPoint topLeft(QRect* theWrappedObject) const;
562 566 QPoint topRight(QRect* theWrappedObject) const;
563 567 void translate(QRect* theWrappedObject, const QPoint& p);
564 568 void translate(QRect* theWrappedObject, int dx, int dy);
565 569 QRect translated(QRect* theWrappedObject, const QPoint& p) const;
566 570 QRect translated(QRect* theWrappedObject, int dx, int dy) const;
567 571 QRect united(QRect* theWrappedObject, const QRect& other) const;
568 572 int width(QRect* theWrappedObject) const;
569 573 int x(QRect* theWrappedObject) const;
570 574 int y(QRect* theWrappedObject) const;
571 575 QString py_toString(QRect*);
572 576 bool __nonzero__(QRect* obj) { return !obj->isNull(); }
573 577 };
574 578
575 579
576 580
577 581
578 582
579 583 class PythonQtWrapper_QRectF : public QObject
580 584 { Q_OBJECT
581 585 public:
582 586 public slots:
583 587 QRectF* new_QRectF();
584 588 QRectF* new_QRectF(const QPointF& topleft, const QPointF& bottomRight);
585 589 QRectF* new_QRectF(const QPointF& topleft, const QSizeF& size);
586 590 QRectF* new_QRectF(const QRect& rect);
587 591 QRectF* new_QRectF(qreal left, qreal top, qreal width, qreal height);
588 592 QRectF* new_QRectF(const QRectF& other) {
589 593 QRectF* a = new QRectF();
590 594 *((QRectF*)a) = other;
591 595 return a; }
592 596 void delete_QRectF(QRectF* obj) { delete obj; }
593 597 void adjust(QRectF* theWrappedObject, qreal x1, qreal y1, qreal x2, qreal y2);
594 598 QRectF adjusted(QRectF* theWrappedObject, qreal x1, qreal y1, qreal x2, qreal y2) const;
595 599 qreal bottom(QRectF* theWrappedObject) const;
596 600 QPointF bottomLeft(QRectF* theWrappedObject) const;
597 601 QPointF bottomRight(QRectF* theWrappedObject) const;
598 602 QPointF center(QRectF* theWrappedObject) const;
599 603 bool contains(QRectF* theWrappedObject, const QPointF& p) const;
600 604 bool contains(QRectF* theWrappedObject, const QRectF& r) const;
601 605 bool contains(QRectF* theWrappedObject, qreal x, qreal y) const;
602 606 qreal height(QRectF* theWrappedObject) const;
603 607 QRectF intersected(QRectF* theWrappedObject, const QRectF& other) const;
604 608 bool intersects(QRectF* theWrappedObject, const QRectF& r) const;
605 609 bool isEmpty(QRectF* theWrappedObject) const;
606 610 bool isNull(QRectF* theWrappedObject) const;
607 611 bool isValid(QRectF* theWrappedObject) const;
608 612 qreal left(QRectF* theWrappedObject) const;
609 613 void moveBottom(QRectF* theWrappedObject, qreal pos);
610 614 void moveBottomLeft(QRectF* theWrappedObject, const QPointF& p);
611 615 void moveBottomRight(QRectF* theWrappedObject, const QPointF& p);
612 616 void moveCenter(QRectF* theWrappedObject, const QPointF& p);
613 617 void moveLeft(QRectF* theWrappedObject, qreal pos);
614 618 void moveRight(QRectF* theWrappedObject, qreal pos);
615 619 void moveTo(QRectF* theWrappedObject, const QPointF& p);
616 620 void moveTo(QRectF* theWrappedObject, qreal x, qreal t);
617 621 void moveTop(QRectF* theWrappedObject, qreal pos);
618 622 void moveTopLeft(QRectF* theWrappedObject, const QPointF& p);
619 623 void moveTopRight(QRectF* theWrappedObject, const QPointF& p);
620 624 QRectF normalized(QRectF* theWrappedObject) const;
621 625 bool __eq__(QRectF* theWrappedObject, const QRectF& arg__2);
622 626 qreal right(QRectF* theWrappedObject) const;
623 627 void setBottom(QRectF* theWrappedObject, qreal pos);
624 628 void setBottomLeft(QRectF* theWrappedObject, const QPointF& p);
625 629 void setBottomRight(QRectF* theWrappedObject, const QPointF& p);
626 630 void setCoords(QRectF* theWrappedObject, qreal x1, qreal y1, qreal x2, qreal y2);
627 631 void setHeight(QRectF* theWrappedObject, qreal h);
628 632 void setLeft(QRectF* theWrappedObject, qreal pos);
629 633 void setRect(QRectF* theWrappedObject, qreal x, qreal y, qreal w, qreal h);
630 634 void setRight(QRectF* theWrappedObject, qreal pos);
631 635 void setSize(QRectF* theWrappedObject, const QSizeF& s);
632 636 void setTop(QRectF* theWrappedObject, qreal pos);
633 637 void setTopLeft(QRectF* theWrappedObject, const QPointF& p);
634 638 void setTopRight(QRectF* theWrappedObject, const QPointF& p);
635 639 void setWidth(QRectF* theWrappedObject, qreal w);
636 640 void setX(QRectF* theWrappedObject, qreal pos);
637 641 void setY(QRectF* theWrappedObject, qreal pos);
638 642 QSizeF size(QRectF* theWrappedObject) const;
639 643 QRect toAlignedRect(QRectF* theWrappedObject) const;
640 644 QRect toRect(QRectF* theWrappedObject) const;
641 645 qreal top(QRectF* theWrappedObject) const;
642 646 QPointF topLeft(QRectF* theWrappedObject) const;
643 647 QPointF topRight(QRectF* theWrappedObject) const;
644 648 void translate(QRectF* theWrappedObject, const QPointF& p);
645 649 void translate(QRectF* theWrappedObject, qreal dx, qreal dy);
646 650 QRectF translated(QRectF* theWrappedObject, const QPointF& p) const;
647 651 QRectF translated(QRectF* theWrappedObject, qreal dx, qreal dy) const;
648 652 QRectF united(QRectF* theWrappedObject, const QRectF& other) const;
649 653 qreal width(QRectF* theWrappedObject) const;
650 654 qreal x(QRectF* theWrappedObject) const;
651 655 qreal y(QRectF* theWrappedObject) const;
652 656 QString py_toString(QRectF*);
653 657 bool __nonzero__(QRectF* obj) { return !obj->isNull(); }
654 658 };
655 659
656 660
657 661
658 662
659 663
660 664 class PythonQtWrapper_QRegExp : public QObject
661 665 { Q_OBJECT
662 666 public:
663 667 Q_ENUMS(PatternSyntax CaretMode )
664 668 enum PatternSyntax{
665 669 RegExp = QRegExp::RegExp, Wildcard = QRegExp::Wildcard, FixedString = QRegExp::FixedString, RegExp2 = QRegExp::RegExp2, WildcardUnix = QRegExp::WildcardUnix, W3CXmlSchema11 = QRegExp::W3CXmlSchema11};
666 670 enum CaretMode{
667 671 CaretAtZero = QRegExp::CaretAtZero, CaretAtOffset = QRegExp::CaretAtOffset, CaretWontMatch = QRegExp::CaretWontMatch};
668 672 public slots:
669 673 QRegExp* new_QRegExp();
670 674 QRegExp* new_QRegExp(const QRegExp& rx);
671 675 QRegExp* new_QRegExp(const QString& pattern, Qt::CaseSensitivity cs = Qt::CaseSensitive, QRegExp::PatternSyntax syntax = QRegExp::RegExp);
672 676 void delete_QRegExp(QRegExp* obj) { delete obj; }
673 677 QString cap(QRegExp* theWrappedObject, int nth = 0) const;
674 678 int captureCount(QRegExp* theWrappedObject) const;
675 679 QStringList capturedTexts(QRegExp* theWrappedObject) const;
676 680 Qt::CaseSensitivity caseSensitivity(QRegExp* theWrappedObject) const;
677 681 QString errorString(QRegExp* theWrappedObject) const;
678 682 QString static_QRegExp_escape(const QString& str);
679 683 bool exactMatch(QRegExp* theWrappedObject, const QString& str) const;
680 684 int indexIn(QRegExp* theWrappedObject, const QString& str, int offset = 0, QRegExp::CaretMode caretMode = QRegExp::CaretAtZero) const;
681 685 bool isEmpty(QRegExp* theWrappedObject) const;
682 686 bool isMinimal(QRegExp* theWrappedObject) const;
683 687 bool isValid(QRegExp* theWrappedObject) const;
684 688 int lastIndexIn(QRegExp* theWrappedObject, const QString& str, int offset = -1, QRegExp::CaretMode caretMode = QRegExp::CaretAtZero) const;
685 689 int matchedLength(QRegExp* theWrappedObject) const;
686 690 bool __ne__(QRegExp* theWrappedObject, const QRegExp& rx) const;
687 691 bool __eq__(QRegExp* theWrappedObject, const QRegExp& rx) const;
688 692 QString pattern(QRegExp* theWrappedObject) const;
689 693 QRegExp::PatternSyntax patternSyntax(QRegExp* theWrappedObject) const;
690 694 int pos(QRegExp* theWrappedObject, int nth = 0) const;
691 695 void setCaseSensitivity(QRegExp* theWrappedObject, Qt::CaseSensitivity cs);
692 696 void setMinimal(QRegExp* theWrappedObject, bool minimal);
693 697 void setPattern(QRegExp* theWrappedObject, const QString& pattern);
694 698 void setPatternSyntax(QRegExp* theWrappedObject, QRegExp::PatternSyntax syntax);
695 699 void swap(QRegExp* theWrappedObject, QRegExp& other);
696 700 QString py_toString(QRegExp*);
697 701 };
698 702
699 703
700 704
701 705
702 706
703 707 class PythonQtWrapper_QSize : public QObject
704 708 { Q_OBJECT
705 709 public:
706 710 public slots:
707 711 QSize* new_QSize();
708 712 QSize* new_QSize(int w, int h);
709 713 QSize* new_QSize(const QSize& other) {
710 714 QSize* a = new QSize();
711 715 *((QSize*)a) = other;
712 716 return a; }
713 717 void delete_QSize(QSize* obj) { delete obj; }
714 718 QSize boundedTo(QSize* theWrappedObject, const QSize& arg__1) const;
715 719 QSize expandedTo(QSize* theWrappedObject, const QSize& arg__1) const;
716 720 int height(QSize* theWrappedObject) const;
717 721 bool isEmpty(QSize* theWrappedObject) const;
718 722 bool isNull(QSize* theWrappedObject) const;
719 723 bool isValid(QSize* theWrappedObject) const;
720 724 const QSize __mul__(QSize* theWrappedObject, qreal c);
721 725 QSize* __imul__(QSize* theWrappedObject, qreal c);
722 726 const QSize __add__(QSize* theWrappedObject, const QSize& s2);
723 727 QSize* __iadd__(QSize* theWrappedObject, const QSize& arg__1);
724 728 const QSize __sub__(QSize* theWrappedObject, const QSize& s2);
725 729 QSize* __isub__(QSize* theWrappedObject, const QSize& arg__1);
726 730 const QSize __div__(QSize* theWrappedObject, qreal c);
727 731 QSize* __idiv__(QSize* theWrappedObject, qreal c);
728 732 bool __eq__(QSize* theWrappedObject, const QSize& s2);
729 733 void scale(QSize* theWrappedObject, const QSize& s, Qt::AspectRatioMode mode);
730 734 void scale(QSize* theWrappedObject, int w, int h, Qt::AspectRatioMode mode);
731 735 QSize scaled(QSize* theWrappedObject, const QSize& s, Qt::AspectRatioMode mode) const;
732 736 QSize scaled(QSize* theWrappedObject, int w, int h, Qt::AspectRatioMode mode) const;
733 737 void setHeight(QSize* theWrappedObject, int h);
734 738 void setWidth(QSize* theWrappedObject, int w);
735 739 void transpose(QSize* theWrappedObject);
736 740 QSize transposed(QSize* theWrappedObject) const;
737 741 int width(QSize* theWrappedObject) const;
738 742 QString py_toString(QSize*);
739 743 bool __nonzero__(QSize* obj) { return !obj->isNull(); }
740 744 };
741 745
742 746
743 747
744 748
745 749
746 750 class PythonQtWrapper_QSizeF : public QObject
747 751 { Q_OBJECT
748 752 public:
749 753 public slots:
750 754 QSizeF* new_QSizeF();
751 755 QSizeF* new_QSizeF(const QSize& sz);
752 756 QSizeF* new_QSizeF(qreal w, qreal h);
753 757 QSizeF* new_QSizeF(const QSizeF& other) {
754 758 QSizeF* a = new QSizeF();
755 759 *((QSizeF*)a) = other;
756 760 return a; }
757 761 void delete_QSizeF(QSizeF* obj) { delete obj; }
758 762 QSizeF boundedTo(QSizeF* theWrappedObject, const QSizeF& arg__1) const;
759 763 QSizeF expandedTo(QSizeF* theWrappedObject, const QSizeF& arg__1) const;
760 764 qreal height(QSizeF* theWrappedObject) const;
761 765 bool isEmpty(QSizeF* theWrappedObject) const;
762 766 bool isNull(QSizeF* theWrappedObject) const;
763 767 bool isValid(QSizeF* theWrappedObject) const;
764 768 const QSizeF __mul__(QSizeF* theWrappedObject, qreal c);
765 769 QSizeF* __imul__(QSizeF* theWrappedObject, qreal c);
766 770 const QSizeF __add__(QSizeF* theWrappedObject, const QSizeF& s2);
767 771 QSizeF* __iadd__(QSizeF* theWrappedObject, const QSizeF& arg__1);
768 772 const QSizeF __sub__(QSizeF* theWrappedObject, const QSizeF& s2);
769 773 QSizeF* __isub__(QSizeF* theWrappedObject, const QSizeF& arg__1);
770 774 const QSizeF __div__(QSizeF* theWrappedObject, qreal c);
771 775 QSizeF* __idiv__(QSizeF* theWrappedObject, qreal c);
772 776 bool __eq__(QSizeF* theWrappedObject, const QSizeF& s2);
773 777 void scale(QSizeF* theWrappedObject, const QSizeF& s, Qt::AspectRatioMode mode);
774 778 void scale(QSizeF* theWrappedObject, qreal w, qreal h, Qt::AspectRatioMode mode);
775 779 QSizeF scaled(QSizeF* theWrappedObject, const QSizeF& s, Qt::AspectRatioMode mode) const;
776 780 QSizeF scaled(QSizeF* theWrappedObject, qreal w, qreal h, Qt::AspectRatioMode mode) const;
777 781 void setHeight(QSizeF* theWrappedObject, qreal h);
778 782 void setWidth(QSizeF* theWrappedObject, qreal w);
779 783 QSize toSize(QSizeF* theWrappedObject) const;
780 784 void transpose(QSizeF* theWrappedObject);
781 785 QSizeF transposed(QSizeF* theWrappedObject) const;
782 786 qreal width(QSizeF* theWrappedObject) const;
783 787 QString py_toString(QSizeF*);
784 788 bool __nonzero__(QSizeF* obj) { return !obj->isNull(); }
785 789 };
786 790
787 791
788 792
789 793
790 794
791 795 class PythonQtWrapper_QTime : public QObject
792 796 { Q_OBJECT
793 797 public:
794 798 public slots:
795 799 QTime* new_QTime();
796 800 QTime* new_QTime(int h, int m, int s = 0, int ms = 0);
797 801 QTime* new_QTime(const QTime& other) {
798 802 QTime* a = new QTime();
799 803 *((QTime*)a) = other;
800 804 return a; }
801 805 void delete_QTime(QTime* obj) { delete obj; }
802 806 QTime addMSecs(QTime* theWrappedObject, int ms) const;
803 807 QTime addSecs(QTime* theWrappedObject, int secs) const;
804 808 QTime static_QTime_currentTime();
805 809 int elapsed(QTime* theWrappedObject) const;
806 810 QTime static_QTime_fromString(const QString& s, Qt::DateFormat f = Qt::TextDate);
807 811 QTime static_QTime_fromString(const QString& s, const QString& format);
808 812 int hour(QTime* theWrappedObject) const;
809 813 bool isNull(QTime* theWrappedObject) const;
810 814 bool isValid(QTime* theWrappedObject) const;
811 815 bool static_QTime_isValid(int h, int m, int s, int ms = 0);
812 816 int minute(QTime* theWrappedObject) const;
813 817 int msec(QTime* theWrappedObject) const;
814 818 int msecsTo(QTime* theWrappedObject, const QTime& arg__1) const;
815 819 bool __ne__(QTime* theWrappedObject, const QTime& other) const;
816 820 bool __lt__(QTime* theWrappedObject, const QTime& other) const;
817 821 bool __le__(QTime* theWrappedObject, const QTime& other) const;
818 822 bool __eq__(QTime* theWrappedObject, const QTime& other) const;
819 823 bool __gt__(QTime* theWrappedObject, const QTime& other) const;
820 824 bool __ge__(QTime* theWrappedObject, const QTime& other) const;
821 825 int restart(QTime* theWrappedObject);
822 826 int second(QTime* theWrappedObject) const;
823 827 int secsTo(QTime* theWrappedObject, const QTime& arg__1) const;
824 828 bool setHMS(QTime* theWrappedObject, int h, int m, int s, int ms = 0);
825 829 void start(QTime* theWrappedObject);
826 830 QString toString(QTime* theWrappedObject, Qt::DateFormat f = Qt::TextDate) const;
827 831 QString toString(QTime* theWrappedObject, const QString& format) const;
828 832 QString py_toString(QTime*);
829 833 bool __nonzero__(QTime* obj) { return !obj->isNull(); }
830 834 };
831 835
832 836
833 837
834 838
835 839
836 840 class PythonQtWrapper_QUrl : public QObject
837 841 { Q_OBJECT
838 842 public:
839 843 Q_ENUMS(ParsingMode )
840 844 enum ParsingMode{
841 845 TolerantMode = QUrl::TolerantMode, StrictMode = QUrl::StrictMode, DecodedMode = QUrl::DecodedMode};
842 846 public slots:
843 847 QUrl* new_QUrl();
844 848 QUrl* new_QUrl(const QString& url, QUrl::ParsingMode mode = QUrl::TolerantMode);
845 849 QUrl* new_QUrl(const QUrl& copy);
846 850 void delete_QUrl(QUrl* obj) { delete obj; }
847 851 void clear(QUrl* theWrappedObject);
848 852 QString errorString(QUrl* theWrappedObject) const;
849 853 QString static_QUrl_fromAce(const QByteArray& arg__1);
850 854 QUrl static_QUrl_fromEncoded(const QByteArray& url, QUrl::ParsingMode mode = QUrl::TolerantMode);
851 855 QUrl static_QUrl_fromLocalFile(const QString& localfile);
852 856 QString static_QUrl_fromPercentEncoding(const QByteArray& arg__1);
853 857 QUrl static_QUrl_fromUserInput(const QString& userInput);
854 858 bool hasFragment(QUrl* theWrappedObject) const;
855 859 bool hasQuery(QUrl* theWrappedObject) const;
856 860 QStringList static_QUrl_idnWhitelist();
857 861 bool isEmpty(QUrl* theWrappedObject) const;
858 862 bool isLocalFile(QUrl* theWrappedObject) const;
859 863 bool isParentOf(QUrl* theWrappedObject, const QUrl& url) const;
860 864 bool isRelative(QUrl* theWrappedObject) const;
861 865 bool isValid(QUrl* theWrappedObject) const;
862 866 bool __ne__(QUrl* theWrappedObject, const QUrl& url) const;
863 867 bool __lt__(QUrl* theWrappedObject, const QUrl& url) const;
864 868 bool __eq__(QUrl* theWrappedObject, const QUrl& url) const;
865 869 int port(QUrl* theWrappedObject, int defaultPort = -1) const;
866 870 QUrl resolved(QUrl* theWrappedObject, const QUrl& relative) const;
867 871 QString scheme(QUrl* theWrappedObject) const;
868 872 void setAuthority(QUrl* theWrappedObject, const QString& authority, QUrl::ParsingMode mode = QUrl::TolerantMode);
869 873 void setFragment(QUrl* theWrappedObject, const QString& fragment, QUrl::ParsingMode mode = QUrl::TolerantMode);
870 874 void setHost(QUrl* theWrappedObject, const QString& host, QUrl::ParsingMode mode = QUrl::TolerantMode);
871 875 void static_QUrl_setIdnWhitelist(const QStringList& arg__1);
872 876 void setPassword(QUrl* theWrappedObject, const QString& password, QUrl::ParsingMode mode = QUrl::TolerantMode);
873 877 void setPath(QUrl* theWrappedObject, const QString& path, QUrl::ParsingMode mode = QUrl::TolerantMode);
874 878 void setPort(QUrl* theWrappedObject, int port);
875 879 void setQuery(QUrl* theWrappedObject, const QString& query, QUrl::ParsingMode mode = QUrl::TolerantMode);
876 880 void setScheme(QUrl* theWrappedObject, const QString& scheme);
877 881 void setUrl(QUrl* theWrappedObject, const QString& url, QUrl::ParsingMode mode = QUrl::TolerantMode);
878 882 void setUserInfo(QUrl* theWrappedObject, const QString& userInfo, QUrl::ParsingMode mode = QUrl::TolerantMode);
879 883 void setUserName(QUrl* theWrappedObject, const QString& userName, QUrl::ParsingMode mode = QUrl::TolerantMode);
880 884 void swap(QUrl* theWrappedObject, QUrl& other);
881 885 QByteArray static_QUrl_toAce(const QString& arg__1);
882 886 QString toLocalFile(QUrl* theWrappedObject) const;
883 887 QByteArray static_QUrl_toPercentEncoding(const QString& arg__1, const QByteArray& exclude = QByteArray(), const QByteArray& include = QByteArray());
884 888 QString py_toString(QUrl*);
885 889 };
886 890
887 891
888 892
889 893
890 894
891 895 class PythonQtWrapper_Qt : public QObject
892 896 { Q_OBJECT
893 897 public:
894 898 Q_ENUMS(AspectRatioMode BGMode MouseButton SortOrder Orientation WidgetAttribute GestureState GlobalColor PenStyle NavigationMode GestureFlag ToolBarArea WindowFrameSection PenCapStyle SizeHint DayOfWeek WindowModality MatchFlag DockWidgetAreaSizes FindChildOption AnchorPoint CaseSensitivity TextFlag BrushStyle ItemSelectionMode DateFormat ApplicationAttribute ItemFlag ScrollBarPolicy WhiteSpaceMode TimerType DropAction FocusPolicy CursorShape TouchPointState CursorMoveStyle InputMethodHint ArrowType TextFormat HitTestAccuracy ToolButtonStyle FocusReason TextElideMode CoordinateSystem KeyboardModifier UIEffect ScreenOrientation ImageConversionFlag TransformationMode PenJoinStyle EventPriority LayoutDirection TextInteractionFlag Corner TileRule ConnectionType AlignmentFlag Key WindowState CheckState ToolBarAreaSizes SizeMode Axis FillRule GestureType ClipOperation InputMethodQuery TimeSpec ItemDataRole ShortcutContext MaskMode WindowType DockWidgetArea ContextMenuPolicy )
895 899 Q_FLAGS(MouseButtons Orientations GestureFlags ToolBarAreas MatchFlags ItemFlags DropActions TouchPointStates InputMethodHints KeyboardModifiers ImageConversionFlags TextInteractionFlags Alignment WindowStates WindowFlags DockWidgetAreas )
896 900 enum AspectRatioMode{
897 901 IgnoreAspectRatio = Qt::IgnoreAspectRatio, KeepAspectRatio = Qt::KeepAspectRatio, KeepAspectRatioByExpanding = Qt::KeepAspectRatioByExpanding};
898 902 enum BGMode{
899 903 TransparentMode = Qt::TransparentMode, OpaqueMode = Qt::OpaqueMode};
900 904 enum MouseButton{
901 905 NoButton = Qt::NoButton, LeftButton = Qt::LeftButton, RightButton = Qt::RightButton, MidButton = Qt::MidButton, MiddleButton = Qt::MiddleButton, BackButton = Qt::BackButton, XButton1 = Qt::XButton1, ExtraButton1 = Qt::ExtraButton1, ForwardButton = Qt::ForwardButton, XButton2 = Qt::XButton2, ExtraButton2 = Qt::ExtraButton2, TaskButton = Qt::TaskButton, ExtraButton3 = Qt::ExtraButton3, ExtraButton4 = Qt::ExtraButton4, ExtraButton5 = Qt::ExtraButton5, ExtraButton6 = Qt::ExtraButton6, ExtraButton7 = Qt::ExtraButton7, ExtraButton8 = Qt::ExtraButton8, ExtraButton9 = Qt::ExtraButton9, ExtraButton10 = Qt::ExtraButton10, ExtraButton11 = Qt::ExtraButton11, ExtraButton12 = Qt::ExtraButton12, ExtraButton13 = Qt::ExtraButton13, ExtraButton14 = Qt::ExtraButton14, ExtraButton15 = Qt::ExtraButton15, ExtraButton16 = Qt::ExtraButton16, ExtraButton17 = Qt::ExtraButton17, ExtraButton18 = Qt::ExtraButton18, ExtraButton19 = Qt::ExtraButton19, ExtraButton20 = Qt::ExtraButton20, ExtraButton21 = Qt::ExtraButton21, ExtraButton22 = Qt::ExtraButton22, ExtraButton23 = Qt::ExtraButton23, ExtraButton24 = Qt::ExtraButton24, AllButtons = Qt::AllButtons, MaxMouseButton = Qt::MaxMouseButton, MouseButtonMask = Qt::MouseButtonMask};
902 906 enum SortOrder{
903 907 AscendingOrder = Qt::AscendingOrder, DescendingOrder = Qt::DescendingOrder};
904 908 enum Orientation{
905 909 Horizontal = Qt::Horizontal, Vertical = Qt::Vertical};
906 910 enum WidgetAttribute{
907 911 WA_Disabled = Qt::WA_Disabled, WA_UnderMouse = Qt::WA_UnderMouse, WA_MouseTracking = Qt::WA_MouseTracking, WA_ContentsPropagated = Qt::WA_ContentsPropagated, WA_OpaquePaintEvent = Qt::WA_OpaquePaintEvent, WA_NoBackground = Qt::WA_NoBackground, WA_StaticContents = Qt::WA_StaticContents, WA_LaidOut = Qt::WA_LaidOut, WA_PaintOnScreen = Qt::WA_PaintOnScreen, WA_NoSystemBackground = Qt::WA_NoSystemBackground, WA_UpdatesDisabled = Qt::WA_UpdatesDisabled, WA_Mapped = Qt::WA_Mapped, WA_MacNoClickThrough = Qt::WA_MacNoClickThrough, WA_InputMethodEnabled = Qt::WA_InputMethodEnabled, WA_WState_Visible = Qt::WA_WState_Visible, WA_WState_Hidden = Qt::WA_WState_Hidden, WA_ForceDisabled = Qt::WA_ForceDisabled, WA_KeyCompression = Qt::WA_KeyCompression, WA_PendingMoveEvent = Qt::WA_PendingMoveEvent, WA_PendingResizeEvent = Qt::WA_PendingResizeEvent, WA_SetPalette = Qt::WA_SetPalette, WA_SetFont = Qt::WA_SetFont, WA_SetCursor = Qt::WA_SetCursor, WA_NoChildEventsFromChildren = Qt::WA_NoChildEventsFromChildren, WA_WindowModified = Qt::WA_WindowModified, WA_Resized = Qt::WA_Resized, WA_Moved = Qt::WA_Moved, WA_PendingUpdate = Qt::WA_PendingUpdate, WA_InvalidSize = Qt::WA_InvalidSize, WA_MacBrushedMetal = Qt::WA_MacBrushedMetal, WA_MacMetalStyle = Qt::WA_MacMetalStyle, WA_CustomWhatsThis = Qt::WA_CustomWhatsThis, WA_LayoutOnEntireRect = Qt::WA_LayoutOnEntireRect, WA_OutsideWSRange = Qt::WA_OutsideWSRange, WA_GrabbedShortcut = Qt::WA_GrabbedShortcut, WA_TransparentForMouseEvents = Qt::WA_TransparentForMouseEvents, WA_PaintUnclipped = Qt::WA_PaintUnclipped, WA_SetWindowIcon = Qt::WA_SetWindowIcon, WA_NoMouseReplay = Qt::WA_NoMouseReplay, WA_DeleteOnClose = Qt::WA_DeleteOnClose, WA_RightToLeft = Qt::WA_RightToLeft, WA_SetLayoutDirection = Qt::WA_SetLayoutDirection, WA_NoChildEventsForParent = Qt::WA_NoChildEventsForParent, WA_ForceUpdatesDisabled = Qt::WA_ForceUpdatesDisabled, WA_WState_Created = Qt::WA_WState_Created, WA_WState_CompressKeys = Qt::WA_WState_CompressKeys, WA_WState_InPaintEvent = Qt::WA_WState_InPaintEvent, WA_WState_Reparented = Qt::WA_WState_Reparented, WA_WState_ConfigPending = Qt::WA_WState_ConfigPending, WA_WState_Polished = Qt::WA_WState_Polished, WA_WState_DND = Qt::WA_WState_DND, WA_WState_OwnSizePolicy = Qt::WA_WState_OwnSizePolicy, WA_WState_ExplicitShowHide = Qt::WA_WState_ExplicitShowHide, WA_ShowModal = Qt::WA_ShowModal, WA_MouseNoMask = Qt::WA_MouseNoMask, WA_GroupLeader = Qt::WA_GroupLeader, WA_NoMousePropagation = Qt::WA_NoMousePropagation, WA_Hover = Qt::WA_Hover, WA_InputMethodTransparent = Qt::WA_InputMethodTransparent, WA_QuitOnClose = Qt::WA_QuitOnClose, WA_KeyboardFocusChange = Qt::WA_KeyboardFocusChange, WA_AcceptDrops = Qt::WA_AcceptDrops, WA_DropSiteRegistered = Qt::WA_DropSiteRegistered, WA_ForceAcceptDrops = Qt::WA_ForceAcceptDrops, WA_WindowPropagation = Qt::WA_WindowPropagation, WA_NoX11EventCompression = Qt::WA_NoX11EventCompression, WA_TintedBackground = Qt::WA_TintedBackground, WA_X11OpenGLOverlay = Qt::WA_X11OpenGLOverlay, WA_AlwaysShowToolTips = Qt::WA_AlwaysShowToolTips, WA_MacOpaqueSizeGrip = Qt::WA_MacOpaqueSizeGrip, WA_SetStyle = Qt::WA_SetStyle, WA_SetLocale = Qt::WA_SetLocale, WA_MacShowFocusRect = Qt::WA_MacShowFocusRect, WA_MacNormalSize = Qt::WA_MacNormalSize, WA_MacSmallSize = Qt::WA_MacSmallSize, WA_MacMiniSize = Qt::WA_MacMiniSize, WA_LayoutUsesWidgetRect = Qt::WA_LayoutUsesWidgetRect, WA_StyledBackground = Qt::WA_StyledBackground, WA_MSWindowsUseDirect3D = Qt::WA_MSWindowsUseDirect3D, WA_CanHostQMdiSubWindowTitleBar = Qt::WA_CanHostQMdiSubWindowTitleBar, WA_MacAlwaysShowToolWindow = Qt::WA_MacAlwaysShowToolWindow, WA_StyleSheet = Qt::WA_StyleSheet, WA_ShowWithoutActivating = Qt::WA_ShowWithoutActivating, WA_X11BypassTransientForHint = Qt::WA_X11BypassTransientForHint, WA_NativeWindow = Qt::WA_NativeWindow, WA_DontCreateNativeAncestors = Qt::WA_DontCreateNativeAncestors, WA_MacVariableSize = Qt::WA_MacVariableSize, WA_DontShowOnScreen = Qt::WA_DontShowOnScreen, WA_X11NetWmWindowTypeDesktop = Qt::WA_X11NetWmWindowTypeDesktop, WA_X11NetWmWindowTypeDock = Qt::WA_X11NetWmWindowTypeDock, WA_X11NetWmWindowTypeToolBar = Qt::WA_X11NetWmWindowTypeToolBar, WA_X11NetWmWindowTypeMenu = Qt::WA_X11NetWmWindowTypeMenu, WA_X11NetWmWindowTypeUtility = Qt::WA_X11NetWmWindowTypeUtility, WA_X11NetWmWindowTypeSplash = Qt::WA_X11NetWmWindowTypeSplash, WA_X11NetWmWindowTypeDialog = Qt::WA_X11NetWmWindowTypeDialog, WA_X11NetWmWindowTypeDropDownMenu = Qt::WA_X11NetWmWindowTypeDropDownMenu, WA_X11NetWmWindowTypePopupMenu = Qt::WA_X11NetWmWindowTypePopupMenu, WA_X11NetWmWindowTypeToolTip = Qt::WA_X11NetWmWindowTypeToolTip, WA_X11NetWmWindowTypeNotification = Qt::WA_X11NetWmWindowTypeNotification, WA_X11NetWmWindowTypeCombo = Qt::WA_X11NetWmWindowTypeCombo, WA_X11NetWmWindowTypeDND = Qt::WA_X11NetWmWindowTypeDND, WA_MacFrameworkScaled = Qt::WA_MacFrameworkScaled, WA_SetWindowModality = Qt::WA_SetWindowModality, WA_WState_WindowOpacitySet = Qt::WA_WState_WindowOpacitySet, WA_TranslucentBackground = Qt::WA_TranslucentBackground, WA_AcceptTouchEvents = Qt::WA_AcceptTouchEvents, WA_WState_AcceptedTouchBeginEvent = Qt::WA_WState_AcceptedTouchBeginEvent, WA_TouchPadAcceptSingleTouchEvents = Qt::WA_TouchPadAcceptSingleTouchEvents, WA_X11DoNotAcceptFocus = Qt::WA_X11DoNotAcceptFocus, WA_MacNoShadow = Qt::WA_MacNoShadow, WA_AttributeCount = Qt::WA_AttributeCount};
908 912 enum GestureState{
909 913 NoGesture = Qt::NoGesture, GestureStarted = Qt::GestureStarted, GestureUpdated = Qt::GestureUpdated, GestureFinished = Qt::GestureFinished, GestureCanceled = Qt::GestureCanceled};
910 914 enum GlobalColor{
911 915 color0 = Qt::color0, color1 = Qt::color1, black = Qt::black, white = Qt::white, darkGray = Qt::darkGray, gray = Qt::gray, lightGray = Qt::lightGray, red = Qt::red, green = Qt::green, blue = Qt::blue, cyan = Qt::cyan, magenta = Qt::magenta, yellow = Qt::yellow, darkRed = Qt::darkRed, darkGreen = Qt::darkGreen, darkBlue = Qt::darkBlue, darkCyan = Qt::darkCyan, darkMagenta = Qt::darkMagenta, darkYellow = Qt::darkYellow, transparent = Qt::transparent};
912 916 enum PenStyle{
913 917 NoPen = Qt::NoPen, SolidLine = Qt::SolidLine, DashLine = Qt::DashLine, DotLine = Qt::DotLine, DashDotLine = Qt::DashDotLine, DashDotDotLine = Qt::DashDotDotLine, CustomDashLine = Qt::CustomDashLine, MPenStyle = Qt::MPenStyle};
914 918 enum NavigationMode{
915 919 NavigationModeNone = Qt::NavigationModeNone, NavigationModeKeypadTabOrder = Qt::NavigationModeKeypadTabOrder, NavigationModeKeypadDirectional = Qt::NavigationModeKeypadDirectional, NavigationModeCursorAuto = Qt::NavigationModeCursorAuto, NavigationModeCursorForceVisible = Qt::NavigationModeCursorForceVisible};
916 920 enum GestureFlag{
917 921 DontStartGestureOnChildren = Qt::DontStartGestureOnChildren, ReceivePartialGestures = Qt::ReceivePartialGestures, IgnoredGesturesPropagateToParent = Qt::IgnoredGesturesPropagateToParent};
918 922 enum ToolBarArea{
919 923 LeftToolBarArea = Qt::LeftToolBarArea, RightToolBarArea = Qt::RightToolBarArea, TopToolBarArea = Qt::TopToolBarArea, BottomToolBarArea = Qt::BottomToolBarArea, ToolBarArea_Mask = Qt::ToolBarArea_Mask, AllToolBarAreas = Qt::AllToolBarAreas, NoToolBarArea = Qt::NoToolBarArea};
920 924 enum WindowFrameSection{
921 925 NoSection = Qt::NoSection, LeftSection = Qt::LeftSection, TopLeftSection = Qt::TopLeftSection, TopSection = Qt::TopSection, TopRightSection = Qt::TopRightSection, RightSection = Qt::RightSection, BottomRightSection = Qt::BottomRightSection, BottomSection = Qt::BottomSection, BottomLeftSection = Qt::BottomLeftSection, TitleBarArea = Qt::TitleBarArea};
922 926 enum PenCapStyle{
923 927 FlatCap = Qt::FlatCap, SquareCap = Qt::SquareCap, RoundCap = Qt::RoundCap, MPenCapStyle = Qt::MPenCapStyle};
924 928 enum SizeHint{
925 929 MinimumSize = Qt::MinimumSize, PreferredSize = Qt::PreferredSize, MaximumSize = Qt::MaximumSize, MinimumDescent = Qt::MinimumDescent, NSizeHints = Qt::NSizeHints};
926 930 enum DayOfWeek{
927 931 Monday = Qt::Monday, Tuesday = Qt::Tuesday, Wednesday = Qt::Wednesday, Thursday = Qt::Thursday, Friday = Qt::Friday, Saturday = Qt::Saturday, Sunday = Qt::Sunday};
928 932 enum WindowModality{
929 933 NonModal = Qt::NonModal, WindowModal = Qt::WindowModal, ApplicationModal = Qt::ApplicationModal};
930 934 enum MatchFlag{
931 935 MatchExactly = Qt::MatchExactly, MatchContains = Qt::MatchContains, MatchStartsWith = Qt::MatchStartsWith, MatchEndsWith = Qt::MatchEndsWith, MatchRegExp = Qt::MatchRegExp, MatchWildcard = Qt::MatchWildcard, MatchFixedString = Qt::MatchFixedString, MatchCaseSensitive = Qt::MatchCaseSensitive, MatchWrap = Qt::MatchWrap, MatchRecursive = Qt::MatchRecursive};
932 936 enum DockWidgetAreaSizes{
933 937 NDockWidgetAreas = Qt::NDockWidgetAreas};
934 938 enum FindChildOption{
935 939 FindDirectChildrenOnly = Qt::FindDirectChildrenOnly, FindChildrenRecursively = Qt::FindChildrenRecursively};
936 940 enum AnchorPoint{
937 941 AnchorLeft = Qt::AnchorLeft, AnchorHorizontalCenter = Qt::AnchorHorizontalCenter, AnchorRight = Qt::AnchorRight, AnchorTop = Qt::AnchorTop, AnchorVerticalCenter = Qt::AnchorVerticalCenter, AnchorBottom = Qt::AnchorBottom};
938 942 enum CaseSensitivity{
939 943 CaseInsensitive = Qt::CaseInsensitive, CaseSensitive = Qt::CaseSensitive};
940 944 enum TextFlag{
941 945 TextSingleLine = Qt::TextSingleLine, TextDontClip = Qt::TextDontClip, TextExpandTabs = Qt::TextExpandTabs, TextShowMnemonic = Qt::TextShowMnemonic, TextWordWrap = Qt::TextWordWrap, TextWrapAnywhere = Qt::TextWrapAnywhere, TextDontPrint = Qt::TextDontPrint, TextIncludeTrailingSpaces = Qt::TextIncludeTrailingSpaces, TextHideMnemonic = Qt::TextHideMnemonic, TextJustificationForced = Qt::TextJustificationForced, TextForceLeftToRight = Qt::TextForceLeftToRight, TextForceRightToLeft = Qt::TextForceRightToLeft, TextLongestVariant = Qt::TextLongestVariant, TextBypassShaping = Qt::TextBypassShaping};
942 946 enum BrushStyle{
943 947 NoBrush = Qt::NoBrush, SolidPattern = Qt::SolidPattern, Dense1Pattern = Qt::Dense1Pattern, Dense2Pattern = Qt::Dense2Pattern, Dense3Pattern = Qt::Dense3Pattern, Dense4Pattern = Qt::Dense4Pattern, Dense5Pattern = Qt::Dense5Pattern, Dense6Pattern = Qt::Dense6Pattern, Dense7Pattern = Qt::Dense7Pattern, HorPattern = Qt::HorPattern, VerPattern = Qt::VerPattern, CrossPattern = Qt::CrossPattern, BDiagPattern = Qt::BDiagPattern, FDiagPattern = Qt::FDiagPattern, DiagCrossPattern = Qt::DiagCrossPattern, LinearGradientPattern = Qt::LinearGradientPattern, RadialGradientPattern = Qt::RadialGradientPattern, ConicalGradientPattern = Qt::ConicalGradientPattern, TexturePattern = Qt::TexturePattern};
944 948 enum ItemSelectionMode{
945 949 ContainsItemShape = Qt::ContainsItemShape, IntersectsItemShape = Qt::IntersectsItemShape, ContainsItemBoundingRect = Qt::ContainsItemBoundingRect, IntersectsItemBoundingRect = Qt::IntersectsItemBoundingRect};
946 950 enum DateFormat{
947 951 TextDate = Qt::TextDate, ISODate = Qt::ISODate, SystemLocaleDate = Qt::SystemLocaleDate, LocalDate = Qt::LocalDate, LocaleDate = Qt::LocaleDate, SystemLocaleShortDate = Qt::SystemLocaleShortDate, SystemLocaleLongDate = Qt::SystemLocaleLongDate, DefaultLocaleShortDate = Qt::DefaultLocaleShortDate, DefaultLocaleLongDate = Qt::DefaultLocaleLongDate};
948 952 enum ApplicationAttribute{
949 953 AA_ImmediateWidgetCreation = Qt::AA_ImmediateWidgetCreation, AA_MSWindowsUseDirect3DByDefault = Qt::AA_MSWindowsUseDirect3DByDefault, AA_DontShowIconsInMenus = Qt::AA_DontShowIconsInMenus, AA_NativeWindows = Qt::AA_NativeWindows, AA_DontCreateNativeWidgetSiblings = Qt::AA_DontCreateNativeWidgetSiblings, AA_MacPluginApplication = Qt::AA_MacPluginApplication, AA_DontUseNativeMenuBar = Qt::AA_DontUseNativeMenuBar, AA_MacDontSwapCtrlAndMeta = Qt::AA_MacDontSwapCtrlAndMeta, AA_Use96Dpi = Qt::AA_Use96Dpi, AA_X11InitThreads = Qt::AA_X11InitThreads, AA_SynthesizeTouchForUnhandledMouseEvents = Qt::AA_SynthesizeTouchForUnhandledMouseEvents, AA_SynthesizeMouseForUnhandledTouchEvents = Qt::AA_SynthesizeMouseForUnhandledTouchEvents, AA_AttributeCount = Qt::AA_AttributeCount};
950 954 enum ItemFlag{
951 955 NoItemFlags = Qt::NoItemFlags, ItemIsSelectable = Qt::ItemIsSelectable, ItemIsEditable = Qt::ItemIsEditable, ItemIsDragEnabled = Qt::ItemIsDragEnabled, ItemIsDropEnabled = Qt::ItemIsDropEnabled, ItemIsUserCheckable = Qt::ItemIsUserCheckable, ItemIsEnabled = Qt::ItemIsEnabled, ItemIsTristate = Qt::ItemIsTristate};
952 956 enum ScrollBarPolicy{
953 957 ScrollBarAsNeeded = Qt::ScrollBarAsNeeded, ScrollBarAlwaysOff = Qt::ScrollBarAlwaysOff, ScrollBarAlwaysOn = Qt::ScrollBarAlwaysOn};
954 958 enum WhiteSpaceMode{
955 959 WhiteSpaceNormal = Qt::WhiteSpaceNormal, WhiteSpacePre = Qt::WhiteSpacePre, WhiteSpaceNoWrap = Qt::WhiteSpaceNoWrap, WhiteSpaceModeUndefined = Qt::WhiteSpaceModeUndefined};
956 960 enum TimerType{
957 961 PreciseTimer = Qt::PreciseTimer, CoarseTimer = Qt::CoarseTimer, VeryCoarseTimer = Qt::VeryCoarseTimer};
958 962 enum DropAction{
959 963 CopyAction = Qt::CopyAction, MoveAction = Qt::MoveAction, LinkAction = Qt::LinkAction, ActionMask = Qt::ActionMask, TargetMoveAction = Qt::TargetMoveAction, IgnoreAction = Qt::IgnoreAction};
960 964 enum FocusPolicy{
961 965 NoFocus = Qt::NoFocus, TabFocus = Qt::TabFocus, ClickFocus = Qt::ClickFocus, StrongFocus = Qt::StrongFocus, WheelFocus = Qt::WheelFocus};
962 966 enum CursorShape{
963 967 ArrowCursor = Qt::ArrowCursor, UpArrowCursor = Qt::UpArrowCursor, CrossCursor = Qt::CrossCursor, WaitCursor = Qt::WaitCursor, IBeamCursor = Qt::IBeamCursor, SizeVerCursor = Qt::SizeVerCursor, SizeHorCursor = Qt::SizeHorCursor, SizeBDiagCursor = Qt::SizeBDiagCursor, SizeFDiagCursor = Qt::SizeFDiagCursor, SizeAllCursor = Qt::SizeAllCursor, BlankCursor = Qt::BlankCursor, SplitVCursor = Qt::SplitVCursor, SplitHCursor = Qt::SplitHCursor, PointingHandCursor = Qt::PointingHandCursor, ForbiddenCursor = Qt::ForbiddenCursor, WhatsThisCursor = Qt::WhatsThisCursor, BusyCursor = Qt::BusyCursor, OpenHandCursor = Qt::OpenHandCursor, ClosedHandCursor = Qt::ClosedHandCursor, DragCopyCursor = Qt::DragCopyCursor, DragMoveCursor = Qt::DragMoveCursor, DragLinkCursor = Qt::DragLinkCursor, LastCursor = Qt::LastCursor, BitmapCursor = Qt::BitmapCursor, CustomCursor = Qt::CustomCursor};
964 968 enum TouchPointState{
965 969 TouchPointPressed = Qt::TouchPointPressed, TouchPointMoved = Qt::TouchPointMoved, TouchPointStationary = Qt::TouchPointStationary, TouchPointReleased = Qt::TouchPointReleased};
966 970 enum CursorMoveStyle{
967 971 LogicalMoveStyle = Qt::LogicalMoveStyle, VisualMoveStyle = Qt::VisualMoveStyle};
968 972 enum InputMethodHint{
969 973 ImhNone = Qt::ImhNone, ImhHiddenText = Qt::ImhHiddenText, ImhSensitiveData = Qt::ImhSensitiveData, ImhNoAutoUppercase = Qt::ImhNoAutoUppercase, ImhPreferNumbers = Qt::ImhPreferNumbers, ImhPreferUppercase = Qt::ImhPreferUppercase, ImhPreferLowercase = Qt::ImhPreferLowercase, ImhNoPredictiveText = Qt::ImhNoPredictiveText, ImhDate = Qt::ImhDate, ImhTime = Qt::ImhTime, ImhPreferLatin = Qt::ImhPreferLatin, ImhDigitsOnly = Qt::ImhDigitsOnly, ImhFormattedNumbersOnly = Qt::ImhFormattedNumbersOnly, ImhUppercaseOnly = Qt::ImhUppercaseOnly, ImhLowercaseOnly = Qt::ImhLowercaseOnly, ImhDialableCharactersOnly = Qt::ImhDialableCharactersOnly, ImhEmailCharactersOnly = Qt::ImhEmailCharactersOnly, ImhUrlCharactersOnly = Qt::ImhUrlCharactersOnly, ImhLatinOnly = Qt::ImhLatinOnly, ImhExclusiveInputMask = Qt::ImhExclusiveInputMask};
970 974 enum ArrowType{
971 975 NoArrow = Qt::NoArrow, UpArrow = Qt::UpArrow, DownArrow = Qt::DownArrow, LeftArrow = Qt::LeftArrow, RightArrow = Qt::RightArrow};
972 976 enum TextFormat{
973 977 PlainText = Qt::PlainText, RichText = Qt::RichText, AutoText = Qt::AutoText};
974 978 enum HitTestAccuracy{
975 979 ExactHit = Qt::ExactHit, FuzzyHit = Qt::FuzzyHit};
976 980 enum ToolButtonStyle{
977 981 ToolButtonIconOnly = Qt::ToolButtonIconOnly, ToolButtonTextOnly = Qt::ToolButtonTextOnly, ToolButtonTextBesideIcon = Qt::ToolButtonTextBesideIcon, ToolButtonTextUnderIcon = Qt::ToolButtonTextUnderIcon, ToolButtonFollowStyle = Qt::ToolButtonFollowStyle};
978 982 enum FocusReason{
979 983 MouseFocusReason = Qt::MouseFocusReason, TabFocusReason = Qt::TabFocusReason, BacktabFocusReason = Qt::BacktabFocusReason, ActiveWindowFocusReason = Qt::ActiveWindowFocusReason, PopupFocusReason = Qt::PopupFocusReason, ShortcutFocusReason = Qt::ShortcutFocusReason, MenuBarFocusReason = Qt::MenuBarFocusReason, OtherFocusReason = Qt::OtherFocusReason, NoFocusReason = Qt::NoFocusReason};
980 984 enum TextElideMode{
981 985 ElideLeft = Qt::ElideLeft, ElideRight = Qt::ElideRight, ElideMiddle = Qt::ElideMiddle, ElideNone = Qt::ElideNone};
982 986 enum CoordinateSystem{
983 987 DeviceCoordinates = Qt::DeviceCoordinates, LogicalCoordinates = Qt::LogicalCoordinates};
984 988 enum KeyboardModifier{
985 989 NoModifier = Qt::NoModifier, ShiftModifier = Qt::ShiftModifier, ControlModifier = Qt::ControlModifier, AltModifier = Qt::AltModifier, MetaModifier = Qt::MetaModifier, KeypadModifier = Qt::KeypadModifier, GroupSwitchModifier = Qt::GroupSwitchModifier, KeyboardModifierMask = Qt::KeyboardModifierMask};
986 990 enum UIEffect{
987 991 UI_General = Qt::UI_General, UI_AnimateMenu = Qt::UI_AnimateMenu, UI_FadeMenu = Qt::UI_FadeMenu, UI_AnimateCombo = Qt::UI_AnimateCombo, UI_AnimateTooltip = Qt::UI_AnimateTooltip, UI_FadeTooltip = Qt::UI_FadeTooltip, UI_AnimateToolBox = Qt::UI_AnimateToolBox};
988 992 enum ScreenOrientation{
989 993 PrimaryOrientation = Qt::PrimaryOrientation, PortraitOrientation = Qt::PortraitOrientation, LandscapeOrientation = Qt::LandscapeOrientation, InvertedPortraitOrientation = Qt::InvertedPortraitOrientation, InvertedLandscapeOrientation = Qt::InvertedLandscapeOrientation};
990 994 enum ImageConversionFlag{
991 995 ColorMode_Mask = Qt::ColorMode_Mask, AutoColor = Qt::AutoColor, ColorOnly = Qt::ColorOnly, MonoOnly = Qt::MonoOnly, AlphaDither_Mask = Qt::AlphaDither_Mask, ThresholdAlphaDither = Qt::ThresholdAlphaDither, OrderedAlphaDither = Qt::OrderedAlphaDither, DiffuseAlphaDither = Qt::DiffuseAlphaDither, NoAlpha = Qt::NoAlpha, Dither_Mask = Qt::Dither_Mask, DiffuseDither = Qt::DiffuseDither, OrderedDither = Qt::OrderedDither, ThresholdDither = Qt::ThresholdDither, DitherMode_Mask = Qt::DitherMode_Mask, AutoDither = Qt::AutoDither, PreferDither = Qt::PreferDither, AvoidDither = Qt::AvoidDither, NoOpaqueDetection = Qt::NoOpaqueDetection, NoFormatConversion = Qt::NoFormatConversion};
992 996 enum TransformationMode{
993 997 FastTransformation = Qt::FastTransformation, SmoothTransformation = Qt::SmoothTransformation};
994 998 enum PenJoinStyle{
995 999 MiterJoin = Qt::MiterJoin, BevelJoin = Qt::BevelJoin, RoundJoin = Qt::RoundJoin, SvgMiterJoin = Qt::SvgMiterJoin, MPenJoinStyle = Qt::MPenJoinStyle};
996 1000 enum EventPriority{
997 1001 HighEventPriority = Qt::HighEventPriority, NormalEventPriority = Qt::NormalEventPriority, LowEventPriority = Qt::LowEventPriority};
998 1002 enum LayoutDirection{
999 1003 LeftToRight = Qt::LeftToRight, RightToLeft = Qt::RightToLeft, LayoutDirectionAuto = Qt::LayoutDirectionAuto};
1000 1004 enum TextInteractionFlag{
1001 1005 NoTextInteraction = Qt::NoTextInteraction, TextSelectableByMouse = Qt::TextSelectableByMouse, TextSelectableByKeyboard = Qt::TextSelectableByKeyboard, LinksAccessibleByMouse = Qt::LinksAccessibleByMouse, LinksAccessibleByKeyboard = Qt::LinksAccessibleByKeyboard, TextEditable = Qt::TextEditable, TextEditorInteraction = Qt::TextEditorInteraction, TextBrowserInteraction = Qt::TextBrowserInteraction};
1002 1006 enum Corner{
1003 1007 TopLeftCorner = Qt::TopLeftCorner, TopRightCorner = Qt::TopRightCorner, BottomLeftCorner = Qt::BottomLeftCorner, BottomRightCorner = Qt::BottomRightCorner};
1004 1008 enum TileRule{
1005 1009 StretchTile = Qt::StretchTile, RepeatTile = Qt::RepeatTile, RoundTile = Qt::RoundTile};
1006 1010 enum ConnectionType{
1007 1011 AutoConnection = Qt::AutoConnection, DirectConnection = Qt::DirectConnection, QueuedConnection = Qt::QueuedConnection, BlockingQueuedConnection = Qt::BlockingQueuedConnection, UniqueConnection = Qt::UniqueConnection};
1008 1012 enum AlignmentFlag{
1009 1013 AlignLeft = Qt::AlignLeft, AlignLeading = Qt::AlignLeading, AlignRight = Qt::AlignRight, AlignTrailing = Qt::AlignTrailing, AlignHCenter = Qt::AlignHCenter, AlignJustify = Qt::AlignJustify, AlignAbsolute = Qt::AlignAbsolute, AlignHorizontal_Mask = Qt::AlignHorizontal_Mask, AlignTop = Qt::AlignTop, AlignBottom = Qt::AlignBottom, AlignVCenter = Qt::AlignVCenter, AlignVertical_Mask = Qt::AlignVertical_Mask, AlignCenter = Qt::AlignCenter};
1010 1014 enum Key{
1011 1015 Key_Escape = Qt::Key_Escape, Key_Tab = Qt::Key_Tab, Key_Backtab = Qt::Key_Backtab, Key_Backspace = Qt::Key_Backspace, Key_Return = Qt::Key_Return, Key_Enter = Qt::Key_Enter, Key_Insert = Qt::Key_Insert, Key_Delete = Qt::Key_Delete, Key_Pause = Qt::Key_Pause, Key_Print = Qt::Key_Print, Key_SysReq = Qt::Key_SysReq, Key_Clear = Qt::Key_Clear, Key_Home = Qt::Key_Home, Key_End = Qt::Key_End, Key_Left = Qt::Key_Left, Key_Up = Qt::Key_Up, Key_Right = Qt::Key_Right, Key_Down = Qt::Key_Down, Key_PageUp = Qt::Key_PageUp, Key_PageDown = Qt::Key_PageDown, Key_Shift = Qt::Key_Shift, Key_Control = Qt::Key_Control, Key_Meta = Qt::Key_Meta, Key_Alt = Qt::Key_Alt, Key_CapsLock = Qt::Key_CapsLock, Key_NumLock = Qt::Key_NumLock, Key_ScrollLock = Qt::Key_ScrollLock, Key_F1 = Qt::Key_F1, Key_F2 = Qt::Key_F2, Key_F3 = Qt::Key_F3, Key_F4 = Qt::Key_F4, Key_F5 = Qt::Key_F5, Key_F6 = Qt::Key_F6, Key_F7 = Qt::Key_F7, Key_F8 = Qt::Key_F8, Key_F9 = Qt::Key_F9, Key_F10 = Qt::Key_F10, Key_F11 = Qt::Key_F11, Key_F12 = Qt::Key_F12, Key_F13 = Qt::Key_F13, Key_F14 = Qt::Key_F14, Key_F15 = Qt::Key_F15, Key_F16 = Qt::Key_F16, Key_F17 = Qt::Key_F17, Key_F18 = Qt::Key_F18, Key_F19 = Qt::Key_F19, Key_F20 = Qt::Key_F20, Key_F21 = Qt::Key_F21, Key_F22 = Qt::Key_F22, Key_F23 = Qt::Key_F23, Key_F24 = Qt::Key_F24, Key_F25 = Qt::Key_F25, Key_F26 = Qt::Key_F26, Key_F27 = Qt::Key_F27, Key_F28 = Qt::Key_F28, Key_F29 = Qt::Key_F29, Key_F30 = Qt::Key_F30, Key_F31 = Qt::Key_F31, Key_F32 = Qt::Key_F32, Key_F33 = Qt::Key_F33, Key_F34 = Qt::Key_F34, Key_F35 = Qt::Key_F35, Key_Super_L = Qt::Key_Super_L, Key_Super_R = Qt::Key_Super_R, Key_Menu = Qt::Key_Menu, Key_Hyper_L = Qt::Key_Hyper_L, Key_Hyper_R = Qt::Key_Hyper_R, Key_Help = Qt::Key_Help, Key_Direction_L = Qt::Key_Direction_L, Key_Direction_R = Qt::Key_Direction_R, Key_Space = Qt::Key_Space, Key_Any = Qt::Key_Any, Key_Exclam = Qt::Key_Exclam, Key_QuoteDbl = Qt::Key_QuoteDbl, Key_NumberSign = Qt::Key_NumberSign, Key_Dollar = Qt::Key_Dollar, Key_Percent = Qt::Key_Percent, Key_Ampersand = Qt::Key_Ampersand, Key_Apostrophe = Qt::Key_Apostrophe, Key_ParenLeft = Qt::Key_ParenLeft, Key_ParenRight = Qt::Key_ParenRight, Key_Asterisk = Qt::Key_Asterisk, Key_Plus = Qt::Key_Plus, Key_Comma = Qt::Key_Comma, Key_Minus = Qt::Key_Minus, Key_Period = Qt::Key_Period, Key_Slash = Qt::Key_Slash, Key_0 = Qt::Key_0, Key_1 = Qt::Key_1, Key_2 = Qt::Key_2, Key_3 = Qt::Key_3, Key_4 = Qt::Key_4, Key_5 = Qt::Key_5, Key_6 = Qt::Key_6, Key_7 = Qt::Key_7, Key_8 = Qt::Key_8, Key_9 = Qt::Key_9, Key_Colon = Qt::Key_Colon, Key_Semicolon = Qt::Key_Semicolon, Key_Less = Qt::Key_Less, Key_Equal = Qt::Key_Equal, Key_Greater = Qt::Key_Greater, Key_Question = Qt::Key_Question, Key_At = Qt::Key_At, Key_A = Qt::Key_A, Key_B = Qt::Key_B, Key_C = Qt::Key_C, Key_D = Qt::Key_D, Key_E = Qt::Key_E, Key_F = Qt::Key_F, Key_G = Qt::Key_G, Key_H = Qt::Key_H, Key_I = Qt::Key_I, Key_J = Qt::Key_J, Key_K = Qt::Key_K, Key_L = Qt::Key_L, Key_M = Qt::Key_M, Key_N = Qt::Key_N, Key_O = Qt::Key_O, Key_P = Qt::Key_P, Key_Q = Qt::Key_Q, Key_R = Qt::Key_R, Key_S = Qt::Key_S, Key_T = Qt::Key_T, Key_U = Qt::Key_U, Key_V = Qt::Key_V, Key_W = Qt::Key_W, Key_X = Qt::Key_X, Key_Y = Qt::Key_Y, Key_Z = Qt::Key_Z, Key_BracketLeft = Qt::Key_BracketLeft, Key_Backslash = Qt::Key_Backslash, Key_BracketRight = Qt::Key_BracketRight, Key_AsciiCircum = Qt::Key_AsciiCircum, Key_Underscore = Qt::Key_Underscore, Key_QuoteLeft = Qt::Key_QuoteLeft, Key_BraceLeft = Qt::Key_BraceLeft, Key_Bar = Qt::Key_Bar, Key_BraceRight = Qt::Key_BraceRight, Key_AsciiTilde = Qt::Key_AsciiTilde, Key_nobreakspace = Qt::Key_nobreakspace, Key_exclamdown = Qt::Key_exclamdown, Key_cent = Qt::Key_cent, Key_sterling = Qt::Key_sterling, Key_currency = Qt::Key_currency, Key_yen = Qt::Key_yen, Key_brokenbar = Qt::Key_brokenbar, Key_section = Qt::Key_section, Key_diaeresis = Qt::Key_diaeresis, Key_copyright = Qt::Key_copyright, Key_ordfeminine = Qt::Key_ordfeminine, Key_guillemotleft = Qt::Key_guillemotleft, Key_notsign = Qt::Key_notsign, Key_hyphen = Qt::Key_hyphen, Key_registered = Qt::Key_registered, Key_macron = Qt::Key_macron, Key_degree = Qt::Key_degree, Key_plusminus = Qt::Key_plusminus, Key_twosuperior = Qt::Key_twosuperior, Key_threesuperior = Qt::Key_threesuperior, Key_acute = Qt::Key_acute, Key_mu = Qt::Key_mu, Key_paragraph = Qt::Key_paragraph, Key_periodcentered = Qt::Key_periodcentered, Key_cedilla = Qt::Key_cedilla, Key_onesuperior = Qt::Key_onesuperior, Key_masculine = Qt::Key_masculine, Key_guillemotright = Qt::Key_guillemotright, Key_onequarter = Qt::Key_onequarter, Key_onehalf = Qt::Key_onehalf, Key_threequarters = Qt::Key_threequarters, Key_questiondown = Qt::Key_questiondown, Key_Agrave = Qt::Key_Agrave, Key_Aacute = Qt::Key_Aacute, Key_Acircumflex = Qt::Key_Acircumflex, Key_Atilde = Qt::Key_Atilde, Key_Adiaeresis = Qt::Key_Adiaeresis, Key_Aring = Qt::Key_Aring, Key_AE = Qt::Key_AE, Key_Ccedilla = Qt::Key_Ccedilla, Key_Egrave = Qt::Key_Egrave, Key_Eacute = Qt::Key_Eacute, Key_Ecircumflex = Qt::Key_Ecircumflex, Key_Ediaeresis = Qt::Key_Ediaeresis, Key_Igrave = Qt::Key_Igrave, Key_Iacute = Qt::Key_Iacute, Key_Icircumflex = Qt::Key_Icircumflex, Key_Idiaeresis = Qt::Key_Idiaeresis, Key_ETH = Qt::Key_ETH, Key_Ntilde = Qt::Key_Ntilde, Key_Ograve = Qt::Key_Ograve, Key_Oacute = Qt::Key_Oacute, Key_Ocircumflex = Qt::Key_Ocircumflex, Key_Otilde = Qt::Key_Otilde, Key_Odiaeresis = Qt::Key_Odiaeresis, Key_multiply = Qt::Key_multiply, Key_Ooblique = Qt::Key_Ooblique, Key_Ugrave = Qt::Key_Ugrave, Key_Uacute = Qt::Key_Uacute, Key_Ucircumflex = Qt::Key_Ucircumflex, Key_Udiaeresis = Qt::Key_Udiaeresis, Key_Yacute = Qt::Key_Yacute, Key_THORN = Qt::Key_THORN, Key_ssharp = Qt::Key_ssharp, Key_division = Qt::Key_division, Key_ydiaeresis = Qt::Key_ydiaeresis, Key_AltGr = Qt::Key_AltGr, Key_Multi_key = Qt::Key_Multi_key, Key_Codeinput = Qt::Key_Codeinput, Key_SingleCandidate = Qt::Key_SingleCandidate, Key_MultipleCandidate = Qt::Key_MultipleCandidate, Key_PreviousCandidate = Qt::Key_PreviousCandidate, Key_Mode_switch = Qt::Key_Mode_switch, Key_Kanji = Qt::Key_Kanji, Key_Muhenkan = Qt::Key_Muhenkan, Key_Henkan = Qt::Key_Henkan, Key_Romaji = Qt::Key_Romaji, Key_Hiragana = Qt::Key_Hiragana, Key_Katakana = Qt::Key_Katakana, Key_Hiragana_Katakana = Qt::Key_Hiragana_Katakana, Key_Zenkaku = Qt::Key_Zenkaku, Key_Hankaku = Qt::Key_Hankaku, Key_Zenkaku_Hankaku = Qt::Key_Zenkaku_Hankaku, Key_Touroku = Qt::Key_Touroku, Key_Massyo = Qt::Key_Massyo, Key_Kana_Lock = Qt::Key_Kana_Lock, Key_Kana_Shift = Qt::Key_Kana_Shift, Key_Eisu_Shift = Qt::Key_Eisu_Shift, Key_Eisu_toggle = Qt::Key_Eisu_toggle, Key_Hangul = Qt::Key_Hangul, Key_Hangul_Start = Qt::Key_Hangul_Start, Key_Hangul_End = Qt::Key_Hangul_End, Key_Hangul_Hanja = Qt::Key_Hangul_Hanja, Key_Hangul_Jamo = Qt::Key_Hangul_Jamo, Key_Hangul_Romaja = Qt::Key_Hangul_Romaja, Key_Hangul_Jeonja = Qt::Key_Hangul_Jeonja, Key_Hangul_Banja = Qt::Key_Hangul_Banja, Key_Hangul_PreHanja = Qt::Key_Hangul_PreHanja, Key_Hangul_PostHanja = Qt::Key_Hangul_PostHanja, Key_Hangul_Special = Qt::Key_Hangul_Special, Key_Dead_Grave = Qt::Key_Dead_Grave, Key_Dead_Acute = Qt::Key_Dead_Acute, Key_Dead_Circumflex = Qt::Key_Dead_Circumflex, Key_Dead_Tilde = Qt::Key_Dead_Tilde, Key_Dead_Macron = Qt::Key_Dead_Macron, Key_Dead_Breve = Qt::Key_Dead_Breve, Key_Dead_Abovedot = Qt::Key_Dead_Abovedot, Key_Dead_Diaeresis = Qt::Key_Dead_Diaeresis, Key_Dead_Abovering = Qt::Key_Dead_Abovering, Key_Dead_Doubleacute = Qt::Key_Dead_Doubleacute, Key_Dead_Caron = Qt::Key_Dead_Caron, Key_Dead_Cedilla = Qt::Key_Dead_Cedilla, Key_Dead_Ogonek = Qt::Key_Dead_Ogonek, Key_Dead_Iota = Qt::Key_Dead_Iota, Key_Dead_Voiced_Sound = Qt::Key_Dead_Voiced_Sound, Key_Dead_Semivoiced_Sound = Qt::Key_Dead_Semivoiced_Sound, Key_Dead_Belowdot = Qt::Key_Dead_Belowdot, Key_Dead_Hook = Qt::Key_Dead_Hook, Key_Dead_Horn = Qt::Key_Dead_Horn, Key_Back = Qt::Key_Back, Key_Forward = Qt::Key_Forward, Key_Stop = Qt::Key_Stop, Key_Refresh = Qt::Key_Refresh, Key_VolumeDown = Qt::Key_VolumeDown, Key_VolumeMute = Qt::Key_VolumeMute, Key_VolumeUp = Qt::Key_VolumeUp, Key_BassBoost = Qt::Key_BassBoost, Key_BassUp = Qt::Key_BassUp, Key_BassDown = Qt::Key_BassDown, Key_TrebleUp = Qt::Key_TrebleUp, Key_TrebleDown = Qt::Key_TrebleDown, Key_MediaPlay = Qt::Key_MediaPlay, Key_MediaStop = Qt::Key_MediaStop, Key_MediaPrevious = Qt::Key_MediaPrevious, Key_MediaNext = Qt::Key_MediaNext, Key_MediaRecord = Qt::Key_MediaRecord, Key_MediaPause = Qt::Key_MediaPause, Key_MediaTogglePlayPause = Qt::Key_MediaTogglePlayPause, Key_HomePage = Qt::Key_HomePage, Key_Favorites = Qt::Key_Favorites, Key_Search = Qt::Key_Search, Key_Standby = Qt::Key_Standby, Key_OpenUrl = Qt::Key_OpenUrl, Key_LaunchMail = Qt::Key_LaunchMail, Key_LaunchMedia = Qt::Key_LaunchMedia, Key_Launch0 = Qt::Key_Launch0, Key_Launch1 = Qt::Key_Launch1, Key_Launch2 = Qt::Key_Launch2, Key_Launch3 = Qt::Key_Launch3, Key_Launch4 = Qt::Key_Launch4, Key_Launch5 = Qt::Key_Launch5, Key_Launch6 = Qt::Key_Launch6, Key_Launch7 = Qt::Key_Launch7, Key_Launch8 = Qt::Key_Launch8, Key_Launch9 = Qt::Key_Launch9, Key_LaunchA = Qt::Key_LaunchA, Key_LaunchB = Qt::Key_LaunchB, Key_LaunchC = Qt::Key_LaunchC, Key_LaunchD = Qt::Key_LaunchD, Key_LaunchE = Qt::Key_LaunchE, Key_LaunchF = Qt::Key_LaunchF, Key_MonBrightnessUp = Qt::Key_MonBrightnessUp, Key_MonBrightnessDown = Qt::Key_MonBrightnessDown, Key_KeyboardLightOnOff = Qt::Key_KeyboardLightOnOff, Key_KeyboardBrightnessUp = Qt::Key_KeyboardBrightnessUp, Key_KeyboardBrightnessDown = Qt::Key_KeyboardBrightnessDown, Key_PowerOff = Qt::Key_PowerOff, Key_WakeUp = Qt::Key_WakeUp, Key_Eject = Qt::Key_Eject, Key_ScreenSaver = Qt::Key_ScreenSaver, Key_WWW = Qt::Key_WWW, Key_Memo = Qt::Key_Memo, Key_LightBulb = Qt::Key_LightBulb, Key_Shop = Qt::Key_Shop, Key_History = Qt::Key_History, Key_AddFavorite = Qt::Key_AddFavorite, Key_HotLinks = Qt::Key_HotLinks, Key_BrightnessAdjust = Qt::Key_BrightnessAdjust, Key_Finance = Qt::Key_Finance, Key_Community = Qt::Key_Community, Key_AudioRewind = Qt::Key_AudioRewind, Key_BackForward = Qt::Key_BackForward, Key_ApplicationLeft = Qt::Key_ApplicationLeft, Key_ApplicationRight = Qt::Key_ApplicationRight, Key_Book = Qt::Key_Book, Key_CD = Qt::Key_CD, Key_Calculator = Qt::Key_Calculator, Key_ToDoList = Qt::Key_ToDoList, Key_ClearGrab = Qt::Key_ClearGrab, Key_Close = Qt::Key_Close, Key_Copy = Qt::Key_Copy, Key_Cut = Qt::Key_Cut, Key_Display = Qt::Key_Display, Key_DOS = Qt::Key_DOS, Key_Documents = Qt::Key_Documents, Key_Excel = Qt::Key_Excel, Key_Explorer = Qt::Key_Explorer, Key_Game = Qt::Key_Game, Key_Go = Qt::Key_Go, Key_iTouch = Qt::Key_iTouch, Key_LogOff = Qt::Key_LogOff, Key_Market = Qt::Key_Market, Key_Meeting = Qt::Key_Meeting, Key_MenuKB = Qt::Key_MenuKB, Key_MenuPB = Qt::Key_MenuPB, Key_MySites = Qt::Key_MySites, Key_News = Qt::Key_News, Key_OfficeHome = Qt::Key_OfficeHome, Key_Option = Qt::Key_Option, Key_Paste = Qt::Key_Paste, Key_Phone = Qt::Key_Phone, Key_Calendar = Qt::Key_Calendar, Key_Reply = Qt::Key_Reply, Key_Reload = Qt::Key_Reload, Key_RotateWindows = Qt::Key_RotateWindows, Key_RotationPB = Qt::Key_RotationPB, Key_RotationKB = Qt::Key_RotationKB, Key_Save = Qt::Key_Save, Key_Send = Qt::Key_Send, Key_Spell = Qt::Key_Spell, Key_SplitScreen = Qt::Key_SplitScreen, Key_Support = Qt::Key_Support, Key_TaskPane = Qt::Key_TaskPane, Key_Terminal = Qt::Key_Terminal, Key_Tools = Qt::Key_Tools, Key_Travel = Qt::Key_Travel, Key_Video = Qt::Key_Video, Key_Word = Qt::Key_Word, Key_Xfer = Qt::Key_Xfer, Key_ZoomIn = Qt::Key_ZoomIn, Key_ZoomOut = Qt::Key_ZoomOut, Key_Away = Qt::Key_Away, Key_Messenger = Qt::Key_Messenger, Key_WebCam = Qt::Key_WebCam, Key_MailForward = Qt::Key_MailForward, Key_Pictures = Qt::Key_Pictures, Key_Music = Qt::Key_Music, Key_Battery = Qt::Key_Battery, Key_Bluetooth = Qt::Key_Bluetooth, Key_WLAN = Qt::Key_WLAN, Key_UWB = Qt::Key_UWB, Key_AudioForward = Qt::Key_AudioForward, Key_AudioRepeat = Qt::Key_AudioRepeat, Key_AudioRandomPlay = Qt::Key_AudioRandomPlay, Key_Subtitle = Qt::Key_Subtitle, Key_AudioCycleTrack = Qt::Key_AudioCycleTrack, Key_Time = Qt::Key_Time, Key_Hibernate = Qt::Key_Hibernate, Key_View = Qt::Key_View, Key_TopMenu = Qt::Key_TopMenu, Key_PowerDown = Qt::Key_PowerDown, Key_Suspend = Qt::Key_Suspend, Key_ContrastAdjust = Qt::Key_ContrastAdjust, Key_LaunchG = Qt::Key_LaunchG, Key_LaunchH = Qt::Key_LaunchH, Key_TouchpadToggle = Qt::Key_TouchpadToggle, Key_TouchpadOn = Qt::Key_TouchpadOn, Key_TouchpadOff = Qt::Key_TouchpadOff, Key_MediaLast = Qt::Key_MediaLast, Key_Select = Qt::Key_Select, Key_Yes = Qt::Key_Yes, Key_No = Qt::Key_No, Key_Cancel = Qt::Key_Cancel, Key_Printer = Qt::Key_Printer, Key_Execute = Qt::Key_Execute, Key_Sleep = Qt::Key_Sleep, Key_Play = Qt::Key_Play, Key_Zoom = Qt::Key_Zoom, Key_Context1 = Qt::Key_Context1, Key_Context2 = Qt::Key_Context2, Key_Context3 = Qt::Key_Context3, Key_Context4 = Qt::Key_Context4, Key_Call = Qt::Key_Call, Key_Hangup = Qt::Key_Hangup, Key_Flip = Qt::Key_Flip, Key_ToggleCallHangup = Qt::Key_ToggleCallHangup, Key_VoiceDial = Qt::Key_VoiceDial, Key_LastNumberRedial = Qt::Key_LastNumberRedial, Key_Camera = Qt::Key_Camera, Key_CameraFocus = Qt::Key_CameraFocus, Key_unknown = Qt::Key_unknown};
1012 1016 enum WindowState{
1013 1017 WindowNoState = Qt::WindowNoState, WindowMinimized = Qt::WindowMinimized, WindowMaximized = Qt::WindowMaximized, WindowFullScreen = Qt::WindowFullScreen, WindowActive = Qt::WindowActive};
1014 1018 enum CheckState{
1015 1019 Unchecked = Qt::Unchecked, PartiallyChecked = Qt::PartiallyChecked, Checked = Qt::Checked};
1016 1020 enum ToolBarAreaSizes{
1017 1021 NToolBarAreas = Qt::NToolBarAreas};
1018 1022 enum SizeMode{
1019 1023 AbsoluteSize = Qt::AbsoluteSize, RelativeSize = Qt::RelativeSize};
1020 1024 enum Axis{
1021 1025 XAxis = Qt::XAxis, YAxis = Qt::YAxis, ZAxis = Qt::ZAxis};
1022 1026 enum FillRule{
1023 1027 OddEvenFill = Qt::OddEvenFill, WindingFill = Qt::WindingFill};
1024 1028 enum GestureType{
1025 1029 TapGesture = Qt::TapGesture, TapAndHoldGesture = Qt::TapAndHoldGesture, PanGesture = Qt::PanGesture, PinchGesture = Qt::PinchGesture, SwipeGesture = Qt::SwipeGesture, CustomGesture = Qt::CustomGesture, LastGestureType = Qt::LastGestureType};
1026 1030 enum ClipOperation{
1027 1031 NoClip = Qt::NoClip, ReplaceClip = Qt::ReplaceClip, IntersectClip = Qt::IntersectClip};
1028 1032 enum InputMethodQuery{
1029 1033 ImEnabled = Qt::ImEnabled, ImCursorRectangle = Qt::ImCursorRectangle, ImMicroFocus = Qt::ImMicroFocus, ImFont = Qt::ImFont, ImCursorPosition = Qt::ImCursorPosition, ImSurroundingText = Qt::ImSurroundingText, ImCurrentSelection = Qt::ImCurrentSelection, ImMaximumTextLength = Qt::ImMaximumTextLength, ImAnchorPosition = Qt::ImAnchorPosition, ImHints = Qt::ImHints, ImPreferredLanguage = Qt::ImPreferredLanguage, ImPlatformData = Qt::ImPlatformData, ImQueryInput = Qt::ImQueryInput, ImQueryAll = Qt::ImQueryAll};
1030 1034 enum TimeSpec{
1031 1035 LocalTime = Qt::LocalTime, UTC = Qt::UTC, OffsetFromUTC = Qt::OffsetFromUTC};
1032 1036 enum ItemDataRole{
1033 1037 DisplayRole = Qt::DisplayRole, DecorationRole = Qt::DecorationRole, EditRole = Qt::EditRole, ToolTipRole = Qt::ToolTipRole, StatusTipRole = Qt::StatusTipRole, WhatsThisRole = Qt::WhatsThisRole, FontRole = Qt::FontRole, TextAlignmentRole = Qt::TextAlignmentRole, BackgroundColorRole = Qt::BackgroundColorRole, BackgroundRole = Qt::BackgroundRole, TextColorRole = Qt::TextColorRole, ForegroundRole = Qt::ForegroundRole, CheckStateRole = Qt::CheckStateRole, AccessibleTextRole = Qt::AccessibleTextRole, AccessibleDescriptionRole = Qt::AccessibleDescriptionRole, SizeHintRole = Qt::SizeHintRole, InitialSortOrderRole = Qt::InitialSortOrderRole, DisplayPropertyRole = Qt::DisplayPropertyRole, DecorationPropertyRole = Qt::DecorationPropertyRole, ToolTipPropertyRole = Qt::ToolTipPropertyRole, StatusTipPropertyRole = Qt::StatusTipPropertyRole, WhatsThisPropertyRole = Qt::WhatsThisPropertyRole, UserRole = Qt::UserRole};
1034 1038 enum ShortcutContext{
1035 1039 WidgetShortcut = Qt::WidgetShortcut, WindowShortcut = Qt::WindowShortcut, ApplicationShortcut = Qt::ApplicationShortcut, WidgetWithChildrenShortcut = Qt::WidgetWithChildrenShortcut};
1036 1040 enum MaskMode{
1037 1041 MaskInColor = Qt::MaskInColor, MaskOutColor = Qt::MaskOutColor};
1038 1042 enum WindowType{
1039 1043 Widget = Qt::Widget, Window = Qt::Window, Dialog = Qt::Dialog, Sheet = Qt::Sheet, Drawer = Qt::Drawer, Popup = Qt::Popup, Tool = Qt::Tool, ToolTip = Qt::ToolTip, SplashScreen = Qt::SplashScreen, Desktop = Qt::Desktop, SubWindow = Qt::SubWindow, WindowType_Mask = Qt::WindowType_Mask, MSWindowsFixedSizeDialogHint = Qt::MSWindowsFixedSizeDialogHint, MSWindowsOwnDC = Qt::MSWindowsOwnDC, X11BypassWindowManagerHint = Qt::X11BypassWindowManagerHint, FramelessWindowHint = Qt::FramelessWindowHint, WindowTitleHint = Qt::WindowTitleHint, WindowSystemMenuHint = Qt::WindowSystemMenuHint, WindowMinimizeButtonHint = Qt::WindowMinimizeButtonHint, WindowMaximizeButtonHint = Qt::WindowMaximizeButtonHint, WindowMinMaxButtonsHint = Qt::WindowMinMaxButtonsHint, WindowContextHelpButtonHint = Qt::WindowContextHelpButtonHint, WindowShadeButtonHint = Qt::WindowShadeButtonHint, WindowStaysOnTopHint = Qt::WindowStaysOnTopHint, WindowTransparentForInput = Qt::WindowTransparentForInput, WindowOverridesSystemGestures = Qt::WindowOverridesSystemGestures, WindowDoesNotAcceptFocus = Qt::WindowDoesNotAcceptFocus, CustomizeWindowHint = Qt::CustomizeWindowHint, WindowStaysOnBottomHint = Qt::WindowStaysOnBottomHint, WindowCloseButtonHint = Qt::WindowCloseButtonHint, MacWindowToolBarButtonHint = Qt::MacWindowToolBarButtonHint, BypassGraphicsProxyWidget = Qt::BypassGraphicsProxyWidget, WindowOkButtonHint = Qt::WindowOkButtonHint, WindowCancelButtonHint = Qt::WindowCancelButtonHint, NoDropShadowWindowHint = Qt::NoDropShadowWindowHint, WindowFullscreenButtonHint = Qt::WindowFullscreenButtonHint};
1040 1044 enum DockWidgetArea{
1041 1045 LeftDockWidgetArea = Qt::LeftDockWidgetArea, RightDockWidgetArea = Qt::RightDockWidgetArea, TopDockWidgetArea = Qt::TopDockWidgetArea, BottomDockWidgetArea = Qt::BottomDockWidgetArea, DockWidgetArea_Mask = Qt::DockWidgetArea_Mask, AllDockWidgetAreas = Qt::AllDockWidgetAreas, NoDockWidgetArea = Qt::NoDockWidgetArea};
1042 1046 enum ContextMenuPolicy{
1043 1047 NoContextMenu = Qt::NoContextMenu, DefaultContextMenu = Qt::DefaultContextMenu, ActionsContextMenu = Qt::ActionsContextMenu, CustomContextMenu = Qt::CustomContextMenu, PreventContextMenu = Qt::PreventContextMenu};
1044 1048 Q_DECLARE_FLAGS(MouseButtons, MouseButton)
1045 1049 Q_DECLARE_FLAGS(Orientations, Orientation)
1046 1050 Q_DECLARE_FLAGS(GestureFlags, GestureFlag)
1047 1051 Q_DECLARE_FLAGS(ToolBarAreas, ToolBarArea)
1048 1052 Q_DECLARE_FLAGS(MatchFlags, MatchFlag)
1049 1053 Q_DECLARE_FLAGS(ItemFlags, ItemFlag)
1050 1054 Q_DECLARE_FLAGS(DropActions, DropAction)
1051 1055 Q_DECLARE_FLAGS(TouchPointStates, TouchPointState)
1052 1056 Q_DECLARE_FLAGS(InputMethodHints, InputMethodHint)
1053 1057 Q_DECLARE_FLAGS(KeyboardModifiers, KeyboardModifier)
1054 1058 Q_DECLARE_FLAGS(ImageConversionFlags, ImageConversionFlag)
1055 1059 Q_DECLARE_FLAGS(TextInteractionFlags, TextInteractionFlag)
1056 1060 Q_DECLARE_FLAGS(Alignment, AlignmentFlag)
1057 1061 Q_DECLARE_FLAGS(WindowStates, WindowState)
1058 1062 Q_DECLARE_FLAGS(WindowFlags, WindowType)
1059 1063 Q_DECLARE_FLAGS(DockWidgetAreas, DockWidgetArea)
1060 1064 public slots:
1061 1065 };
1062 1066
1063 1067
@@ -1,2936 +1,2928
1 1 <?xml version="1.0"?>
2 2 <typesystem package="com.trolltech.qt.core"><template name="core.prepare_removed_bool*_argument">
3 3 bool __ok;
4 4 bool *%out% = &amp;__ok;
5 5 </template><template name="core.convert_to_null_or_wrap">
6 6 QScriptValue %out%;
7 7 if (!__ok)
8 8 %out% = context-&gt;engine()-&gt;nullValue();
9 9 else
10 10 %out% = qScriptValueFromValue(context-&gt;engine(), %in%);
11 11 </template><template name="core.convert_to_null_or_primitive">
12 12 QScriptValue %out%;
13 13 if (!__ok)
14 14 %out% = context-&gt;engine()-&gt;nullValue();
15 15 else
16 16 %out% = QScriptValue(context-&gt;engine(), %in%);
17 17 </template><template name="core.convert_string_arg_to_latin1">
18 18 QByteArray %out% = %in%.toString().toLatin1();
19 19 </template><template name="core.convert_string_arg_to_char*">
20 20 QByteArray tmp_%out% = %in%.toString().toLatin1();
21 21 const char * %out% = tmp_%out%.constData();
22 22 </template><template name="core.convert_int_arg_and_check_range">
23 23 int %out% = %in%.toInt32();
24 24 if ((%out% &lt; 0) || (%this%-&gt;size() &lt; %out%)) {
25 25 return context-&gt;throwError(QScriptContext::RangeError,
26 26 QString::fromLatin1("%CLASS_NAME%::%FUNCTION_NAME%(): index out of range"));
27 27 }
28 28 </template><template name="core.convert_pointer_arg_and_check_null">
29 29 %TYPE% %out% = qscriptvalue_cast&lt;%TYPE%&gt;(%in%);
30 30 if (!%out%) {
31 31 return context-&gt;throwError(QScriptContext::TypeError,
32 32 QString::fromLatin1("%CLASS_NAME%::%FUNCTION_NAME%(): failed to convert argument to %TYPE%"));
33 33 }
34 34 </template><template name="core.convert_stringref_to_string">
35 35 QString %out% = %in%.toString();
36 36 </template><rejection class="QTextCodec::ConverterState"/><rejection class="QTextCodecFactoryInterface"/><rejection class="QAbstractEventDispatcher"/><rejection class="QAbstractFileEngine"/><rejection class="QAbstractFileEngineHandler"/><rejection class="QAbstractFileEngineIterator"/><rejection class="QFSFileEngine"/><rejection class="QSystemLocale"/><rejection class="QThread"/><rejection class="QFutureWatcherBase"/><rejection class="QFutureSynchronizer"/><rejection class="QByteArray" function-name="contains"/><enum-type name="QXmlStreamReader::Error"/><enum-type name="QXmlStreamReader::TokenType"/><primitive-type name="bool"/><primitive-type name="double"/><primitive-type name="qreal"/><primitive-type name="float"/><primitive-type name="qint64"/><primitive-type name="__int64"/><primitive-type name="unsigned __int64"/><primitive-type name="unsigned long long"/><primitive-type name="long long"/><primitive-type name="qlonglong"/><primitive-type name="qulonglong"/><primitive-type name="short"/><primitive-type name="short"/><primitive-type name="signed short"/><primitive-type name="ushort"/><primitive-type name="unsigned short"/><primitive-type name="char"/><primitive-type name="signed char"/><primitive-type name="uchar"/><primitive-type name="unsigned char"/><primitive-type name="int"/><primitive-type name="signed int"/><primitive-type name="uint"/><primitive-type name="ulong"/><primitive-type name="unsigned int"/><primitive-type name="signed long"/><primitive-type name="long"/><primitive-type name="unsigned long"/><primitive-type name="WId"/><primitive-type name="Qt::HANDLE"/><primitive-type name="QVariant::Type"/><primitive-type name="QByteRef"/><primitive-type name="QBitRef"/><primitive-type name="QBool"/><primitive-type name="jobject"/><primitive-type name="quintptr"/><suppress-warning text="WARNING(MetaJavaBuilder) :: signal 'finished' in class 'QProcess' is overloaded."/><suppress-warning text="WARNING(MetaJavaBuilder) :: missing required class for enums: QRegExp"/><suppress-warning text="WARNING(MetaJavaBuilder) :: enum 'QtValidLicenseForScriptToolsModule' does not have a type entry or is not an enum"/><suppress-warning text="WARNING(MetaJavaBuilder) :: Rejected enum has no alternative...: QDataStream::Qt_4_5"/><suppress-warning text="WARNING(MetaJavaBuilder) :: unhandled enum value: Qt::MatchFlags(Qt::MatchStartsWith in Qt::MatchFlag"/><suppress-warning text="WARNING(MetaJavaBuilder) :: unhandled enum value: Qt::MatchWrap) in Qt::MatchFlag"/><suppress-warning text="WARNING(MetaJavaBuilder) :: unmatched enum Qt::MatchFlags(Qt::MatchStartsWith|Qt::MatchWrap) when parsing default value of 'match' in class 'QAbstractItemModel'"/><suppress-warning text="WARNING(MetaJavaBuilder) :: Unable to decide type of property: 'Qt::GestureState' in class 'QGesture'"/><suppress-warning text="WARNING(MetaJavaBuilder) :: enum 'Qt::GestureState' does not have a type entry or is not an enum"/><suppress-warning text="WARNING(MetaJavaBuilder) :: template baseclass 'QGenericMatrix&lt;qreal&gt;' of 'QMatrix3x3' is not known"/><suppress-warning text="WARNING(MetaJavaBuilder) :: unhandled enum value: ~0u in Qt::GestureType"/><suppress-warning text="WARNING(MetaJavaBuilder) :: unmatched enum ~0u"/><suppress-warning text="WARNING(MetaJavaBuilder) :: unhandled enum value: Qt::GestureFlags() in Qt::GestureFlag"/><suppress-warning text="WARNING(MetaJavaBuilder) :: unmatched enum Qt::GestureFlags() when parsing default value of 'grabGesture' in class 'QWidget'"/><suppress-warning text="WARNING(MetaJavaBuilder) :: unmatched enum Qt::GestureFlags() when parsing default value of 'grabGesture' in class 'QGraphicsObject'"/><suppress-warning text="WARNING(MetaJavaBuilder) :: unsupported default value 'QLatin1String(defaultConnection)' of argument in function '*', class '*'"/><suppress-warning text="WARNING(MetaJavaBuilder) :: Class '*' has equals operators but no qHash() function"/><suppress-warning text="WARNING(MetaJavaBuilder) :: type '*' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/><suppress-warning text="WARNING(MetaJavaBuilder) :: namespace '*' for enum '*' is not declared"/><suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function '*', unmatched parameter type '*'"/><suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function '*', unmatched return type '*'"/><suppress-warning text="WARNING(MetaJavaBuilder) :: signature '*' for function modification in '*' not found. Possible candidates: "/><suppress-warning text="WARNING(MetaJavaBuilder) :: namespace '*' does not have a type entry"/><suppress-warning text="WARNING(MetaJavaBuilder) :: unsupported default value '*' of argument in function '*', class '*'"/><suppress-warning text="WARNING(MetaJavaBuilder) :: Shadowing: * and *; Java code will not compile"/><suppress-warning text="WARNING(MetaJavaBuilder) :: enum '*' is specified in typesystem, but not declared"/>
37 37
38 38 <rejection class="*" function-name="d_func"/>
39 39 <rejection class="*" function-name="data_ptr"/>
40 40 <rejection class="*" function-name="detach"/>
41 41 <rejection class="*" function-name="isDetached"/>
42 42
43 43 <rejection class="*" field-name="d_ptr"/>
44 44 <rejection class="*" field-name="d"/>
45 45
46 46 <rejection class="" enum-name="QtValidLicenseForTestModule"/>
47 47
48 48
49 49 <rejection class="" enum-name="QtValidLicenseForDBusModule"/>
50 50 <rejection class="" enum-name="QtValidLicenseForSqlModule"/>
51 51 <rejection class="" enum-name="QtValidLicenseForOpenGLModule"/>
52 52 <rejection class="" enum-name="enum_1"/>
53 53 <rejection class="" enum-name="enum_2"/>
54 54 <rejection class="" enum-name="QtValidLicenseForXmlModule"/>
55 55 <rejection class="" enum-name="QtValidLicenseForXmlPatternsModule"/>
56 56 <rejection class="" enum-name="QtValidLicenseForActiveQtModule"/>
57 57 <rejection class="" enum-name="QtValidLicenseForCoreModule"/>
58 58 <rejection class="" enum-name="QtValidLicenseForQt3SupportLightModule"/>
59 59 <rejection class="" enum-name="QtValidLicenseForQt3SupportModule"/>
60 60 <rejection class="" enum-name="QtValidLicenseForNetworkModule"/>
61 61 <rejection class="" enum-name="QtValidLicenseForSvgModule"/>
62 62 <rejection class="" enum-name="QtValidLicenseForGuiModule"/>
63 63 <rejection class="" enum-name="QtValidLicenseForScriptModule"/>
64 64 <rejection class="" enum-name="QtValidLicenseForHelpModule"/>
65 65 <rejection class="" enum-name="QtValidLicenseForScriptToolsModule"/>
66 66 <rejection class="" enum-name="QtValidLicenseForMultimediaModule"/>
67 67 <rejection class="" enum-name="QtValidLicenseForOpenVGModule"/>
68 68 <rejection class="" enum-name="QtValidLicenseForDeclarativeModule"/>
69 69
70 70 <rejection class="QtConcurrent" enum-name="enum_1"/>
71 71 <rejection class="QtConcurrent" function-name="operator|"/>
72 72
73 73 <rejection class="Qt" enum-name="Modifier"/>
74 74
75 75 <rejection class="QSharedPointer"/>
76 76 <rejection class="QWeakPointer"/>
77 77 <rejection class="QFuture::const_iterator"/>
78 78 <rejection class="QFutureInterface"/>
79 79 <rejection class="QFutureInterfaceBase"/>
80 80 <rejection class="QtConcurrent::BlockSizeManager"/>
81 81 <rejection class="QtConcurrent::ConstMemberFunctionWrapper"/>
82 82 <rejection class="QtConcurrent::Exception"/>
83 83 <rejection class="QtConcurrent::FilterKernel"/>
84 84 <rejection class="QtConcurrent::FilteredEachKernel"/>
85 85 <rejection class="QtConcurrent::FilteredReducedKernel"/>
86 86 <rejection class="QtConcurrent::FunctionWrapper0"/>
87 87 <rejection class="QtConcurrent::FunctionWrapper1"/>
88 88 <rejection class="QtConcurrent::FunctionWrapper2"/>
89 89 <rejection class="QtConcurrent::IntermediateResults"/>
90 90 <rejection class="QtConcurrent::IterateKernel"/>
91 91 <rejection class="QtConcurrent::MapKernel"/>
92 92 <rejection class="QtConcurrent::MappedEachKernel"/>
93 93 <rejection class="QtConcurrent::MappedReducedKernel"/>
94 94 <rejection class="QtConcurrent::Median"/>
95 95 <rejection class="QtConcurrent::MemberFunctionWrapper"/>
96 96 <rejection class="QtConcurrent::MemberFunctionWrapper1"/>
97 97 <rejection class="QtConcurrent::qValueType"/>
98 98 <rejection class="QtConcurrent::ReduceKernel"/>
99 99 <rejection class="QtConcurrent::ResultItem"/>
100 100 <rejection class="QtConcurrent::ResultIterator"/>
101 101 <rejection class="QtConcurrent::ResultIteratorBase"/>
102 102 <rejection class="QtConcurrent::ResultReporter"/>
103 103 <rejection class="QtConcurrent::ResultStore"/>
104 104 <rejection class="QtConcurrent::ResultStoreBase"/>
105 105 <rejection class="QtConcurrent::RunFunctionTask"/>
106 106 <rejection class="QtConcurrent::RunFunctionTaskBase"/>
107 107 <rejection class="QtConcurrent::SelectSpecialization"/>
108 108 <rejection class="QtConcurrent::SelectStoredConstMemberFunctionCall0"/>
109 109 <rejection class="QtConcurrent::SelectStoredConstMemberFunctionCall1"/>
110 110 <rejection class="QtConcurrent::SelectStoredConstMemberFunctionCall2"/>
111 111 <rejection class="QtConcurrent::SelectStoredConstMemberFunctionCall3"/>
112 112 <rejection class="QtConcurrent::SelectStoredConstMemberFunctionCall4"/>
113 113 <rejection class="QtConcurrent::SelectStoredConstMemberFunctionCall5"/>
114 114 <rejection class="QtConcurrent::SelectStoredConstMemberFunctionPointerCall0"/>
115 115 <rejection class="QtConcurrent::SelectStoredConstMemberFunctionPointerCall1"/>
116 116 <rejection class="QtConcurrent::SelectStoredConstMemberFunctionPointerCall2"/>
117 117 <rejection class="QtConcurrent::SelectStoredConstMemberFunctionPointerCall3"/>
118 118 <rejection class="QtConcurrent::SelectStoredConstMemberFunctionPointerCall4"/>
119 119 <rejection class="QtConcurrent::SelectStoredConstMemberFunctionPointerCall5"/>
120 120 <rejection class="QtConcurrent::SelectStoredFunctorCall0"/>
121 121 <rejection class="QtConcurrent::SelectStoredFunctorCall1"/>
122 122 <rejection class="QtConcurrent::SelectStoredFunctorCall2"/>
123 123 <rejection class="QtConcurrent::SelectStoredFunctorCall3"/>
124 124 <rejection class="QtConcurrent::SelectStoredFunctorCall4"/>
125 125 <rejection class="QtConcurrent::SelectStoredFunctorCall5"/>
126 126 <rejection class="QtConcurrent::SelectStoredFunctorPointerCall0"/>
127 127 <rejection class="QtConcurrent::SelectStoredFunctorPointerCall1"/>
128 128 <rejection class="QtConcurrent::SelectStoredFunctorPointerCall2"/>
129 129 <rejection class="QtConcurrent::SelectStoredFunctorPointerCall3"/>
130 130 <rejection class="QtConcurrent::SelectStoredFunctorPointerCall4"/>
131 131 <rejection class="QtConcurrent::SelectStoredFunctorPointerCall5"/>
132 132 <rejection class="QtConcurrent::SelectStoredMemberFunctionCall0"/>
133 133 <rejection class="QtConcurrent::SelectStoredMemberFunctionCall1"/>
134 134 <rejection class="QtConcurrent::SelectStoredMemberFunctionCall2"/>
135 135 <rejection class="QtConcurrent::SelectStoredMemberFunctionCall3"/>
136 136 <rejection class="QtConcurrent::SelectStoredMemberFunctionCall4"/>
137 137 <rejection class="QtConcurrent::SelectStoredMemberFunctionCall5"/>
138 138 <rejection class="QtConcurrent::SelectStoredMemberFunctionPointerCall0"/>
139 139 <rejection class="QtConcurrent::SelectStoredMemberFunctionPointerCall1"/>
140 140 <rejection class="QtConcurrent::SelectStoredMemberFunctionPointerCall2"/>
141 141 <rejection class="QtConcurrent::SelectStoredMemberFunctionPointerCall3"/>
142 142 <rejection class="QtConcurrent::SelectStoredMemberFunctionPointerCall4"/>
143 143 <rejection class="QtConcurrent::SelectStoredMemberFunctionPointerCall5"/>
144 144 <rejection class="QtConcurrent::SequenceHolder1"/>
145 145 <rejection class="QtConcurrent::SequenceHolder2"/>
146 146 <rejection class="QtConcurrent::StoredConstMemberFunctionCall0"/>
147 147 <rejection class="QtConcurrent::StoredConstMemberFunctionCall1"/>
148 148 <rejection class="QtConcurrent::StoredConstMemberFunctionCall2"/>
149 149 <rejection class="QtConcurrent::StoredConstMemberFunctionCall3"/>
150 150 <rejection class="QtConcurrent::StoredConstMemberFunctionCall4"/>
151 151 <rejection class="QtConcurrent::StoredConstMemberFunctionCall5"/>
152 152 <rejection class="QtConcurrent::StoredConstMemberFunctionPointerCall0"/>
153 153 <rejection class="QtConcurrent::StoredConstMemberFunctionPointerCall1"/>
154 154 <rejection class="QtConcurrent::StoredConstMemberFunctionPointerCall2"/>
155 155 <rejection class="QtConcurrent::StoredConstMemberFunctionPointerCall3"/>
156 156 <rejection class="QtConcurrent::StoredConstMemberFunctionPointerCall4"/>
157 157 <rejection class="QtConcurrent::StoredConstMemberFunctionPointerCall5"/>
158 158 <rejection class="QtConcurrent::StoredFunctorCall0"/>
159 159 <rejection class="QtConcurrent::StoredFunctorCall1"/>
160 160 <rejection class="QtConcurrent::StoredFunctorCall2"/>
161 161 <rejection class="QtConcurrent::StoredFunctorCall3"/>
162 162 <rejection class="QtConcurrent::StoredFunctorCall4"/>
163 163 <rejection class="QtConcurrent::StoredFunctorCall5"/>
164 164 <rejection class="QtConcurrent::StoredFunctorPointerCall0"/>
165 165 <rejection class="QtConcurrent::StoredFunctorPointerCall1"/>
166 166 <rejection class="QtConcurrent::StoredFunctorPointerCall2"/>
167 167 <rejection class="QtConcurrent::StoredFunctorPointerCall3"/>
168 168 <rejection class="QtConcurrent::StoredFunctorPointerCall4"/>
169 169 <rejection class="QtConcurrent::StoredFunctorPointerCall5"/>
170 170 <rejection class="QtConcurrent::StoredMemberFunctionCall0"/>
171 171 <rejection class="QtConcurrent::StoredMemberFunctionCall1"/>
172 172 <rejection class="QtConcurrent::StoredMemberFunctionCall2"/>
173 173 <rejection class="QtConcurrent::StoredMemberFunctionCall3"/>
174 174 <rejection class="QtConcurrent::StoredMemberFunctionCall4"/>
175 175 <rejection class="QtConcurrent::StoredMemberFunctionCall5"/>
176 176 <rejection class="QtConcurrent::StoredMemberFunctionPointerCall0"/>
177 177 <rejection class="QtConcurrent::StoredMemberFunctionPointerCall1"/>
178 178 <rejection class="QtConcurrent::StoredMemberFunctionPointerCall2"/>
179 179 <rejection class="QtConcurrent::StoredMemberFunctionPointerCall3"/>
180 180 <rejection class="QtConcurrent::StoredMemberFunctionPointerCall4"/>
181 181 <rejection class="QtConcurrent::StoredMemberFunctionPointerCall5"/>
182 182 <rejection class="QtConcurrent::ThreadEngine"/>
183 183 <rejection class="QtConcurrent::ThreadEngineBase"/>
184 184 <rejection class="QtConcurrent::ThreadEngineSemaphore"/>
185 185 <rejection class="QtConcurrent::ThreadEngineStarter"/>
186 186 <rejection class="QtConcurrent::ThreadEngineStarterBase"/>
187 187 <rejection class="QtConcurrent::UnhandledException"/>
188 188 <rejection class="QtConcurrent::VoidStoredConstMemberFunctionCall0"/>
189 189 <rejection class="QtConcurrent::VoidStoredConstMemberFunctionCall1"/>
190 190 <rejection class="QtConcurrent::VoidStoredConstMemberFunctionCall2"/>
191 191 <rejection class="QtConcurrent::VoidStoredConstMemberFunctionCall3"/>
192 192 <rejection class="QtConcurrent::VoidStoredConstMemberFunctionCall4"/>
193 193 <rejection class="QtConcurrent::VoidStoredConstMemberFunctionCall5"/>
194 194 <rejection class="QtConcurrent::VoidStoredConstMemberFunctionPointerCall0"/>
195 195 <rejection class="QtConcurrent::VoidStoredConstMemberFunctionPointerCall1"/>
196 196 <rejection class="QtConcurrent::VoidStoredConstMemberFunctionPointerCall2"/>
197 197 <rejection class="QtConcurrent::VoidStoredConstMemberFunctionPointerCall3"/>
198 198 <rejection class="QtConcurrent::VoidStoredConstMemberFunctionPointerCall4"/>
199 199 <rejection class="QtConcurrent::VoidStoredConstMemberFunctionPointerCall5"/>
200 200 <rejection class="QtConcurrent::VoidStoredFunctorCall0"/>
201 201 <rejection class="QtConcurrent::VoidStoredFunctorCall1"/>
202 202 <rejection class="QtConcurrent::VoidStoredFunctorCall2"/>
203 203 <rejection class="QtConcurrent::VoidStoredFunctorCall3"/>
204 204 <rejection class="QtConcurrent::VoidStoredFunctorCall4"/>
205 205 <rejection class="QtConcurrent::VoidStoredFunctorCall5"/>
206 206 <rejection class="QtConcurrent::VoidStoredFunctorPointerCall0"/>
207 207 <rejection class="QtConcurrent::VoidStoredFunctorPointerCall1"/>
208 208 <rejection class="QtConcurrent::VoidStoredFunctorPointerCall2"/>
209 209 <rejection class="QtConcurrent::VoidStoredFunctorPointerCall3"/>
210 210 <rejection class="QtConcurrent::VoidStoredFunctorPointerCall4"/>
211 211 <rejection class="QtConcurrent::VoidStoredFunctorPointerCall5"/>
212 212 <rejection class="QtConcurrent::VoidStoredMemberFunctionCall0"/>
213 213 <rejection class="QtConcurrent::VoidStoredMemberFunctionCall1"/>
214 214 <rejection class="QtConcurrent::VoidStoredMemberFunctionCall2"/>
215 215 <rejection class="QtConcurrent::VoidStoredMemberFunctionCall3"/>
216 216 <rejection class="QtConcurrent::VoidStoredMemberFunctionCall4"/>
217 217 <rejection class="QtConcurrent::VoidStoredMemberFunctionCall5"/>
218 218 <rejection class="QtConcurrent::VoidStoredMemberFunctionPointerCall0"/>
219 219 <rejection class="QtConcurrent::VoidStoredMemberFunctionPointerCall1"/>
220 220 <rejection class="QtConcurrent::VoidStoredMemberFunctionPointerCall2"/>
221 221 <rejection class="QtConcurrent::VoidStoredMemberFunctionPointerCall3"/>
222 222 <rejection class="QtConcurrent::VoidStoredMemberFunctionPointerCall4"/>
223 223 <rejection class="QtConcurrent::VoidStoredMemberFunctionPointerCall5"/>
224 224
225 225 <rejection class="QMdi"/>
226 226 <rejection class="stdext"/>
227 227 <rejection class="QAlgorithmsPrivate"/>
228 228 <rejection class="QAtomic"/>
229 229 <rejection class="QAtomicPointer"/>
230 230 <rejection class="QAtomicInt"/>
231 231 <rejection class="QBasicAtomicInt"/>
232 232 <rejection class="QBasicAtomic"/>
233 233 <rejection class="QBasicAtomicPointer"/>
234 234 <rejection class="QScopedPointer"/>
235 235 <rejection class="QScopedArrayPointer"/>
236 236 <rejection class="QScopedPointer"/>
237 237 <rejection class="QScopedPointerArrayDeleter"/>
238 238 <rejection class="QScopedPointerDeleter"/>
239 239 <rejection class="QScopedPointerPodDeleter"/>
240 240 <rejection class="QScopedPointerSharedDeleter"/>
241 241 <rejection class="QScopedSharedPointer"/>
242 242 <rejection class="QCustomScopedPointer"/>
243 243 <rejection class="QStringBuilder"/>
244 244
245 245 <rejection class="QBitRef"/>
246 246 <rejection class="QCache"/>
247 247 <rejection class="QContiguousCache"/>
248 248 <rejection class="QContiguousCacheData"/>
249 249 <rejection class="QContiguousCacheTypedData"/>
250 250 <rejection class="QCharRef"/>
251 251 <rejection class="QDebug"/>
252 252 <rejection class="QNoDebug"/>
253 253 <rejection class="QExplicitlySharedDataPointer"/>
254 254 <rejection class="QFlag"/>
255 255 <rejection class="QFlags"/>
256 256 <rejection class="QForeachContainer"/>
257 257 <rejection class="QForeachContainerBase"/>
258 258 <rejection class="QGlobalStatic"/>
259 259 <rejection class="QHash"/>
260 260 <rejection class="QHashData"/>
261 261 <rejection class="QHashDummyNode"/>
262 262 <rejection class="QHashDummyNode"/>
263 263 <rejection class="QHashDummyNode"/>
264 264 <rejection class="QHashDummyNode"/>
265 265 <rejection class="QHashDummyNode"/>
266 266 <rejection class="QHashDummyValue"/>
267 267 <rejection class="QHashIterator"/>
268 268 <rejection class="QHashNode"/>
269 269 <rejection class="QHashNode"/>
270 270 <rejection class="QHashNode"/>
271 271 <rejection class="QHashNode"/>
272 272 <rejection class="QHashNode"/>
273 273 <rejection class="QInternal"/>
274 274 <rejection class="QIncompatibleFlag"/>
275 275 <rejection class="QLibrary"/>
276 276 <rejection class="QLinkedList"/>
277 277 <rejection class="QLinkedListData"/>
278 278 <rejection class="QLinkedListIterator"/>
279 279 <rejection class="QLinkedListNode"/>
280 280 <rejection class="QListData"/>
281 281 <rejection class="QListIterator"/>
282 282 <rejection class="QMap"/>
283 283 <rejection class="QMapNode"/>
284 284 <rejection class="QMapPayloadNode"/>
285 285 <rejection class="QMapData"/>
286 286 <rejection class="QMapIterator"/>
287 287 <rejection class="QMetaType"/>
288 288 <rejection class="QMetaTypeId"/>
289 289 <rejection class="QMetaProperty"/>
290 290 <rejection class="QMetaObject"/>
291 291 <rejection class="QMetaClassInfo"/>
292 292 <rejection class="QMetaMethod"/>
293 293 <rejection class="QMetaEnum"/>
294 294 <rejection class="QMultiHash"/>
295 295 <rejection class="QMultiMap"/>
296 296 <rejection class="QMutableHashIterator"/>
297 297 <rejection class="QMutableLinkedListIterator"/>
298 298 <rejection class="QMutableListIterator"/>
299 299 <rejection class="QMutableMapIterator"/>
300 300 <rejection class="QMutableVectorIterator"/>
301 301 <rejection class="QMutexLocker"/>
302 302 <rejection class="QNoImplicitBoolCast"/>
303 303 <rejection class="QObjectCleanupHandler"/>
304 304 <rejection class="QObjectData"/>
305 305 <rejection class="QObjectUserData"/>
306 306 <rejection class="QPluginLoader"/>
307 307 <rejection class="QPointer"/>
308 308 <rejection class="QReadLocker"/>
309 309 <rejection class="QResource"/>
310 310 <rejection class="QSet"/>
311 311 <rejection class="QSetIterator"/>
312 312 <rejection class="QSharedData"/>
313 313 <rejection class="QSharedDataPointer"/>
314 314 <rejection class="QStack"/>
315 315 <rejection class="QSysInfo"/>
316 316 <rejection class="QTextStreamManipulator"/>
317 317 <rejection class="QThread"/>
318 318 <rejection class="QThreadStorage"/>
319 319 <rejection class="QThreadStorageData"/>
320 320 <rejection class="QTypeInfo"/>
321 321 <rejection class="QTypeInfo"/>
322 322 <rejection class="QVFbKeyData"/>
323 323 <rejection class="QVariantComparisonHelper"/>
324 324 <rejection class="QVectorData"/>
325 325 <rejection class="QVectorIterator"/>
326 326 <rejection class="QVectorTypedData"/>
327 327 <rejection class="QWriteLocker"/>
328 328 <rejection class="QtPrivate"/>
329 329 <rejection class="qGreater"/>
330 330 <rejection class="qLess"/>
331 331 <rejection class="std"/>
332 332 <rejection class="QAbstractFileEngine::ExtensionOption"/>
333 333 <rejection class="QAbstractFileEngine::ExtensionReturn"/>
334 334 <rejection class="QByteArray::Data"/>
335 335 <rejection class="QIntForType"/>
336 336 <rejection class="QList::Node"/>
337 337 <rejection class="QList::const_iterator"/>
338 338 <rejection class="QList::iterator"/>
339 339 <rejection class="QMetaTypeId2"/>
340 340 <rejection class="QMutableSetIterator"/>
341 341 <rejection class="QSubString"/>
342 342 <rejection class="QUintForType"/>
343 343 <rejection class="QtConcurrent::internal"/>
344 344 <rejection class="QByteArrayMatcher::Data"/>
345 345 <rejection class="QStringMatcher::Data"/>
346 346
347 347 <rejection class="StringBuilder"/>
348 348 <rejection class="QConcatenable"/>
349 349 <rejection class="QLatin1Literal"/>
350 350 <rejection class="QIntegerForSizeof"/>
351 351
352 352
353 353 <rejection class="QLocale::Data"/>
354 354 <rejection class="QGlobalStaticDeleter"/>
355 355 <rejection class="QSharedMemory"/> <!-- Temporarily until we know how to implement it in Java -->
356 356 <rejection class="QVarLengthArray"/>
357 357
358 358 <!-- DBus -->
359 359 <rejection class="QDBusAbstractAdaptor"/>
360 360 <rejection class="QDBusAbstractInterface"/>
361 361 <rejection class="QDBusArgument"/>
362 362 <rejection class="QDBusConnection"/>
363 363 <rejection class="QDBusConnectionInterface"/>
364 364 <rejection class="QDBusContext"/>
365 365 <rejection class="QDBusError"/>
366 366 <rejection class="QDBusInterface"/>
367 367 <rejection class="QDBusMessage"/>
368 368 <rejection class="QDBusMetaType"/>
369 369 <rejection class="QDBusObjectPath"/>
370 370 <rejection class="QDBusReply"/>
371 371 <rejection class="QDBusServer"/>
372 372 <rejection class="QDBusSignature"/>
373 373 <rejection class="QDBusVariant"/>
374 374
375 375 <rejection class="_Revbidit"/>
376 376 <rejection class="_complex"/>
377 377 <rejection class="_exception"/>
378 378 <rejection class="_iobuf"/>
379 379 <rejection class="_stat"/>
380 380 <rejection class="_wfinddata_t"/>
381 381 <rejection class="exception"/>
382 382 <rejection class="istreambuf_iterator"/>
383 383 <rejection class="ostreambuf_iterator"/>
384 384 <rejection class="reverse_bidirectional_iterator"/>
385 385 <rejection class="reverse_iterator"/>
386 386 <rejection class="stat"/>
387 387 <rejection class="tm"/>
388 388
389 389 <rejection class="Qt" enum-name="Initialization"/>
390 390
391 391 <rejection class="QAbstractEventDispatcher" function-name="filterEvent"/>
392 392 <rejection class="QAbstractEventDispatcher" function-name="setEventFilter"/>
393 393 <rejection class="QAbstractEventDispatcher" function-name="registerTimer"/>
394 394 <rejection class="QAbstractFileEngine" function-name="beginEntryList"/>
395 395 <rejection class="QAbstractFileEngine" function-name="endEntryList"/>
396 396 <rejection class="QAbstractFileEngine" function-name="extension"/>
397 397 <rejection class="QCoreApplication" function-name="compressEvent"/>
398 398 <rejection class="QCoreApplication" function-name="eventFilter"/>
399 399 <rejection class="QCoreApplication" function-name="filterEvent"/>
400 400 <rejection class="QCoreApplication" function-name="setEventFilter"/>
401 401 <rejection class="QFile" function-name="setDecodingFunction"/>
402 402 <rejection class="QFile" function-name="setEncodingFunction"/>
403 403 <rejection class="QList" function-name="begin"/>
404 404 <rejection class="QList" function-name="constBegin"/>
405 405 <rejection class="QList" function-name="constEnd"/>
406 406 <rejection class="QList" function-name="end"/>
407 407 <rejection class="QList" function-name="erase"/>
408 408 <rejection class="QList" function-name="erase"/>
409 409 <rejection class="QList" function-name="free"/>
410 410 <rejection class="QList" function-name="fromList"/>
411 411 <rejection class="QList" function-name="fromSet"/>
412 412 <rejection class="QList" function-name="fromSet"/>
413 413 <rejection class="QList" function-name="insert"/>
414 414 <rejection class="QList" function-name="malloc"/>
415 415 <rejection class="QList" function-name="node_construct"/>
416 416 <rejection class="QList" function-name="node_copy"/>
417 417 <rejection class="QList" function-name="node_destruct"/>
418 418 <rejection class="QList" function-name="toSet"/>
419 419 <rejection class="QObject" function-name="receivers"/>
420 420 <rejection class="QObject" function-name="findChild"/>
421 421 <rejection class="QObject" function-name="findChildren"/>
422 422 <rejection class="QObject" function-name="setUserData"/>
423 423 <rejection class="QObject" function-name="userData"/>
424 424 <rejection class="QObject" function-name="destroyed"/>
425 425 <rejection class="QObject" function-name="connect"/>
426 426 <rejection class="QObject" function-name="connectNotify"/>
427 427 <rejection class="QObject" function-name="disconnect"/>
428 428 <rejection class="QObject" function-name="disconnectNotify"/>
429 429 <rejection class="QObject" function-name="registerUserData"/>
430 430 <rejection class="QObject" function-name="sender"/>
431 431 <rejection class="QObject" function-name="moveToThread"/>
432 432 <rejection class="QObject" function-name="thread"/>
433 433 <rejection class="QTimer" function-name="singleShot"/>
434 434 <rejection class="QProcess" function-name="pid"/>
435 435 <rejection class="QRegion" function-name="cleanUp"/>
436 436 <rejection class="QSettings" function-name="registerFormat"/>
437 437 <rejection class="QVector" function-name="back"/>
438 438 <rejection class="QVector" function-name="begin"/>
439 439 <rejection class="QVector" function-name="constBegin"/>
440 440 <rejection class="QVector" function-name="constEnd"/>
441 441 <rejection class="QVector" function-name="end"/>
442 442 <rejection class="QVector" function-name="erase"/>
443 443 <rejection class="QVector" function-name="free"/>
444 444 <rejection class="QVector" function-name="front"/>
445 445 <rejection class="QVector" function-name="insert"/>
446 446 <rejection class="QVector" function-name="malloc"/>
447 447 <rejection class="QVector" function-name="alloc"/>
448 448 <rejection class="QVector" function-name="operator+="/>
449 449 <rejection class="QAbstractFileEngineIterator" function-name="entryInfo"/>
450 450 <rejection class="QtConcurrent::ThreadEngineBarrier"/>
451 451
452 452 <rejection class="QAbstractFileEngineIterator" enum-name="EntryInfoType"/>
453 453 <rejection class="QDataStream"/>
454 454 <rejection class="QDataStream" enum-name="ByteOrder"/>
455 455
456 456
457 457 <namespace-type name="Qt">
458 458 <modify-function signature="codecForHtml(const QByteArray &amp;)" remove="all"/>
459 459 <modify-function signature="mightBeRichText(const QString &amp;)" remove="all"/>
460 460 <modify-function signature="escape(const QString&amp;)" remove="all"/>
461 461 <modify-function signature="convertFromPlainText(const QString &amp;, Qt::WhiteSpaceMode)" remove="all"/>
462 462 <extra-includes>
463 463 <include file-name="QGesture" location="global"/>
464 464 </extra-includes>
465 465
466 466 <extra-includes>
467 467 <include file-name="QTextDocument" location="global"/>
468 468 </extra-includes>
469 469 </namespace-type>
470 470
471 471 <enum-type name="QDate::MonthNameType"/>
472 472 <enum-type name="QAbstractAnimation::DeletionPolicy"/>
473 473 <enum-type name="QAbstractAnimation::Direction"/>
474 474 <enum-type name="QAbstractAnimation::State"/>
475 475 <enum-type name="QDataStream::FloatingPointPrecision"/>
476 476 <enum-type name="QEasingCurve::Type"/>
477 477 <enum-type name="QHistoryState::HistoryType"/>
478 478 <enum-type name="QState::ChildMode"/>
479 479 <enum-type name="QStateMachine::Error"/>
480 480 <enum-type name="QStateMachine::EventPriority"/>
481 481 <enum-type name="QStateMachine::RestorePolicy"/>
482 482 <enum-type name="Qt::AnchorPoint"/>
483 483 <enum-type name="Qt::CoordinateSystem"/>
484 484 <enum-type name="Qt::GestureFlag" flags="Qt::GestureFlags"/>
485 485 <enum-type name="Qt::GestureState"/>
486 486 <enum-type name="Qt::GestureType"/>
487 487 <enum-type name="Qt::InputMethodHint" flags="Qt::InputMethodHints"/>
488 488 <enum-type name="Qt::NavigationMode"/>
489 489 <enum-type name="Qt::RenderHint"/>
490 490 <enum-type name="Qt::TileRule"/>
491 491 <enum-type name="Qt::TouchPointState" flags="Qt::TouchPointStates"/>
492 492
493 493 <enum-type name="QtMsgType">
494 494 <reject-enum-value name="QtSystemMsg"/>
495 495 </enum-type>
496 496
497 497
498 498 <enum-type name="QReadWriteLock::RecursionMode"/>
499 499 <enum-type name="QSystemSemaphore::AccessMode"/>
500 500 <enum-type name="QSystemSemaphore::SystemSemaphoreError"/>
501 501 <enum-type name="QTextBoundaryFinder::BoundaryReason" flags="QTextBoundaryFinder::BoundaryReasons"/>
502 502 <enum-type name="QTextBoundaryFinder::BoundaryType"/>
503 503 <enum-type name="QAbstractFileEngine::Extension" extensible="yes"/>
504 504 <enum-type name="QAbstractFileEngine::FileFlag" flags="QAbstractFileEngine::FileFlags"/>
505 505 <enum-type name="QAbstractFileEngine::FileName"/>
506 506 <enum-type name="QAbstractFileEngine::FileOwner"/>
507 507 <enum-type name="QAbstractFileEngine::FileTime"/>
508 508 <enum-type name="QDataStream::Status"/>
509 509 <enum-type name="QDir::Filter" flags="QDir::Filters"/>
510 510 <enum-type name="QEvent::Type" extensible="yes">
511 511 <reject-enum-value name="ApplicationActivated"/>
512 512 <reject-enum-value name="ApplicationDeactivated"/>
513 513 </enum-type>
514 514 <enum-type name="QEventLoop::ProcessEventsFlag" flags="QEventLoop::ProcessEventsFlags"/>
515 515 <enum-type name="QFile::FileHandleFlag"/>
516 516 <enum-type name="QFile::FileError"/>
517 517 <enum-type name="QFile::MemoryMapFlags"/>
518 518 <enum-type name="QFile::Permission" flags="QFile::Permissions"/>
519 519 <enum-type name="QIODevice::OpenModeFlag" flags="QIODevice::OpenMode"/>
520 520 <enum-type name="QLibraryInfo::LibraryLocation"/>
521 521 <enum-type name="QLocale::FormatType"/>
522 522 <enum-type name="QLocale::QuotationStyle"/>
523 523 <enum-type name="QLocale::CurrencySymbolFormat"/>
524 524 <enum-type name="QLocale::Script"/>
525 525 <enum-type name="QLocale::NumberOption" flags="QLocale::NumberOptions"/>
526 526 <enum-type name="QLocale::MeasurementSystem"/>
527 527 <enum-type name="QMutex::RecursionMode"/>
528 528 <enum-type name="QProcess::ExitStatus"/>
529 529 <enum-type name="QProcess::ProcessChannel"/>
530 530 <enum-type name="QProcess::ProcessChannelMode"/>
531 531 <enum-type name="QProcess::ProcessError"/>
532 532 <enum-type name="QProcess::ProcessState"/>
533 533 <enum-type name="QRegExp::CaretMode"/>
534 534 <enum-type name="QRegExp::PatternSyntax"/>
535 535 <enum-type name="QSettings::Format"/>
536 536 <enum-type name="QSettings::Scope"/>
537 537 <enum-type name="QSettings::Status"/>
538 538 <enum-type name="QSocketNotifier::Type"/>
539 539 <enum-type name="QSystemLocale::QueryType"/>
540 540 <enum-type name="QTextCodec::ConversionFlag" flags="QTextCodec::ConversionFlags"/>
541 541 <enum-type name="QTextStream::FieldAlignment"/>
542 542 <enum-type name="QTextStream::NumberFlag" flags="QTextStream::NumberFlags"/>
543 543 <enum-type name="QTextStream::RealNumberNotation"/>
544 544 <enum-type name="QTextStream::Status"/>
545 545 <enum-type name="QTimeLine::CurveShape"/>
546 546 <enum-type name="QTimeLine::Direction"/>
547 547 <enum-type name="QTimeLine::State"/>
548 548 <enum-type name="QUrl::ParsingMode"/>
549 549 <enum-type name="QUuid::Variant"/>
550 550 <enum-type name="QUuid::Version"/>
551 551 <enum-type name="Qt::SizeHint"/>
552 552 <enum-type name="Qt::TimerType"/>
553 553 <enum-type name="Qt::CursorMoveStyle"/>
554 554 <enum-type name="Qt::FindChildOption"/>
555 555 <enum-type name="Qt::ScreenOrientation"/>
556 556 <enum-type name="Qt::SizeMode"/>
557 557 <enum-type name="Qt::WindowFrameSection"/>
558 558 <enum-type name="Qt::Axis"/>
559 559 <enum-type name="Qt::AnchorAttribute"/>
560 560 <enum-type name="Qt::ApplicationAttribute"/>
561 561 <enum-type name="Qt::ArrowType"/>
562 562 <enum-type name="Qt::AspectRatioMode"/>
563 563 <enum-type name="Qt::BGMode"/>
564 564 <enum-type name="Qt::BrushStyle"/>
565 565 <enum-type name="Qt::CaseSensitivity"/>
566 566 <enum-type name="Qt::CheckState"/>
567 567 <enum-type name="Qt::ClipOperation"/>
568 568 <enum-type name="Qt::ConnectionType"/>
569 569 <enum-type name="Qt::ContextMenuPolicy"/>
570 570 <enum-type name="Qt::Corner"/>
571 571 <enum-type name="Qt::DayOfWeek"/>
572 572 <enum-type name="Qt::DockWidgetAreaSizes"/>
573 573 <enum-type name="Qt::DropAction" flags="Qt::DropActions"/>
574 574 <enum-type name="Qt::FillRule"/>
575 575 <enum-type name="Qt::FocusPolicy"/>
576 576 <enum-type name="Qt::FocusReason"/>
577 577 <enum-type name="Qt::GlobalColor"/>
578 578 <enum-type name="Qt::HitTestAccuracy"/>
579 579 <enum-type name="Qt::InputMethodQuery"/>
580 580 <enum-type name="Qt::ItemFlag" flags="Qt::ItemFlags"/>
581 581 <enum-type name="Qt::ItemSelectionMode"/>
582 582 <enum-type name="Qt::KeyboardModifier" flags="Qt::KeyboardModifiers"/>
583 583 <enum-type name="Qt::LayoutDirection"/>
584 584 <enum-type name="Qt::MatchFlag" flags="Qt::MatchFlags"/>
585 585 <enum-type name="Qt::Modifier"/>
586 586 <enum-type name="Qt::MouseButton" flags="Qt::MouseButtons"/>
587 587 <enum-type name="Qt::Orientation" flags="Qt::Orientations"/>
588 588 <enum-type name="Qt::PenCapStyle"/>
589 589 <enum-type name="Qt::PenJoinStyle"/>
590 590 <enum-type name="Qt::PenStyle"/>
591 591 <enum-type name="Qt::ScrollBarPolicy"/>
592 592 <enum-type name="Qt::ShortcutContext"/>
593 593 <enum-type name="Qt::SortOrder"/>
594 594 <enum-type name="Qt::TextElideMode"/>
595 595 <enum-type name="Qt::TextFlag"/>
596 596 <enum-type name="Qt::TextFormat"/>
597 597 <enum-type name="Qt::TextInteractionFlag" flags="Qt::TextInteractionFlags"/>
598 598 <enum-type name="Qt::TimeSpec"/>
599 599 <enum-type name="Qt::ToolBarAreaSizes"/>
600 600 <enum-type name="Qt::ToolButtonStyle"/>
601 601 <enum-type name="Qt::TransformationMode"/>
602 602 <enum-type name="Qt::UIEffect"/>
603 603 <enum-type name="Qt::WhiteSpaceMode"/>
604 604 <enum-type name="Qt::WindowModality"/>
605 605 <enum-type name="Qt::WindowState" flags="Qt::WindowStates"/>
606 606 <enum-type name="Qt::WindowType" flags="Qt::WindowFlags"/>
607 607 <enum-type name="QDirIterator::IteratorFlag" flags="QDirIterator::IteratorFlags"/>
608 608 <enum-type name="Qt::EventPriority"/>
609 609 <enum-type name="Qt::MaskMode"/>
610 610 <enum-type name="QCryptographicHash::Algorithm"/>
611 611
612 612 <enum-type name="QtConcurrent::ReduceOption" flags="QtConcurrent::ReduceOptions"/>
613 613 <enum-type name="QtConcurrent::ThreadFunctionResult"/>
614 614
615 615
616 616 <enum-type name="QCoreApplication::Encoding">
617 617 <reject-enum-value name="DefaultCodec"/>
618 618 </enum-type>
619 619
620 620 <enum-type name="Qt::AlignmentFlag" flags="Qt::Alignment">
621 621 <reject-enum-value name="AlignLeading"/>
622 622 <reject-enum-value name="AlignTrailing"/>
623 623 </enum-type>
624 624
625 625 <enum-type name="Qt::CursorShape">
626 626 <reject-enum-value name="LastCursor"/>
627 627 </enum-type>
628 628
629 629 <enum-type name="Qt::DateFormat">
630 630 <reject-enum-value name="LocalDate"/>
631 631 </enum-type>
632 632
633 633
634 634 <enum-type name="Qt::ItemDataRole" force-integer="yes">
635 635 <reject-enum-value name="BackgroundColorRole"/>
636 636 <reject-enum-value name="TextColorRole"/>
637 637 </enum-type>
638 638
639 639
640 640 <enum-type name="QDataStream::Version">
641 641 <reject-enum-value name="Qt_4_1"/>
642 642 <reject-enum-value name="Qt_4_5"/>
643 643 <reject-enum-value name="Qt_4_6"/>
644 644 </enum-type>
645 645
646 646 <enum-type name="QDir::SortFlag" flags="QDir::SortFlags">
647 647 <reject-enum-value name="Unsorted"/>
648 648 </enum-type>
649 649
650 650 <enum-type name="Qt::DockWidgetArea" flags="Qt::DockWidgetAreas">
651 651 <reject-enum-value name="AllDockWidgetAreas"/>
652 652 </enum-type>
653 653
654 654 <enum-type name="Qt::ImageConversionFlag" flags="Qt::ImageConversionFlags">
655 655 <reject-enum-value name="AutoDither"/>
656 656 <reject-enum-value name="ColorOnly"/>
657 657 <reject-enum-value name="DiffuseDither"/>
658 658 <reject-enum-value name="NoAlpha"/>
659 659 <reject-enum-value name="ThresholdAlphaDither"/>
660 660 </enum-type>
661 661
662 662 <enum-type name="Qt::Key">
663 663 <reject-enum-value name="Key_Any"/>
664 664 </enum-type>
665 665
666 666 <enum-type name="QLocale::Language">
667 667 <reject-enum-value name="LastLanguage"/>
668 668 <reject-enum-value name="NorwegianBokmal"/>
669 669 <reject-enum-value name="Nynorsk"/>
670 670 </enum-type>
671 671
672 672 <enum-type name="QLocale::Country">
673 673 <reject-enum-value name="LastCountry"/>
674 674 </enum-type>
675 675
676 676 <enum-type name="Qt::ToolBarArea" flags="Qt::ToolBarAreas">
677 677 <reject-enum-value name="AllToolBarAreas"/>
678 678 </enum-type>
679 679
680 680 <enum-type name="Qt::WidgetAttribute">
681 681 <reject-enum-value name="WA_ForceAcceptDrops"/>
682 682 <reject-enum-value name="WA_NoBackground"/>
683 683 <reject-enum-value name="WA_MacMetalStyle"/>
684 684 </enum-type>
685 685
686 686 <value-type name="QProcessEnvironment"/>
687 687 <value-type name="QBasicTimer"/>
688 688 <value-type name="QByteArrayMatcher">
689 689 <modify-function signature="operator=(QByteArrayMatcher)" remove="all"/>
690 690 </value-type>
691 691
692 692 <value-type name="QDate">
693 693 <modify-function signature="julianToGregorian(uint,int&amp;,int&amp;,int&amp;)">
694 694 <remove/>
695 695 </modify-function>
696 696
697 697 <modify-function signature="setYMD(int, int, int)" remove="all"/>
698 698 <!--### Obsolete in 4.3-->
699 699 </value-type>
700 700
701 701 <value-type name="QDateTime">
702 702 <modify-function signature="operator=(QDateTime)" remove="all"/>
703 703 </value-type>
704 704
705 705 <value-type name="QDir">
706 706 <modify-function signature="QDir(QString,QString,QFlags&lt;QDir::SortFlag&gt;,QFlags&lt;QDir::Filter&gt;)">
707 707 <modify-argument index="3">
708 708 <replace-default-expression with="SortFlag.Name, SortFlag.IgnoreCase"/>
709 709 </modify-argument>
710 710 </modify-function>
711 711 <modify-function signature="operator=(QDir)" remove="all"/>
712 712 <modify-function signature="operator=(QString)" remove="all"/>
713 713 <modify-function signature="addResourceSearchPath(QString)" remove="all"/>
714 714 <!--### Obsolete in 4.3-->
715 715 </value-type>
716 716
717 717 <value-type name="QPoint">
718 718 <modify-function signature="rx()" remove="all"/>
719 719 <modify-function signature="ry()" remove="all"/>
720 720 </value-type>
721 721 <value-type name="QPointF">
722 722 <modify-function signature="rx()" remove="all"/>
723 723 <modify-function signature="ry()" remove="all"/>
724 724 </value-type>
725 725
726 726 <value-type name="QRect">
727 727 <modify-function signature="getCoords(int*,int*,int*,int*)const">
728 728 <remove/>
729 729 </modify-function>
730 730 <modify-function signature="getRect(int*,int*,int*,int*)const">
731 731 <remove/>
732 732 </modify-function>
733 733 <modify-function signature="operator&amp;=(QRect)">
734 734 <remove/>
735 735 </modify-function>
736 736 <modify-function signature="operator|=(QRect)">
737 737 <remove/>
738 738 </modify-function>
739 739 <modify-function signature="operator&amp;(QRect)const">
740 740 <remove/>
741 741 </modify-function>
742 742 <modify-function signature="operator|(QRect)const">
743 743 <remove/>
744 744 </modify-function>
745 745
746 746 <modify-function signature="intersect(const QRect&amp;)const" remove="all"/>
747 747 <!--### Obsolete in 4.3-->
748 748 <modify-function signature="unite(const QRect&amp;)const" remove="all"/>
749 749 <!--### Obsolete in 4.3-->
750 750 </value-type>
751 751
752 752 <value-type name="QRectF">
753 753 <modify-function signature="getCoords(qreal*,qreal*,qreal*,qreal*)const">
754 754 <remove/>
755 755 </modify-function>
756 756 <modify-function signature="getRect(qreal*,qreal*,qreal*,qreal*)const">
757 757 <remove/>
758 758 </modify-function>
759 759 <modify-function signature="operator&amp;=(QRectF)">
760 760 <remove/>
761 761 </modify-function>
762 762 <modify-function signature="operator|=(QRectF)">
763 763 <remove/>
764 764 </modify-function>
765 765 <modify-function signature="operator&amp;(QRectF)const">
766 766 <remove/>
767 767 </modify-function>
768 768 <modify-function signature="operator|(QRectF)const">
769 769 <remove/>
770 770 </modify-function>
771 771
772 772 <modify-function signature="intersect(const QRectF&amp;)const" remove="all"/>
773 773 <!--### Obsolete in 4.3-->
774 774 <modify-function signature="unite(const QRectF&amp;)const" remove="all"/>
775 775 <!--### Obsolete in 4.3-->
776 776 </value-type>
777 777
778 778
779 779 <value-type name="QSize">
780 780 <modify-function signature="operator*=(qreal)">
781 781 <access modifier="private"/>
782 782 </modify-function>
783 783 <modify-function signature="operator/=(qreal)">
784 784 <access modifier="private"/>
785 785 </modify-function>
786 786 <modify-function signature="operator+=(QSize)">
787 787 <access modifier="private"/>
788 788 </modify-function>
789 789 <modify-function signature="operator-=(QSize)">
790 790 <access modifier="private"/>
791 791 </modify-function>
792 792 <modify-function signature="rheight()">
793 793 <remove/>
794 794 </modify-function>
795 795 <modify-function signature="rwidth()">
796 796 <remove/>
797 797 </modify-function>
798 798 </value-type>
799 799
800 800 <value-type name="QSizeF">
801 801 <modify-function signature="operator*=(qreal)">
802 802 <access modifier="private"/>
803 803 </modify-function>
804 804 <modify-function signature="operator/=(qreal)">
805 805 <access modifier="private"/>
806 806 </modify-function>
807 807 <modify-function signature="operator+=(QSizeF)">
808 808 <access modifier="private"/>
809 809 </modify-function>
810 810 <modify-function signature="operator-=(QSizeF)">
811 811 <access modifier="private"/>
812 812 </modify-function>
813 813 <modify-function signature="rheight()">
814 814 <remove/>
815 815 </modify-function>
816 816 <modify-function signature="rwidth()">
817 817 <remove/>
818 818 </modify-function>
819 819 </value-type>
820 820
821 821 <value-type name="QStringMatcher">
822 822 <modify-function signature="operator=(QStringMatcher)" remove="all"/>
823 823 <modify-function signature="QStringMatcher(const QChar*,int,Qt::CaseSensitivity)" remove="all"/>
824 824 <modify-function signature="indexIn(const QChar*,int,int)const" remove="all"/>
825 825 </value-type>
826 826
827 827 <value-type name="QTime"/>
828 828
829 829 <value-type name="QPersistentModelIndex">
830 830 <modify-function signature="operator=(QPersistentModelIndex)" remove="all"/>
831 831 <modify-function signature="operator=(QModelIndex)" remove="all"/>
832 832 <modify-function signature="internalPointer()const" remove="all"/>
833 833 </value-type>
834 834
835 835 <value-type name="QUuid">
836 836 <modify-function signature="QUuid(const char*)">
837 837 <remove/>
838 838 </modify-function>
839 839 </value-type>
840 840
841 841 <value-type name="QLocale">
842 842 <modify-function signature="toString(qlonglong) const" remove="all"/>
843 843 <modify-function signature="toString(ushort) const" remove="all"/>
844 844 <modify-function signature="toString(unsigned int) const" remove="all"/>
845 845 <modify-function signature="toUInt(QString,bool*,int)const" remove="all"/>
846 846 <modify-function signature="toULongLong(QString,bool*,int)const" remove="all"/>
847 847 <modify-function signature="operator=(QLocale)" remove="all"/>
848 848
849 849 <extra-includes>
850 850 <include file-name="QDate" location="global"/>
851 851 </extra-includes>
852 852
853 853 <inject-code class="native" position="beginning">
854 854 Q_DECLARE_METATYPE(QScriptValue)
855 855 </inject-code>
856 856
857 857 <modify-function signature="toDouble(QString,bool*)const">
858 858 <modify-argument index="2">
859 859 <remove-default-expression/>
860 860 <remove-argument/>
861 861 <conversion-rule class="native">
862 862 <insert-template name="core.prepare_removed_bool*_argument"/>
863 863 </conversion-rule>
864 864 </modify-argument>
865 865 <modify-argument index="return">
866 866 <conversion-rule class="native">
867 867 <insert-template name="core.convert_to_null_or_primitive"/>
868 868 </conversion-rule>
869 869 </modify-argument>
870 870 </modify-function>
871 871
872 872 <modify-function signature="toFloat(QString,bool*)const">
873 873 <modify-argument index="2">
874 874 <remove-default-expression/>
875 875 <remove-argument/>
876 876 <conversion-rule class="native">
877 877 <insert-template name="core.prepare_removed_bool*_argument"/>
878 878 </conversion-rule>
879 879 </modify-argument>
880 880 <modify-argument index="return">
881 881 <conversion-rule class="native">
882 882 <insert-template name="core.convert_to_null_or_primitive"/>
883 883 </conversion-rule>
884 884 </modify-argument>
885 885 </modify-function>
886 886
887 887 <modify-function signature="toInt(QString,bool*,int)const">
888 888 <modify-argument index="2">
889 889 <remove-default-expression/>
890 890 <remove-argument/>
891 891 <conversion-rule class="native">
892 892 <insert-template name="core.prepare_removed_bool*_argument"/>
893 893 </conversion-rule>
894 894 </modify-argument>
895 895 <modify-argument index="return">
896 896 <conversion-rule class="native">
897 897 <insert-template name="core.convert_to_null_or_primitive"/>
898 898 </conversion-rule>
899 899 </modify-argument>
900 900 </modify-function>
901 901
902 902 <modify-function signature="toLongLong(QString,bool*,int)const">
903 903 <modify-argument index="2">
904 904 <remove-default-expression/>
905 905 <remove-argument/>
906 906 <conversion-rule class="native">
907 907 <insert-template name="core.prepare_removed_bool*_argument"/>
908 908 </conversion-rule>
909 909 </modify-argument>
910 910 <modify-argument index="return">
911 911 <conversion-rule class="native">
912 912 QScriptValue %out%;
913 913 if (!__ok)
914 914 %out% = context-&gt;engine()-&gt;nullValue();
915 915 else
916 916 %out% = QScriptValue(context-&gt;engine(), double(%in%)).toObject();
917 917 </conversion-rule>
918 918 </modify-argument>
919 919 </modify-function>
920 920
921 921 <modify-function signature="toShort(QString,bool*,int)const">
922 922 <modify-argument index="2">
923 923 <remove-default-expression/>
924 924 <remove-argument/>
925 925 <conversion-rule class="native">
926 926 <insert-template name="core.prepare_removed_bool*_argument"/>
927 927 </conversion-rule>
928 928 </modify-argument>
929 929 <modify-argument index="return">
930 930 <conversion-rule class="native">
931 931 <insert-template name="core.convert_to_null_or_primitive"/>
932 932 </conversion-rule>
933 933 </modify-argument>
934 934 </modify-function>
935 935
936 936 <modify-function signature="toUShort(QString,bool*,int)const">
937 937 <modify-argument index="2">
938 938 <remove-default-expression/>
939 939 <remove-argument/>
940 940 <conversion-rule class="native">
941 941 <insert-template name="core.prepare_removed_bool*_argument"/>
942 942 </conversion-rule>
943 943 </modify-argument>
944 944 <modify-argument index="return">
945 945 <conversion-rule class="native">
946 946 <insert-template name="core.convert_to_null_or_primitive"/>
947 947 </conversion-rule>
948 948 </modify-argument>
949 949 </modify-function>
950 950 </value-type>
951 951
952 952
953 953 <value-type name="QBitArray">
954 954 <modify-function signature="operator[](int)" remove="all"/>
955 955 <modify-function signature="operator[](int)const" remove="all"/>
956 956 <modify-function signature="operator[](uint)const" remove="all"/>
957 957 <modify-function signature="operator[](uint)" remove="all"/>
958 958
959 959 <modify-function signature="operator&amp;=(QBitArray)" access="private"/>
960 960 <modify-function signature="operator=(QBitArray)" access="private"/>
961 961 <modify-function signature="operator^=(QBitArray)" access="private"/>
962 962 <modify-function signature="operator|=(QBitArray)" access="private"/>
963 963 <modify-function signature="operator~()const" access="private"/>
964 964
965 965 <modify-function signature="at(int)const">
966 966 <modify-argument index="1">
967 967 <conversion-rule class="native">
968 968 <insert-template name="core.convert_int_arg_and_check_range">
969 969 <replace from="%CLASS_NAME%" to="QBitArray"/>
970 970 <replace from="%FUNCTION_NAME%" to="at"/>
971 971 </insert-template>
972 972 </conversion-rule>
973 973 </modify-argument>
974 974 </modify-function>
975 975
976 976 <modify-function signature="clearBit(int)">
977 977 <modify-argument index="1">
978 978 <conversion-rule class="native">
979 979 <insert-template name="core.convert_int_arg_and_check_range">
980 980 <replace from="%CLASS_NAME%" to="QBitArray"/>
981 981 <replace from="%FUNCTION_NAME%" to="clearBit"/>
982 982 </insert-template>
983 983 </conversion-rule>
984 984 </modify-argument>
985 985 </modify-function>
986 986
987 987 <modify-function signature="setBit(int)">
988 988 <modify-argument index="1">
989 989 <conversion-rule class="native">
990 990 <insert-template name="core.convert_int_arg_and_check_range">
991 991 <replace from="%CLASS_NAME%" to="QBitArray"/>
992 992 <replace from="%FUNCTION_NAME%" to="setBit"/>
993 993 </insert-template>
994 994 </conversion-rule>
995 995 </modify-argument>
996 996 </modify-function>
997 997
998 998 <modify-function signature="setBit(int,bool)">
999 999 <modify-argument index="1">
1000 1000 <conversion-rule class="native">
1001 1001 <insert-template name="core.convert_int_arg_and_check_range">
1002 1002 <replace from="%CLASS_NAME%" to="QBitArray"/>
1003 1003 <replace from="%FUNCTION_NAME%" to="setBit"/>
1004 1004 </insert-template>
1005 1005 </conversion-rule>
1006 1006 </modify-argument>
1007 1007 </modify-function>
1008 1008
1009 1009 <modify-function signature="testBit(int)const">
1010 1010 <modify-argument index="1">
1011 1011 <conversion-rule class="native">
1012 1012 <insert-template name="core.convert_int_arg_and_check_range">
1013 1013 <replace from="%CLASS_NAME%" to="QBitArray"/>
1014 1014 <replace from="%FUNCTION_NAME%" to="testBit"/>
1015 1015 </insert-template>
1016 1016 </conversion-rule>
1017 1017 </modify-argument>
1018 1018 </modify-function>
1019 1019
1020 1020 <modify-function signature="toggleBit(int)">
1021 1021 <modify-argument index="1">
1022 1022 <conversion-rule class="native">
1023 1023 <insert-template name="core.convert_int_arg_and_check_range">
1024 1024 <replace from="%CLASS_NAME%" to="QBitArray"/>
1025 1025 <replace from="%FUNCTION_NAME%" to="toggleBit"/>
1026 1026 </insert-template>
1027 1027 </conversion-rule>
1028 1028 </modify-argument>
1029 1029 </modify-function>
1030 1030
1031 1031 <modify-function signature="operator&amp;=(QBitArray)">
1032 1032 <modify-argument index="0" replace-value="this"/>
1033 1033 </modify-function>
1034 1034 <modify-function signature="operator=(QBitArray)">
1035 1035 <modify-argument index="0" replace-value="this"/>
1036 1036 </modify-function>
1037 1037 <modify-function signature="operator^=(QBitArray)">
1038 1038 <modify-argument index="0" replace-value="this"/>
1039 1039 </modify-function>
1040 1040 <modify-function signature="operator|=(QBitArray)">
1041 1041 <modify-argument index="0" replace-value="this"/>
1042 1042 </modify-function>
1043 1043 </value-type>
1044 1044
1045 1045 <object-type name="QReadWriteLock"/>
1046 1046 <object-type name="QDirIterator"/>
1047 1047 <object-type name="QAbstractFileEngineIterator"/>
1048 1048 <object-type name="QAbstractItemModel"/>
1049 1049
1050 1050 <object-type name="QAbstractListModel">
1051 1051 <extra-includes>
1052 1052 <include file-name="QStringList" location="global"/>
1053 1053 <include file-name="QSize" location="global"/>
1054 1054 </extra-includes>
1055 1055 </object-type>
1056 1056
1057 1057 <object-type name="QAbstractTableModel">
1058 1058 <extra-includes>
1059 1059 <include file-name="QStringList" location="global"/>
1060 1060 <include file-name="QSize" location="global"/>
1061 1061 </extra-includes>
1062 1062 </object-type>
1063 1063
1064 1064 <value-type name="QUrl">
1065 1065 <extra-includes>
1066 1066 <include file-name="QStringList" location="global"/>
1067 1067 </extra-includes>
1068 1068 <modify-function signature="operator=(QUrl)" remove="all"/>
1069 1069 <modify-function signature="operator=(QString)" remove="all"/>
1070 1070
1071 1071 <modify-function signature="fromPunycode(const QByteArray&amp;)" remove="all"/>
1072 1072 <!--### Obsolete in 4.3-->
1073 1073 <modify-function signature="toPunycode(const QString&amp;)" remove="all"/>
1074 1074 <!--### Obsolete in 4.3-->
1075 1075 </value-type>
1076 1076
1077 1077 <value-type name="QRegExp">
1078 1078 <extra-includes>
1079 1079 <include file-name="QStringList" location="global"/>
1080 1080 </extra-includes>
1081 1081 <modify-function signature="operator=(QRegExp)" remove="all"/>
1082 1082
1083 1083 <modify-function signature="cap(int)" remove="all"/>
1084 1084 <modify-function signature="capturedTexts()" remove="all"/>
1085 1085 <modify-function signature="pos(int)" remove="all"/>
1086 1086 <modify-function signature="errorString()" remove="all"/>
1087 1087 </value-type>
1088 1088
1089 1089 <value-type name="QFileInfo">
1090 1090 <extra-includes>
1091 1091 <include file-name="QDateTime" location="global"/>
1092 1092 <include file-name="QDir" location="global"/>
1093 1093 </extra-includes>
1094 1094 <modify-function signature="operator!=(const QFileInfo &amp;)const" remove="all"/>
1095 1095 <modify-function signature="operator==(const QFileInfo &amp;)const" remove="all"/>
1096 1096 <modify-function signature="operator=(QFileInfo)" remove="all"/>
1097 1097 <modify-function signature="setFile(QFile)">
1098 1098 <modify-argument index="1">
1099 1099 <reference-count action="ignore"/>
1100 1100 </modify-argument>
1101 1101 </modify-function>
1102 1102
1103 1103 <modify-function signature="readLink()const" remove="all"/>
1104 1104 <!--### Obsolete in 4.3-->
1105 1105
1106 1106 <modify-function signature="QFileInfo(QFile)">
1107 1107 <modify-argument index="1">
1108 1108 <replace-type modified-type="QFile*"/>
1109 1109 <conversion-rule class="native">
1110 1110 QFile &amp; %out% = *qscriptvalue_cast&lt;QFile*&gt;(%in%);
1111 1111 </conversion-rule>
1112 1112 </modify-argument>
1113 1113 </modify-function>
1114 1114 <modify-function signature="setFile(QFile)">
1115 1115 <modify-argument index="1">
1116 1116 <replace-type modified-type="QFile*"/>
1117 1117 <conversion-rule class="native">
1118 1118 QFile &amp; %out% = *qscriptvalue_cast&lt;QFile*&gt;(%in%);
1119 1119 </conversion-rule>
1120 1120 </modify-argument>
1121 1121 </modify-function>
1122 1122 </value-type>
1123 1123
1124 1124 <!-- <interface-type name="QFactoryInterface" java-name="QAbstractFactory" /> -->
1125 1125
1126 1126 <value-type name="QByteArray">
1127 1127
1128 1128 <extra-includes>
1129 1129 <include file-name="QNoImplicitBoolCast" location="global"/>
1130 1130 </extra-includes>
1131 1131
1132 1132 <!-- removed functions -->
1133 1133 <modify-function signature="begin()" remove="all"/>
1134 1134 <modify-function signature="begin()const" remove="all"/>
1135 1135 <modify-function signature="constBegin()const" remove="all"/>
1136 1136 <modify-function signature="constData()const" remove="all"/>
1137 1137 <modify-function signature="constEnd()const" remove="all"/>
1138 1138 <modify-function signature="count()const" remove="all"/>
1139 1139 <modify-function signature="data()const" remove="all"/>
1140 1140 <modify-function signature="end()" remove="all"/>
1141 1141 <modify-function signature="end()const" remove="all"/>
1142 1142 <modify-function signature="number(uint,int)" remove="all"/>
1143 1143 <modify-function signature="number(qulonglong,int)" remove="all"/>
1144 1144 <modify-function signature="operator const char *()const" remove="all"/>
1145 1145 <modify-function signature="operator const void *()const" remove="all"/>
1146 1146 <modify-function signature="operator+=(const char*)" remove="all"/>
1147 1147 <modify-function signature="operator=(const char*)" remove="all"/>
1148 1148 <modify-function signature="operator[](int)" remove="all"/>
1149 1149 <modify-function signature="operator[](int)const" remove="all"/>
1150 1150 <modify-function signature="operator[](uint)" remove="all"/>
1151 1151 <modify-function signature="operator[](uint)const" remove="all"/>
1152 1152 <modify-function signature="push_back(char)" remove="all"/>
1153 1153 <modify-function signature="push_back(const QByteArray&amp;)" remove="all"/>
1154 1154 <modify-function signature="push_back(const char*)" remove="all"/>
1155 1155 <modify-function signature="push_front(char)" remove="all"/>
1156 1156 <modify-function signature="push_front(const QByteArray&amp;)" remove="all"/>
1157 1157 <modify-function signature="push_front(const char*)" remove="all"/>
1158 1158 <modify-function signature="setNum(uint,int)" remove="all"/>
1159 1159 <modify-function signature="setNum(qulonglong,int)" remove="all"/>
1160 1160 <modify-function signature="setNum(ushort,int)" remove="all"/>
1161 1161 <modify-function signature="toLong(bool*, int) const" remove="all"/>
1162 1162 <modify-function signature="toLongLong(bool*, int) const" remove="all"/>
1163 1163 <modify-function signature="toShort(bool*, int) const" remove="all"/>
1164 1164 <modify-function signature="toUInt(bool*, int) const" remove="all"/>
1165 1165 <modify-function signature="toULong(bool*, int) const" remove="all"/>
1166 1166 <modify-function signature="toULongLong(bool*, int) const" remove="all"/>
1167 1167
1168 1168 <!-- functions made private... -->
1169 1169 <modify-function signature="operator=(QByteArray)" access="private"/>
1170 1170 <modify-function signature="operator+=(QByteArray)" remove="all"/>
1171 1171 <modify-function signature="operator+=(QString)" remove="all"/>
1172 1172 <modify-function signature="operator+=(char)" remove="all"/>
1173 1173
1174 1174 <inject-code class="pywrap-h">
1175 1175 PyObject* data(QByteArray* b) {
1176 1176 if (b-&gt;data()) {
1177 1177 return PyString_FromStringAndSize(b-&gt;data(), b-&gt;size());
1178 1178 } else {
1179 1179 Py_INCREF(Py_None);
1180 1180 return Py_None;
1181 1181 }
1182 1182 }
1183 1183 </inject-code>
1184 1184
1185 1185 <inject-code class="native" position="beginning">
1186 1186 Q_DECLARE_METATYPE(QScriptValue)
1187 1187 </inject-code>
1188 1188
1189 1189
1190 1190 <modify-function signature="QByteArray(const char*,int)" remove="all"/>
1191 1191 <modify-function signature="QByteArray(const char*)" remove="all"/>
1192 1192
1193 1193 <modify-function signature="at(int)const">
1194 1194 <modify-argument index="1">
1195 1195 <conversion-rule class="native">
1196 1196 <insert-template name="core.convert_int_arg_and_check_range">
1197 1197 <replace from="%CLASS_NAME%" to="QByteArray"/>
1198 1198 <replace from="%FUNCTION_NAME%" to="at"/>
1199 1199 </insert-template>
1200 1200 </conversion-rule>
1201 1201 </modify-argument>
1202 1202 </modify-function>
1203 1203
1204 1204 <modify-function signature="append(const char *)" remove="all"/>
1205 1205 <modify-function signature="append(QByteArray)">
1206 1206 <modify-argument index="0" replace-value="this"/>
1207 1207 </modify-function>
1208 1208 <modify-function signature="append(QString)">
1209 1209 <modify-argument index="0" replace-value="this"/>
1210 1210 </modify-function>
1211 1211 <modify-function signature="append(const char *)" remove="all">
1212 1212 <modify-argument index="0" replace-value="this"/>
1213 1213 </modify-function>
1214 1214 <modify-function signature="append(char)">
1215 1215 <modify-argument index="0" replace-value="this"/>
1216 1216 <rename to="appendByte"/>
1217 1217 </modify-function>
1218 1218
1219 1219 <modify-function signature="count(const char *)const" remove="all"/>
1220 1220
1221 1221 <modify-function signature="data()" remove="all"/>
1222 1222
1223 1223 <modify-function signature="endsWith(const char *)const" remove="all"/>
1224 1224
1225 1225 <modify-function signature="fill(char,int)">
1226 1226 <modify-argument index="0" replace-value="this"/>
1227 1227 </modify-function>
1228 1228
1229 1229 <modify-function signature="indexOf(const char*,int)const" remove="all"/>
1230 1230 <modify-function signature="indexOf(char,int)const">
1231 1231 <rename to="indexOfByte"/>
1232 1232 </modify-function>
1233 1233
1234 1234 <modify-function signature="insert(int,QByteArray)">
1235 1235 <modify-argument index="0" replace-value="this"/>
1236 1236 </modify-function>
1237 1237 <modify-function signature="insert(int,QString)">
1238 1238 <modify-argument index="0" replace-value="this"/>
1239 1239 </modify-function>
1240 1240 <modify-function signature="insert(int,const char *)" remove="all"/>
1241 1241 <modify-function signature="insert(int,char)">
1242 1242 <modify-argument index="0" replace-value="this"/>
1243 1243 <rename to="insertByte"/>
1244 1244 </modify-function>
1245 1245
1246 1246 <modify-function signature="lastIndexOf(const char*,int)const" remove="all"/>
1247 1247 <modify-function signature="lastIndexOf(char,int)const">
1248 1248 <rename to="lastIndexOfByte"/>
1249 1249 </modify-function>
1250 1250
1251 1251 <modify-function signature="prepend(QByteArray)">
1252 1252 <modify-argument index="0" replace-value="this"/>
1253 1253 </modify-function>
1254 1254 <modify-function signature="prepend(const char *)" remove="all"/>
1255 1255 <modify-function signature="prepend(char)">
1256 1256 <modify-argument index="0" replace-value="this"/>
1257 1257 <rename to="prependByte"/>
1258 1258 </modify-function>
1259 1259
1260 1260 <modify-function signature="remove(int,int)">
1261 1261 <modify-argument index="0" replace-value="this"/>
1262 1262 </modify-function>
1263 1263
1264 1264 <modify-function signature="replace(int,int,QByteArray)">
1265 1265 <modify-argument index="0" replace-value="this"/>
1266 1266 </modify-function>
1267 1267 <modify-function signature="replace(int,int,const char *)" remove="all"/>
1268 1268 <modify-function signature="replace(QByteArray,QByteArray)">
1269 1269 <modify-argument index="0" replace-value="this"/>
1270 1270 </modify-function>
1271 1271 <modify-function signature="replace(const char*,QByteArray)" remove="all"/>
1272 1272 <modify-function signature="replace(QByteArray,const char *)" remove="all"/>
1273 1273 <modify-function signature="replace(QString,QByteArray)">
1274 1274 <modify-argument index="0" replace-value="this"/>
1275 1275 </modify-function>
1276 1276 <modify-function signature="replace(QString,const char *)" remove="all"/>
1277 1277 <modify-function signature="replace(const char *,const char *)" remove="all"/>
1278 1278 <modify-function signature="replace(char,QByteArray)">
1279 1279 <modify-argument index="0" replace-value="this"/>
1280 1280 </modify-function>
1281 1281 <modify-function signature="replace(char,QString)">
1282 1282 <modify-argument index="0" replace-value="this"/>
1283 1283 </modify-function>
1284 1284 <modify-function signature="replace(char,const char *)" remove="all"/>
1285 1285 <modify-function signature="replace(char,char)">
1286 1286 <modify-argument index="0" replace-value="this"/>
1287 1287 </modify-function>
1288 1288
1289 1289 <modify-function signature="startsWith(const char *)const" remove="all"/>
1290 1290
1291 1291 <modify-function signature="fromRawData(const char*,int)" remove="all"/>
1292 1292
1293 1293 <modify-function signature="number(int,int)">
1294 1294 <rename to="fromInt"/>
1295 1295 </modify-function>
1296 1296 <modify-function signature="number(uint,int)">
1297 1297 <rename to="fromUInt"/>
1298 1298 </modify-function>
1299 1299 <modify-function signature="number(qlonglong,int)">
1300 1300 <rename to="fromLongLong"/>
1301 1301 </modify-function>
1302 1302 <modify-function signature="number(qulonglong,int)">
1303 1303 <rename to="fromULongLong"/>
1304 1304 </modify-function>
1305 1305
1306 1306 <modify-function signature="setNum(int,int)">
1307 1307 <modify-argument index="0" replace-value="this"/>
1308 1308 <rename to="setInt"/>
1309 1309 </modify-function>
1310 1310 <modify-function signature="setNum(uint,int)">
1311 1311 <modify-argument index="0" replace-value="this"/>
1312 1312 <rename to="setUInt"/>
1313 1313 </modify-function>
1314 1314 <modify-function signature="setNum(short,int)">
1315 1315 <modify-argument index="0" replace-value="this"/>
1316 1316 <rename to="setShort"/>
1317 1317 </modify-function>
1318 1318 <modify-function signature="setNum(ushort,int)">
1319 1319 <modify-argument index="0" replace-value="this"/>
1320 1320 <rename to="setUShort"/>
1321 1321 </modify-function>
1322 1322 <modify-function signature="setNum(qlonglong,int)">
1323 1323 <modify-argument index="0" replace-value="this"/>
1324 1324 <rename to="setLongLong"/>
1325 1325 </modify-function>
1326 1326 <modify-function signature="setNum(qulonglong,int)">
1327 1327 <modify-argument index="0" replace-value="this"/>
1328 1328 <rename to="setULongLong"/>
1329 1329 </modify-function>
1330 1330 <modify-function signature="setNum(double,char,int)">
1331 1331 <modify-argument index="0" replace-value="this"/>
1332 1332 <rename to="setDouble"/>
1333 1333 </modify-function>
1334 1334 <modify-function signature="setNum(float,char,int)">
1335 1335 <modify-argument index="0" replace-value="this"/>
1336 1336 <rename to="setFloat"/>
1337 1337 </modify-function>
1338 1338
1339 1339 <modify-function signature="toDouble(bool*)const">
1340 1340 <modify-argument index="1">
1341 1341 <remove-default-expression/>
1342 1342 <remove-argument/>
1343 1343 <conversion-rule class="native">
1344 1344 <insert-template name="core.prepare_removed_bool*_argument"/>
1345 1345 </conversion-rule>
1346 1346 </modify-argument>
1347 1347 <modify-argument index="return">
1348 1348 <conversion-rule class="native">
1349 1349 <insert-template name="core.convert_to_null_or_primitive"/>
1350 1350 </conversion-rule>
1351 1351 </modify-argument>
1352 1352 </modify-function>
1353 1353
1354 1354 <modify-function signature="toFloat(bool*)const">
1355 1355 <modify-argument index="1">
1356 1356 <remove-default-expression/>
1357 1357 <remove-argument/>
1358 1358 <conversion-rule class="native">
1359 1359 <insert-template name="core.prepare_removed_bool*_argument"/>
1360 1360 </conversion-rule>
1361 1361 </modify-argument>
1362 1362 <modify-argument index="return">
1363 1363 <conversion-rule class="native">
1364 1364 <insert-template name="core.convert_to_null_or_primitive"/>
1365 1365 </conversion-rule>
1366 1366 </modify-argument>
1367 1367 </modify-function>
1368 1368
1369 1369 <modify-function signature="toInt(bool*,int)const">
1370 1370 <modify-argument index="1">
1371 1371 <remove-default-expression/>
1372 1372 <remove-argument/>
1373 1373 <conversion-rule class="native">
1374 1374 <insert-template name="core.prepare_removed_bool*_argument"/>
1375 1375 </conversion-rule>
1376 1376 </modify-argument>
1377 1377 <modify-argument index="return">
1378 1378 <conversion-rule class="native">
1379 1379 <insert-template name="core.convert_to_null_or_primitive"/>
1380 1380 </conversion-rule>
1381 1381 </modify-argument>
1382 1382 </modify-function>
1383 1383
1384 1384 <modify-function signature="toUShort(bool*,int)const">
1385 1385 <modify-argument index="1">
1386 1386 <remove-default-expression/>
1387 1387 <remove-argument/>
1388 1388 <conversion-rule class="native">
1389 1389 <insert-template name="core.prepare_removed_bool*_argument"/>
1390 1390 </conversion-rule>
1391 1391 </modify-argument>
1392 1392 <modify-argument index="return">
1393 1393 <conversion-rule class="native">
1394 1394 <insert-template name="core.convert_to_null_or_primitive"/>
1395 1395 </conversion-rule>
1396 1396 </modify-argument>
1397 1397 </modify-function>
1398 1398 </value-type>
1399 1399
1400 1400 <value-type name="QTextBoundaryFinder">
1401 1401 <modify-function signature="QTextBoundaryFinder(QTextBoundaryFinder::BoundaryType,const QChar*,int,unsigned char*,int)" remove="all"/>
1402 1402 <modify-function signature="operator=(QTextBoundaryFinder)" remove="all"/>
1403 1403 </value-type>
1404 1404
1405 1405 <value-type name="QEasingCurve">
1406 1406 <modify-function signature="customType()const" remove="all"/>
1407 1407 <modify-function signature="setCustomType(double)" remove="all"/>
1408 1408
1409 1409 <modify-function signature="QEasingCurve(QEasingCurve)" remove="all"/>
1410 1410 <modify-function signature="operator=(QEasingCurve)" remove="all"/>
1411 1411 <modify-function signature="operator==(const QEasingCurve &amp;)const" remove="all"/>
1412 1412 <modify-function signature="operator!=(const QEasingCurve &amp;)const" remove="all"/>
1413 1413 <modify-function signature="setCustomType(double)" remove="all"/>
1414 1414 <modify-function signature="customType()const" remove="all"/>
1415 1415 </value-type>
1416 1416
1417 1417 <object-type name="QAbstractAnimation"/>
1418 1418 <object-type name="QVariantAnimation"/>
1419 1419 <object-type name="QAnimationGroup"/>
1420 1420 <object-type name="QPauseAnimation"/>
1421 1421 <object-type name="QParallelAnimationGroup"/>
1422 1422 <object-type name="QSequentialAnimationGroup"/>
1423 1423 <object-type name="QPropertyAnimation">
1424 1424 <modify-function signature="QPropertyAnimation(QObject*,QByteArray,QObject*)">
1425 1425 <modify-argument index="2">
1426 1426 <replace-type modified-type="QString"/>
1427 1427 <conversion-rule class="native">
1428 1428 <insert-template name="core.convert_string_arg_to_latin1"/>
1429 1429 </conversion-rule>
1430 1430 </modify-argument>
1431 1431 </modify-function>
1432 1432 </object-type>
1433 1433
1434 1434 <object-type name="QAbstractState"/>
1435 1435 <object-type name="QAbstractTransition"/>
1436 1436 <object-type name="QState">
1437 1437 <modify-function signature="addTransition(QObject*,const char*,QAbstractState*)">
1438 1438 <modify-argument index="2">
1439 1439 <replace-type modified-type="QString"/>
1440 1440 <conversion-rule class="native">
1441 1441 <insert-template name="core.convert_string_arg_to_char*"/>
1442 1442 </conversion-rule>
1443 1443 </modify-argument>
1444 1444 </modify-function>
1445 1445 <modify-function signature="assignProperty(QObject*,const char*,QVariant)">
1446 1446 <modify-argument index="2">
1447 1447 <replace-type modified-type="QString"/>
1448 1448 <conversion-rule class="native">
1449 1449 <insert-template name="core.convert_string_arg_to_char*"/>
1450 1450 </conversion-rule>
1451 1451 </modify-argument>
1452 1452 </modify-function>
1453 1453 </object-type>
1454 1454 <object-type name="QStateMachine"/>
1455 1455 <object-type name="QHistoryState"/>
1456 1456 <object-type name="QSignalTransition"/>
1457 1457 <object-type name="QEventTransition"/>
1458 1458 <object-type name="QFinalState"/>
1459 1459
1460 1460 <object-type name="QXmlStreamEntityResolver"/>
1461 1461 <!-- object-type name="QAbstractEventDispatcher"/ -->
1462 1462 <object-type name="QEventLoop"/>
1463 1463 <object-type name="QFile">
1464 1464 <modify-function signature="readLink()const" remove="all"/>
1465 1465 <!--### Obsolete in 4.3-->
1466 1466 <modify-function signature="readLink(QString)" remove="all"/>
1467 1467 <!--### Obsolete in 4.3-->
1468 1468 <modify-function signature="map(qint64,qint64,QFile::MemoryMapFlags)" remove="all"/>
1469 1469 <!-- Can't provide same API and performance -->
1470 1470 <modify-function signature="unmap(uchar*)" remove="all"/>
1471 1471 <!-- Can't provide same API and performance -->
1472 1472
1473 1473 <modify-function signature="open(int,QFlags&lt;QIODevice::OpenModeFlag&gt;)" remove="all"/>
1474 1474 <modify-function signature="decodeName(const char*)" remove="all"/>
1475 1475 <modify-function signature="map(qint64,qint64,QFile::MemoryMapFlags)" remove="all"/>
1476 1476 <modify-function signature="unmap(uchar*)" remove="all"/>
1477 1477 </object-type>
1478 1478
1479 1479 <object-type name="QIODevice">
1480 1480 <modify-function signature="peek(char *,qint64)" remove="all"/>
1481 1481 <modify-function signature="read(char *,qint64)" remove="all"/>
1482 1482 <modify-function signature="readLine(char *,qint64)" remove="all"/>
1483 1483 <modify-function signature="write(const char *,qint64)" remove="all"/>
1484 1484 </object-type>
1485 1485 <object-type name="QStateMachine::SignalEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::StateMachineSignal"/>
1486 1486 <object-type name="QStateMachine::WrappedEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::StateMachineWrapped"/>
1487 1487
1488 1488 <object-type name="QCryptographicHash">
1489 1489 <modify-function signature="addData(const char*,int)" remove="all"/>
1490 1490 </object-type>
1491 1491 <object-type name="QLibraryInfo"/>
1492 1492 <object-type name="QBasicMutex"/>
1493 1493 <object-type name="QMutex"/>
1494 1494 <object-type name="QSemaphore"/>
1495 1495 <object-type name="QSocketNotifier"/>
1496 1496 <object-type name="QSystemLocale"/>
1497 1497 <object-type name="QTemporaryFile">
1498 1498 <modify-function signature="fileName()const" rename="uniqueFilename"/>
1499 1499
1500 1500 <modify-function signature="createLocalFile(QFile&amp;)">
1501 1501 <modify-argument index="1">
1502 1502 <replace-type modified-type="QFile*"/>
1503 1503 <conversion-rule class="native">
1504 1504 QFile &amp; %out% = *qscriptvalue_cast&lt;QFile*&gt;(%in%);
1505 1505 </conversion-rule>
1506 1506 </modify-argument>
1507 1507 </modify-function>
1508 <modify-function signature="createNativeFile(QFile&amp;)">
1509 <modify-argument index="1">
1510 <replace-type modified-type="QFile*"/>
1511 <conversion-rule class="native">
1512 QFile &amp; %out% = *qscriptvalue_cast&lt;QFile*&gt;(%in%);
1513 </conversion-rule>
1514 </modify-argument>
1515 </modify-function>
1516 1508 </object-type>
1517 1509 <object-type name="QMimeData">
1518 1510 <extra-includes>
1519 1511 <include file-name="QStringList" location="global"/>
1520 1512 <include file-name="QUrl" location="global"/>
1521 1513 </extra-includes>
1522 1514 </object-type>
1523 1515 <object-type name="QTextCodec">
1524 1516
1525 1517 <modify-function signature="setCodecForTr(QTextCodec*)">
1526 1518 <access modifier="private"/>
1527 1519 <modify-argument index="1">
1528 1520 <reference-count action="set" variable-name="__rcCodecForTr"/>
1529 1521 </modify-argument>
1530 1522 </modify-function>
1531 1523 <modify-function signature="setCodecForCStrings(QTextCodec*)">
1532 1524 <modify-argument index="1">
1533 1525 <reference-count action="set" variable-name="__rcCodecForCStrings"/>
1534 1526 </modify-argument>
1535 1527 </modify-function>
1536 1528 <modify-function signature="setCodecForLocale(QTextCodec*)">
1537 1529 <modify-argument index="1">
1538 1530 <reference-count action="set" variable-name="__rcCodecForLocale"/>
1539 1531 </modify-argument>
1540 1532 </modify-function>
1541 1533
1542 1534
1543 1535 <modify-function signature="codecForTr()">
1544 1536 <remove/>
1545 1537 </modify-function>
1546 1538
1547 1539 <modify-function signature="QTextCodec()">
1548 1540 <modify-argument index="-1">
1549 1541 <define-ownership class="java" owner="c++"/>
1550 1542 </modify-argument>
1551 1543 </modify-function>
1552 1544
1553 1545 <modify-function signature="fromUnicode(const QChar*,int,QTextCodec::ConverterState*)const">
1554 1546 <remove/>
1555 1547 </modify-function>
1556 1548
1557 1549 <modify-function signature="toUnicode(const char*,int,QTextCodec::ConverterState*)const">
1558 1550 <remove/>
1559 1551 </modify-function>
1560 1552
1561 1553 <modify-function signature="toUnicode(const char*)const">
1562 1554 <remove/>
1563 1555 </modify-function>
1564 1556 </object-type>
1565 1557
1566 1558 <interface-type name="QTextCodecFactoryInterface" java-name="QAbstractTextCodecFactory"/>
1567 1559 <object-type name="QTextCodecPlugin"/>
1568 1560
1569 1561 <object-type name="QTextDecoder">
1570 1562 <modify-function signature="toUnicode(const char*,int)">
1571 1563 <remove/>
1572 1564 </modify-function>
1573 1565 <modify-function signature="toUnicode(QString*,const char*,int)" remove="all"/>
1574 1566 </object-type>
1575 1567 <object-type name="QTextEncoder">
1576 1568 <modify-function signature="fromUnicode(const QChar*,int)">
1577 1569 <remove/>
1578 1570 </modify-function>
1579 1571 </object-type>
1580 1572 <object-type name="QTimeLine"/>
1581 1573 <object-type name="QTranslator">
1582 1574 <modify-function signature="translate(const char*,const char*,const char*,int)const">
1583 1575 <remove/>
1584 1576 </modify-function>
1585 1577 </object-type>
1586 1578
1587 1579 <object-type name="QWaitCondition"/>
1588 1580
1589 1581 <object-type name="QFileSystemWatcher">
1590 1582 <extra-includes>
1591 1583 <include file-name="QStringList" location="global"/>
1592 1584 </extra-includes>
1593 1585 </object-type>
1594 1586
1595 1587 <object-type name="QTextCodec::ConverterState">
1596 1588 <include file-name="QTextCodec" location="global"/>
1597 1589 </object-type>
1598 1590
1599 1591 <object-type name="QBuffer">
1600 1592 <modify-function signature="buffer()">
1601 1593 <remove/>
1602 1594 </modify-function>
1603 1595
1604 1596 <!-- ### modify to return value by pointer? -->
1605 1597 <modify-function signature="buffer()const" remove="all"/>
1606 1598 <modify-function signature="data()const" remove="all"/>
1607 1599
1608 1600 <modify-function signature="setData(const char*,int)" remove="all"/>
1609 1601 </object-type>
1610 1602
1611 1603 <object-type name="QTimer"/>
1612 1604
1613 1605 <object-type name="QAbstractFileEngineHandler">
1614 1606 <modify-function signature="create(const QString &amp;) const">
1615 1607 <modify-argument index="return">
1616 1608 <define-ownership owner="c++" class="shell"/>
1617 1609 </modify-argument>
1618 1610 </modify-function>
1619 1611 </object-type>
1620 1612
1621 1613 <!-- <object-type name="QAbstractFileEngine::MapExtensionOption" /> -->
1622 1614 <!-- <object-type name="QAbstractFileEngine::MapExtensionReturn" /> -->
1623 1615 <!-- <object-type name="QAbstractFileEngine::UnMapExtensionOption" /> -->
1624 1616 <object-type name="QAbstractFileEngine">
1625 1617 <extra-includes>
1626 1618 <include file-name="QDateTime" location="global"/>
1627 1619 </extra-includes>
1628 1620 <modify-function signature="map(qlonglong,qlonglong,QFile::MemoryMapFlags)" remove="all"/>
1629 1621 <modify-function signature="unmap(unsigned char*)" remove="all"/>
1630 1622 </object-type>
1631 1623
1632 1624 <object-type name="QProcess">
1633 1625 <modify-function signature="readChannelMode()const" remove="all"/>
1634 1626 <!--### Obsolete in 4.3-->
1635 1627 <modify-function signature="setReadChannelMode(QProcess::ProcessChannelMode)" remove="all"/>
1636 1628 <!--### Obsolete in 4.3-->
1637 1629 </object-type>
1638 1630
1639 1631 <object-type name="QSignalMapper">
1640 1632 <modify-function signature="mapped(const QString &amp;)">
1641 1633 <rename to="mappedString"/>
1642 1634 </modify-function>
1643 1635 <modify-function signature="mapped(int)">
1644 1636 <rename to="mappedInteger"/>
1645 1637 </modify-function>
1646 1638 <modify-function signature="mapped(QObject *)">
1647 1639 <rename to="mappedQObject"/>
1648 1640 </modify-function>
1649 1641 <modify-function signature="mapped(QWidget *)" remove="all"/>
1650 1642
1651 1643 <modify-function signature="mapping(QWidget*)const" remove="all"/>
1652 1644
1653 1645 <modify-function signature="setMapping(QObject*,QWidget*)" remove="all"/>
1654 1646
1655 1647 <!-- ### overloads -->
1656 1648 <modify-function signature="mapping(int)const">
1657 1649 <rename to="mappingById"/>
1658 1650 </modify-function>
1659 1651 <modify-function signature="mapping(QString)const">
1660 1652 <rename to="mappingByString"/>
1661 1653 </modify-function>
1662 1654 <modify-function signature="mapping(QObject*)const">
1663 1655 <rename to="mappingByObject"/>
1664 1656 </modify-function>
1665 1657 <modify-function signature="setMapping(QObject*,int)">
1666 1658 <rename to="setMappingById"/>
1667 1659 </modify-function>
1668 1660 <modify-function signature="setMapping(QObject*,QString)">
1669 1661 <rename to="setMappingByString"/>
1670 1662 </modify-function>
1671 1663 <modify-function signature="setMapping(QObject*,QObject*)">
1672 1664 <rename to="setMappingByObject"/>
1673 1665 </modify-function>
1674 1666 </object-type>
1675 1667
1676 1668 <object-type name="QObject">
1677 1669 <modify-function signature="childEvent(QChildEvent*)">
1678 1670 <modify-argument index="1" invalidate-after-use="yes"/>
1679 1671 </modify-function>
1680 1672 <modify-function signature="customEvent(QEvent*)">
1681 1673 <modify-argument index="1" invalidate-after-use="yes"/>
1682 1674 </modify-function>
1683 1675 <modify-function signature="event(QEvent*)">
1684 1676 <modify-argument index="1" invalidate-after-use="yes"/>
1685 1677 </modify-function>
1686 1678 <modify-function signature="eventFilter(QObject*,QEvent*)">
1687 1679 <modify-argument index="2" invalidate-after-use="yes"/>
1688 1680 </modify-function>
1689 1681 <modify-function signature="timerEvent(QTimerEvent*)">
1690 1682 <modify-argument index="1" invalidate-after-use="yes"/>
1691 1683 </modify-function>
1692 1684
1693 1685 <modify-function signature="installEventFilter(QObject*)">
1694 1686 <modify-argument index="1">
1695 1687 <reference-count action="add" variable-name="__rcEventFilters"/>
1696 1688 </modify-argument>
1697 1689 </modify-function>
1698 1690 <modify-function signature="removeEventFilter(QObject*)">
1699 1691 <modify-argument index="1">
1700 1692 <reference-count action="remove" variable-name="__rcEventFilters"/>
1701 1693 </modify-argument>
1702 1694 </modify-function>
1703 1695 <modify-function signature="setParent(QObject*)">
1704 1696 <modify-argument index="1">
1705 1697 <reference-count action="ignore"/>
1706 1698 </modify-argument>
1707 1699 </modify-function>
1708 1700
1709 1701 <modify-function signature="deleteLater()">
1710 1702 <rename to="disposeLater"/>
1711 1703 </modify-function>
1712 1704 <!--
1713 1705 <modify-function signature="inherits(const char*)const">
1714 1706 <remove/>
1715 1707 </modify-function>
1716 1708 -->
1717 1709 <modify-function signature="property(const char*)const">
1718 1710 <access modifier="private"/>
1719 1711 </modify-function>
1720 1712
1721 1713 <modify-function signature="setProperty(const char*,QVariant)">
1722 1714 <access modifier="private"/>
1723 1715 </modify-function>
1724 1716
1725 1717
1726 1718 <extra-includes>
1727 1719 <include file-name="QVarLengthArray" location="global"/>
1728 1720 </extra-includes>
1729 1721
1730 1722
1731 1723 <modify-function signature="property(const char*)const">
1732 1724 <modify-argument index="1">
1733 1725 <replace-type modified-type="QString"/>
1734 1726 <conversion-rule class="native">
1735 1727 <insert-template name="core.convert_string_arg_to_char*"/>
1736 1728 </conversion-rule>
1737 1729 </modify-argument>
1738 1730 </modify-function>
1739 1731
1740 1732 <modify-function signature="setProperty(const char*,QVariant)">
1741 1733 <modify-argument index="1">
1742 1734 <replace-type modified-type="QString"/>
1743 1735 <conversion-rule class="native">
1744 1736 <insert-template name="core.convert_string_arg_to_char*"/>
1745 1737 </conversion-rule>
1746 1738 </modify-argument>
1747 1739 </modify-function>
1748 1740
1749 1741 <modify-function signature="inherits(const char*)const">
1750 1742 <modify-argument index="1">
1751 1743 <replace-type modified-type="QString"/>
1752 1744 <conversion-rule class="native">
1753 1745 <insert-template name="core.convert_string_arg_to_char*"/>
1754 1746 </conversion-rule>
1755 1747 </modify-argument>
1756 1748 </modify-function>
1757 1749 </object-type>
1758 1750
1759 1751 <object-type name="QCoreApplication">
1760 1752 <extra-includes>
1761 1753 <include file-name="QStringList" location="global"/>
1762 1754 </extra-includes>
1763 1755
1764 1756 <modify-function signature="argv()" remove="all"/>
1765 1757 <!-- Obsolete -->
1766 1758 <modify-function signature="argc()" remove="all"/>
1767 1759 <!-- Obsolete -->
1768 1760
1769 1761 <modify-function signature="notify(QObject*,QEvent*)">
1770 1762 <modify-argument index="2" invalidate-after-use="yes"/>
1771 1763 </modify-function>
1772 1764
1773 1765
1774 1766 <modify-function signature="QCoreApplication(int &amp;, char **)">
1775 1767 <access modifier="private"/>
1776 1768 </modify-function>
1777 1769 <modify-function signature="removePostedEvents(QObject*)">
1778 1770 <modify-argument index="1">
1779 1771 <reference-count action="ignore"/>
1780 1772 </modify-argument>
1781 1773 </modify-function>
1782 1774 <modify-function signature="removePostedEvents(QObject*,int)">
1783 1775 <modify-argument index="1">
1784 1776 <reference-count action="ignore"/>
1785 1777 </modify-argument>
1786 1778 </modify-function>
1787 1779
1788 1780 <modify-function signature="installTranslator(QTranslator *)">
1789 1781 <modify-argument index="1">
1790 1782 <reference-count action="add" variable-name="__rcTranslators"/>
1791 1783 </modify-argument>
1792 1784 </modify-function>
1793 1785
1794 1786 <modify-function signature="removeTranslator(QTranslator *)">
1795 1787 <modify-argument index="1">
1796 1788 <reference-count action="remove" variable-name="__rcTranslators"/>
1797 1789 </modify-argument>
1798 1790 </modify-function>
1799 1791
1800 1792
1801 1793 <modify-function signature="postEvent(QObject*,QEvent*)">
1802 1794 <modify-argument index="2">
1803 1795 <define-ownership class="java" owner="c++"/>
1804 1796 </modify-argument>
1805 1797 </modify-function>
1806 1798
1807 1799 <modify-function signature="QCoreApplication(int &amp;, char **)" remove="all"/>
1808 1800 <!-- ### arguments() causes a warning: "QScriptValue::setProperty(arguments): cannot change flags of a native property" -->
1809 1801 <modify-function signature="arguments()" remove="all"/>
1810 1802 <modify-function signature="translate(const char*,const char*,const char*,QCoreApplication::Encoding,int)">
1811 1803 <modify-argument index="1">
1812 1804 <replace-type modified-type="QString"/>
1813 1805 <conversion-rule class="native">
1814 1806 <insert-template name="core.convert_string_arg_to_char*"/>
1815 1807 </conversion-rule>
1816 1808 </modify-argument>
1817 1809 <modify-argument index="2">
1818 1810 <replace-type modified-type="QString"/>
1819 1811 <conversion-rule class="native">
1820 1812 <insert-template name="core.convert_string_arg_to_char*"/>
1821 1813 </conversion-rule>
1822 1814 </modify-argument>
1823 1815 <modify-argument index="3">
1824 1816 <replace-type modified-type="QString"/>
1825 1817 <conversion-rule class="native">
1826 1818 <insert-template name="core.convert_string_arg_to_char*"/>
1827 1819 </conversion-rule>
1828 1820 </modify-argument>
1829 1821 </modify-function>
1830 1822 <modify-function signature="translate(const char *,const char *,const char *,QCoreApplication::Encoding)">
1831 1823 <modify-argument index="1">
1832 1824 <replace-type modified-type="QString"/>
1833 1825 <conversion-rule class="native">
1834 1826 <insert-template name="core.convert_string_arg_to_char*"/>
1835 1827 </conversion-rule>
1836 1828 </modify-argument>
1837 1829 <modify-argument index="2">
1838 1830 <replace-type modified-type="QString"/>
1839 1831 <conversion-rule class="native">
1840 1832 <insert-template name="core.convert_string_arg_to_char*"/>
1841 1833 </conversion-rule>
1842 1834 </modify-argument>
1843 1835 <modify-argument index="3">
1844 1836 <replace-type modified-type="QString"/>
1845 1837 <conversion-rule class="native">
1846 1838 <insert-template name="core.convert_string_arg_to_char*"/>
1847 1839 </conversion-rule>
1848 1840 </modify-argument>
1849 1841 </modify-function>
1850 1842
1851 1843 </object-type>
1852 1844
1853 1845 <object-type name="QSettings">
1854 1846 <extra-includes>
1855 1847 <include file-name="QStringList" location="global"/>
1856 1848 </extra-includes>
1857 1849
1858 1850 <modify-function signature="setSystemIniPath(const QString&amp;)" remove="all"/>
1859 1851 <!--### Obsolete in 4.3-->
1860 1852 <modify-function signature="setUserIniPath(const QString&amp;)" remove="all"/>
1861 1853 <!--### Obsolete in 4.3-->
1862 1854 </object-type>
1863 1855
1864 1856 <object-type name="QEvent" polymorphic-base="yes" polymorphic-id-expression="%1-&gt;type() == QEvent::None"/>
1865 1857 <object-type name="QChildEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::ChildAdded || %1-&gt;type() == QEvent::ChildPolished || %1-&gt;type() == QEvent::ChildRemoved">
1866 1858 <modify-field name="c" read="false" write="false"/>
1867 1859 </object-type>
1868 1860 <object-type name="QTimerEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Timer"/>
1869 1861 <object-type name="QDynamicPropertyChangeEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::DynamicPropertyChange"/>
1870 1862
1871 1863 <object-type name="QDataStream">
1872 1864 <modify-function signature="setDevice(QIODevice*)">
1873 1865 <modify-argument index="1">
1874 1866 <reference-count action="set" variable-name="__rcDevice"/>
1875 1867 </modify-argument>
1876 1868 </modify-function>
1877 1869 <!--
1878 1870 <modify-function signature="unsetDevice()">
1879 1871 <inject-code position="end">
1880 1872 __rcDevice = null;
1881 1873 </inject-code>
1882 1874 </modify-function>
1883 1875 -->
1884 1876
1885 1877
1886 1878 <modify-function signature="operator&lt;&lt;(const char*)">
1887 1879 <remove/>
1888 1880 </modify-function>
1889 1881 <modify-function signature="operator&lt;&lt;(unsigned int)">
1890 1882 <remove/>
1891 1883 </modify-function>
1892 1884 <modify-function signature="operator&lt;&lt;(unsigned long long)">
1893 1885 <remove/>
1894 1886 </modify-function>
1895 1887 <modify-function signature="operator&lt;&lt;(unsigned short)">
1896 1888 <remove/>
1897 1889 </modify-function>
1898 1890
1899 1891 <modify-function signature="operator&gt;&gt;(char &amp;*)">
1900 1892 <remove/>
1901 1893 </modify-function>
1902 1894
1903 1895 <modify-function signature="readRawData(char*,int)">
1904 1896 <remove/>
1905 1897 </modify-function>
1906 1898 <modify-function signature="readBytes(char&amp;*,uint&amp;)">
1907 1899 <remove/>
1908 1900 </modify-function>
1909 1901 <modify-function signature="writeRawData(const char*,int)">
1910 1902 <remove/>
1911 1903 </modify-function>
1912 1904 <modify-function signature="writeBytes(const char*,uint)">
1913 1905 <remove/>
1914 1906 </modify-function>
1915 1907
1916 1908 <modify-function signature="operator&gt;&gt;(signed char&amp;)" remove="all"/>
1917 1909 <modify-function signature="operator&lt;&lt;(signed char)" remove="all"/>
1918 1910
1919 1911 <modify-function signature="operator&lt;&lt;(bool)">
1920 1912 <rename to="writeBoolean"/>
1921 1913 <modify-argument index="0" replace-value="this"/>
1922 1914 </modify-function>
1923 1915 <modify-function signature="operator&lt;&lt;(unsigned char)">
1924 1916 <modify-argument index="0" replace-value="this"/>
1925 1917 <rename to="writeByte"/>
1926 1918 </modify-function>
1927 1919 <modify-function signature="operator&lt;&lt;(int)">
1928 1920 <rename to="writeInt"/>
1929 1921 <modify-argument index="0" replace-value="this"/>
1930 1922 </modify-function>
1931 1923 <modify-function signature="operator&lt;&lt;(qint64)">
1932 1924 <rename to="writeLongLong"/>
1933 1925 <modify-argument index="0" replace-value="this"/>
1934 1926 </modify-function>
1935 1927 <modify-function signature="operator&lt;&lt;(float)">
1936 1928 <rename to="writeFloat"/>
1937 1929 <modify-argument index="0" replace-value="this"/>
1938 1930 </modify-function>
1939 1931 <modify-function signature="operator&lt;&lt;(double)">
1940 1932 <rename to="writeDouble"/>
1941 1933 <modify-argument index="0" replace-value="this"/>
1942 1934 </modify-function>
1943 1935 <modify-function signature="operator&lt;&lt;(short)">
1944 1936 <rename to="writeShort"/>
1945 1937 <modify-argument index="0" replace-value="this"/>
1946 1938 </modify-function>
1947 1939
1948 1940 <modify-function signature="operator&gt;&gt;(bool &amp;)">
1949 1941 <rename to="readBoolean"/>
1950 1942 <modify-argument index="1">
1951 1943 <remove-argument/>
1952 1944 <conversion-rule class="native">
1953 1945 bool __result;
1954 1946 bool &amp; %out% = __result;
1955 1947 </conversion-rule>
1956 1948 </modify-argument>
1957 1949 <modify-argument index="0" replace-value="void">
1958 1950 <conversion-rule class="native">
1959 1951 bool %out% = __result;
1960 1952 </conversion-rule>
1961 1953 </modify-argument>
1962 1954 </modify-function>
1963 1955 <modify-function signature="operator&gt;&gt;(unsigned char &amp;)">
1964 1956 <rename to="readByte"/>
1965 1957 <modify-argument index="1">
1966 1958 <remove-argument/>
1967 1959 <conversion-rule class="native">
1968 1960 unsigned char __result;
1969 1961 unsigned char &amp; %out% = __result;
1970 1962 </conversion-rule>
1971 1963 </modify-argument>
1972 1964 <modify-argument index="0" replace-value="void">
1973 1965 <conversion-rule class="native">
1974 1966 int %out% = __result;
1975 1967 </conversion-rule>
1976 1968 </modify-argument>
1977 1969 </modify-function>
1978 1970 <modify-function signature="operator&gt;&gt;(int &amp;)">
1979 1971 <rename to="readInt"/>
1980 1972 <modify-argument index="1">
1981 1973 <remove-argument/>
1982 1974 <conversion-rule class="native">
1983 1975 int __result;
1984 1976 int &amp; %out% = __result;
1985 1977 </conversion-rule>
1986 1978 </modify-argument>
1987 1979 <modify-argument index="0" replace-value="void">
1988 1980 <conversion-rule class="native">
1989 1981 int %out% = __result;
1990 1982 </conversion-rule>
1991 1983 </modify-argument>
1992 1984 </modify-function>
1993 1985 <modify-function signature="operator&gt;&gt;(uint &amp;)">
1994 1986 <rename to="readUInt"/>
1995 1987 <modify-argument index="1">
1996 1988 <remove-argument/>
1997 1989 <conversion-rule class="native">
1998 1990 uint __result;
1999 1991 uint &amp; %out% = __result;
2000 1992 </conversion-rule>
2001 1993 </modify-argument>
2002 1994 <modify-argument index="0" replace-value="void">
2003 1995 <conversion-rule class="native">
2004 1996 uint %out% = __result;
2005 1997 </conversion-rule>
2006 1998 </modify-argument>
2007 1999 </modify-function>
2008 2000 <modify-function signature="operator&gt;&gt;(qint64 &amp;)">
2009 2001 <rename to="readLongLong"/>
2010 2002 <modify-argument index="1">
2011 2003 <remove-argument/>
2012 2004 <conversion-rule class="native">
2013 2005 qint64 __result;
2014 2006 qint64 &amp; %out% = __result;
2015 2007 </conversion-rule>
2016 2008 </modify-argument>
2017 2009 <modify-argument index="0" replace-value="void">
2018 2010 <conversion-rule class="native">
2019 2011 qint64 %out% = __result;
2020 2012 </conversion-rule>
2021 2013 </modify-argument>
2022 2014 </modify-function>
2023 2015 <modify-function signature="operator&gt;&gt;(unsigned long long &amp;)">
2024 2016 <rename to="readULongLong"/>
2025 2017 <modify-argument index="1">
2026 2018 <remove-argument/>
2027 2019 <conversion-rule class="native">
2028 2020 unsigned long long __result;
2029 2021 unsigned long long &amp; %out% = __result;
2030 2022 </conversion-rule>
2031 2023 </modify-argument>
2032 2024 <modify-argument index="0" replace-value="void">
2033 2025 <conversion-rule class="native">
2034 2026 unsigned long long %out% = __result;
2035 2027 </conversion-rule>
2036 2028 </modify-argument>
2037 2029 </modify-function>
2038 2030 <modify-function signature="operator&gt;&gt;(float &amp;)">
2039 2031 <rename to="readFloat"/>
2040 2032 <modify-argument index="1">
2041 2033 <remove-argument/>
2042 2034 <conversion-rule class="native">
2043 2035 float __result;
2044 2036 float &amp; %out% = __result;
2045 2037 </conversion-rule>
2046 2038 </modify-argument>
2047 2039 <modify-argument index="0" replace-value="void">
2048 2040 <conversion-rule class="native">
2049 2041 float %out% = __result;
2050 2042 </conversion-rule>
2051 2043 </modify-argument>
2052 2044 </modify-function>
2053 2045 <modify-function signature="operator&gt;&gt;(double &amp;)">
2054 2046 <rename to="readDouble"/>
2055 2047 <modify-argument index="1">
2056 2048 <remove-argument/>
2057 2049 <conversion-rule class="native">
2058 2050 double __result;
2059 2051 double &amp; %out% = __result;
2060 2052 </conversion-rule>
2061 2053 </modify-argument>
2062 2054 <modify-argument index="0" replace-value="void">
2063 2055 <conversion-rule class="native">
2064 2056 double %out% = __result;
2065 2057 </conversion-rule>
2066 2058 </modify-argument>
2067 2059 </modify-function>
2068 2060 <modify-function signature="operator&gt;&gt;(short &amp;)">
2069 2061 <rename to="readShort"/>
2070 2062 <modify-argument index="1">
2071 2063 <remove-argument/>
2072 2064 <conversion-rule class="native">
2073 2065 short __result;
2074 2066 short &amp; %out% = __result;
2075 2067 </conversion-rule>
2076 2068 </modify-argument>
2077 2069 <modify-argument index="0" replace-value="void">
2078 2070 <conversion-rule class="native">
2079 2071 short %out% = __result;
2080 2072 </conversion-rule>
2081 2073 </modify-argument>
2082 2074 </modify-function>
2083 2075 <modify-function signature="operator&gt;&gt;(unsigned short &amp;)">
2084 2076 <rename to="readUShort"/>
2085 2077 <modify-argument index="1">
2086 2078 <remove-argument/>
2087 2079 <conversion-rule class="native">
2088 2080 unsigned short __result;
2089 2081 unsigned short &amp; %out% = __result;
2090 2082 </conversion-rule>
2091 2083 </modify-argument>
2092 2084 <modify-argument index="0" replace-value="void">
2093 2085 <conversion-rule class="native">
2094 2086 unsigned short %out% = __result;
2095 2087 </conversion-rule>
2096 2088 </modify-argument>
2097 2089 </modify-function>
2098 2090 </object-type>
2099 2091
2100 2092 <object-type name="QFSFileEngine">
2101 2093 <extra-includes>
2102 2094 <include file-name="QDateTime" location="global"/>
2103 2095 </extra-includes>
2104 2096 </object-type>
2105 2097
2106 2098 <object-type name="QTextStream">
2107 2099 <modify-function signature="QTextStream(QByteArray *, QFlags&lt;QIODevice::OpenModeFlag&gt;)">
2108 2100 <remove/>
2109 2101 </modify-function>
2110 2102 <modify-function signature="QTextStream(QString*,QFlags&lt;QIODevice::OpenModeFlag&gt;)">
2111 2103 <remove/>
2112 2104 </modify-function>
2113 2105 <modify-function signature="operator&gt;&gt;(QChar&amp;)">
2114 2106 <remove/>
2115 2107 </modify-function>
2116 2108 <modify-function signature="operator&lt;&lt;(const void*)">
2117 2109 <remove/>
2118 2110 </modify-function>
2119 2111 <modify-function signature="operator&lt;&lt;(unsigned int)">
2120 2112 <remove/>
2121 2113 </modify-function>
2122 2114 <modify-function signature="operator&lt;&lt;(qlonglong)">
2123 2115 <remove/>
2124 2116 </modify-function>
2125 2117 <modify-function signature="operator&lt;&lt;(const QChar &amp;)">
2126 2118 <remove/>
2127 2119 </modify-function>
2128 2120 <modify-function signature="operator&lt;&lt;(unsigned long)">
2129 2121 <remove/>
2130 2122 </modify-function>
2131 2123 <modify-function signature="operator&lt;&lt;(signed long)">
2132 2124 <remove/>
2133 2125 </modify-function>
2134 2126 <modify-function signature="operator&lt;&lt;(const char*)">
2135 2127 <remove/>
2136 2128 </modify-function>
2137 2129 <modify-function signature="operator&lt;&lt;(unsigned short)">
2138 2130 <remove/>
2139 2131 </modify-function>
2140 2132 <modify-function signature="operator&gt;&gt;(qulonglong&amp;)">
2141 2133 <remove/>
2142 2134 </modify-function>
2143 2135 <modify-function signature="operator&gt;&gt;(ulong&amp;)">
2144 2136 <remove/>
2145 2137 </modify-function>
2146 2138 <modify-function signature="operator&lt;&lt;(const QLatin1String &amp;)">
2147 2139 <remove/>
2148 2140 </modify-function>
2149 2141 <modify-function signature="setString(QString*,QFlags&lt;QIODevice::OpenModeFlag&gt;)">
2150 2142 <remove/>
2151 2143 </modify-function>
2152 2144 <modify-function signature="string()const">
2153 2145 <remove/>
2154 2146 </modify-function>
2155 2147 <modify-function signature="operator&gt;&gt;(signed long&amp;)">
2156 2148 <remove/>
2157 2149 </modify-function>
2158 2150 <modify-function signature="operator&gt;&gt;(char*)">
2159 2151 <remove/>
2160 2152 </modify-function>
2161 2153 <modify-function signature="operator&gt;&gt;(QByteArray&amp;)">
2162 2154 <remove/>
2163 2155 </modify-function>
2164 2156 <modify-function signature="operator&gt;&gt;(QString&amp;)">
2165 2157 <remove/>
2166 2158 </modify-function>
2167 2159
2168 2160
2169 2161 <modify-function signature="setCodec(QTextCodec *)">
2170 2162 <modify-argument index="1">
2171 2163 <reference-count action="set" variable-name="__rcCodec"/>
2172 2164 </modify-argument>
2173 2165 </modify-function>
2174 2166
2175 2167 <modify-function signature="QTextStream(QIODevice *)">
2176 2168 <modify-argument index="1">
2177 2169 <reference-count action="set" variable-name="__rcDevice"/>
2178 2170 </modify-argument>
2179 2171 </modify-function>
2180 2172 <modify-function signature="setDevice(QIODevice *)">
2181 2173 <modify-argument index="1">
2182 2174 <reference-count action="set" variable-name="__rcDevice"/>
2183 2175 </modify-argument>
2184 2176 </modify-function>
2185 2177
2186 2178 <modify-function signature="setCodec(const char *)">
2187 2179 <modify-argument index="1">
2188 2180 <replace-type modified-type="QString"/>
2189 2181 <conversion-rule class="native">
2190 2182 <insert-template name="core.convert_string_arg_to_char*"/>
2191 2183 </conversion-rule>
2192 2184 </modify-argument>
2193 2185 </modify-function>
2194 2186
2195 2187 <modify-function signature="operator&lt;&lt;(QBool)">
2196 2188 <rename to="writeBoolean"/>
2197 2189 <modify-argument index="0" replace-value="this"/>
2198 2190 </modify-function>
2199 2191 <modify-function signature="operator&lt;&lt;(char)">
2200 2192 <modify-argument index="0" replace-value="this"/>
2201 2193 <rename to="writeByte"/>
2202 2194 </modify-function>
2203 2195 <modify-function signature="operator&lt;&lt;(signed int)">
2204 2196 <rename to="writeInt"/>
2205 2197 <modify-argument index="0" replace-value="this"/>
2206 2198 </modify-function>
2207 2199 <modify-function signature="operator&lt;&lt;(qlonglong)">
2208 2200 <rename to="writeLongLong"/>
2209 2201 <modify-argument index="0" replace-value="this"/>
2210 2202 </modify-function>
2211 2203 <modify-function signature="operator&lt;&lt;(float)">
2212 2204 <rename to="writeFloat"/>
2213 2205 <modify-argument index="0" replace-value="this"/>
2214 2206 </modify-function>
2215 2207 <modify-function signature="operator&lt;&lt;(double)">
2216 2208 <rename to="writeDouble"/>
2217 2209 <modify-argument index="0" replace-value="this"/>
2218 2210 </modify-function>
2219 2211 <modify-function signature="operator&lt;&lt;(signed short)">
2220 2212 <rename to="writeShort"/>
2221 2213 <modify-argument index="0" replace-value="this"/>
2222 2214 </modify-function>
2223 2215 <modify-function signature="operator&lt;&lt;(const QByteArray&amp;)">
2224 2216 <rename to="writeByteArray"/>
2225 2217 <modify-argument index="0" replace-value="this"/>
2226 2218 </modify-function>
2227 2219 <modify-function signature="operator&lt;&lt;(const QString&amp;)">
2228 2220 <rename to="writeString"/>
2229 2221 <modify-argument index="0" replace-value="this"/>
2230 2222 </modify-function>
2231 2223
2232 2224 <modify-function signature="operator&gt;&gt;(char&amp;)">
2233 2225 <rename to="readByte"/>
2234 2226 <modify-argument index="1">
2235 2227 <remove-argument/>
2236 2228 <conversion-rule class="native">
2237 2229 char __result;
2238 2230 char &amp; %out% = __result;
2239 2231 </conversion-rule>
2240 2232 </modify-argument>
2241 2233 <modify-argument index="0" replace-value="void">
2242 2234 <conversion-rule class="native">
2243 2235 int %out% = __result;
2244 2236 </conversion-rule>
2245 2237 </modify-argument>
2246 2238 </modify-function>
2247 2239 <modify-function signature="operator&gt;&gt;(signed short&amp;)">
2248 2240 <rename to="readShort"/>
2249 2241 <modify-argument index="1">
2250 2242 <remove-argument/>
2251 2243 <conversion-rule class="native">
2252 2244 short __result;
2253 2245 short &amp; %out% = __result;
2254 2246 </conversion-rule>
2255 2247 </modify-argument>
2256 2248 <modify-argument index="0" replace-value="void">
2257 2249 <conversion-rule class="native">
2258 2250 short %out% = __result;
2259 2251 </conversion-rule>
2260 2252 </modify-argument>
2261 2253 </modify-function>
2262 2254 <modify-function signature="operator&gt;&gt;(signed int&amp;)">
2263 2255 <rename to="readInt"/>
2264 2256 <modify-argument index="1">
2265 2257 <remove-argument/>
2266 2258 <conversion-rule class="native">
2267 2259 int __result;
2268 2260 int &amp; %out% = __result;
2269 2261 </conversion-rule>
2270 2262 </modify-argument>
2271 2263 <modify-argument index="0" replace-value="void">
2272 2264 <conversion-rule class="native">
2273 2265 int %out% = __result;
2274 2266 </conversion-rule>
2275 2267 </modify-argument>
2276 2268 </modify-function>
2277 2269 <modify-function signature="operator&gt;&gt;(unsigned short&amp;)">
2278 2270 <rename to="readUShort"/>
2279 2271 <modify-argument index="1">
2280 2272 <remove-argument/>
2281 2273 <conversion-rule class="native">
2282 2274 unsigned short __result;
2283 2275 unsigned short &amp; %out% = __result;
2284 2276 </conversion-rule>
2285 2277 </modify-argument>
2286 2278 <modify-argument index="0" replace-value="void">
2287 2279 <conversion-rule class="native">
2288 2280 unsigned short %out% = __result;
2289 2281 </conversion-rule>
2290 2282 </modify-argument>
2291 2283 </modify-function>
2292 2284 <modify-function signature="operator&gt;&gt;(unsigned int&amp;)">
2293 2285 <rename to="readUInt"/>
2294 2286 <modify-argument index="1">
2295 2287 <remove-argument/>
2296 2288 <conversion-rule class="native">
2297 2289 unsigned int __result;
2298 2290 unsigned int &amp; %out% = __result;
2299 2291 </conversion-rule>
2300 2292 </modify-argument>
2301 2293 <modify-argument index="0" replace-value="void">
2302 2294 <conversion-rule class="native">
2303 2295 unsigned int %out% = __result;
2304 2296 </conversion-rule>
2305 2297 </modify-argument>
2306 2298 </modify-function>
2307 2299 <modify-function signature="operator&gt;&gt;(qlonglong&amp;)">
2308 2300 <rename to="readLongLong"/>
2309 2301 <modify-argument index="1">
2310 2302 <remove-argument/>
2311 2303 <conversion-rule class="native">
2312 2304 qlonglong __result;
2313 2305 qlonglong &amp; %out% = __result;
2314 2306 </conversion-rule>
2315 2307 </modify-argument>
2316 2308 <modify-argument index="0" replace-value="void">
2317 2309 <conversion-rule class="native">
2318 2310 qlonglong %out% = __result;
2319 2311 </conversion-rule>
2320 2312 </modify-argument>
2321 2313 </modify-function>
2322 2314 <modify-function signature="operator&gt;&gt;(qulonglong&amp;)">
2323 2315 <rename to="readULongLong"/>
2324 2316 <modify-argument index="1">
2325 2317 <remove-argument/>
2326 2318 <conversion-rule class="native">
2327 2319 qulonglong __result;
2328 2320 qulonglong &amp; %out% = __result;
2329 2321 </conversion-rule>
2330 2322 </modify-argument>
2331 2323 <modify-argument index="0" replace-value="void">
2332 2324 <conversion-rule class="native">
2333 2325 qulonglong %out% = __result;
2334 2326 </conversion-rule>
2335 2327 </modify-argument>
2336 2328 </modify-function>
2337 2329 <modify-function signature="operator&gt;&gt;(float&amp;)">
2338 2330 <rename to="readFloat"/>
2339 2331 <modify-argument index="1">
2340 2332 <remove-argument/>
2341 2333 <conversion-rule class="native">
2342 2334 float __result;
2343 2335 float &amp; %out% = __result;
2344 2336 </conversion-rule>
2345 2337 </modify-argument>
2346 2338 <modify-argument index="0" replace-value="void">
2347 2339 <conversion-rule class="native">
2348 2340 float %out% = __result;
2349 2341 </conversion-rule>
2350 2342 </modify-argument>
2351 2343 </modify-function>
2352 2344 <modify-function signature="operator&gt;&gt;(double&amp;)">
2353 2345 <rename to="readDouble"/>
2354 2346 <modify-argument index="1">
2355 2347 <remove-argument/>
2356 2348 <conversion-rule class="native">
2357 2349 double __result;
2358 2350 double &amp; %out% = __result;
2359 2351 </conversion-rule>
2360 2352 </modify-argument>
2361 2353 <modify-argument index="0" replace-value="void">
2362 2354 <conversion-rule class="native">
2363 2355 double %out% = __result;
2364 2356 </conversion-rule>
2365 2357 </modify-argument>
2366 2358 </modify-function>
2367 2359
2368 2360 <modify-function signature="operator&lt;&lt;(qulonglong)" remove="all"/>
2369 2361 <modify-function signature="operator&gt;&gt;(qulonglong&amp;)" remove="all"/>
2370 2362 </object-type>
2371 2363
2372 2364 <object-type name="QSystemSemaphore"/>
2373 2365
2374 2366 <namespace-type name="QtConcurrent" target-type="class">
2375 2367 <extra-includes>
2376 2368 <include file-name="qtconcurrentreducekernel.h" location="global"/>
2377 2369 <include file-name="qtconcurrentthreadengine.h" location="global"/>
2378 2370 </extra-includes>
2379 2371 </namespace-type>
2380 2372
2381 2373 <value-type name="QFuture" generate="no">
2382 2374 <modify-function signature="operator T() const" remove="all"/>
2383 2375 <modify-function signature="operator=(const QFuture &amp;)" remove="all"/>
2384 2376 </value-type>
2385 2377 <value-type name="QtScriptVoidFuture" java-name="QFutureVoid">
2386 2378 <modify-function signature="resultCount()const" remove="all"/>
2387 2379 <modify-function signature="isResultReadyAt(int)const" remove="all"/>
2388 2380
2389 2381 <modify-function signature="operator==(const QFuture &amp;)const">
2390 2382 <modify-argument index="1">
2391 2383 <replace-type modified-type="QtScriptVoidFuture*"/>
2392 2384 <conversion-rule class="native">
2393 2385 const QtScriptVoidFuture &amp; %out% = *qscriptvalue_cast&lt;QtScriptVoidFuture*&gt;(%in%);
2394 2386 </conversion-rule>
2395 2387 </modify-argument>
2396 2388 </modify-function>
2397 2389 <modify-function signature="QFuture(const QFuture &amp;)">
2398 2390 <modify-argument index="1">
2399 2391 <replace-type modified-type="QtScriptVoidFuture*"/>
2400 2392 <conversion-rule class="native">
2401 2393 const QtScriptVoidFuture &amp; %out% = *qscriptvalue_cast&lt;QtScriptVoidFuture*&gt;(%in%);
2402 2394 </conversion-rule>
2403 2395 </modify-argument>
2404 2396 </modify-function>
2405 2397 </value-type>
2406 2398 <value-type name="QtScriptFuture" java-name="QFuture" generic-class="yes">
2407 2399 <modify-function signature="operator==(const QFuture &amp;)const">
2408 2400 <modify-argument index="1">
2409 2401 <replace-type modified-type="QtScriptFuture*"/>
2410 2402 <conversion-rule class="native">
2411 2403 const QtScriptFuture &amp; %out% = *qscriptvalue_cast&lt;QtScriptFuture*&gt;(%in%);
2412 2404 </conversion-rule>
2413 2405 </modify-argument>
2414 2406 </modify-function>
2415 2407 <modify-function signature="QFuture(const QFuture &amp;)">
2416 2408 <modify-argument index="1">
2417 2409 <replace-type modified-type="QtScriptFuture"/>
2418 2410 <conversion-rule class="native">
2419 2411 const QtScriptFuture &amp; %out% = *qscriptvalue_cast&lt;QtScriptFuture*&gt;(%in%);
2420 2412 </conversion-rule>
2421 2413 </modify-argument>
2422 2414 </modify-function>
2423 2415 <inject-code class="native">
2424 2416 </inject-code>
2425 2417 </value-type>
2426 2418
2427 2419 <object-type name="QFutureWatcherBase">
2428 2420 <modify-function signature="connectNotify(const char *)" remove="all"/>
2429 2421 <modify-function signature="disconnectNotify(const char *)" remove="all"/>
2430 2422 </object-type>
2431 2423 <object-type name="QtScriptVoidFutureWatcher" java-name="QFutureWatcherVoid">
2432 2424 <modify-function signature="setFuture(const QFuture &amp;)">
2433 2425 <modify-argument index="1">
2434 2426 <replace-type modified-type="QtScriptVoidFuture*"/>
2435 2427 <conversion-rule class="native">
2436 2428 const QtScriptVoidFuture &amp; %out% = *qscriptvalue_cast&lt;QtScriptVoidFuture*&gt;(%in%);
2437 2429 </conversion-rule>
2438 2430 </modify-argument>
2439 2431 </modify-function>
2440 2432 </object-type>
2441 2433
2442 2434 <object-type name="QFutureWatcher" generate="no">
2443 2435 <modify-function signature="future()const" remove="all"/>
2444 2436 </object-type>
2445 2437 <object-type name="QtScriptFutureWatcher" java-name="QFutureWatcher" generic-class="yes">
2446 2438 <modify-function signature="setFuture(const QFuture &amp;)">
2447 2439 <modify-argument index="1">
2448 2440 <replace-type modified-type="QtScriptFuture*"/>
2449 2441 <conversion-rule class="native">
2450 2442 const QtScriptFuture &amp; %out% = *qscriptvalue_cast&lt;QtScriptFuture*&gt;(%in%);
2451 2443 </conversion-rule>
2452 2444 </modify-argument>
2453 2445 </modify-function>
2454 2446 </object-type>
2455 2447
2456 2448 <object-type name="QFutureSynchronizer" generate="no"/>
2457 2449 <object-type name="QtScriptFutureSynchronizer" generic-class="yes" java-name="QFutureSynchronizer">
2458 2450 <modify-function signature="QFutureSynchronizer(const QFuture &amp;)">
2459 2451 <modify-argument index="1">
2460 2452 <replace-type modified-type="QtScriptFuture*"/>
2461 2453 <conversion-rule class="native">
2462 2454 const QtScriptFuture &amp; %out% = *qscriptvalue_cast&lt;QtScriptFuture*&gt;(%in%);
2463 2455 </conversion-rule>
2464 2456 </modify-argument>
2465 2457 </modify-function>
2466 2458 <modify-function signature="addFuture(const QFuture &amp;)">
2467 2459 <modify-argument index="1">
2468 2460 <replace-type modified-type="QtScriptFuture*"/>
2469 2461 <conversion-rule class="native">
2470 2462 const QtScriptFuture &amp; %out% = *qscriptvalue_cast&lt;QtScriptFuture*&gt;(%in%);
2471 2463 </conversion-rule>
2472 2464 </modify-argument>
2473 2465 </modify-function>
2474 2466 <modify-function signature="setFuture(const QFuture &amp;)">
2475 2467 <modify-argument index="1">
2476 2468 <replace-type modified-type="QtScriptFuture*"/>
2477 2469 <conversion-rule class="native">
2478 2470 const QtScriptFuture &amp; %out% = *qscriptvalue_cast&lt;QtScriptFuture*&gt;(%in%);
2479 2471 </conversion-rule>
2480 2472 </modify-argument>
2481 2473 </modify-function>
2482 2474 <modify-function signature="futures()const" remove="all"/>
2483 2475 </object-type>
2484 2476 <object-type name="QtScriptVoidFutureSynchronizer" java-name="QFutureSynchronizerVoid">
2485 2477 <modify-function signature="QFutureSynchronizer(const QFuture &amp;)">
2486 2478 <modify-argument index="1">
2487 2479 <replace-type modified-type="QtScriptVoidFuture*"/>
2488 2480 <conversion-rule class="native">
2489 2481 const QtScriptVoidFuture &amp; %out% = *qscriptvalue_cast&lt;QtScriptVoidFuture*&gt;(%in%);
2490 2482 </conversion-rule>
2491 2483 </modify-argument>
2492 2484 </modify-function>
2493 2485 <modify-function signature="addFuture(const QFuture &amp;)">
2494 2486 <modify-argument index="1">
2495 2487 <replace-type modified-type="QtScriptVoidFuture*"/>
2496 2488 <conversion-rule class="native">
2497 2489 const QtScriptVoidFuture &amp; %out% = *qscriptvalue_cast&lt;QtScriptVoidFuture*&gt;(%in%);
2498 2490 </conversion-rule>
2499 2491 </modify-argument>
2500 2492 </modify-function>
2501 2493 <modify-function signature="setFuture(const QFuture &amp;)">
2502 2494 <modify-argument index="1">
2503 2495 <replace-type modified-type="QtScriptVoidFuture*"/>
2504 2496 <conversion-rule class="native">
2505 2497 const QtScriptVoidFuture &amp; %out% = *qscriptvalue_cast&lt;QtScriptVoidFuture*&gt;(%in%);
2506 2498 </conversion-rule>
2507 2499 </modify-argument>
2508 2500 </modify-function>
2509 2501 <modify-function signature="futures()const" remove="all"/>
2510 2502 </object-type>
2511 2503 <object-type name="QThreadPool"/>
2512 2504
2513 2505 <object-type name="QFutureIterator" generate="no">
2514 2506 <modify-function signature="operator=(const QFuture&amp;)" remove="all"/>
2515 2507 </object-type>
2516 2508 <object-type name="QtScriptFutureIterator" generic-class="yes" java-name="QFutureIterator">
2517 2509 <modify-function signature="QFutureIterator(const QFuture &amp;)">
2518 2510 <modify-argument index="1">
2519 2511 <replace-type modified-type="QtScriptFuture*"/>
2520 2512 <conversion-rule class="native">
2521 2513 const QtScriptFuture &amp; %out% = *qscriptvalue_cast&lt;QtScriptFuture*&gt;(%in%);
2522 2514 </conversion-rule>
2523 2515 </modify-argument>
2524 2516 </modify-function>
2525 2517 </object-type>
2526 2518 <object-type name="QRunnable"/>
2527 2519
2528 2520
2529 2521 <value-type name="QXmlStreamAttribute">
2530 2522 <modify-function signature="operator=(QXmlStreamAttribute)" remove="all"/>
2531 2523
2532 2524 <modify-function signature="name()const">
2533 2525 <modify-argument index="return">
2534 2526 <conversion-rule class="native">
2535 2527 <insert-template name="core.convert_stringref_to_string"/>
2536 2528 </conversion-rule>
2537 2529 </modify-argument>
2538 2530 </modify-function>
2539 2531
2540 2532 <modify-function signature="namespaceUri()const">
2541 2533 <modify-argument index="return">
2542 2534 <conversion-rule class="native">
2543 2535 <insert-template name="core.convert_stringref_to_string"/>
2544 2536 </conversion-rule>
2545 2537 </modify-argument>
2546 2538 </modify-function>
2547 2539
2548 2540 <modify-function signature="prefix()const">
2549 2541 <modify-argument index="return">
2550 2542 <conversion-rule class="native">
2551 2543 <insert-template name="core.convert_stringref_to_string"/>
2552 2544 </conversion-rule>
2553 2545 </modify-argument>
2554 2546 </modify-function>
2555 2547
2556 2548 <modify-function signature="qualifiedName()const">
2557 2549 <modify-argument index="return">
2558 2550 <conversion-rule class="native">
2559 2551 <insert-template name="core.convert_stringref_to_string"/>
2560 2552 </conversion-rule>
2561 2553 </modify-argument>
2562 2554 </modify-function>
2563 2555
2564 2556 <modify-function signature="value()const">
2565 2557 <modify-argument index="return">
2566 2558 <conversion-rule class="native">
2567 2559 <insert-template name="core.convert_stringref_to_string"/>
2568 2560 </conversion-rule>
2569 2561 </modify-argument>
2570 2562 </modify-function>
2571 2563
2572 2564 </value-type>
2573 2565 <value-type name="QXmlStreamAttributes">
2574 2566 <modify-function signature="operator+(QVector&lt;QXmlStreamAttribute&gt;)const" remove="all"/>
2575 2567 <modify-function signature="operator&lt;&lt;(QVector&lt;QXmlStreamAttribute&gt;)" remove="all"/>
2576 2568 <modify-function signature="operator&lt;&lt;(QXmlStreamAttribute)" remove="all"/>
2577 2569 <modify-function signature="push_back(QXmlStreamAttribute)" remove="all"/>
2578 2570 <modify-function signature="pop_back()" remove="all"/>
2579 2571 <modify-function signature="push_front(QXmlStreamAttribute)" remove="all"/>
2580 2572 <modify-function signature="pop_front()" remove="all"/>
2581 2573
2582 2574 <modify-function signature="value(const QString &amp;, const QLatin1String &amp;)const">
2583 2575 <remove/>
2584 2576 </modify-function>
2585 2577 <modify-function signature="value(const QLatin1String &amp;, const QLatin1String &amp;)const">
2586 2578 <remove/>
2587 2579 </modify-function>
2588 2580 <modify-function signature="value(const QLatin1String &amp;)const">
2589 2581 <remove/>
2590 2582 </modify-function>
2591 2583 <modify-function signature="hasAttribute(const QLatin1String &amp;)const">
2592 2584 <remove/>
2593 2585 </modify-function>
2594 2586
2595 2587
2596 2588 <modify-function signature="value(QString,QString)const">
2597 2589 <modify-argument index="return">
2598 2590 <conversion-rule class="native">
2599 2591 <insert-template name="core.convert_stringref_to_string"/>
2600 2592 </conversion-rule>
2601 2593 </modify-argument>
2602 2594 </modify-function>
2603 2595
2604 2596 <modify-function signature="value(QString)const">
2605 2597 <modify-argument index="return">
2606 2598 <conversion-rule class="native">
2607 2599 <insert-template name="core.convert_stringref_to_string"/>
2608 2600 </conversion-rule>
2609 2601 </modify-argument>
2610 2602 </modify-function>
2611 2603
2612 2604 </value-type>
2613 2605 <value-type name="QXmlStreamNamespaceDeclaration">
2614 2606 <modify-function signature="operator=(QXmlStreamNamespaceDeclaration)" remove="all"/>
2615 2607
2616 2608 <modify-function signature="namespaceUri()const">
2617 2609 <modify-argument index="return">
2618 2610 <conversion-rule class="native">
2619 2611 <insert-template name="core.convert_stringref_to_string"/>
2620 2612 </conversion-rule>
2621 2613 </modify-argument>
2622 2614 </modify-function>
2623 2615
2624 2616 <modify-function signature="prefix()const">
2625 2617 <modify-argument index="return">
2626 2618 <conversion-rule class="native">
2627 2619 <insert-template name="core.convert_stringref_to_string"/>
2628 2620 </conversion-rule>
2629 2621 </modify-argument>
2630 2622 </modify-function>
2631 2623
2632 2624 </value-type>
2633 2625 <value-type name="QXmlStreamNotationDeclaration">
2634 2626 <modify-function signature="operator=(QXmlStreamNotationDeclaration)" remove="all"/>
2635 2627
2636 2628 <modify-function signature="name()const">
2637 2629 <modify-argument index="return">
2638 2630 <conversion-rule class="native">
2639 2631 <insert-template name="core.convert_stringref_to_string"/>
2640 2632 </conversion-rule>
2641 2633 </modify-argument>
2642 2634 </modify-function>
2643 2635
2644 2636 <modify-function signature="publicId()const">
2645 2637 <modify-argument index="return">
2646 2638 <conversion-rule class="native">
2647 2639 <insert-template name="core.convert_stringref_to_string"/>
2648 2640 </conversion-rule>
2649 2641 </modify-argument>
2650 2642 </modify-function>
2651 2643
2652 2644 <modify-function signature="systemId()const">
2653 2645 <modify-argument index="return">
2654 2646 <conversion-rule class="native">
2655 2647 <insert-template name="core.convert_stringref_to_string"/>
2656 2648 </conversion-rule>
2657 2649 </modify-argument>
2658 2650 </modify-function>
2659 2651
2660 2652 </value-type>
2661 2653 <value-type name="QXmlStreamEntityDeclaration">
2662 2654 <modify-function signature="operator=(QXmlStreamEntityDeclaration)" remove="all"/>
2663 2655
2664 2656 <modify-function signature="name()const">
2665 2657 <modify-argument index="return">
2666 2658 <conversion-rule class="native">
2667 2659 <insert-template name="core.convert_stringref_to_string"/>
2668 2660 </conversion-rule>
2669 2661 </modify-argument>
2670 2662 </modify-function>
2671 2663
2672 2664 <modify-function signature="notationName()const">
2673 2665 <modify-argument index="return">
2674 2666 <conversion-rule class="native">
2675 2667 <insert-template name="core.convert_stringref_to_string"/>
2676 2668 </conversion-rule>
2677 2669 </modify-argument>
2678 2670 </modify-function>
2679 2671
2680 2672 <modify-function signature="publicId()const">
2681 2673 <modify-argument index="return">
2682 2674 <conversion-rule class="native">
2683 2675 <insert-template name="core.convert_stringref_to_string"/>
2684 2676 </conversion-rule>
2685 2677 </modify-argument>
2686 2678 </modify-function>
2687 2679
2688 2680 <modify-function signature="systemId()const">
2689 2681 <modify-argument index="return">
2690 2682 <conversion-rule class="native">
2691 2683 <insert-template name="core.convert_stringref_to_string"/>
2692 2684 </conversion-rule>
2693 2685 </modify-argument>
2694 2686 </modify-function>
2695 2687
2696 2688 <modify-function signature="value()const">
2697 2689 <modify-argument index="return">
2698 2690 <conversion-rule class="native">
2699 2691 <insert-template name="core.convert_stringref_to_string"/>
2700 2692 </conversion-rule>
2701 2693 </modify-argument>
2702 2694 </modify-function>
2703 2695
2704 2696 </value-type>
2705 2697 <object-type name="QXmlStreamReader">
2706 2698 <modify-function signature="QXmlStreamReader(const char*)" remove="all"/>
2707 2699 <modify-function signature="addData(const char*)" remove="all"/>
2708 2700 <modify-function signature="setEntityResolver(QXmlStreamEntityResolver*)">
2709 2701 <modify-argument index="1">
2710 2702 <reference-count action="set" variable-name="__rcEntityResolver"/>
2711 2703 </modify-argument>
2712 2704 </modify-function>
2713 2705
2714 2706 <modify-function signature="name()const">
2715 2707 <modify-argument index="return">
2716 2708 <conversion-rule class="native">
2717 2709 <insert-template name="core.convert_stringref_to_string"/>
2718 2710 </conversion-rule>
2719 2711 </modify-argument>
2720 2712 </modify-function>
2721 2713
2722 2714 <modify-function signature="documentEncoding()const">
2723 2715 <modify-argument index="return">
2724 2716 <conversion-rule class="native">
2725 2717 <insert-template name="core.convert_stringref_to_string"/>
2726 2718 </conversion-rule>
2727 2719 </modify-argument>
2728 2720 </modify-function>
2729 2721
2730 2722 <modify-function signature="documentVersion()const">
2731 2723 <modify-argument index="return">
2732 2724 <conversion-rule class="native">
2733 2725 <insert-template name="core.convert_stringref_to_string"/>
2734 2726 </conversion-rule>
2735 2727 </modify-argument>
2736 2728 </modify-function>
2737 2729
2738 2730 <modify-function signature="dtdName()const">
2739 2731 <modify-argument index="return">
2740 2732 <conversion-rule class="native">
2741 2733 <insert-template name="core.convert_stringref_to_string"/>
2742 2734 </conversion-rule>
2743 2735 </modify-argument>
2744 2736 </modify-function>
2745 2737
2746 2738 <modify-function signature="dtdPublicId()const">
2747 2739 <modify-argument index="return">
2748 2740 <conversion-rule class="native">
2749 2741 <insert-template name="core.convert_stringref_to_string"/>
2750 2742 </conversion-rule>
2751 2743 </modify-argument>
2752 2744 </modify-function>
2753 2745
2754 2746 <modify-function signature="dtdSystemId()const">
2755 2747 <modify-argument index="return">
2756 2748 <conversion-rule class="native">
2757 2749 <insert-template name="core.convert_stringref_to_string"/>
2758 2750 </conversion-rule>
2759 2751 </modify-argument>
2760 2752 </modify-function>
2761 2753
2762 2754 <modify-function signature="namespaceUri()const">
2763 2755 <modify-argument index="return">
2764 2756 <conversion-rule class="native">
2765 2757 <insert-template name="core.convert_stringref_to_string"/>
2766 2758 </conversion-rule>
2767 2759 </modify-argument>
2768 2760 </modify-function>
2769 2761
2770 2762 <modify-function signature="prefix()const">
2771 2763 <modify-argument index="return">
2772 2764 <conversion-rule class="native">
2773 2765 <insert-template name="core.convert_stringref_to_string"/>
2774 2766 </conversion-rule>
2775 2767 </modify-argument>
2776 2768 </modify-function>
2777 2769
2778 2770 <modify-function signature="processingInstructionData()const">
2779 2771 <modify-argument index="return">
2780 2772 <conversion-rule class="native">
2781 2773 <insert-template name="core.convert_stringref_to_string"/>
2782 2774 </conversion-rule>
2783 2775 </modify-argument>
2784 2776 </modify-function>
2785 2777
2786 2778 <modify-function signature="processingInstructionTarget()const">
2787 2779 <modify-argument index="return">
2788 2780 <conversion-rule class="native">
2789 2781 <insert-template name="core.convert_stringref_to_string"/>
2790 2782 </conversion-rule>
2791 2783 </modify-argument>
2792 2784 </modify-function>
2793 2785
2794 2786 <modify-function signature="qualifiedName()const">
2795 2787 <modify-argument index="return">
2796 2788 <conversion-rule class="native">
2797 2789 <insert-template name="core.convert_stringref_to_string"/>
2798 2790 </conversion-rule>
2799 2791 </modify-argument>
2800 2792 </modify-function>
2801 2793
2802 2794 <modify-function signature="text()const">
2803 2795 <modify-argument index="return">
2804 2796 <conversion-rule class="native">
2805 2797 <insert-template name="core.convert_stringref_to_string"/>
2806 2798 </conversion-rule>
2807 2799 </modify-argument>
2808 2800 </modify-function>
2809 2801 </object-type>
2810 2802 <object-type name="QXmlStreamWriter">
2811 2803 <modify-function signature="QXmlStreamWriter(QString *)">
2812 2804 <remove/>
2813 2805 </modify-function>
2814 2806
2815 2807 <modify-function signature="setCodec(const char*)">
2816 2808 <modify-argument index="1">
2817 2809 <replace-type modified-type="QString"/>
2818 2810 <conversion-rule class="native">
2819 2811 <insert-template name="core.convert_string_arg_to_char*"/>
2820 2812 </conversion-rule>
2821 2813 </modify-argument>
2822 2814 </modify-function>
2823 2815
2824 2816 <modify-function signature="writeCurrentToken(QXmlStreamReader)">
2825 2817 <modify-argument index="1">
2826 2818 <replace-type modified-type="QXmlStreamReader*"/>
2827 2819 <conversion-rule class="native">
2828 2820 QXmlStreamReader &amp; %out% = *qscriptvalue_cast&lt;QXmlStreamReader*&gt;(%in%);
2829 2821 </conversion-rule>
2830 2822 </modify-argument>
2831 2823 </modify-function>
2832 2824
2833 2825 </object-type>
2834 2826 <enum-type name="QXmlStreamReader::ReadElementTextBehaviour"/>
2835 2827
2836 2828 <value-type name="QModelIndex"/>
2837 2829 <value-type name="QMargins"/>
2838 2830
2839 2831 <!-- Inefficient hash codes -->
2840 2832 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QUuid' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
2841 2833 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QLocale' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
2842 2834 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QFuture' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
2843 2835 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QRegExp' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
2844 2836 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QFutureVoid' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
2845 2837 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QUrl' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
2846 2838 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QProcessEnvironment' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
2847 2839
2848 2840 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::selectIteration', unmatched parameter type 'T'"/>
2849 2841 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QVariantAnimation::registerInterpolator', unmatched parameter type 'QVariantAnimation::Interpolator'"/>
2850 2842
2851 2843 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'Qt::Initialization'"/>
2852 2844 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'std::*'"/>
2853 2845 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type '*Private\*'"/>
2854 2846 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type '*Private&amp;'"/>
2855 2847 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QMetaObject'"/>
2856 2848 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'FILE\*'"/>
2857 2849 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QByteArray::Data\*'"/>
2858 2850 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QTSMFC'"/>
2859 2851 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QTSMFI'"/>
2860 2852 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QAbstractFileEngine::ExtensionOption const\*'"/>
2861 2853 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QAbstractFileEngine::Iterator\*'"/>
2862 2854 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QDataStream::ByteOrder'"/>
2863 2855 <suppress-warning text="WARNING(MetaJavaBuilder) :: visibility of function '*' modified in class '*'"/>
2864 2856 <suppress-warning text="WARNING(MetaJavaBuilder) :: hiding of function '*' in class '*'"/>
2865 2857 <suppress-warning text="WARNING(CppImplGenerator) :: protected function '*' in final class '*'"/>
2866 2858 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QPointer&lt;*&gt;'"/>
2867 2859 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QVector&lt;*&gt;'"/>
2868 2860 <suppress-warning text="* private virtual function '*' in 'QAbstractListModel'"/>
2869 2861 <suppress-warning text="* private virtual function '*' in 'QAbstractTableModel'"/>
2870 2862 <suppress-warning text="* private virtual function '*' in 'QListWidget'"/>
2871 2863 <suppress-warning text="* private virtual function '*' in 'QTreeWidget'"/>
2872 2864 <suppress-warning text="* private virtual function '*' in 'QFontDialog'"/>
2873 2865 <suppress-warning text="* private virtual function '*' in 'QTableWidget'"/>
2874 2866 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QFutureWatcherBase::futureInterface', unmatched return type 'QFutureInterfaceBase&amp;'"/>
2875 2867 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QFutureWatcherBase::futureInterface', unmatched return type 'QFutureInterfaceBase const&amp;'"/>
2876 2868 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QFutureWatcher::futureInterface', unmatched return type 'QFutureInterfaceBase&amp;'"/>
2877 2869 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QFutureWatcher::futureInterface', unmatched return type 'QFutureInterfaceBase const&amp;'"/>
2878 2870 <suppress-warning text="WARNING(MetaJavaBuilder) :: unknown operator 'T'"/>
2879 2871 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QFuture::constBegin', unmatched return type 'const_iterator'"/>
2880 2872 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QFuture::end', unmatched return type 'const_iterator'"/>
2881 2873 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QFuture::constEnd', unmatched return type 'const_iterator'"/>
2882 2874 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QFuture::QFuture', unmatched parameter type 'QFutureInterface&lt;T&gt;*'"/>
2883 2875 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QFuture::begin', unmatched return type 'const_iterator'"/>
2884 2876 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::advance', unmatched parameter type 'It&amp;'"/>
2885 2877 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::blockingMapped', unmatched return type 'Sequence'"/>
2886 2878 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::blockingMapped', unmatched return type 'QList&lt;U&gt;'"/>
2887 2879 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::blockingMapped', unmatched return type 'QList&lt;MapFunctor::result_type&gt;'"/>
2888 2880 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::blockingMapped', unmatched return type 'OutputSequence'"/>
2889 2881 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::filtered', unmatched parameter type 'Iterator'"/>
2890 2882 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::filtered', unmatched parameter type 'Sequence const&amp;'"/>
2891 2883 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::filter', unmatched parameter type 'Sequence&amp;'"/>
2892 2884 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::startFiltered', unmatched return type 'ThreadEngineStarter&lt;qValueType&lt;Iterator&gt;::value_type&gt;"/>
2893 2885 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::startFiltered', unmatched return type 'ThreadEngineStarter&lt;Sequence::value_type&gt;'"/>
2894 2886 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::startFiltered', unmatched return type 'ThreadEngineStarter&lt;Iterator::value_type&gt;'"/>
2895 2887 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::blockingMappedReduced', unmatched return type 'V'"/>
2896 2888 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::blockingMappedReduced', unmatched return type 'W'"/>
2897 2889 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::blockingMappedReduced', unmatched return type 'ResultType'"/>
2898 2890 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::blockingMappedReduced', unmatched return type 'U'"/>
2899 2891 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::blockingFiltered', unmatched return type 'OutputSequence'"/>
2900 2892 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::blockingFiltered', unmatched return type 'Sequence'"/>
2901 2893 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::startMappedReduced', unmatched return type 'ThreadEngineStarter&lt;ResultType&gt;'"/>
2902 2894 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::blockingFilteredReduced', unmatched return type 'U'"/>
2903 2895 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::blockingFilteredReduced', unmatched return type 'V'"/>
2904 2896 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::blockingFilteredReduced', unmatched return type 'ResultType'"/>
2905 2897 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::startMap', unmatched return type 'ThreadEngineStarter&lt;void&gt;'"/>
2906 2898 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::startThreadEngine', unmatched return type 'ThreadEngineStarter&lt;ThreadEngine::ResultType&gt;'"/>
2907 2899 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::mappedReduced', unmatched parameter type 'Iterator'"/>
2908 2900 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::mappedReduced', unmatched parameter type 'Sequence const&amp;'"/>
2909 2901 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::filteredReduced', unmatched parameter type 'Iterator'"/>
2910 2902 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::filteredReduced', unmatched parameter type 'Sequence const&amp;'"/>
2911 2903 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::map', unmatched parameter type 'Iterator'"/>
2912 2904 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::map', unmatched parameter type 'Sequence&amp;'"/>
2913 2905 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::filterInternal', unmatched return type 'ThreadEngineStarter&lt;void&gt;'"/>
2914 2906 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::createFunctor', unmatched return type 'QtConcurrent::SelectMemberFunctor0lt;T,Class&gt;::type'"/>
2915 2907 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::createFunctor', unmatched return type 'SelectFunctor0&lt;T,T&gt;::type'"/>
2916 2908 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::mapped', unmatched parameter type 'Iterator'"/>
2917 2909 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::mapped', unmatched parameter type 'Sequence const&amp;'"/>
2918 2910 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::blockingMap', unmatched parameter type 'Iterator'"/>
2919 2911 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::blockingMap', unmatched parameter type 'Sequence&amp;'"/>
2920 2912 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::startMapped', unmatched return type 'QtConcurrent::ThreadEngineStarter&lt;T&gt;'"/>
2921 2913 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::startFilteredReduced', unmatched return type 'ThreadEngineStarter&lt;ResultType&gt;'"/>
2922 2914 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::run', unmatched parameter type 'Class const*'"/>
2923 2915 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::run', unmatched parameter type 'Class*'"/>
2924 2916 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::run', unmatched parameter type 'Class const&amp;'"/>
2925 2917 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::run', unmatched parameter type 'FunctionObject*'"/>
2926 2918 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::run', unmatched parameter type 'FunctionObject'"/>
2927 2919 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::run', unmatched parameter type 'T'"/>
2928 2920 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::blockingFilter', unmatched parameter type 'Sequence&amp;'"/>
2929 2921 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QtConcurrent::createFunctor', unmatched return type 'QtConcurrent::SelectMemberFunctor0&lt;T,Class&gt;::type'"/>
2930 2922
2931 2923 <suppress-warning text="WARNING(Parser) :: ** WARNING scope not found for function definition:QFuture&lt;void&gt;::operator= - definition *ignored*"/>
2932 2924 <suppress-warning text="WARNING(Parser) :: ** WARNING scope not found for function definition:QFutureInterface&lt;void&gt;::future - definition *ignored*"/>
2933 2925 <suppress-warning text="WARNING(Parser) :: ** WARNING scope not found for function definition:QFutureWatcher&lt;void&gt;::setFuture - definition *ignored*"/>
2934 2926
2935 2927
2936 2928 </typesystem>
@@ -1,5673 +1,5676
1 1 <?xml version="1.0"?>
2 2 <typesystem package="com.trolltech.qt.gui"><rejection class="QAbstractTextDocumentLayout"/><rejection class="QColormap"/><rejection class="QFontDatabase"/><rejection class="QIconEngineV2"/><rejection class="QInputMethodEvent"/><rejection class="QPainterPath::Element"/><rejection class="QTextBlock::iterator"/><rejection class="QTextFrame::iterator"/><rejection class="QTextLayout::FormatRange"/><rejection class="QTreeWidgetItemIterator"/><rejection class="QAccessibleFactoryInterface"/><rejection class="QIconEngineFactoryInterfaceV2"/><rejection class="QImageIOHandlerFactoryInterface"/><rejection class="QInputContextFactoryInterface"/><rejection class="QStyleFactoryInterface"/><rejection class="QPictureFormatInterface"/><rejection class="QAbstractProxyModel"/><rejection class="QSortFilterProxyModel"/><rejection class="QDirModel"/><rejection class="QFileSystemModel"/><rejection class="QPrinterInfo"/><rejection class="QProxyModel"/><rejection class="QPrinterInfo"/><rejection class="QTextOption"/><suppress-warning text="WARNING(MetaJavaBuilder) :: Rejected enum has no alternative...: QPalette::NColorRoles"/><suppress-warning text="WARNING(MetaJavaBuilder) :: Cannot find enum constant for value 'DragMove' in 'QDragMoveEvent' or any of its super classes"/><suppress-warning text="WARNING() :: Unknown attribute for 'modify-function': 'allow-as-slot'"/>
3 3
4 4 <rejection class="*" function-name="d_func"/>
5 5
6 6 <rejection class="*" field-name="d_ptr"/>
7 7 <rejection class="*" field-name="d"/>
8 8
9 9 <rejection class="QGenericMatrix"/>
10 10 <rejection class="QPixmapFilterPrivate"/>
11 11 <rejection class="QPenPrivate"/>
12 12 <rejection class="QGtkStyle"/>
13 13 <rejection class="QWindowsCEStyle"/>
14 14 <rejection class="QWindowsMobileStyle"/>
15 15 <rejection class="QAbstractUndoItem"/>
16 16 <rejection class="QAccessibleApplication"/>
17 17 <rejection class="QBrushData"/>
18 18 <rejection class="QImageTextKeyLang"/>
19 19 <rejection class="QItemEditorCreator"/>
20 20 <rejection class="QLibrary"/>
21 21 <rejection class="QLinkedList"/>
22 22 <rejection class="QLinkedListData"/>
23 23 <rejection class="QLinkedListIterator"/>
24 24 <rejection class="QLinkedListNode"/>
25 25 <rejection class="QMimeSource"/>
26 26 <rejection class="QPainterPathPrivate"/>
27 27 <rejection class="QRegionData"/>
28 28 <rejection class="QStandardItemEditorCreator"/>
29 29 <rejection class="QStyleOptionQ3DockWindow"/>
30 30 <rejection class="QStyleOptionQ3ListView"/>
31 31 <rejection class="QStyleOptionQ3ListViewItem"/>
32 32 <rejection class="QTextFrameLayoutData"/>
33 33 <rejection class="QUpdateLaterEvent"/>
34 34 <rejection class="QVFbHeader"/>
35 35 <rejection class="QWidgetData"/>
36 36 <rejection class="QWindowSurface"/>
37 37 <rejection class="QWindowsXPStyle"/>
38 38 <rejection class="QWindowsVistaStyle"/>
39 39 <rejection class="QWSEmbedWidget"/>
40 40 <rejection class="QRegion::QRegionData"/>
41 41 <rejection class="JObject_key"/>
42 42 <rejection class="QAccessibleEditableTextInterface"/>
43 43 <rejection class="QAccessibleSimpleEditableTextInterface"/>
44 44 <rejection class="QAccessibleTextInterface"/>
45 45 <rejection class="QAccessibleValueInterface"/>
46 46 <rejection class="QAccessibleBridge"/>
47 47 <rejection class="QIconEngineFactoryInterface"/>
48 48 <rejection class="QIconEnginePlugin"/>
49 49 <rejection class="QWidgetItemV2"/>
50 50 <rejection class="QAbstractItemDelegate" function-name="operator="/>
51 51 <rejection class="QAccessible" function-name="installFactory"/>
52 52 <rejection class="QAccessible" function-name="installRootObjectHandler"/>
53 53 <rejection class="QAccessible" function-name="installUpdateHandler"/>
54 54 <rejection class="QAccessible" function-name="removeFactory"/>
55 55 <rejection class="QApplication" function-name="compressEvent"/>
56 56 <rejection class="QBrush" function-name="cleanUp"/>
57 57 <rejection class="QPictureIO" function-name="defineIOHandler"/>
58 58 <rejection class="QPolygon" function-name="putPoints"/>
59 59 <rejection class="QPolygon" function-name="setPoints"/>
60 60 <rejection class="QPolygon" function-name="setPoint"/>
61 61 <rejection class="QPolygon" function-name="points"/>
62 62 <rejection class="QPolygon" function-name="point"/>
63 63 <rejection class="QPrinter" function-name="printerSelectionOption"/>
64 64 <rejection class="QPrinter" function-name="setPrinterSelectionOption"/>
65 65 <rejection class="QWidget" function-name="create"/>
66 66 <rejection class="QWidget" function-name="find"/>
67 67 <rejection class="QWidget" function-name="handle"/>
68 68 <rejection class="QWidget" function-name="styleChange"/>
69 69 <rejection class="QWidget" function-name="internalWinId"/>
70 70 <rejection class="QActionGroup" function-name="selected"/>
71 71 <rejection class="QPaintEngine" function-name="fix_neg_rect"/>
72 72 <rejection class="QTreeModel" function-name="node"/>
73 73 <rejection class="QTreeModel" function-name="initializeNode"/>
74 74 <rejection class="QTreeModel" function-name="queryChildren"/>
75 75 <rejection class="QTextObjectInterface"/>
76 76 <rejection class="QAccessible" function-name="cast_helper"/>
77 77 <rejection class="QAccessible" function-name="updateAccessibility"/>
78 78 <rejection class="QAccessible2"/>
79 79 <rejection class="QAccessibleInterface" function-name="backgroundColor"/>
80 80 <rejection class="QAccessibleInterface" function-name="foregroundColor"/>
81 81 <rejection class="QAccessibleInterface" function-name="textInterface"/>
82 82 <rejection class="QAccessibleInterface" function-name="valueInterface"/>
83 83 <rejection class="QAccessibleInterface" function-name="tableInterface"/>
84 84 <rejection class="QAccessibleInterface" function-name="editableTextInterface"/>
85 85 <rejection class="QAccessibleInterface" function-name="cast_helper"/>
86 86 <rejection class="QAccessibleInterfaceEx" function-name="interface_cast"/>
87 87 <rejection class="QAccessibleBridgePlugin"/>
88 88 <rejection class="QAccessibleBridgeFactoryInterface"/>
89 89 <rejection class="QTabletEvent" field-name="mExtra"/>
90 90 <rejection class="QWidgetItem" field-name="wid"/>
91 91 <rejection class="QFont" enum-name="ResolveProperties"/>
92 92 <rejection class="QGradient" enum-name="InterpolationMode"/>
93 93 <rejection class="QIconEngine::AvailableSizesArgument"/>
94 94 <rejection class="QIconEngine" enum-name="IconEngineHook"/>
95 95 <rejection class="QGradient" enum-name="InterpolationMode"/>
96 96 <rejection class="QGradient" function-name="setInterpolationMode"/>
97 97 <rejection class="QGradient" function-name="interpolationMode"/>
98 98 <rejection class="QAbstractTextDocumentLayout" function-name="handlerForObject"/>
99 99 <rejection class="QStyleOptionDockWidgetV2"/>
100 100 <rejection class="QStyleOptionFrameV2"/>
101 101 <rejection class="QStyleOptionFrameV3"/>
102 102 <rejection class="QStyleOptionProgressBarV2"/>
103 103 <rejection class="QStyleOptionTabBarBaseV2"/>
104 104 <rejection class="QStyleOptionTabV2"/>
105 105 <rejection class="QStyleOptionTabV3"/>
106 106 <rejection class="QStyleOptionToolBoxV2"/>
107 107 <rejection class="QStyleOptionViewItemV2"/>
108 108 <rejection class="QStyleOptionViewItemV3"/>
109 109 <rejection class="QStyleOptionViewItemV4"/>
110 110 <rejection class="QDataStream"/>
111 111 <rejection class="QIconEngine"/>
112 112
113 113 <enum-type name="QStyleOptionTabBarBase::StyleOptionVersion"/>
114 114 <enum-type name="QTabBar::SelectionBehavior"/>
115 115 <enum-type name="QTabBar::ButtonPosition"/>
116 116 <enum-type name="QInputDialog::InputMode"/>
117 117 <enum-type name="QInputDialog::InputDialogOption" flags="QInputDialog::InputDialogOptions"/>
118 118 <enum-type name="QFontDialog::FontDialogOption" flags="QFontDialog::FontDialogOptions"/>
119 119 <enum-type name="QColorDialog::ColorDialogOption" flags="QColorDialog::ColorDialogOptions"/>
120 120 <enum-type name="QAbstractItemDelegate::EndEditHint"/>
121 121 <enum-type name="QAbstractItemView::CursorAction"/>
122 122 <enum-type name="QAbstractItemView::DragDropMode"/>
123 123 <enum-type name="QAbstractItemView::DropIndicatorPosition"/>
124 124 <enum-type name="QAbstractItemView::EditTrigger" flags="QAbstractItemView::EditTriggers"/>
125 125 <enum-type name="QAbstractItemView::ScrollHint"/>
126 126 <enum-type name="QAbstractItemView::ScrollMode"/>
127 127 <enum-type name="QAbstractItemView::SelectionBehavior"/>
128 128 <enum-type name="QAbstractItemView::SelectionMode"/>
129 129 <enum-type name="QAbstractItemView::State"/>
130 130 <enum-type name="QAbstractPrintDialog::PrintDialogOption" flags="QAbstractPrintDialog::PrintDialogOptions"/>
131 131 <enum-type name="QAbstractPrintDialog::PrintRange"/>
132 132 <enum-type name="QAbstractSlider::SliderAction"/>
133 133 <enum-type name="QAbstractSlider::SliderChange"/>
134 134 <enum-type name="QAbstractSpinBox::ButtonSymbols"/>
135 135 <enum-type name="QAbstractSpinBox::CorrectionMode"/>
136 136 <enum-type name="QAbstractSpinBox::StepEnabledFlag" flags="QAbstractSpinBox::StepEnabled"/>
137 137 <enum-type name="QAccessible::Event"/>
138 138 <enum-type name="QAccessible::Method"/>
139 139 <enum-type name="QAccessible::State"/>
140 140 <enum-type name="QAccessible::RelationFlag" flags="QAccessible::Relation"/>
141 141 <enum-type name="QAccessible::Role"/>
142 142 <enum-type name="QAccessible::Text"/>
143 143 <enum-type name="QDesktopServices::StandardLocation"/>
144 144 <enum-type name="QDirModel::Roles"/>
145 145 <enum-type name="QFont::Capitalization"/>
146 146 <enum-type name="QFont::SpacingType"/>
147 147 <enum-type name="QGraphicsItem::CacheMode"/>
148 148 <enum-type name="QMdiArea::AreaOption" flags="QMdiArea::AreaOptions"/>
149 149 <enum-type name="QMdiArea::WindowOrder"/>
150 150 <enum-type name="QMdiArea::ViewMode"/>
151 151 <enum-type name="QFileSystemModel::Roles"/>
152 152 <enum-type name="QFormLayout::FieldGrowthPolicy"/>
153 153 <enum-type name="QFormLayout::FormStyle"/>
154 154 <enum-type name="QFormLayout::ItemRole"/>
155 155 <enum-type name="QFormLayout::RowWrapPolicy"/>
156 156 <enum-type name="QGraphicsProxyWidget::enum_1"/>
157 157 <enum-type name="QGraphicsWidget::enum_1"/>
158 158 <enum-type name="QPlainTextEdit::LineWrapMode"/>
159 159 <enum-type name="QPrintPreviewWidget::ViewMode"/>
160 160 <enum-type name="QPrintPreviewWidget::ZoomMode"/>
161 161 <enum-type name="QStyleOptionTab::StyleOptionVersion"/>
162 162 <enum-type name="QStyleOptionFrame::StyleOptionVersion"/>
163 163 <enum-type name="QStyleOptionViewItem::StyleOptionVersion"/>
164 164 <enum-type name="QStyleOptionViewItem::ViewItemPosition"/>
165 165
166 166 <enum-type name="QMdiSubWindow::SubWindowOption" flags="QMdiSubWindow::SubWindowOptions"/>
167 167
168 168 <enum-type name="QAction::ActionEvent"/>
169 169 <enum-type name="QAction::MenuRole"/>
170 170 <enum-type name="QApplication::ColorSpec"/>
171 171 <enum-type name="QApplication::Type"/>
172 172 <enum-type name="QCalendarWidget::HorizontalHeaderFormat"/>
173 173 <enum-type name="QCalendarWidget::SelectionMode"/>
174 174 <enum-type name="QCalendarWidget::VerticalHeaderFormat"/>
175 175 <enum-type name="QColor::Spec"/>
176 176 <enum-type name="QColormap::Mode"/>
177 177 <enum-type name="QComboBox::InsertPolicy"/>
178 178 <enum-type name="QComboBox::SizeAdjustPolicy"/>
179 179 <enum-type name="QCompleter::CompletionMode"/>
180 180 <enum-type name="QCompleter::ModelSorting"/>
181 181 <enum-type name="QContextMenuEvent::Reason"/>
182 182 <enum-type name="QDataWidgetMapper::SubmitPolicy"/>
183 183 <enum-type name="QDateTimeEdit::Section" flags="QDateTimeEdit::Sections"/>
184 184 <enum-type name="QDialog::DialogCode"/>
185 185 <enum-type name="QDialogButtonBox::ButtonLayout"/>
186 186 <enum-type name="QDialogButtonBox::ButtonRole"/>
187 187 <enum-type name="QFileDialog::AcceptMode"/>
188 188 <enum-type name="QFileDialog::DialogLabel"/>
189 189 <enum-type name="QFileDialog::FileMode"/>
190 190 <enum-type name="QFileDialog::Option" flags="QFileDialog::Options"/>
191 191 <enum-type name="QFileDialog::ViewMode"/>
192 192 <enum-type name="QFileIconProvider::IconType"/>
193 193 <enum-type name="QFont::Stretch"/>
194 194 <enum-type name="QFont::Style"/>
195 195 <enum-type name="QFont::StyleStrategy"/>
196 196 <enum-type name="QFont::Weight"/>
197 197 <enum-type name="QFontComboBox::FontFilter" flags="QFontComboBox::FontFilters"/>
198 198 <enum-type name="QFrame::Shadow" extensible="yes"/>
199 199 <enum-type name="QFrame::Shape"/>
200 200 <enum-type name="QFrame::StyleMask"/>
201 201 <enum-type name="QGradient::CoordinateMode"/>
202 202 <enum-type name="QGradient::Spread" lower-bound="QGradient.PadSpread" upper-bound="QGradient.RepeatSpread"/>
203 203 <enum-type name="QGradient::Type"/>
204 204 <enum-type name="QGraphicsEllipseItem::enum_1"/>
205 205 <enum-type name="QGraphicsItem::Extension"/>
206 206 <enum-type name="QGraphicsItem::GraphicsItemChange"/>
207 207 <enum-type name="QGraphicsItem::GraphicsItemFlag" flags="QGraphicsItem::GraphicsItemFlags"/>
208 208 <enum-type name="QGraphicsItem::enum_1"/>
209 209 <enum-type name="QGraphicsItemGroup::enum_1"/>
210 210 <enum-type name="QGraphicsLineItem::enum_1"/>
211 211 <enum-type name="QGraphicsPathItem::enum_1"/>
212 212 <enum-type name="QGraphicsPixmapItem::ShapeMode"/>
213 213 <enum-type name="QGraphicsPixmapItem::enum_1"/>
214 214 <enum-type name="QGraphicsPolygonItem::enum_1"/>
215 215 <enum-type name="QGraphicsRectItem::enum_1"/>
216 216 <enum-type name="QGraphicsScene::ItemIndexMethod"/>
217 217 <enum-type name="QGraphicsSceneContextMenuEvent::Reason"/>
218 218 <enum-type name="QGraphicsSimpleTextItem::enum_1"/>
219 219 <enum-type name="QGraphicsTextItem::enum_1"/>
220 220 <enum-type name="QGraphicsView::CacheModeFlag" flags="QGraphicsView::CacheMode"/>
221 221 <enum-type name="QGraphicsView::DragMode"/>
222 222 <enum-type name="QGraphicsView::OptimizationFlag" flags="QGraphicsView::OptimizationFlags"/>
223 223 <enum-type name="QGraphicsView::ViewportAnchor"/>
224 224 <enum-type name="QGraphicsView::ViewportUpdateMode"/>
225 225 <enum-type name="QIcon::Mode"/>
226 226 <enum-type name="QIcon::State"/>
227 227 <enum-type name="QImage::Format"/>
228 228 <enum-type name="QImage::InvertMode"/>
229 229 <enum-type name="QImageIOHandler::ImageOption"/>
230 230 <enum-type name="QImageReader::ImageReaderError"/>
231 231 <enum-type name="QImageWriter::ImageWriterError"/>
232 232 <enum-type name="QInputContext::StandardFormat"/>
233 233 <enum-type name="QInputMethodEvent::AttributeType"/>
234 234 <enum-type name="QItemSelectionModel::SelectionFlag" flags="QItemSelectionModel::SelectionFlags"/>
235 235 <enum-type name="QKeySequence::SequenceFormat"/>
236 236 <enum-type name="QKeySequence::SequenceMatch"/>
237 237 <enum-type name="QKeySequence::StandardKey"/>
238 238 <enum-type name="QLCDNumber::Mode"/>
239 239 <enum-type name="QLCDNumber::SegmentStyle"/>
240 240 <enum-type name="QLayout::SizeConstraint"/>
241 241 <enum-type name="QLineEdit::EchoMode"/>
242 242 <enum-type name="QLineF::IntersectType"/>
243 243 <enum-type name="QListView::Flow"/>
244 244 <enum-type name="QListView::LayoutMode"/>
245 245 <enum-type name="QListView::Movement"/>
246 246 <enum-type name="QListView::ResizeMode"/>
247 247 <enum-type name="QListView::ViewMode"/>
248 248 <enum-type name="QListWidgetItem::ItemType"/>
249 249 <enum-type name="QMainWindow::DockOption" flags="QMainWindow::DockOptions"/>
250 250 <enum-type name="QMessageBox::ButtonRole"/>
251 251 <enum-type name="QMessageBox::Icon"/>
252 252 <enum-type name="QMovie::CacheMode"/>
253 253 <enum-type name="QMovie::MovieState"/>
254 254 <enum-type name="QPaintDevice::PaintDeviceMetric"/>
255 255 <enum-type name="QPaintEngine::DirtyFlag" flags="QPaintEngine::DirtyFlags"/>
256 256 <enum-type name="QPaintEngine::PaintEngineFeature" flags="QPaintEngine::PaintEngineFeatures"/>
257 257 <enum-type name="QPaintEngine::PolygonDrawMode"/>
258 258 <enum-type name="QPaintEngine::Type"/>
259 259 <enum-type name="QPageSetupDialog::PageSetupDialogOption" flags="QPageSetupDialog::PageSetupDialogOptions"/>
260 260 <enum-type name="QPainter::CompositionMode"/>
261 261 <enum-type name="QPainter::PixmapFragmentHint"/>
262 262 <enum-type name="QPainter::RenderHint" flags="QPainter::RenderHints"/>
263 263 <enum-type name="QPainterPath::ElementType"/>
264 264 <enum-type name="QPrintEngine::PrintEnginePropertyKey">
265 265 <reject-enum-value name="PPK_PaperSize"/>
266 266 </enum-type>
267 267 <enum-type name="QPrinter::ColorMode"/>
268 268 <enum-type name="QPrinter::Orientation"/>
269 269 <enum-type name="QPrinter::OutputFormat"/>
270 270 <enum-type name="QPrinter::PageOrder"/>
271 271 <enum-type name="QPrinter::PaperSource"/>
272 272 <enum-type name="QPrinter::PrintRange"/>
273 273 <enum-type name="QPrinter::PrinterMode"/>
274 274 <enum-type name="QPrinter::PrinterState"/>
275 275 <enum-type name="QPrinter::Unit"/>
276 276 <enum-type name="QPrinter::DuplexMode"/>
277 277 <enum-type name="QProgressBar::Direction"/>
278 278 <enum-type name="QRegion::RegionType"/>
279 279 <enum-type name="QRubberBand::Shape"/>
280 280 <enum-type name="QSessionManager::RestartHint"/>
281 281 <enum-type name="QSizePolicy::Policy"/>
282 282 <enum-type name="QSizePolicy::PolicyFlag"/>
283 283 <enum-type name="QSizePolicy::ControlType" flags="QSizePolicy::ControlTypes"/>
284 284 <enum-type name="QStandardItem::ItemType"/>
285 285 <enum-type name="QStyle::SubControl" flags="QStyle::SubControls" extensible="yes" force-integer="yes"/>
286 286 <enum-type name="QStyle::ComplexControl" extensible="yes"/>
287 287 <enum-type name="QStyle::ContentsType" extensible="yes"/>
288 288 <enum-type name="QStyle::ControlElement" extensible="yes"/>
289 289 <enum-type name="QStyle::PixelMetric" extensible="yes">
290 290 <reject-enum-value name="PM_MDIFrameWidth"/>
291 291 <reject-enum-value name="PM_MDIMinimizedWidth"/>
292 292 </enum-type>
293 293 <enum-type name="QStyle::PrimitiveElement" extensible="yes">
294 294 <reject-enum-value name="PE_IndicatorItemViewItemCheck"/>
295 295 <reject-enum-value name="PE_FrameStatusBarItem"/>
296 296 </enum-type>
297 297 <enum-type name="QStyle::StandardPixmap" extensible="yes"/>
298 298 <enum-type name="QStyle::StateFlag" flags="QStyle::State"/>
299 299 <enum-type name="QStyle::SubElement" extensible="yes">
300 300 <reject-enum-value name="SE_ItemViewItemCheckIndicator"/>
301 301 </enum-type>
302 302 <enum-type name="QStyleHintReturn::HintReturnType"/>
303 303 <enum-type name="QStyleHintReturn::StyleOptionType"/>
304 304 <enum-type name="QStyleHintReturn::StyleOptionVersion"/>
305 305 <enum-type name="QStyleHintReturnVariant::StyleOptionType"/>
306 306 <enum-type name="QStyleHintReturnVariant::StyleOptionVersion"/>
307 307
308 308 <enum-type name="QStyleHintReturnMask::StyleOptionType"/>
309 309 <enum-type name="QStyleHintReturnMask::StyleOptionVersion"/>
310 310 <enum-type name="QStyleOption::StyleOptionType"/>
311 311 <enum-type name="QStyleOption::OptionType" extensible="yes"/>
312 312 <enum-type name="QStyleOption::StyleOptionVersion"/>
313 313 <enum-type name="QStyleOptionButton::ButtonFeature" flags="QStyleOptionButton::ButtonFeatures"/>
314 314 <enum-type name="QStyleOptionButton::StyleOptionType"/>
315 315 <enum-type name="QStyleOptionButton::StyleOptionVersion"/>
316 316 <enum-type name="QStyleOptionComboBox::StyleOptionType"/>
317 317 <enum-type name="QStyleOptionComboBox::StyleOptionVersion"/>
318 318 <enum-type name="QStyleOptionComplex::StyleOptionType"/>
319 319 <enum-type name="QStyleOptionComplex::StyleOptionVersion"/>
320 320 <enum-type name="QStyleOptionDockWidget::StyleOptionType"/>
321 321 <enum-type name="QStyleOptionDockWidget::StyleOptionVersion"/>
322 322 <enum-type name="QStyleOptionFocusRect::StyleOptionType"/>
323 323 <enum-type name="QStyleOptionFocusRect::StyleOptionVersion"/>
324 324 <enum-type name="QStyleOptionFrame::StyleOptionType"/>
325 325 <enum-type name="QStyleOptionFrame::FrameFeature" flags="QStyleOptionFrame::FrameFeatures"/>
326 326 <enum-type name="QStyleOptionGraphicsItem::StyleOptionType"/>
327 327 <enum-type name="QStyleOptionGraphicsItem::StyleOptionVersion"/>
328 328 <enum-type name="QStyleOptionGroupBox::StyleOptionType"/>
329 329 <enum-type name="QStyleOptionGroupBox::StyleOptionVersion"/>
330 330 <enum-type name="QStyleOptionHeader::SectionPosition"/>
331 331 <enum-type name="QStyleOptionHeader::SelectedPosition"/>
332 332 <enum-type name="QStyleOptionHeader::SortIndicator"/>
333 333 <enum-type name="QStyleOptionHeader::StyleOptionType"/>
334 334 <enum-type name="QStyleOptionHeader::StyleOptionVersion"/>
335 335 <enum-type name="QStyleOptionMenuItem::CheckType"/>
336 336 <enum-type name="QStyleOptionMenuItem::MenuItemType"/>
337 337 <enum-type name="QStyleOptionMenuItem::StyleOptionType"/>
338 338 <enum-type name="QStyleOptionMenuItem::StyleOptionVersion"/>
339 339 <enum-type name="QStyleOptionProgressBar::StyleOptionType"/>
340 340 <enum-type name="QStyleOptionProgressBar::StyleOptionVersion"/>
341 341 <enum-type name="QStyleOptionRubberBand::StyleOptionType"/>
342 342 <enum-type name="QStyleOptionRubberBand::StyleOptionVersion"/>
343 343 <enum-type name="QStyleOptionSizeGrip::StyleOptionType"/>
344 344 <enum-type name="QStyleOptionSizeGrip::StyleOptionVersion"/>
345 345 <enum-type name="QStyleOptionSlider::StyleOptionType"/>
346 346 <enum-type name="QStyleOptionSlider::StyleOptionVersion"/>
347 347 <enum-type name="QStyleOptionSpinBox::StyleOptionType"/>
348 348 <enum-type name="QStyleOptionSpinBox::StyleOptionVersion"/>
349 349 <enum-type name="QStyleOptionTab::CornerWidget" flags="QStyleOptionTab::CornerWidgets"/>
350 350 <enum-type name="QStyleOptionTab::SelectedPosition"/>
351 351 <enum-type name="QStyleOptionTab::StyleOptionType"/>
352 352 <enum-type name="QStyleOptionTab::TabPosition"/>
353 353 <enum-type name="QStyleOptionTabBarBase::StyleOptionType"/>
354 354 <enum-type name="QStyleOptionTabWidgetFrame::StyleOptionType"/>
355 355 <enum-type name="QStyleOptionTabWidgetFrame::StyleOptionVersion"/>
356 356 <enum-type name="QStyleOptionTitleBar::StyleOptionType"/>
357 357 <enum-type name="QStyleOptionTitleBar::StyleOptionVersion"/>
358 358 <enum-type name="QStyleOptionToolBar::StyleOptionType"/>
359 359 <enum-type name="QStyleOptionToolBar::StyleOptionVersion"/>
360 360 <enum-type name="QStyleOptionToolBar::ToolBarFeature" flags="QStyleOptionToolBar::ToolBarFeatures"/>
361 361 <enum-type name="QStyleOptionToolBar::ToolBarPosition"/>
362 362 <enum-type name="QStyleOptionToolBox::StyleOptionType"/>
363 363 <enum-type name="QStyleOptionToolBox::StyleOptionVersion"/>
364 364 <enum-type name="QStyleOptionToolButton::StyleOptionType"/>
365 365 <enum-type name="QStyleOptionToolButton::StyleOptionVersion"/>
366 366 <enum-type name="QStyleOptionToolButton::ToolButtonFeature" flags="QStyleOptionToolButton::ToolButtonFeatures">
367 367 <reject-enum-value name="MenuButtonPopup"/>
368 368 </enum-type>
369 369 <enum-type name="QStyleOptionViewItem::Position"/>
370 370 <enum-type name="QStyleOptionViewItem::StyleOptionType"/>
371 371 <enum-type name="QStyleOptionViewItem::ViewItemFeature" flags="QStyleOptionViewItem::ViewItemFeatures"/>
372 372 <enum-type name="QSystemTrayIcon::ActivationReason"/>
373 373 <enum-type name="QSystemTrayIcon::MessageIcon"/>
374 374 <enum-type name="QTabBar::Shape"/>
375 375 <enum-type name="QTabWidget::TabPosition"/>
376 376 <enum-type name="QTabWidget::TabShape"/>
377 377 <enum-type name="QTableWidgetItem::ItemType"/>
378 378 <enum-type name="QTabletEvent::PointerType"/>
379 379 <enum-type name="QTabletEvent::TabletDevice"/>
380 380 <enum-type name="QTextCharFormat::UnderlineStyle"/>
381 381 <enum-type name="QTextCharFormat::VerticalAlignment"/>
382 382 <enum-type name="QTextCursor::MoveMode"/>
383 383 <enum-type name="QTextCursor::MoveOperation"/>
384 384 <enum-type name="QTextCursor::SelectionType"/>
385 385 <enum-type name="QTextDocument::FindFlag" flags="QTextDocument::FindFlags"/>
386 386 <enum-type name="QTextDocument::MetaInformation"/>
387 387 <enum-type name="QTextDocument::ResourceType"/>
388 388 <enum-type name="QTextDocument::Stacks"/>
389 389 <enum-type name="QTextEdit::AutoFormattingFlag" flags="QTextEdit::AutoFormatting"/>
390 390 <enum-type name="QTextEdit::LineWrapMode"/>
391 391 <enum-type name="QTextFormat::ObjectTypes"/>
392 392 <enum-type name="QTextFormat::PageBreakFlag" flags="QTextFormat::PageBreakFlags"/>
393 393 <enum-type name="QTextFrameFormat::Position"/>
394 394 <enum-type name="QTextFrameFormat::BorderStyle"/>
395 395 <enum-type name="QTextItem::RenderFlag" flags="QTextItem::RenderFlags"/>
396 396 <enum-type name="QTextLayout::CursorMode"/>
397 397 <enum-type name="QTextLength::Type"/>
398 398 <enum-type name="QTextLine::CursorPosition"/>
399 399 <enum-type name="QTextLine::Edge"/>
400 400 <enum-type name="QTextListFormat::Style"/>
401 401 <enum-type name="QTextOption::Flag" flags="QTextOption::Flags"/>
402 402 <enum-type name="QTextOption::WrapMode"/>
403 403 <enum-type name="QTextOption::TabType"/>
404 404 <enum-type name="QToolButton::ToolButtonPopupMode"/>
405 405 <enum-type name="QTreeWidgetItem::ItemType"/>
406 406 <enum-type name="QTreeWidgetItemIterator::IteratorFlag" flags="QTreeWidgetItemIterator::IteratorFlags"/>
407 407 <enum-type name="QValidator::State"/>
408 408 <enum-type name="QWidget::RenderFlag" flags="QWidget::RenderFlags"/>
409 409 <enum-type name="QWorkspace::WindowOrder"/>
410 410 <enum-type name="QDoubleValidator::Notation"/>
411 411 <enum-type name="QGraphicsScene::SceneLayer" flags="QGraphicsScene::SceneLayers"/>
412 412 <enum-type name="QStyleOptionToolBox::SelectedPosition"/>
413 413 <enum-type name="QStyleOptionToolBox::TabPosition"/>
414 414 <enum-type name="QTransform::TransformationType"/>
415 415 <enum-type name="QTreeWidgetItem::ChildIndicatorPolicy"/>
416 416 <enum-type name="QWizard::WizardOption" flags="QWizard::WizardOptions"/>
417 417 <enum-type name="QWizard::WizardPixmap"/>
418 418 <enum-type name="QWizard::WizardStyle"/>
419 419 <enum-type name="QImageIOPlugin::Capability" flags="QImageIOPlugin::Capabilities"/>
420 420 <enum-type name="QStackedLayout::StackingMode"/>
421 421
422 422 <enum-type name="QWizard::WizardButton">
423 423 <reject-enum-value name="NStandardButtons"/>
424 424 <reject-enum-value name="NButtons"/>
425 425 </enum-type>
426 426
427 427 <enum-type name="QAccessible::Action">
428 428 <reject-enum-value name="FirstStandardAction"/>
429 429 <reject-enum-value name="LastStandardAction"/>
430 430 </enum-type>
431 431
432 432 <enum-type name="QBoxLayout::Direction">
433 433 <reject-enum-value name="Down"/>
434 434 <reject-enum-value name="Up"/>
435 435 </enum-type>
436 436
437 437
438 438 <enum-type name="QClipboard::Mode">
439 439 <reject-enum-value name="LastMode"/>
440 440 </enum-type>
441 441
442 442 <enum-type name="QDialogButtonBox::StandardButton" flags="QDialogButtonBox::StandardButtons">
443 443 <reject-enum-value name="FirstButton"/>
444 444 <reject-enum-value name="LastButton"/>
445 445 <reject-enum-value name="YesAll"/>
446 446 <reject-enum-value name="NoAll"/>
447 447 <reject-enum-value name="Default"/>
448 448 <reject-enum-value name="Escape"/>
449 449 <reject-enum-value name="FlagMask"/>
450 450 <reject-enum-value name="ButtonMask"/>
451 451 </enum-type>
452 452
453 453 <enum-type name="QDockWidget::DockWidgetFeature" flags="QDockWidget::DockWidgetFeatures"/>
454 454
455 455 <enum-type name="QFont::StyleHint">
456 456 <reject-enum-value name="SansSerif"/>
457 457 <reject-enum-value name="Serif"/>
458 458 <reject-enum-value name="TypeWriter"/>
459 459 <reject-enum-value name="Decorative"/>
460 460 </enum-type>
461 461
462 462 <enum-type name="QFontDatabase::WritingSystem">
463 463 <reject-enum-value name="Other"/>
464 464 </enum-type>
465 465
466 466 <enum-type name="QHeaderView::ResizeMode">
467 467 <reject-enum-value name="Custom"/>
468 468 </enum-type>
469 469
470 470
471 471 <enum-type name="QMessageBox::StandardButton" flags="QMessageBox::StandardButtons">
472 472 <reject-enum-value name="FirstButton"/>
473 473 <reject-enum-value name="LastButton"/>
474 474 <reject-enum-value name="YesAll"/>
475 475 <reject-enum-value name="NoAll"/>
476 476 </enum-type>
477 477
478 478 <enum-type name="QPalette::ColorGroup">
479 479 <reject-enum-value name="Normal"/>
480 480 </enum-type>
481 481
482 482 <enum-type name="QPalette::ColorRole">
483 483 <reject-enum-value name="NColorRoles"/>
484 484 <reject-enum-value name="Foreground"/>
485 485 <reject-enum-value name="Background"/>
486 486 </enum-type>
487 487
488 488 <enum-type name="QPrinter::PageSize">
489 489 <reject-enum-value name="NPageSize"/>
490 490 <reject-enum-value name="NPaperSize"/>
491 491 </enum-type>
492 492
493 493 <enum-type name="QSlider::TickPosition">
494 494 <reject-enum-value name="TicksLeft"/>
495 495 <reject-enum-value name="TicksRight"/>
496 496 </enum-type>
497 497
498 498 <enum-type name="QStyle::StyleHint" extensible="yes">
499 499 <reject-enum-value name="SH_ScrollBar_StopMouseOverSlider"/>
500 500 </enum-type>
501 501
502 502
503 503 <enum-type name="QTextFormat::FormatType"/>
504 504
505 505 <enum-type name="QTextFormat::Property">
506 506 <reject-enum-value name="FontSizeIncrement"/>
507 507 <reject-enum-value name="FirstFontProperty"/>
508 508 <reject-enum-value name="LastFontProperty"/>
509 509 </enum-type>
510 510
511 511 <enum-type name="QAction::Priority"/>
512 512 <enum-type name="QAction::SoftKeyRole"/>
513 513 <enum-type name="QGraphicsEffect::ChangeFlag" flags="QGraphicsEffect::ChangeFlags"/>
514 514 <enum-type name="QGraphicsItem::PanelModality"/>
515 515 <enum-type name="QPinchGesture::WhatChange" flags="QPinchGesture::WhatChanged"/>
516 516 <enum-type name="QStyle::RequestSoftwareInputPanel"/>
517 517 <enum-type name="QSwipeGesture::SwipeDirection"/>
518 518 <enum-type name="QTouchEvent::DeviceType"/>
519 519
520 520 <enum-type name="QTextBlockFormat::LineHeightTypes"/>
521 521
522 522
523 523 <value-type name="QPixmapCache::Key"/>
524 524 <value-type name="QTileRules"/>
525 525 <value-type name="QVector2D"/>
526 526 <value-type name="QVector3D"/>
527 527 <value-type name="QVector4D"/>
528 528 <value-type name="QTouchEvent::TouchPoint"/>
529 529
530 530
531 531 <value-type name="QTransform">
532 532 <modify-function signature="operator=(QTransform)" remove="all"/>
533 533 <modify-function signature="map(int,int,int*,int*)const" remove="all"/>
534 534 <modify-function signature="map(qreal,qreal,qreal*,qreal*)const" remove="all"/>
535 535
536 536 <modify-function signature="operator*=(qreal)" access="private"/>
537 537 <modify-function signature="operator+=(qreal)" access="private"/>
538 538 <modify-function signature="operator-=(qreal)" access="private"/>
539 539 <modify-function signature="operator/=(qreal)" access="private"/>
540 540 <modify-function signature="operator*(QTransform)const" rename="multiplied"/>
541 541 <modify-function signature="operator*=(QTransform)" access="private"/>
542 542
543 543 <modify-function signature="inverted(bool*)const">
544 544 <modify-argument index="1">
545 545 <remove-argument/>
546 546 </modify-argument>
547 547 </modify-function>
548 548 </value-type>
549 549
550 550 <value-type name="QStyleOption" delete-in-main-thread="yes" polymorphic-base="yes" polymorphic-id-expression="%1-&gt;type == QStyleOption::SO_Default">
551 551 <modify-function signature="operator=(QStyleOption)" remove="all"/>
552 552 <modify-function signature="init(const QWidget*)" remove="all"/> <!--### Obsolete in 4.3-->
553 553 </value-type>
554 554 <value-type name="QStyleOptionGraphicsItem" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionGraphicsItem::Type &amp;&amp; %1-&gt;version == QStyleOptionGraphicsItem::Version"/>
555 555 <value-type name="QStyleOptionSizeGrip" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionSizeGrip::Type &amp;&amp; %1-&gt;version == QStyleOptionSizeGrip::Version"/>
556 556 <value-type name="QStyleOptionButton" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionButton::Type &amp;&amp; %1-&gt;version == QStyleOptionButton::Version"/>
557 557 <value-type name="QStyleOptionComboBox" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionComboBox::Type &amp;&amp; %1-&gt;version == QStyleOptionComboBox::Version"/>
558 558 <value-type name="QStyleOptionComplex" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionComplex::Type &amp;&amp; %1-&gt;version == QStyleOptionComplex::Version"/>
559 559 <value-type name="QStyleOptionDockWidget" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionDockWidget::Type &amp;&amp; %1-&gt;version == QStyleOptionDockWidget::Version"/>
560 560 <value-type name="QStyleOptionFocusRect" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionFocusRect::Type &amp;&amp; %1-&gt;version == QStyleOptionFocusRect::Version"/>
561 561 <value-type name="QStyleOptionFrame" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionFrame::Type &amp;&amp; %1-&gt;version == QStyleOptionFrame::Version"/>
562 562
563 563 <value-type name="QStyleOptionGroupBox" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionGroupBox::Type &amp;&amp; %1-&gt;version == QStyleOptionGroupBox::Version"/>
564 564 <value-type name="QStyleOptionHeader" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionHeader::Type &amp;&amp; %1-&gt;version == QStyleOptionHeader::Version"/>
565 565 <value-type name="QStyleOptionMenuItem" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionMenuItem::Type &amp;&amp; %1-&gt;version == QStyleOptionMenuItem::Version"/>
566 566 <value-type name="QStyleOptionProgressBar" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionProgressBar::Type &amp;&amp; %1-&gt;version == QStyleOptionProgressBar::Version"/>
567 567
568 568 <value-type name="QStyleOptionRubberBand" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionRubberBand::Type &amp;&amp; %1-&gt;version == QStyleOptionRubberBand::Version"/>
569 569 <value-type name="QStyleOptionSlider" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionSlider::Type &amp;&amp; %1-&gt;version == QStyleOptionSlider::Version"/>
570 570 <value-type name="QStyleOptionSpinBox" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionSpinBox::Type &amp;&amp; %1-&gt;version == QStyleOptionSpinBox::Version"/>
571 571 <value-type name="QStyleOptionTab" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionTab::Type &amp;&amp; %1-&gt;version == QStyleOptionTab::Version"/>
572 572 <value-type name="QStyleOptionTabBarBase" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionTabBarBase::Type &amp;&amp; %1-&gt;version == QStyleOptionTabBarBase::Version"/>
573 573 <value-type name="QStyleOptionTabWidgetFrame" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionTabWidgetFrame::Type &amp;&amp; %1-&gt;version == QStyleOptionTabWidgetFrame::Version"/>
574 574 <value-type name="QStyleOptionTitleBar" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionTitleBar::Type &amp;&amp; %1-&gt;version == QStyleOptionTitleBar::Version"/>
575 575 <value-type name="QStyleOptionToolBar" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionToolBar::Type &amp;&amp; %1-&gt;version == QStyleOptionToolBar::Version"/>
576 576 <value-type name="QStyleOptionToolBox" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionToolBox::Type &amp;&amp; %1-&gt;version == QStyleOptionToolBox::Version"/>
577 577 <value-type name="QStyleOptionToolButton" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionToolButton::Type &amp;&amp; %1-&gt;version == QStyleOptionToolButton::Version"/>
578 578 <value-type name="QStyleOptionViewItem" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionViewItem::Type &amp;&amp; %1-&gt;version == QStyleOptionViewItem::Version"/>
579 579 <value-type name="QTextFragment" delete-in-main-thread="yes">
580 580 <modify-function signature="operator=(QTextFragment)" remove="all"/>
581 581 </value-type>
582 582 <value-type name="QBitmap" delete-in-main-thread="yes">
583 583 <modify-function signature="operator=(const QPixmap &amp;)" remove="all"/>
584 584 <modify-function signature="QBitmap(QString,const char*)" access="private">
585 585 <modify-argument index="2"> <remove-default-expression/> </modify-argument>
586 586 </modify-function>
587 587
588 588 <modify-function signature="fromData(QSize,const uchar*,QImage::Format)">
589 589 <access modifier="private"/>
590 590 <modify-argument index="3">
591 591 <remove-default-expression/>
592 592 </modify-argument>
593 593 </modify-function>
594 594
595 595 <modify-function signature="fromData(QSize,const uchar*,QImage::Format)" remove="all"/>
596 596
597 597 <modify-function signature="QBitmap(QString,const char*)">
598 598 <modify-argument index="2">
599 599 <replace-type modified-type="QString"/>
600 600 <conversion-rule class="native">
601 601 <insert-template name="core.convert_string_arg_to_char*"/>
602 602 </conversion-rule>
603 603 </modify-argument>
604 604 </modify-function>
605 605 </value-type>
606 606 <value-type name="QTextInlineObject" delete-in-main-thread="yes"/>
607 607 <value-type name="QSizePolicy"/>
608 608 <value-type name="QTableWidgetSelectionRange"/>
609 609 <value-type name="QTextDocumentFragment" delete-in-main-thread="yes">
610 610 <modify-function signature="operator=(QTextDocumentFragment)" remove="all"/>
611 611 </value-type>
612 612 <value-type name="QTextOption" delete-in-main-thread="yes">
613 613 <modify-function signature="operator=(const QTextOption &amp;)" remove="all"/>
614 614 </value-type>
615 615 <value-type name="QTextLine" delete-in-main-thread="yes">
616 616 <modify-function signature="cursorToX(int*,QTextLine::Edge)const">
617 617 <remove/>
618 618 </modify-function>
619 619 </value-type>
620 620 <value-type name="QTextTableFormat" delete-in-main-thread="yes"/>
621 621 <value-type name="QTextImageFormat" delete-in-main-thread="yes"/>
622 622 <value-type name="QTextFrameFormat" delete-in-main-thread="yes">
623 623 <modify-function signature="isValid()const" access="non-final"/>
624 624 </value-type>
625 625 <value-type name="QTextLength" delete-in-main-thread="yes"/>
626 626 <value-type name="QItemSelectionRange">
627 627 <modify-function signature="intersect(QItemSelectionRange)const" remove="all"/> <!--### Obsolete in 4.3-->
628 628 </value-type>
629 629 <value-type name="QLine"/>
630 630 <value-type name="QLineF"/>
631 631
632 632 <value-type name="QPainterPath">
633 633 <modify-function signature="operator=(QPainterPath)" remove="all"/>
634 634 </value-type>
635 635 <value-type name="QPalette">
636 636 <modify-function signature="operator=(const QPalette&amp;)" remove="all"/>
637 637
638 638 <modify-function signature="QPalette(QColor, QColor, QColor, QColor, QColor, QColor, QColor)" remove="all"/> <!--### Obsolete in 4.3-->
639 639 <modify-function signature="background()const" remove="all"/> <!--### Obsolete in 4.3-->
640 640 <modify-function signature="foreground()const" remove="all"/> <!--### Obsolete in 4.3-->
641 641 <modify-function signature="serialNumber()const" remove="all"/> <!--### Obsolete in 4.3-->
642 642 </value-type>
643 643 <value-type name="QKeySequence">
644 644 <modify-function signature="operator=(QKeySequence)" remove="all"/>
645 645 <modify-function signature="operator int()const" access="private"/>
646 646 <modify-function signature="operator[](uint)const" access="private"/>
647 647 </value-type>
648 648
649 649 <value-type name="QPicture" delete-in-main-thread="yes">
650 650 <modify-function signature="operator=(QPicture)" remove="all"/>
651 651 <modify-function signature="pictureFormat(QString)">
652 652 <remove/>
653 653 </modify-function>
654 654
655 655 <modify-function signature="inputFormatList()" remove="all"/> <!--### Obsolete in 4.3-->
656 656 <modify-function signature="inputFormats()" remove="all"/> <!--### Obsolete in 4.3-->
657 657 <modify-function signature="outputFormatList()" remove="all"/> <!--### Obsolete in 4.3-->
658 658 <modify-function signature="outputFormats()" remove="all"/> <!--### Obsolete in 4.3-->
659 659
660 660 <modify-function signature="setData(const char*,uint)" remove="all"/>
661 661
662 662 <modify-function signature="load(QIODevice*,const char*)">
663 663 <modify-argument index="2">
664 664 <replace-type modified-type="QString"/>
665 665 <conversion-rule class="native">
666 666 <insert-template name="core.convert_string_arg_to_char*"/>
667 667 </conversion-rule>
668 668 </modify-argument>
669 669 </modify-function>
670 670
671 671 <modify-function signature="load(QString,const char*)">
672 672 <modify-argument index="2">
673 673 <replace-type modified-type="QString"/>
674 674 <conversion-rule class="native">
675 675 <insert-template name="core.convert_string_arg_to_char*"/>
676 676 </conversion-rule>
677 677 </modify-argument>
678 678 </modify-function>
679 679
680 680 <modify-function signature="save(QIODevice*,const char*)">
681 681 <modify-argument index="2">
682 682 <replace-type modified-type="QString"/>
683 683 <conversion-rule class="native">
684 684 <insert-template name="core.convert_string_arg_to_char*"/>
685 685 </conversion-rule>
686 686 </modify-argument>
687 687 </modify-function>
688 688
689 689 <modify-function signature="save(QString,const char*)">
690 690 <modify-argument index="2">
691 691 <replace-type modified-type="QString"/>
692 692 <conversion-rule class="native">
693 693 <insert-template name="core.convert_string_arg_to_char*"/>
694 694 </conversion-rule>
695 695 </modify-argument>
696 696 </modify-function>
697 697 </value-type>
698 698
699 699 <value-type name="QRegion" expense-limit="4096">
700 700 <modify-function signature="operator=(QRegion)" remove="all"/>
701 701 <modify-function signature="operator&amp;=(QRegion)" remove="all"/>
702 702 <modify-function signature="operator+=(QRegion)" remove="all"/>
703 703 <modify-function signature="operator-=(QRegion)" remove="all"/>
704 704 <modify-function signature="operator^=(QRegion)" remove="all"/>
705 705 <modify-function signature="operator|=(QRegion)" remove="all"/>
706 706 <modify-function signature="operator&amp;(QRegion)const" remove="all"/>
707 707 <modify-function signature="operator+(QRegion)const" remove="all"/>
708 708 <modify-function signature="operator-(QRegion)const" remove="all"/>
709 709 <modify-function signature="operator^(QRegion)const" remove="all"/>
710 710 <modify-function signature="operator|(QRegion)const" remove="all"/>
711 711 <modify-function signature="eor(QRegion)const" remove="all"/> <!--### Obsolete in 4.3-->
712 712 <modify-function signature="intersect(QRegion)const" remove="all"/> <!--### Obsolete in 4.3-->
713 713 <modify-function signature="subtract(QRegion)const" remove="all"/> <!--### Obsolete in 4.3-->
714 714 <modify-function signature="unite(QRegion)const" remove="all"/> <!--### Obsolete in 4.3-->
715 715 <modify-function signature="operator&amp;=(QRect)" remove="all"/>
716 716 <modify-function signature="operator+=(QRect)" remove="all"/>
717 717
718 718 </value-type>
719 719
720 720 <value-type name="QTextBlock" delete-in-main-thread="yes">
721 721 <modify-function signature="operator=(QTextBlock)" remove="all"/>
722 722 <modify-function signature="setUserData(QTextBlockUserData *)">
723 723 <modify-argument index="1">
724 724 <define-ownership class="java" owner="c++"/>
725 725 </modify-argument>
726 726 </modify-function>
727 727 </value-type>
728 728 <value-type name="QTextBlockFormat" delete-in-main-thread="yes"/>
729 729 <value-type name="QTextTableCellFormat" delete-in-main-thread="yes"/>
730 730 <value-type name="QTextCharFormat" delete-in-main-thread="yes">
731 731 <modify-function signature="isValid()const" access="non-final"/>
732 732
733 733 <modify-function signature="anchorName()const" remove="all"/> <!--### Obsolete in 4.3-->
734 734 <modify-function signature="setAnchorName(QString)" remove="all"/> <!--### Obsolete in 4.3-->
735 735 </value-type>
736 736 <value-type name="QTextFormat" delete-in-main-thread="yes">
737 737 <modify-function signature="operator=(QTextFormat)" remove="all"/>
738 738 <modify-function signature="isValid()const" access="non-final"/>
739 739
740 740
741 741 <modify-function signature="setProperty(int,QVector&lt;QTextLength&gt;)" rename="setLengthVectorProperty"/>
742 742 <inject-code class="native" position="constructor">
743 743 if ((context-&gt;argumentCount() == 1) &amp;&amp; (qMetaTypeId&lt;QTextFormat&gt;() == context-&gt;argument(0).toVariant().userType())) {
744 744 QTextFormat _q_arg0 = qscriptvalue_cast&lt;QTextFormat&gt;(context-&gt;argument(0));
745 745 QTextFormat _q_cpp_result(_q_arg0);
746 746 QScriptValue _q_result = context-&gt;engine()-&gt;newVariant(context-&gt;thisObject(), qVariantFromValue(_q_cpp_result));
747 747 return _q_result;
748 748 }
749 749 </inject-code>
750 750 </value-type>
751 751
752 752 <value-type name="QTextListFormat" delete-in-main-thread="yes"/>
753 753 <value-type name="QPolygon">
754 754 <modify-function signature="QPolygon(int, const int *)" remove="all"/>
755 755 <modify-function signature="operator+(QVector&lt;QPoint&gt;)const" remove="all"/>
756 756 <modify-function signature="operator&lt;&lt;(QPoint)" remove="all"/>
757 757 <modify-function signature="operator&lt;&lt;(QVector&lt;QPoint&gt;)" remove="all"/>
758 758
759 759
760 760 </value-type>
761 761
762 762 <value-type name="QPolygonF">
763 763 <modify-function signature="operator+(QVector&lt;QPointF&gt;)const" remove="all"/>
764 764 <modify-function signature="operator&lt;&lt;(QPointF)" remove="all"/>
765 765 <modify-function signature="operator&lt;&lt;(QVector&lt;QPointF&gt;)" remove="all"/>
766 766 </value-type>
767 767
768 768 <value-type name="QIcon" delete-in-main-thread="yes">
769 769 <include file-name="QIconEngine" location="global"/>
770 770 <modify-function signature="operator=(QIcon)" remove="all"/>
771 771 <modify-function signature="serialNumber()const" remove="all"/> <!--### Obsolete in 4.3-->
772 772 <!--modify-function signature="QIcon(QIconEngineV2 *)">
773 773 <modify-argument index="1">
774 774 <define-ownership class="java" owner="c++" />
775 775 </modify-argument>
776 776 </modify-function-->
777 777 <modify-function signature="QIcon(QIconEngine *)">
778 778 <modify-argument index="1">
779 779 <define-ownership class="java" owner="c++"/>
780 780 </modify-argument>
781 781 </modify-function>
782 782 </value-type>
783 783
784 784 <value-type name="QTextFrame::iterator" delete-in-main-thread="yes">
785 785 <include file-name="QTextFrame" location="global"/>
786 786 <modify-function signature="operator++(int)" remove="all"/>
787 787 <modify-function signature="operator--(int)" remove="all"/>
788 788 <modify-function signature="operator=(QTextFrame::iterator)" remove="all"/>
789 789 <modify-function signature="operator++()" access="private"/>
790 790 <modify-function signature="operator--()" access="private"/>
791 791 </value-type>
792 792
793 793 <value-type name="QTreeWidgetItemIterator" delete-in-main-thread="yes">
794 794 <custom-constructor>
795 795 return new QTreeWidgetItemIterator(*copy);
796 796 </custom-constructor>
797 797 <custom-destructor>
798 798 delete copy;
799 799 </custom-destructor>
800 800 <modify-function signature="operator=(QTreeWidgetItemIterator)" remove="all"/>
801 801 <modify-function signature="operator++(int)" remove="all"/>
802 802 <modify-function signature="operator--(int)" remove="all"/>
803 803 <modify-function signature="operator+=(int)" access="private"/>
804 804 <modify-function signature="operator-=(int)" access="private"/>
805 805 <modify-function signature="operator++()" access="private"/>
806 806 <modify-function signature="operator--()" access="private"/>
807 807 <modify-function signature="operator*()const" access="private"/>
808 808 </value-type>
809 809
810 810 <value-type name="QTextBlock::iterator" delete-in-main-thread="yes">
811 811 <include file-name="QTextBlock" location="global"/>
812 812
813 813 <modify-function signature="operator++()" access="private"/>
814 814 <modify-function signature="operator--()" access="private"/>
815 815 <modify-function signature="operator++(int)" remove="all"/>
816 816 <modify-function signature="operator--(int)" remove="all"/>
817 817 </value-type>
818 818
819 819 <value-type name="QAbstractTextDocumentLayout::PaintContext" delete-in-main-thread="yes">
820 820 <include file-name="QAbstractTextDocumentLayout" location="global"/>
821 821 </value-type>
822 822 <value-type name="QAbstractTextDocumentLayout::Selection" delete-in-main-thread="yes"/>
823 823
824 824 <value-type name="QPixmap" delete-in-main-thread="yes">
825 825 <modify-function signature="operator=(QPixmap)" remove="all"/>
826 826 <modify-function signature="operator!()const" remove="all"/>
827 827 <modify-function signature="QPixmap(const char **)" access="private"/>
828 828 <modify-function signature="serialNumber()const" remove="all"/> <!--### Obsolete in 4.3-->
829 829
830 830 <modify-function signature="loadFromData(const uchar *,uint,const char *,QFlags&lt;Qt::ImageConversionFlag&gt;)" remove="all"/>
831 831
832 832 <modify-function signature="QPixmap(QString,const char*,QFlags&lt;Qt::ImageConversionFlag&gt;)">
833 833 <modify-argument index="2">
834 834 <replace-type modified-type="QString"/>
835 835 <conversion-rule class="native">
836 836 <insert-template name="core.convert_string_arg_to_char*"/>
837 837 </conversion-rule>
838 838 </modify-argument>
839 839 </modify-function>
840 840
841 841 <modify-function signature="load(QString,const char*,QFlags&lt;Qt::ImageConversionFlag&gt;)">
842 842 <modify-argument index="2">
843 843 <replace-type modified-type="QString"/>
844 844 <conversion-rule class="native">
845 845 <insert-template name="core.convert_string_arg_to_char*"/>
846 846 </conversion-rule>
847 847 </modify-argument>
848 848 </modify-function>
849 849
850 850 <modify-function signature="loadFromData(QByteArray,const char*,QFlags&lt;Qt::ImageConversionFlag&gt;)">
851 851 <modify-argument index="2">
852 852 <replace-type modified-type="QString"/>
853 853 <conversion-rule class="native">
854 854 <insert-template name="core.convert_string_arg_to_char*"/>
855 855 </conversion-rule>
856 856 </modify-argument>
857 857 </modify-function>
858 858
859 859 <modify-function signature="save(QIODevice*,const char*,int)const">
860 860 <modify-argument index="2">
861 861 <replace-type modified-type="QString"/>
862 862 <conversion-rule class="native">
863 863 <insert-template name="core.convert_string_arg_to_char*"/>
864 864 </conversion-rule>
865 865 </modify-argument>
866 866 </modify-function>
867 867
868 868 <modify-function signature="save(QString,const char*,int)const">
869 869 <modify-argument index="2">
870 870 <replace-type modified-type="QString"/>
871 871 <conversion-rule class="native">
872 872 <insert-template name="core.convert_string_arg_to_char*"/>
873 873 </conversion-rule>
874 874 </modify-argument>
875 875 </modify-function>
876 876 </value-type>
877 877
878 878 <value-type name="QTextCursor" delete-in-main-thread="yes">
879 879 <extra-includes>
880 880 <include file-name="QTextBlock" location="global"/>
881 881 <include file-name="QTextDocumentFragment" location="global"/>
882 882 </extra-includes>
883 883 <modify-function signature="operator=(QTextCursor)" remove="all"/>
884 884 <modify-function signature="selectedTableCells(int*,int*,int*,int*)const">
885 885 <access modifier="private"/>
886 886 </modify-function>
887 887 </value-type>
888 888
889 889 <value-type name="QTextLayout::FormatRange">
890 890 <include file-name="QTextLayout" location="global"/>
891 891 </value-type>
892 892
893 893 <value-type name="QInputMethodEvent::Attribute">
894 894 <include file-name="QInputMethodEvent" location="global"/>
895 895 <custom-constructor>
896 896 return new QInputMethodEvent::Attribute(copy-&gt;type, copy-&gt;start, copy-&gt;length, copy-&gt;value);
897 897 </custom-constructor>
898 898 <custom-destructor>
899 899 delete copy;
900 900 </custom-destructor>
901 901 </value-type>
902 902
903 903 <value-type name="QItemSelection" delete-in-main-thread="yes">
904 904
905 905 <modify-function signature="operator+(const QList&lt;QItemSelectionRange&gt;&amp;)const" remove="all"/>
906 906 <modify-function signature="operator+=(const QList&lt;QItemSelectionRange&gt;&amp;)" remove="all"/>
907 907 <modify-function signature="operator+=(const QItemSelectionRange&amp;)" remove="all"/>
908 908 <modify-function signature="operator&lt;&lt;(const QList&lt;QItemSelectionRange&gt;&amp;)" remove="all"/>
909 909 <modify-function signature="operator&lt;&lt;(QItemSelectionRange)" remove="all"/>
910 910 </value-type>
911 911
912 912 <value-type name="QMatrix4x4">
913 913 <modify-function signature="data()const" remove="all"/>
914 914 <modify-function signature="operator()(int, int)const" remove="all"/>
915 915 </value-type>
916 916 <value-type name="QMatrix">
917 917 <extra-includes>
918 918 <include file-name="QPainterPath" location="global"/>
919 919 </extra-includes>
920 920
921 921 <modify-function signature="map(int,int,int*,int*)const" remove="all"/>
922 922 <modify-function signature="map(qreal,qreal,qreal*,qreal*)const" remove="all"/>
923 923 <modify-function signature="operator=(QMatrix)" remove="all"/>
924 924
925 925 <modify-function signature="operator*(QMatrix)const" access="private"/>
926 926 <modify-function signature="operator*=(QMatrix)" access="private"/>
927 927 <modify-function signature="rotate(qreal)" access="private" rename="rotate_private"/>
928 928 <modify-function signature="scale(qreal,qreal)" access="private" rename="scale_private"/>
929 929 <modify-function signature="shear(qreal,qreal)" access="private" rename="shear_private"/>
930 930 <modify-function signature="translate(qreal,qreal)" access="private" rename="translate_private"/>
931 931
932 932 <modify-function signature="inverted(bool*)const">
933 933 <access modifier="private"/>
934 934 <modify-argument index="1">
935 935 <!-- <remove-default-expression/> -->
936 936 </modify-argument>
937 937 </modify-function>
938 938
939 939 <inject-code>
940 940 <insert-template name="core.unary_other_type">
941 941 <replace from="%FUNCTION_NAME" to="rotate"/>
942 942 <replace from="%OUT_TYPE" to="QMatrix"/>
943 943 <replace from="%IN_TYPE" to="double"/>
944 944 </insert-template>
945 945
946 946 <insert-template name="core.private_function_return_self">
947 947 <replace from="%RETURN_TYPE" to="QMatrix"/>
948 948 <replace from="%FUNCTION_NAME" to="scale"/>
949 949 <replace from="%ARGUMENTS" to="double sx, double sy"/>
950 950 <replace from="%ARGUMENT_NAMES" to="sx, sy"/>
951 951 </insert-template>
952 952
953 953 <insert-template name="core.private_function_return_self">
954 954 <replace from="%RETURN_TYPE" to="QMatrix"/>
955 955 <replace from="%FUNCTION_NAME" to="shear"/>
956 956 <replace from="%ARGUMENTS" to="double sh, double sv"/>
957 957 <replace from="%ARGUMENT_NAMES" to="sh, sv"/>
958 958 </insert-template>
959 959
960 960 <insert-template name="core.private_function_return_self">
961 961 <replace from="%RETURN_TYPE" to="QMatrix"/>
962 962 <replace from="%FUNCTION_NAME" to="translate"/>
963 963 <replace from="%ARGUMENTS" to="double dx, double dy"/>
964 964 <replace from="%ARGUMENT_NAMES" to="dx, dy"/>
965 965 </insert-template>
966 966 </inject-code>
967 967
968 968 <modify-function signature="inverted(bool*)const">
969 969 <modify-argument index="1">
970 970 <remove-argument/>
971 971 </modify-argument>
972 972 </modify-function>
973 973 </value-type>
974 974
975 975 <value-type name="QConicalGradient" polymorphic-id-expression="%1-&gt;type() == QGradient::ConicalGradient">
976 976 <custom-constructor>
977 977 return new QConicalGradient(copy-&gt;center(), copy-&gt;angle());
978 978 </custom-constructor>
979 979 <custom-destructor>
980 980 delete copy;
981 981 </custom-destructor>
982 982 </value-type>
983 983
984 984 <value-type name="QFontInfo" delete-in-main-thread="yes" expense-cost="1" expense-limit="1000">
985 985 <custom-constructor>
986 986 return new QFontInfo(*copy);
987 987 </custom-constructor>
988 988 <custom-destructor>
989 989 delete copy;
990 990 </custom-destructor>
991 991 <modify-function signature="operator=(QFontInfo)" remove="all"/>
992 992
993 993
994 994 <modify-function signature="QFontInfo(QFontInfo)">
995 995 <modify-argument index="1">
996 996 <replace-type modified-type="QFontInfo*"/>
997 997 <conversion-rule class="native">
998 998 QFontInfo &amp; %out% = *qscriptvalue_cast&lt;QFontInfo*&gt;(%in%);
999 999 </conversion-rule>
1000 1000 </modify-argument>
1001 1001 </modify-function>
1002 1002 </value-type>
1003 1003
1004 1004 <value-type name="QRadialGradient" polymorphic-id-expression="%1-&gt;type() == QGradient::RadialGradient">
1005 1005 <custom-constructor>
1006 1006 return new QRadialGradient(copy-&gt;center(), copy-&gt;radius(), copy-&gt;focalPoint());
1007 1007 </custom-constructor>
1008 1008 <custom-destructor>
1009 1009 delete copy;
1010 1010 </custom-destructor>
1011 1011 </value-type>
1012 1012
1013 1013 <value-type name="QPainterPath::Element">
1014 1014 <modify-field name="x" write="false"/>
1015 1015 <modify-field name="y" write="false"/>
1016 1016 <modify-field name="type" write="false"/>
1017 1017 <include file-name="QPainterPath" location="global"/>
1018 1018 <modify-function signature="operator QPointF()const" access="private"/>
1019 1019 </value-type>
1020 1020
1021 1021 <value-type name="QTextEdit::ExtraSelection" delete-in-main-thread="yes">
1022 1022 <include file-name="QTextEdit" location="global"/>
1023 1023 </value-type>
1024 1024
1025 1025 <value-type name="QFont" delete-in-main-thread="yes" expense-cost="1" expense-limit="1000">
1026 1026 <extra-includes>
1027 1027 <include file-name="QStringList" location="global"/>
1028 1028 </extra-includes>
1029 1029 <modify-function signature="operator=(QFont)" remove="all"/>
1030 1030 </value-type>
1031 1031
1032 1032 <value-type name="QTextTableCell" delete-in-main-thread="yes">
1033 1033 <extra-includes>
1034 1034 <include file-name="QTextCursor" location="global"/>
1035 1035 </extra-includes>
1036 1036 <modify-function signature="operator=(QTextTableCell)" remove="all"/>
1037 1037 </value-type>
1038 1038
1039 1039 <value-type name="QImage" expense-limit="67108864" expense-cost="height()*bytesPerLine()">
1040 1040 <modify-function signature="QImage(const char *, const char *)">
1041 1041 <remove/>
1042 1042 </modify-function>
1043 1043 <modify-function signature="QImage(const char **)">
1044 1044 <access modifier="private"/>
1045 1045 </modify-function>
1046 1046 <modify-function signature="QImage(const uchar*,int,int,int,QImage::Format)">
1047 1047 <remove/>
1048 1048 </modify-function>
1049 1049 <modify-function signature="bits()const">
1050 1050 <remove/>
1051 1051 </modify-function>
1052 1052 <modify-function signature="scanLine(int)const">
1053 1053 <remove/>
1054 1054 </modify-function>
1055 1055 <modify-function signature="QImage(const uchar *, int, int, QImage::Format)">
1056 1056 <remove/>
1057 1057 </modify-function>
1058 1058
1059 1059 <extra-includes>
1060 1060 <include file-name="QStringList" location="global"/>
1061 1061 <include file-name="QMatrix" location="global"/>
1062 1062 </extra-includes>
1063 1063
1064 1064 <modify-function signature="QImage(uchar*,int,int,QImage::Format)">
1065 1065 <access modifier="private"/>
1066 1066 </modify-function>
1067 1067
1068 1068 <!--
1069 1069 <modify-function signature="QImage(QString,const char*)">
1070 1070 <access modifier="private"/>
1071 1071 <modify-argument index="2">
1072 1072 <remove-default-expression/>
1073 1073 </modify-argument>
1074 1074 </modify-function>
1075 1075 -->
1076 1076
1077 1077 <modify-function signature="load(QString,const char*)">
1078 1078 <access modifier="private"/>
1079 1079 <modify-argument index="2">
1080 1080 <remove-default-expression/>
1081 1081 </modify-argument>
1082 1082 </modify-function>
1083 1083
1084 1084 <modify-function signature="load(QIODevice*,const char*)">
1085 1085 <access modifier="private"/>
1086 1086 </modify-function>
1087 1087
1088 1088 <modify-function signature="loadFromData(const uchar*,int,const char*)">
1089 1089 <access modifier="private"/>
1090 1090 <modify-argument index="2">
1091 1091 <remove-default-expression/>
1092 1092 </modify-argument>
1093 1093 <modify-argument index="3">
1094 1094 <remove-default-expression/>
1095 1095 </modify-argument>
1096 1096 </modify-function>
1097 1097
1098 1098 <modify-function signature="loadFromData(QByteArray,const char*)">
1099 1099 <access modifier="private"/>
1100 1100 <modify-argument index="2">
1101 1101 <remove-default-expression/>
1102 1102 </modify-argument>
1103 1103 </modify-function>
1104 1104
1105 1105 <modify-function signature="operator=(QImage)" remove="all"/>
1106 1106
1107 1107 <modify-function signature="setText(const char*,const char*,QString)">
1108 1108 <remove/>
1109 1109 </modify-function>
1110 1110
1111 1111 <modify-function signature="text(const char*,const char*)const">
1112 1112 <remove/>
1113 1113 </modify-function>
1114 1114
1115 1115 <modify-function signature="fromData(QByteArray,const char*)">
1116 1116 <access modifier="private"/>
1117 1117 <modify-argument index="2">
1118 1118 <remove-default-expression/>
1119 1119 </modify-argument>
1120 1120 </modify-function>
1121 1121
1122 1122 <modify-function signature="fromData(const uchar*,int,const char*)">
1123 1123 <remove/>
1124 1124 </modify-function>
1125 1125
1126 1126 <modify-function signature="serialNumber()const" remove="all"/> <!--### Obsolete in 4.3-->
1127 1127 <modify-function signature="textLanguages()const" remove="all"/> <!--### Obsolete in 4.3-->
1128 1128
1129 1129 <modify-function signature="QImage(const char**)" remove="all"/>
1130 1130 <modify-function signature="QImage(const uchar *,int,int,QImage::Format)" remove="all"/>
1131 1131 <modify-function signature="QImage(const uchar *,int,int,int,QImage::Format)" remove="all"/>
1132 1132 <modify-function signature="QImage(uchar *,int,int,QImage::Format)" remove="all"/>
1133 1133 <modify-function signature="QImage(uchar *,int,int,int,QImage::Format)" remove="all"/>
1134 1134 <modify-function signature="setColorTable(const QVector&lt;uint&gt;)" remove="all"/>
1135 1135 <modify-function signature="loadFromData(const uchar *,int,const char *)" remove="all"/>
1136 1136 <modify-function signature="fromData(const uchar *,int,const char *)" remove="all"/>
1137 1137 <modify-function signature="bits()" remove="all"/>
1138 1138 <modify-function signature="scanLine(int)" remove="all"/>
1139 1139
1140 1140 <modify-function signature="QImage(QString,const char*)">
1141 1141 <modify-argument index="2">
1142 1142 <replace-type modified-type="QString"/>
1143 1143 <conversion-rule class="native">
1144 1144 <insert-template name="core.convert_string_arg_to_char*"/>
1145 1145 </conversion-rule>
1146 1146 </modify-argument>
1147 1147 </modify-function>
1148 1148
1149 1149 <modify-function signature="fromData(QByteArray,const char*)">
1150 1150 <modify-argument index="2">
1151 1151 <replace-type modified-type="QString"/>
1152 1152 <conversion-rule class="native">
1153 1153 <insert-template name="core.convert_string_arg_to_char*"/>
1154 1154 </conversion-rule>
1155 1155 </modify-argument>
1156 1156 </modify-function>
1157 1157
1158 1158 <modify-function signature="load(QString,const char*)">
1159 1159 <modify-argument index="2">
1160 1160 <replace-type modified-type="QString"/>
1161 1161 <conversion-rule class="native">
1162 1162 <insert-template name="core.convert_string_arg_to_char*"/>
1163 1163 </conversion-rule>
1164 1164 </modify-argument>
1165 1165 </modify-function>
1166 1166
1167 1167 <modify-function signature="load(QIODevice*,const char*)">
1168 1168 <modify-argument index="2">
1169 1169 <replace-type modified-type="QString"/>
1170 1170 <conversion-rule class="native">
1171 1171 <insert-template name="core.convert_string_arg_to_char*"/>
1172 1172 </conversion-rule>
1173 1173 </modify-argument>
1174 1174 </modify-function>
1175 1175
1176 1176 <modify-function signature="loadFromData(QByteArray,const char*)">
1177 1177 <modify-argument index="2">
1178 1178 <replace-type modified-type="QString"/>
1179 1179 <conversion-rule class="native">
1180 1180 <insert-template name="core.convert_string_arg_to_char*"/>
1181 1181 </conversion-rule>
1182 1182 </modify-argument>
1183 1183 </modify-function>
1184 1184
1185 1185 <modify-function signature="save(QString,const char*,int)const">
1186 1186 <modify-argument index="2">
1187 1187 <replace-type modified-type="QString"/>
1188 1188 <conversion-rule class="native">
1189 1189 <insert-template name="core.convert_string_arg_to_char*"/>
1190 1190 </conversion-rule>
1191 1191 </modify-argument>
1192 1192 </modify-function>
1193 1193
1194 1194 <modify-function signature="save(QIODevice*,const char*,int)const">
1195 1195 <modify-argument index="2">
1196 1196 <replace-type modified-type="QString"/>
1197 1197 <conversion-rule class="native">
1198 1198 <insert-template name="core.convert_string_arg_to_char*"/>
1199 1199 </conversion-rule>
1200 1200 </modify-argument>
1201 1201 </modify-function>
1202 1202
1203 <inject-code class="pywrap-h">
1204 QImage* new_QImage( const uchar * data, int width, int height, QImage::Format format )
1205 {
1206 QImage* image = new QImage(width, height, format);
1207 memcpy(image-&gt;bits(), data, image-&gt;byteCount());
1208 return image;
1209 }
1210 </inject-code>
1211 1203 </value-type>
1212 1204
1213 1205 <value-type name="QColormap" delete-in-main-thread="yes">
1214 1206 <modify-function signature="operator=(QColormap)" remove="all"/>
1215 1207 <extra-includes>
1216 1208 <include file-name="QColor" location="global"/>
1217 1209 </extra-includes>
1218 1210 <custom-constructor>
1219 1211 return new QColormap(*copy);
1220 1212 </custom-constructor>
1221 1213 <custom-destructor>
1222 1214 delete copy;
1223 1215 </custom-destructor>
1224 1216 </value-type>
1225 1217
1226 1218 <value-type name="QCursor" delete-in-main-thread="yes">
1227 1219 <extra-includes>
1228 1220 <include file-name="QPixmap" location="global"/>
1229 1221 </extra-includes>
1230 1222 <modify-function signature="operator=(QCursor)" remove="all"/>
1231 1223 </value-type>
1232 1224
1233 1225 <value-type name="QFontDatabase" delete-in-main-thread="yes">
1234 1226 <extra-includes>
1235 1227 <include file-name="QStringList" location="global"/>
1236 1228 </extra-includes>
1237 1229 </value-type>
1238 1230
1239 1231 <value-type name="QPen">
1240 1232 <extra-includes>
1241 1233 <include file-name="QBrush" location="global"/>
1242 1234 </extra-includes>
1243 1235
1244 1236 <modify-function signature="operator=(QPen)" remove="all"/>
1245 1237 </value-type>
1246 1238
1247 1239 <value-type name="QBrush">
1248 1240 <modify-function signature="QBrush(Qt::GlobalColor, Qt::BrushStyle)" remove="all"/>
1249 1241 <modify-function signature="operator=(const QBrush &amp;)" remove="all"/>
1250 1242
1251 1243 <extra-includes>
1252 1244 <include file-name="QPixmap" location="global"/>
1253 1245 </extra-includes>
1254 1246
1255 1247 <modify-function signature="QBrush(QGradient)">
1256 1248 <modify-argument index="1">
1257 1249 <replace-type modified-type="QGradient*"/>
1258 1250 <conversion-rule class="native">
1259 1251 QGradient &amp; %out% = *qscriptvalue_cast&lt;QGradient*&gt;(%in%);
1260 1252 </conversion-rule>
1261 1253 </modify-argument>
1262 1254 </modify-function>
1263 1255 </value-type>
1264 1256
1265 1257 <value-type name="QColor">
1266 1258 <modify-function signature="QColor(QColor::Spec)" remove="all"/>
1267 1259 <modify-function signature="operator=(QColor)" remove="all"/>
1268 1260 <modify-function signature="operator=(Qt::GlobalColor)" remove="all"/>
1269 1261
1270 1262 <modify-function signature="QColor(const char*)">
1271 1263 <remove/>
1272 1264 </modify-function>
1273 1265
1274 1266 <modify-function signature="getCmyk(int*,int*,int*,int*,int*)">
1275 1267 <remove/>
1276 1268 </modify-function>
1277 1269
1278 1270 <modify-function signature="getCmykF(qreal*,qreal*,qreal*,qreal*,qreal*)">
1279 1271 <remove/>
1280 1272 </modify-function>
1281 1273
1282 1274 <modify-function signature="getHsv(int*,int*,int*,int*)const">
1283 1275 <remove/>
1284 1276 </modify-function>
1285 1277
1286 1278 <modify-function signature="getHsvF(qreal*,qreal*,qreal*,qreal*)const">
1287 1279 <remove/>
1288 1280 </modify-function>
1289 1281
1290 1282 <modify-function signature="getRgb(int*,int*,int*,int*)const">
1291 1283 <remove/>
1292 1284 </modify-function>
1293 1285
1294 1286 <modify-function signature="getRgbF(qreal*,qreal*,qreal*,qreal*)const">
1295 1287 <remove/>
1296 1288 </modify-function>
1297 1289
1298 1290 <modify-function signature="dark(int)const" remove="all"/> <!--### Obsolete in 4.3-->
1299 1291 <modify-function signature="light(int)const" remove="all"/> <!--### Obsolete in 4.3-->
1300 1292 </value-type>
1301 1293
1302 1294 <value-type name="QFontMetricsF" delete-in-main-thread="yes" expense-cost="1" expense-limit="1000">
1303 1295 <custom-constructor>
1304 1296 return new QFontMetricsF(*copy);
1305 1297 </custom-constructor>
1306 1298 <custom-destructor>
1307 1299 delete copy;
1308 1300 </custom-destructor>
1309 1301 <modify-function signature="operator!=(const QFontMetricsF &amp;)">
1310 1302 <remove/>
1311 1303 </modify-function>
1312 1304 <modify-function signature="operator==(const QFontMetricsF &amp;)">
1313 1305 <remove/>
1314 1306 </modify-function>
1315 1307
1316 1308 <modify-function signature="boundingRect(QRectF,int,QString,int,int*)const">
1317 1309 <access modifier="private"/>
1318 1310 <modify-argument index="4">
1319 1311 <remove-default-expression/>
1320 1312 </modify-argument>
1321 1313 <modify-argument index="5">
1322 1314 <remove-default-expression/>
1323 1315 </modify-argument>
1324 1316 </modify-function>
1325 1317
1326 1318 <modify-function signature="operator=(QFontMetrics)" remove="all"/>
1327 1319 <modify-function signature="operator=(QFontMetricsF)" remove="all"/>
1328 1320
1329 1321 <modify-function signature="size(int,QString,int,int*)const">
1330 1322 <access modifier="private"/>
1331 1323 <modify-argument index="3">
1332 1324 <remove-default-expression/>
1333 1325 </modify-argument>
1334 1326 <modify-argument index="4">
1335 1327 <remove-default-expression/>
1336 1328 </modify-argument>
1337 1329 </modify-function>
1338 1330
1339 1331 <modify-function signature="QFontMetricsF(QFontMetricsF)" remove="all"/>
1340 1332 <modify-function signature="QFontMetricsF(QFontMetrics)" remove="all"/>
1341 1333 <modify-function signature="operator==(QFontMetricsF)const" remove="all"/>
1342 1334 <modify-function signature="operator!=(QFontMetricsF)const" remove="all"/>
1343 1335 </value-type>
1344 1336 <value-type name="QTextOption::Tab"/>
1345 1337
1346 1338 <value-type name="QFontMetrics" delete-in-main-thread="yes" expense-cost="1" expense-limit="1000">
1347 1339 <custom-constructor>
1348 1340 return new QFontMetrics(*copy);
1349 1341 </custom-constructor>
1350 1342 <custom-destructor>
1351 1343 delete copy;
1352 1344 </custom-destructor>
1353 1345 <modify-function signature="operator!=(const QFontMetrics &amp;)">
1354 1346 <remove/>
1355 1347 </modify-function>
1356 1348 <modify-function signature="operator==(const QFontMetrics &amp;)">
1357 1349 <remove/>
1358 1350 </modify-function>
1359 1351
1360 1352 <modify-function signature="boundingRect(int,int,int,int,int,QString,int,int*)const">
1361 1353 <access modifier="private"/>
1362 1354 <modify-argument index="7">
1363 1355 <remove-default-expression/>
1364 1356 </modify-argument>
1365 1357 <modify-argument index="8">
1366 1358 <remove-default-expression/>
1367 1359 </modify-argument>
1368 1360 </modify-function>
1369 1361
1370 1362 <modify-function signature="boundingRect(QRect,int,QString,int,int*)const">
1371 1363 <access modifier="private"/>
1372 1364 <modify-argument index="4">
1373 1365 <remove-default-expression/>
1374 1366 </modify-argument>
1375 1367 <modify-argument index="5">
1376 1368 <remove-default-expression/>
1377 1369 </modify-argument>
1378 1370 </modify-function>
1379 1371
1380 1372 <modify-function signature="operator=(QFontMetrics)" remove="all"/>
1381 1373
1382 1374 <modify-function signature="size(int,QString,int,int*)const">
1383 1375 <access modifier="private"/>
1384 1376 <modify-argument index="3">
1385 1377 <remove-default-expression/>
1386 1378 </modify-argument>
1387 1379 <modify-argument index="4">
1388 1380 <remove-default-expression/>
1389 1381 </modify-argument>
1390 1382 </modify-function>
1391 1383
1392 1384
1393 1385 <modify-function signature="QFontMetrics(QFontMetrics)" remove="all"/>
1394 1386 <modify-function signature="operator==(QFontMetrics)const" remove="all"/>
1395 1387 <modify-function signature="operator!=(QFontMetrics)const" remove="all"/>
1396 1388 </value-type>
1397 1389
1398 1390 <value-type name="QGradient" force-abstract="yes" polymorphic-base="yes" polymorphic-id-expression="%1-&gt;type() == QGradient::NoGradient">
1399 1391 <custom-constructor>
1400 1392 Q_UNUSED(copy)
1401 1393 qWarning("Copying empty QGradient object");
1402 1394 return new QGradient();
1403 1395 </custom-constructor>
1404 1396 <custom-destructor>
1405 1397 delete copy;
1406 1398 </custom-destructor>
1407 1399 <modify-function signature="operator==(const QGradient &amp;)">
1408 1400 <remove/>
1409 1401 </modify-function>
1410 1402 </value-type>
1411 1403
1412 1404 <value-type name="QLinearGradient" polymorphic-id-expression="%1-&gt;type() == QGradient::LinearGradient">
1413 1405 <custom-constructor>
1414 1406 QLinearGradient *lg = new QLinearGradient(copy-&gt;start(), copy-&gt;finalStop());
1415 1407 lg-&gt;setSpread(copy-&gt;spread());
1416 1408 lg-&gt;setStops(copy-&gt;stops());
1417 1409 return (void *) lg;
1418 1410 </custom-constructor>
1419 1411 <custom-destructor>
1420 1412 delete copy;
1421 1413 </custom-destructor>
1422 1414 </value-type>
1423 1415
1424 1416 <value-type name="QPrinterInfo">
1425 1417 <modify-function signature="operator=(const QPrinterInfo &amp;)" remove="all"/>
1426 1418 </value-type>
1427 1419
1428 1420 <interface-type name="QLayoutItem"/>
1429 1421 <interface-type name="QPaintDevice"/>
1430 1422
1431 1423 <interface-type name="QGraphicsItem" delete-in-main-thread="yes">
1432 1424 <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/>
1433 1425 <modify-function signature="toGraphicsObject() const" remove="all"/>
1434 1426
1435 1427 <modify-function signature="paint(QPainter*,const QStyleOptionGraphicsItem*,QWidget*)">
1436 1428 <modify-argument index="1" invalidate-after-use="yes"/>
1437 1429 </modify-function>
1438 1430 <modify-function signature="collidesWithItem(const QGraphicsItem*,Qt::ItemSelectionMode)const">
1439 1431 <modify-argument index="1" invalidate-after-use="yes"/>
1440 1432 </modify-function>
1441 1433
1442 1434 <modify-function signature="contextMenuEvent(QGraphicsSceneContextMenuEvent*)">
1443 1435 <modify-argument index="1" invalidate-after-use="yes"/>
1444 1436 </modify-function>
1445 1437 <modify-function signature="dragEnterEvent(QGraphicsSceneDragDropEvent*)">
1446 1438 <modify-argument index="1" invalidate-after-use="yes"/>
1447 1439 </modify-function>
1448 1440 <modify-function signature="dragLeaveEvent(QGraphicsSceneDragDropEvent*)">
1449 1441 <modify-argument index="1" invalidate-after-use="yes"/>
1450 1442 </modify-function>
1451 1443 <modify-function signature="dragMoveEvent(QGraphicsSceneDragDropEvent*)">
1452 1444 <modify-argument index="1" invalidate-after-use="yes"/>
1453 1445 </modify-function>
1454 1446 <modify-function signature="dropEvent(QGraphicsSceneDragDropEvent*)">
1455 1447 <modify-argument index="1" invalidate-after-use="yes"/>
1456 1448 </modify-function>
1457 1449 <modify-function signature="focusInEvent(QFocusEvent*)">
1458 1450 <modify-argument index="1" invalidate-after-use="yes"/>
1459 1451 </modify-function>
1460 1452 <modify-function signature="focusOutEvent(QFocusEvent*)">
1461 1453 <modify-argument index="1" invalidate-after-use="yes"/>
1462 1454 </modify-function>
1463 1455 <modify-function signature="hoverEnterEvent(QGraphicsSceneHoverEvent*)">
1464 1456 <modify-argument index="1" invalidate-after-use="yes"/>
1465 1457 </modify-function>
1466 1458 <modify-function signature="hoverLeaveEvent(QGraphicsSceneHoverEvent*)">
1467 1459 <modify-argument index="1" invalidate-after-use="yes"/>
1468 1460 </modify-function>
1469 1461 <modify-function signature="hoverMoveEvent(QGraphicsSceneHoverEvent*)">
1470 1462 <modify-argument index="1" invalidate-after-use="yes"/>
1471 1463 </modify-function>
1472 1464 <modify-function signature="inputMethodEvent(QInputMethodEvent*)">
1473 1465 <modify-argument index="1" invalidate-after-use="yes"/>
1474 1466 </modify-function>
1475 1467 <modify-function signature="isObscuredBy(const QGraphicsItem*)const">
1476 1468 <modify-argument index="1" invalidate-after-use="yes"/>
1477 1469 </modify-function>
1478 1470 <modify-function signature="keyPressEvent(QKeyEvent*)">
1479 1471 <modify-argument index="1" invalidate-after-use="yes"/>
1480 1472 </modify-function>
1481 1473 <modify-function signature="keyReleaseEvent(QKeyEvent*)">
1482 1474 <modify-argument index="1" invalidate-after-use="yes"/>
1483 1475 </modify-function>
1484 1476 <modify-function signature="mouseDoubleClickEvent(QGraphicsSceneMouseEvent*)">
1485 1477 <modify-argument index="1" invalidate-after-use="yes"/>
1486 1478 </modify-function>
1487 1479 <modify-function signature="mouseMoveEvent(QGraphicsSceneMouseEvent*)">
1488 1480 <modify-argument index="1" invalidate-after-use="yes"/>
1489 1481 </modify-function>
1490 1482 <modify-function signature="mousePressEvent(QGraphicsSceneMouseEvent*)">
1491 1483 <modify-argument index="1" invalidate-after-use="yes"/>
1492 1484 </modify-function>
1493 1485 <modify-function signature="mouseReleaseEvent(QGraphicsSceneMouseEvent*)">
1494 1486 <modify-argument index="1" invalidate-after-use="yes"/>
1495 1487 </modify-function>
1496 1488 <modify-function signature="sceneEvent(QEvent*)">
1497 1489 <modify-argument index="1" invalidate-after-use="yes"/>
1498 1490 </modify-function>
1499 1491 <modify-function signature="sceneEventFilter(QGraphicsItem*,QEvent*)">
1500 1492 <modify-argument index="1" invalidate-after-use="yes"/>
1501 1493 <modify-argument index="2" invalidate-after-use="yes"/>
1502 1494 </modify-function>
1503 1495 <modify-function signature="wheelEvent(QGraphicsSceneWheelEvent*)">
1504 1496 <modify-argument index="1" invalidate-after-use="yes"/>
1505 1497 </modify-function>
1506 1498
1507 1499 <modify-function signature="children()const" remove="all"/>
1508 1500 <modify-function signature="installSceneEventFilter(QGraphicsItem *)">
1509 1501 <modify-argument index="1">
1510 1502 <!-- Safe to ignore because items in a scene are memory managed by the scene -->
1511 1503 <reference-count action="ignore"/>
1512 1504 </modify-argument>
1513 1505 </modify-function>
1514 1506 <modify-function signature="removeSceneEventFilter(QGraphicsItem *)">
1515 1507 <modify-argument index="1">
1516 1508 <!-- Safe to ignore because items in a scene are memory managed by the scene -->
1517 1509 <reference-count action="ignore"/>
1518 1510 </modify-argument>
1519 1511 </modify-function>
1520 1512
1521 1513 <modify-function signature="matrix()const" remove="all"/> <!--### Obsolete in 4.3-->
1522 1514 <modify-function signature="resetMatrix()" remove="all"/> <!--### Obsolete in 4.3-->
1523 1515 <modify-function signature="sceneMatrix()const" remove="all"/> <!--### Obsolete in 4.3-->
1524 1516 <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/> <!--### Obsolete in 4.3-->
1525 1517
1526 1518 <modify-function signature="supportsExtension(QGraphicsItem::Extension)const" remove="all"/>
1527 1519 <modify-function signature="setExtension(QGraphicsItem::Extension,QVariant)" remove="all"/>
1528 1520 </interface-type>
1529 1521
1530 1522 <object-type name="QAbstractGraphicsShapeItem" delete-in-main-thread="yes">
1531 1523 <modify-function signature="QAbstractGraphicsShapeItem(QGraphicsItem*,QGraphicsScene*)">
1532 1524 <inject-code position="end">
1533 1525 <argument-map index="1" meta-name="%1"/>
1534 1526 if (%1 != null) disableGarbageCollection();
1535 1527 </inject-code>
1536 1528 </modify-function>
1537 1529
1538 1530 <modify-function signature="matrix()const" remove="all"/> <!--### Obsolete in 4.3-->
1539 1531 <modify-function signature="resetMatrix()" remove="all"/> <!--### Obsolete in 4.3-->
1540 1532 <modify-function signature="sceneMatrix()const" remove="all"/> <!--### Obsolete in 4.3-->
1541 1533 <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/> <!--### Obsolete in 4.3-->
1542 1534 </object-type>
1543 1535
1544 1536 <object-type name="QAbstractItemView">
1545 1537 <modify-function signature="update()" remove="all"/>
1546 1538 <modify-function signature="horizontalStepsPerItem()const" remove="all"/> <!--### Obsolete in 4.3-->
1547 1539 <modify-function signature="setHorizontalStepsPerItem(int)" remove="all"/> <!--### Obsolete in 4.3-->
1548 1540 <modify-function signature="setVerticalStepsPerItem(int)" remove="all"/> <!--### Obsolete in 4.3-->
1549 1541 <modify-function signature="verticalStepsPerItem()const" remove="all"/> <!--### Obsolete in 4.3-->
1550 1542
1551 1543 <modify-function signature="edit(QModelIndex,QAbstractItemView::EditTrigger,QEvent*)">
1552 1544 <modify-argument index="3" invalidate-after-use="yes"/>
1553 1545 </modify-function>
1554 1546 <modify-function signature="selectionCommand(QModelIndex,const QEvent*)const">
1555 1547 <modify-argument index="2" invalidate-after-use="yes"/>
1556 1548 </modify-function>
1557 1549
1558 1550
1559 1551 <!-- ### because the CursorAction enum is protected -->
1560 1552 <modify-function signature="moveCursor(QAbstractItemView::CursorAction,QFlags&lt;Qt::KeyboardModifier&gt;)" remove="all"/>
1561 1553 <inject-code class="shell-declaration">
1562 1554 QModelIndex moveCursor(QAbstractItemView::CursorAction, Qt::KeyboardModifiers)
1563 1555 { return QModelIndex(); }
1564 1556 </inject-code>
1565 1557 </object-type>
1566 1558
1567 1559 <object-type name="QAbstractPageSetupDialog"/>
1568 1560 <object-type name="QAbstractPrintDialog"/>
1569 1561 <object-type name="QAbstractSlider">
1570 1562 <modify-function signature="sliderChange(QAbstractSlider::SliderChange)" remove="all"/>
1571 1563 </object-type>
1572 1564 <object-type name="QAbstractTextDocumentLayout">
1573 1565 <modify-function signature="setPaintDevice(QPaintDevice*)">
1574 1566 <modify-argument index="1">
1575 1567 <reference-count action="set" variable-name="__rcPaintDevice"/>
1576 1568 </modify-argument>
1577 1569 </modify-function>
1578 1570
1579 1571 <modify-function signature="draw(QPainter*,QAbstractTextDocumentLayout::PaintContext)">
1580 1572 <modify-argument index="1" invalidate-after-use="yes"/>
1581 1573 </modify-function>
1582 1574 <modify-function signature="drawInlineObject(QPainter*,QRectF,QTextInlineObject,int,QTextFormat)">
1583 1575 <modify-argument index="1" invalidate-after-use="yes"/>
1584 1576 </modify-function>
1585 1577
1586 1578 </object-type>
1587 1579 <object-type name="QActionGroup"/>
1588 1580 <object-type name="QCDEStyle">
1589 1581 <modify-function signature="standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const" virtual-slot="yes"/>
1590 1582 </object-type>
1591 1583 <object-type name="QCheckBox">
1592 1584 <modify-function signature="initStyleOption(QStyleOptionButton*)const">
1593 1585 <access modifier="private"/>
1594 1586 </modify-function>
1595 1587 </object-type>
1596 1588 <object-type name="QCleanlooksStyle">
1597 1589 <modify-function signature="standardPixmap(QStyle::StandardPixmap,const QStyleOption*,const QWidget*)const" remove="all"/> <!--### Obsolete in 4.3-->
1598 1590 <modify-function signature="standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const" virtual-slot="yes"/>
1599 1591 </object-type>
1600 1592 <object-type name="QCommonStyle">
1601 1593 <modify-function signature="standardPixmap(QStyle::StandardPixmap, const QStyleOption*,const QWidget*)const" remove="all"/> <!--### Obsolete in 4.3-->
1602 1594 <modify-function signature="standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const" virtual-slot="yes"/>
1603 1595 </object-type>
1604 1596 <object-type name="QDataWidgetMapper">
1605 1597 <modify-function signature="addMapping(QWidget*,int)">
1606 1598 <modify-argument index="1">
1607 1599 <reference-count action="add" variable-name="__rcMappings"/>
1608 1600 </modify-argument>
1609 1601 </modify-function>
1610 1602 <modify-function signature="addMapping(QWidget*,int,QByteArray)">
1611 1603 <modify-argument index="1">
1612 1604 <reference-count action="add" variable-name="__rcMappings"/>
1613 1605 </modify-argument>
1614 1606 </modify-function>
1615 1607 <modify-function signature="removeMapping(QWidget*)">
1616 1608 <modify-argument index="1">
1617 1609 <reference-count action="remove" variable-name="__rcMappings"/>
1618 1610 </modify-argument>
1619 1611 </modify-function>
1620 1612 <modify-function signature="setItemDelegate(QAbstractItemDelegate*)">
1621 1613 <modify-argument index="1">
1622 1614 <reference-count action="set" variable-name="__rcItemDelegate"/>
1623 1615 </modify-argument>
1624 1616 </modify-function>
1625 1617 <modify-function signature="setModel(QAbstractItemModel*)">
1626 1618 <modify-argument index="1">
1627 1619 <reference-count action="set" variable-name="__rcModel"/>
1628 1620 </modify-argument>
1629 1621 </modify-function>
1630 1622 </object-type>
1631 1623 <object-type name="QDateEdit"/>
1632 1624 <object-type name="QDesktopServices">
1633 1625 <modify-function signature="setUrlHandler(const QString &amp;, QObject *, const char *)" access="private">
1634 1626 <modify-argument index="2">
1635 1627 <reference-count action="ignore"/> <!-- Handled in injected code -->
1636 1628 </modify-argument>
1637 1629 </modify-function>
1638 1630 </object-type>
1639 1631 <object-type name="QDialog">
1640 1632 <modify-function signature="setExtension(QWidget*)" remove="all"/>
1641 1633 <modify-function signature="exec()" access="non-final"/>
1642 1634 <modify-function signature="extension()const" remove="all"/> <!--### Obsolete in 4.3-->
1643 1635 <modify-function signature="orientation()const" remove="all"/> <!--### Obsolete in 4.3-->
1644 1636 <modify-function signature="open()" virtual-slot="yes"/>
1645 1637 <modify-function signature="setOrientation(Qt::Orientation)" remove="all"/> <!--### Obsolete in 4.3-->
1646 1638 <modify-function signature="showExtension(bool)" remove="all"/> <!--### Obsolete in 4.3-->
1647 1639 <modify-function signature="setVisible(bool)" allow-as-slot="yes"/>
1648 1640 </object-type>
1649 1641 <object-type name="QDialogButtonBox">
1650 1642 <modify-function signature="addButton(QAbstractButton*,QDialogButtonBox::ButtonRole)">
1651 1643 <modify-argument index="1">
1652 1644 <reference-count action="ignore"/>
1653 1645 </modify-argument>
1654 1646 </modify-function>
1655 1647 <modify-function signature="removeButton(QAbstractButton*)">
1656 1648 <modify-argument index="1">
1657 1649 <reference-count action="ignore"/>
1658 1650 </modify-argument>
1659 1651 </modify-function>
1660 1652 </object-type>
1661 1653 <object-type name="QDirModel">
1662 1654 <modify-function signature="parent()const" remove="all"/>
1663 1655 <modify-function signature="setIconProvider(QFileIconProvider*)">
1664 1656 <modify-argument index="1">
1665 1657 <reference-count action="set" variable-name="__rcIconProvider"/>
1666 1658 </modify-argument>
1667 1659 </modify-function>
1668 1660 </object-type>
1669 1661 <object-type name="QDoubleValidator"/>
1670 1662 <object-type name="QFileIconProvider"/>
1671 1663 <object-type name="QWizard">
1672 1664 <!-- ### Requires correct class name in meta object -->
1673 1665 <modify-function signature="setDefaultProperty(const char *, const char *, const char *)" remove="all"/>
1674 1666 <modify-function signature="addPage(QWizardPage*)">
1675 1667 <modify-argument index="1">
1676 1668 <no-null-pointer/>
1677 1669 <reference-count action="ignore"/>
1678 1670 </modify-argument>
1679 1671 </modify-function>
1680 1672 <modify-function signature="setButton(QWizard::WizardButton,QAbstractButton*)">
1681 1673 <modify-argument index="1">
1682 1674 <reference-count action="ignore"/>
1683 1675 </modify-argument>
1684 1676 </modify-function>
1685 1677 <modify-function signature="setPage(int,QWizardPage*)">
1686 1678 <modify-argument index="2">
1687 1679 <no-null-pointer/>
1688 1680 <reference-count action="ignore"/>
1689 1681 </modify-argument>
1690 1682 </modify-function>
1691 1683
1692 1684 </object-type>
1693 1685 <object-type name="QWizardPage">
1694 1686 <!-- ### Reduced functionality due to meta object having missing information -->
1695 1687 <modify-function signature="registerField(const QString &amp;, QWidget *, const char *, const char *)">
1696 1688 <access modifier="private"/>
1697 1689 <modify-argument index="3">
1698 1690 <remove-default-expression/>
1699 1691 </modify-argument>
1700 1692 <modify-argument index="4">
1701 1693 <remove-default-expression/>
1702 1694 </modify-argument>
1703 1695 </modify-function>
1704 1696
1705 1697 </object-type>
1706 1698 <object-type name="QFocusFrame">
1707 1699 <modify-function signature="initStyleOption(QStyleOption*)const">
1708 1700 <access modifier="private"/>
1709 1701 </modify-function>
1710 1702 <modify-function signature="setWidget(QWidget*)">
1711 1703 <modify-argument index="1">
1712 1704 <reference-count action="set" variable-name="__rcWidget"/>
1713 1705 </modify-argument>
1714 1706 </modify-function>
1715 1707 <inject-code>
1716 1708 <insert-template name="gui.init_style_option">
1717 1709 <replace from="%TYPE" to="QStyleOption"/>
1718 1710 </insert-template>
1719 1711 </inject-code>
1720 1712 </object-type>
1721 1713 <object-type name="QFontComboBox"/>
1722 1714 <object-type name="QFontDialog">
1723 1715 <inject-code class="native" position="beginning">
1724 1716 Q_DECLARE_METATYPE(QScriptValue)
1725 1717 </inject-code>
1726 1718 <modify-function signature="getFont(bool*,QWidget*)">
1727 1719 <modify-argument index="1">
1728 1720 <remove-argument/>
1729 1721 <conversion-rule class="native">
1730 1722 <insert-template name="core.prepare_removed_bool*_argument"/>
1731 1723 </conversion-rule>
1732 1724 </modify-argument>
1733 1725 <modify-argument index="return">
1734 1726 <conversion-rule class="native">
1735 1727 <insert-template name="core.convert_to_null_or_wrap"/>
1736 1728 </conversion-rule>
1737 1729 </modify-argument>
1738 1730 </modify-function>
1739 1731
1740 1732 <modify-function signature="getFont(bool*,QFont,QWidget*)">
1741 1733 <modify-argument index="1">
1742 1734 <remove-argument/>
1743 1735 <conversion-rule class="native">
1744 1736 <insert-template name="core.prepare_removed_bool*_argument"/>
1745 1737 </conversion-rule>
1746 1738 </modify-argument>
1747 1739 <modify-argument index="return">
1748 1740 <conversion-rule class="native">
1749 1741 <insert-template name="core.convert_to_null_or_wrap"/>
1750 1742 </conversion-rule>
1751 1743 </modify-argument>
1752 1744 </modify-function>
1753 1745
1754 1746 <modify-function signature="getFont(bool*,QFont,QWidget*,QString)">
1755 1747 <modify-argument index="1">
1756 1748 <remove-argument/>
1757 1749 <conversion-rule class="native">
1758 1750 <insert-template name="core.prepare_removed_bool*_argument"/>
1759 1751 </conversion-rule>
1760 1752 </modify-argument>
1761 1753 <modify-argument index="return">
1762 1754 <conversion-rule class="native">
1763 1755 <insert-template name="core.convert_to_null_or_wrap"/>
1764 1756 </conversion-rule>
1765 1757 </modify-argument>
1766 1758 </modify-function>
1767 1759 </object-type>
1768 1760
1769 1761 <object-type name="QGraphicsEllipseItem" delete-in-main-thread="yes"/>
1770 1762 <object-type name="QGraphicsItemAnimation">
1771 1763 <modify-function signature="setItem(QGraphicsItem*)">
1772 1764 <modify-argument index="1">
1773 1765 <reference-count action="set" variable-name="__rcItem"/>
1774 1766 </modify-argument>
1775 1767 </modify-function>
1776 1768 <modify-function signature="setTimeLine(QTimeLine*)">
1777 1769 <modify-argument index="1">
1778 1770 <reference-count action="set" variable-name="__rcTimeLine"/>
1779 1771 </modify-argument>
1780 1772 </modify-function>
1781 1773
1782 1774 <extra-includes>
1783 1775 <include file-name="QPair" location="global"/>
1784 1776 </extra-includes>
1785 1777 </object-type>
1786 1778 <object-type name="QGraphicsItemGroup" delete-in-main-thread="yes">
1787 1779 <modify-function signature="matrix()const" remove="all"/> <!--### Obsolete in 4.3-->
1788 1780 <modify-function signature="resetMatrix()" remove="all"/> <!--### Obsolete in 4.3-->
1789 1781 <modify-function signature="sceneMatrix()const" remove="all"/> <!--### Obsolete in 4.3-->
1790 1782 <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/> <!--### Obsolete in 4.3-->
1791 1783 </object-type>
1792 1784 <object-type name="QGraphicsLineItem" delete-in-main-thread="yes">
1793 1785 <modify-function signature="matrix()const" remove="all"/> <!--### Obsolete in 4.3-->
1794 1786 <modify-function signature="resetMatrix()" remove="all"/> <!--### Obsolete in 4.3-->
1795 1787 <modify-function signature="sceneMatrix()const" remove="all"/> <!--### Obsolete in 4.3-->
1796 1788 <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/> <!--### Obsolete in 4.3-->
1797 1789 </object-type>
1798 1790 <object-type name="QGraphicsPathItem" delete-in-main-thread="yes"/>
1799 1791
1800 1792 <object-type name="QGraphicsPixmapItem" delete-in-main-thread="yes">
1801 1793 <modify-function signature="matrix()const" remove="all"/> <!--### Obsolete in 4.3-->
1802 1794 <modify-function signature="resetMatrix()" remove="all"/> <!--### Obsolete in 4.3-->
1803 1795 <modify-function signature="sceneMatrix()const" remove="all"/> <!--### Obsolete in 4.3-->
1804 1796 <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/> <!--### Obsolete in 4.3-->
1805 1797 </object-type>
1806 1798 <object-type name="QGraphicsPolygonItem" delete-in-main-thread="yes"/>
1807 1799 <object-type name="QGraphicsRectItem" delete-in-main-thread="yes"/>
1808 1800 <object-type name="QGraphicsSimpleTextItem" delete-in-main-thread="yes"/>
1809 1801 <object-type name="QHBoxLayout"/>
1810 1802 <object-type name="QHeaderView">
1811 1803 <modify-function signature="initStyleOption(QStyleOptionHeader*)const">
1812 1804 <access modifier="private"/>
1813 1805 </modify-function>
1814 1806
1815 1807 <modify-function signature="paintSection(QPainter*,QRect,int)const">
1816 1808 <modify-argument index="1" invalidate-after-use="yes"/>
1817 1809 </modify-function>
1818 1810
1819 1811 <inject-code>
1820 1812 <insert-template name="gui.init_style_option">
1821 1813 <replace from="%TYPE" to="QStyleOptionHeader"/>
1822 1814 </insert-template>
1823 1815 </inject-code>
1824 1816 <modify-function signature="setModel(QAbstractItemModel*)">
1825 1817 <modify-argument index="1">
1826 1818 <reference-count declare-variable="QAbstractItemView" action="set" variable-name="__rcModel"/>
1827 1819 </modify-argument>
1828 1820 </modify-function>
1829 1821 </object-type>
1830 1822 <rejection class="QIconEngineV2"/>
1831 1823 <object-type name="QIconEngine">
1832 1824 <!-- modify-function signature="read(QDataStream&amp;)">
1833 1825 <modify-argument index="1">
1834 1826 <replace-type modified-type="QDataStream*"/>
1835 1827 <conversion-rule class="native">
1836 1828 QDataStream &amp; %out% = *qscriptvalue_cast&lt;QDataStream*&gt;(%in%);
1837 1829 </conversion-rule>
1838 1830 </modify-argument>
1839 1831 </modify-function>
1840 1832 <modify-function signature="write(QDataStream&amp;)const">
1841 1833 <modify-argument index="1">
1842 1834 <replace-type modified-type="QDataStream*"/>
1843 1835 <conversion-rule class="native">
1844 1836 QDataStream &amp; %out% = *qscriptvalue_cast&lt;QDataStream*&gt;(%in%);
1845 1837 </conversion-rule>
1846 1838 </modify-argument>
1847 1839 </modify-function -->
1848 1840
1849 1841 <modify-function signature="virtual_hook(int,void*)" remove="all"/>
1850 1842 <modify-function signature="clone()const">
1851 1843 <modify-argument index="return">
1852 1844 <define-ownership class="shell" owner="c++"/>
1853 1845 </modify-argument>
1854 1846 </modify-function>
1855 1847
1856 1848 <modify-function signature="read(QDataStream&amp;)">
1857 1849 <modify-argument index="1">
1858 1850 <replace-type modified-type="QDataStream*"/>
1859 1851 <conversion-rule class="native">
1860 1852 QDataStream &amp; %out% = *qscriptvalue_cast&lt;QDataStream*&gt;(%in%);
1861 1853 </conversion-rule>
1862 1854 <conversion-rule class="shell">
1863 1855 jobject %out = qtjambi_from_object(__jni_env, %in, "QImage", "com/trolltech/qt/gui/", false);
1864 1856 QtJambiLink *__link = %out != 0 ? QtJambiLink::findLink(__jni_env, %out) : 0;
1865 1857 </conversion-rule>
1866 1858 </modify-argument>
1867 1859 </modify-function>
1868 1860 <modify-function signature="write(QDataStream&amp;)const">
1869 1861 <modify-argument index="1">
1870 1862 <replace-type modified-type="QDataStream*"/>
1871 1863 <conversion-rule class="native">
1872 1864 QDataStream &amp; %out% = *qscriptvalue_cast&lt;QDataStream*&gt;(%in%);
1873 1865 </conversion-rule>
1874 1866 </modify-argument>
1875 1867 </modify-function>
1876 1868 </object-type>
1877 1869 <object-type name="QImageWriter">
1878 1870 <modify-function signature="setDevice(QIODevice*)">
1879 1871 <modify-argument index="1">
1880 1872 <reference-count action="set" variable-name="__rcDevice"/>
1881 1873 </modify-argument>
1882 1874 </modify-function>
1883 1875 <modify-function signature="description()const" remove="all"/> <!--### Obsolete in 4.3-->
1884 1876 <modify-function signature="setDescription(QString)" remove="all"/> <!--### Obsolete in 4.3-->
1885 1877 </object-type>
1886 1878 <object-type name="QInputContextFactory"/>
1887 1879 <object-type name="QIntValidator"/>
1888 1880 <object-type name="QItemDelegate">
1889 1881 <modify-function signature="doLayout(QStyleOptionViewItem,QRect*,QRect*,QRect*,bool)const">
1890 1882 <remove/>
1891 1883 </modify-function>
1892 1884
1893 1885 <modify-function signature="drawCheck(QPainter*,QStyleOptionViewItem,QRect,Qt::CheckState)const">
1894 1886 <modify-argument index="1" invalidate-after-use="yes"/>
1895 1887 </modify-function>
1896 1888 <modify-function signature="drawDecoration(QPainter*,QStyleOptionViewItem,QRect,QPixmap)const">
1897 1889 <modify-argument index="1" invalidate-after-use="yes"/>
1898 1890 </modify-function>
1899 1891 <modify-function signature="drawDisplay(QPainter*,QStyleOptionViewItem,QRect,QString)const">
1900 1892 <modify-argument index="1" invalidate-after-use="yes"/>
1901 1893 </modify-function>
1902 1894 <modify-function signature="drawFocus(QPainter*,QStyleOptionViewItem,QRect)const">
1903 1895 <modify-argument index="1" invalidate-after-use="yes"/>
1904 1896 </modify-function>
1905 1897
1906 1898
1907 1899 <modify-function signature="selected(QPixmap,QPalette,bool)const">
1908 1900 <remove/>
1909 1901 </modify-function>
1910 1902 <modify-function signature="setItemEditorFactory(QItemEditorFactory*)">
1911 1903 <modify-argument index="1">
1912 1904 <reference-count action="set" variable-name="__rcItemEditorFactory"/>
1913 1905 </modify-argument>
1914 1906 </modify-function>
1915 1907 <modify-function signature="setEditorData(QWidget*,QModelIndex)const">
1916 1908 <modify-argument index="1">
1917 1909 <reference-count action="ignore"/>
1918 1910 </modify-argument>
1919 1911 </modify-function>
1920 1912 <modify-function signature="setModelData(QWidget*,QAbstractItemModel*,QModelIndex)const">
1921 1913 <modify-argument index="1">
1922 1914 <reference-count action="ignore"/>
1923 1915 </modify-argument>
1924 1916 </modify-function>
1925 1917
1926 1918 </object-type>
1927 1919 <object-type name="QItemEditorCreatorBase"/>
1928 1920 <object-type name="QItemEditorFactory">
1929 1921 <modify-function signature="registerEditor(QVariant::Type, QItemEditorCreatorBase *)">
1930 1922 <modify-argument index="2">
1931 1923 <define-ownership class="java" owner="c++"/>
1932 1924 </modify-argument>
1933 1925 </modify-function>
1934 1926 <modify-function signature="setDefaultFactory(QItemEditorFactory *)">
1935 1927 <modify-argument index="1">
1936 1928 <reference-count action="set" variable-name="__rcDefaultItemEditorFactory"/>
1937 1929 </modify-argument>
1938 1930 </modify-function>
1939 1931 </object-type>
1940 1932 <object-type name="QItemSelectionModel"/>
1941 1933 <object-type name="QTreeModel"/>
1942 1934 <object-type name="QListView"/>
1943 1935 <object-type name="QColumnView">
1944 1936 <modify-function signature="setPreviewWidget(QWidget*)">
1945 1937 <modify-argument index="1">
1946 1938 <reference-count action="ignore"/>
1947 1939 </modify-argument>
1948 1940 </modify-function>
1949 1941 <modify-function signature="setModel(QAbstractItemModel*)">
1950 1942 <modify-argument index="1">
1951 1943 <reference-count declare-variable="QAbstractItemView" action="set" variable-name="__rcItemModel"/>
1952 1944 </modify-argument>
1953 1945 </modify-function>
1954 1946 <modify-function signature="setSelectionModel(QItemSelectionModel*)">
1955 1947 <modify-argument index="1">
1956 1948 <no-null-pointer/>
1957 1949 <reference-count declare-variable="QAbstractItemView" action="set" variable-name="__rcItemSelectionModel"/>
1958 1950 </modify-argument>
1959 1951 </modify-function>
1960 1952 </object-type>
1961 1953 <object-type name="QMainWindow">
1962 1954 <modify-function signature="addDockWidget(Qt::DockWidgetArea,QDockWidget*,Qt::Orientation)">
1963 1955 <modify-argument index="2">
1964 1956 <reference-count action="ignore"/>
1965 1957 </modify-argument>
1966 1958 </modify-function>
1967 1959 <modify-function signature="addDockWidget(Qt::DockWidgetArea,QDockWidget*)">
1968 1960 <modify-argument index="2">
1969 1961 <reference-count action="ignore"/>
1970 1962 </modify-argument>
1971 1963 </modify-function>
1972 1964 <modify-function signature="addToolBar(QToolBar*)">
1973 1965 <modify-argument index="1">
1974 1966 <reference-count action="ignore"/>
1975 1967 </modify-argument>
1976 1968 </modify-function>
1977 1969 <modify-function signature="addToolBar(Qt::ToolBarArea,QToolBar*)">
1978 1970 <modify-argument index="2">
1979 1971 <reference-count action="ignore"/>
1980 1972 </modify-argument>
1981 1973 </modify-function>
1982 1974 <modify-function signature="insertToolBar(QToolBar*,QToolBar*)">
1983 1975 <modify-argument index="2">
1984 1976 <reference-count action="ignore"/>
1985 1977 </modify-argument>
1986 1978 <modify-argument index="2">
1987 1979 <reference-count action="ignore"/>
1988 1980 </modify-argument>
1989 1981 </modify-function>
1990 1982 <modify-function signature="insertToolBarBreak(QToolBar*)">
1991 1983 <modify-argument index="1">
1992 1984 <reference-count action="ignore"/>
1993 1985 </modify-argument>
1994 1986 </modify-function>
1995 1987 <modify-function signature="removeDockWidget(QDockWidget*)">
1996 1988 <modify-argument index="1">
1997 1989 <reference-count action="ignore"/>
1998 1990 </modify-argument>
1999 1991 </modify-function>
2000 1992 <modify-function signature="removeToolBar(QToolBar*)">
2001 1993 <modify-argument index="1">
2002 1994 <reference-count action="ignore"/>
2003 1995 </modify-argument>
2004 1996 </modify-function>
2005 1997 <modify-function signature="removeToolBarBreak(QToolBar*)">
2006 1998 <modify-argument index="1">
2007 1999 <reference-count action="ignore"/>
2008 2000 </modify-argument>
2009 2001 </modify-function>
2010 2002 <modify-function signature="setCentralWidget(QWidget*)">
2011 2003 <modify-argument index="1">
2012 2004 <reference-count action="ignore"/>
2013 2005 </modify-argument>
2014 2006 </modify-function>
2015 2007 <modify-function signature="setMenuBar(QMenuBar*)">
2016 2008 <modify-argument index="1">
2017 2009 <reference-count action="ignore"/>
2018 2010 </modify-argument>
2019 2011 </modify-function>
2020 2012 <modify-function signature="setMenuWidget(QWidget*)">
2021 2013 <modify-argument index="1">
2022 2014 <reference-count action="ignore"/>
2023 2015 </modify-argument>
2024 2016 </modify-function>
2025 2017 <modify-function signature="setStatusBar(QStatusBar*)">
2026 2018 <modify-argument index="1">
2027 2019 <reference-count action="ignore"/>
2028 2020 </modify-argument>
2029 2021 </modify-function>
2030 2022
2031 2023 </object-type>
2032 2024 <object-type name="QMdiArea">
2033 2025 <modify-function signature="addSubWindow(QWidget*,QFlags&lt;Qt::WindowType&gt;)">
2034 2026 <modify-argument index="1">
2035 2027 <reference-count action="ignore"/>
2036 2028 </modify-argument>
2037 2029 </modify-function>
2038 2030
2039 2031 <modify-function signature="removeSubWindow(QWidget*)">
2040 2032 <modify-argument index="1">
2041 2033 <reference-count action="ignore"/>
2042 2034 </modify-argument>
2043 2035 </modify-function>
2044 2036
2045 2037 <modify-function signature="setActiveSubWindow(QMdiSubWindow*)">
2046 2038 <modify-argument index="1">
2047 2039 <reference-count action="ignore"/>
2048 2040 </modify-argument>
2049 2041 </modify-function>
2050 2042
2051 2043 <modify-function signature="setupViewport(QWidget*)">
2052 2044 <modify-argument index="1">
2053 2045 <reference-count action="ignore"/>
2054 2046 </modify-argument>
2055 2047 </modify-function>
2056 2048
2057 2049 </object-type>
2058 2050 <object-type name="QMdiSubWindow">
2059 2051 <modify-function signature="setSystemMenu(QMenu*)">
2060 2052 <modify-argument index="1">
2061 2053 <reference-count action="ignore"/>
2062 2054 </modify-argument>
2063 2055 </modify-function>
2064 2056 <modify-function signature="setWidget(QWidget*)">
2065 2057 <modify-argument index="1">
2066 2058 <reference-count action="ignore"/>
2067 2059 </modify-argument>
2068 2060 </modify-function>
2069 2061 </object-type>
2070 2062 <object-type name="QMenu">
2071 2063 <modify-function signature="addAction(QAction *)" remove="all"/>
2072 2064 <modify-function signature="addMenu(QMenu*)">
2073 2065 <modify-argument index="1">
2074 2066 <reference-count action="add" variable-name="__rcMenus"/>
2075 2067 </modify-argument>
2076 2068 </modify-function>
2077 2069 <modify-function signature="insertMenu(QAction*,QMenu*)">
2078 2070 <modify-argument index="2">
2079 2071 <reference-count action="add" variable-name="__rcMenus"/>
2080 2072 </modify-argument>
2081 2073 </modify-function>
2082 2074 <modify-function signature="insertSeparator(QAction*)">
2083 2075 <modify-argument index="1">
2084 2076 <reference-count action="ignore"/>
2085 2077 </modify-argument>
2086 2078 </modify-function>
2087 2079 <modify-function signature="setActiveAction(QAction*)">
2088 2080 <modify-argument index="1">
2089 2081 <reference-count action="ignore"/>
2090 2082 </modify-argument>
2091 2083 </modify-function>
2092 2084 <modify-function signature="setDefaultAction(QAction*)">
2093 2085 <modify-argument index="1">
2094 2086 <reference-count action="ignore"/>
2095 2087 </modify-argument>
2096 2088 </modify-function>
2097 2089 <modify-function signature="setNoReplayFor(QWidget*)">
2098 2090 <remove/>
2099 2091 </modify-function>
2100 2092 <modify-function signature="initStyleOption(QStyleOptionMenuItem*,const QAction*)const">
2101 2093 <access modifier="private"/>
2102 2094 </modify-function>
2103 2095
2096 <modify-function signature="addAction(QString,const QObject*,const char*,QKeySequence)">
2097 <remove/>
2098 </modify-function>
2099
2100 <modify-function signature="addAction(QIcon,QString,const QObject*,const char*,QKeySequence)">
2101 <remove/>
2102 </modify-function>
2103
2104 2104 <inject-code class="pywrap-h">
2105 2105 QAction* addAction (QMenu* menu, const QString &amp; text, PyObject* callable, const QKeySequence &amp; shortcut = 0) {
2106 2106 QAction* a = menu-&gt;addAction(text);
2107 2107 a-&gt;setShortcut(shortcut);
2108 2108 PythonQt::self()-&gt;addSignalHandler(a, SIGNAL(triggered(bool)), callable);
2109 2109 return a;
2110 2110 }
2111 2111
2112 2112 QAction* addAction (QMenu* menu, const QIcon&amp; icon, const QString&amp; text, PyObject* callable, const QKeySequence&amp; shortcut = 0)
2113 2113 {
2114 2114 QAction* a = menu-&gt;addAction(text);
2115 2115 a-&gt;setIcon(icon);
2116 2116 a-&gt;setShortcut(shortcut);
2117 2117 PythonQt::self()-&gt;addSignalHandler(a, SIGNAL(triggered(bool)), callable);
2118 2118 return a;
2119 2119 }
2120 2120 </inject-code>
2121 2121 </object-type>
2122 2122
2123 2123 <object-type name="QMenuBar">
2124 2124 <modify-function signature="addAction(QAction *)" remove="all"/>
2125 2125 <modify-function signature="addAction(QString,const QObject*,const char*)">
2126 2126 <remove/>
2127 2127 </modify-function>
2128 2128
2129 2129 <modify-function signature="initStyleOption(QStyleOptionMenuItem*,const QAction*)const">
2130 2130 <access modifier="private"/>
2131 2131 </modify-function>
2132 2132
2133 2133 <modify-function signature="addMenu(QMenu*)">
2134 2134 <modify-argument index="1">
2135 2135 <reference-count action="add" variable-name="__rcMenus"/>
2136 2136 </modify-argument>
2137 2137 </modify-function>
2138 2138 <modify-function signature="insertMenu(QAction*,QMenu*)">
2139 2139 <modify-argument index="1">
2140 2140 <reference-count action="ignore"/>
2141 2141 </modify-argument>
2142 2142 <modify-argument index="2">
2143 2143 <reference-count action="add" variable-name="__rcMenus"/>
2144 2144 </modify-argument>
2145 2145 </modify-function>
2146 2146 <modify-function signature="insertSeparator(QAction*)">
2147 2147 <modify-argument index="1">
2148 2148 <reference-count action="ignore"/>
2149 2149 </modify-argument>
2150 2150 </modify-function>
2151 2151 <modify-function signature="setActiveAction(QAction*)">
2152 2152 <modify-argument index="1">
2153 2153 <reference-count action="ignore"/>
2154 2154 </modify-argument>
2155 2155 </modify-function>
2156 2156 <modify-function signature="setCornerWidget(QWidget*,Qt::Corner) ">
2157 2157 <modify-argument index="1">
2158 2158 <reference-count action="ignore"/>
2159 2159 </modify-argument>
2160 2160 </modify-function>
2161
2161 2162 <inject-code class="pywrap-h">
2162 2163 QAction* addAction (QMenuBar* menu, const QString &amp; text, PyObject* callable)
2163 2164 {
2164 2165 QAction* a = menu-&gt;addAction(text);
2165 2166 PythonQt::self()-&gt;addSignalHandler(a, SIGNAL(triggered(bool)), callable);
2166 2167 return a;
2167 2168 }
2168 2169 </inject-code>
2169 2170 </object-type>
2170 2171 <object-type name="QMotifStyle">
2171 2172 <modify-function signature="standardPixmap(QStyle::StandardPixmap, const QStyleOption*, const QWidget*)const" remove="all"/> <!--### Obsolete in 4.3-->
2172 2173 <modify-function signature="standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const" virtual-slot="yes"/>
2173 2174 </object-type>
2174 2175 <object-type name="QPainterPathStroker"/>
2175 2176
2176 2177 <object-type name="QPictureIO">
2177 2178 <modify-function signature="QPictureIO(QIODevice*,const char*)">
2178 2179 <access modifier="private"/>
2179 2180 <modify-argument index="1">
2180 2181 <reference-count action="set" variable-name="__rcDevice"/>
2181 2182 </modify-argument>
2182 2183 </modify-function>
2183 2184
2184 2185 <modify-function signature="setIODevice(QIODevice*)">
2185 2186 <modify-argument index="1">
2186 2187 <reference-count action="set" variable-name="__rcDevice"/>
2187 2188 </modify-argument>
2188 2189 </modify-function>
2189 2190
2190 2191 <modify-function signature="QPictureIO(QString,const char*)">
2191 2192 <access modifier="private"/>
2192 2193 </modify-function>
2193 2194
2194 2195 <modify-function signature="format()const">
2195 2196 <access modifier="private"/>
2196 2197 <rename to="format_private"/>
2197 2198 </modify-function>
2198 2199
2199 2200 <modify-function signature="parameters()const">
2200 2201 <access modifier="private"/>
2201 2202 <rename to="parameters_private"/>
2202 2203 </modify-function>
2203 2204
2204 2205 <modify-function signature="setFormat(const char*)">
2205 2206 <access modifier="private"/>
2206 2207 </modify-function>
2207 2208
2208 2209 <modify-function signature="setParameters(const char*)">
2209 2210 <access modifier="private"/>
2210 2211 </modify-function>
2211 2212
2212 2213
2213 2214 <modify-function signature="QPictureIO(QIODevice*,const char*)">
2214 2215 <modify-argument index="2">
2215 2216 <replace-type modified-type="QString"/>
2216 2217 <conversion-rule class="native">
2217 2218 <insert-template name="core.convert_string_arg_to_char*"/>
2218 2219 </conversion-rule>
2219 2220 </modify-argument>
2220 2221 </modify-function>
2221 2222
2222 2223 <modify-function signature="QPictureIO(QString,const char*)">
2223 2224 <modify-argument index="2">
2224 2225 <replace-type modified-type="QString"/>
2225 2226 <conversion-rule class="native">
2226 2227 <insert-template name="core.convert_string_arg_to_char*"/>
2227 2228 </conversion-rule>
2228 2229 </modify-argument>
2229 2230 </modify-function>
2230 2231
2231 2232 <modify-function signature="setFormat(const char*)">
2232 2233 <modify-argument index="1">
2233 2234 <replace-type modified-type="QString"/>
2234 2235 <conversion-rule class="native">
2235 2236 <insert-template name="core.convert_string_arg_to_char*"/>
2236 2237 </conversion-rule>
2237 2238 </modify-argument>
2238 2239 </modify-function>
2239 2240
2240 2241 <modify-function signature="setParameters(const char*)">
2241 2242 <modify-argument index="1">
2242 2243 <replace-type modified-type="QString"/>
2243 2244 <conversion-rule class="native">
2244 2245 <insert-template name="core.convert_string_arg_to_char*"/>
2245 2246 </conversion-rule>
2246 2247 </modify-argument>
2247 2248 </modify-function>
2248 2249 </object-type>
2249 2250
2250 2251 <object-type name="QPixmapCache">
2251 2252 <modify-function signature="find(QString)">
2252 2253 <remove/>
2253 2254 </modify-function>
2254 2255 <modify-function signature="find(QString,QPixmap*)" remove="all"/>
2255 2256
2256 2257 <modify-function signature="find(QString,QPixmap&amp;)">
2257 2258 <access modifier="private"/>
2258 2259 </modify-function>
2259 2260 </object-type>
2260 2261 <object-type name="QPlastiqueStyle">
2261 2262 <modify-function signature="standardPixmap(QStyle::StandardPixmap, const QStyleOption*, const QWidget*)const" remove="all"/> <!--### Obsolete in 4.3-->
2262 2263 <modify-function signature="standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const" virtual-slot="yes"/>
2263 2264 <modify-function signature="layoutSpacingImplementation(QSizePolicy::ControlType, QSizePolicy::ControlType, Qt::Orientation, const QStyleOption *, const QWidget *) const" virtual-slot="yes"/>
2264 2265 </object-type>
2265 2266 <object-type name="QPrintDialog">
2266 2267 </object-type>
2267 2268 <object-type name="QPrintEngine"/>
2268 2269 <object-type name="QProgressBar">
2269 2270 <modify-function signature="initStyleOption(QStyleOptionProgressBar*)const">
2270 2271 <access modifier="private"/>
2271 2272 </modify-function>
2272 2273 </object-type>
2273 2274 <object-type name="QPushButton">
2274 2275 <modify-function signature="initStyleOption(QStyleOptionButton*)const">
2275 2276 <access modifier="private"/>
2276 2277 </modify-function>
2277 2278
2278 2279 <modify-function signature="setMenu(QMenu*)">
2279 2280 <modify-argument index="1">
2280 2281 <reference-count action="set" variable-name="__rcMenu"/>
2281 2282 </modify-argument>
2282 2283 </modify-function>
2283 2284 </object-type>
2284 2285 <object-type name="QRegExpValidator"/>
2285 2286 <object-type name="QScrollArea">
2286 2287 <modify-function signature="setWidget(QWidget*)">
2287 2288 <modify-argument index="1">
2288 2289 <reference-count action="ignore"/>
2289 2290 </modify-argument>
2290 2291 </modify-function>
2291 2292 </object-type>
2292 2293 <object-type name="QSessionManager"/>
2293 2294 <object-type name="QShortcut">
2294 2295 <modify-function signature="QShortcut(QKeySequence,QWidget*,const char*,const char*,Qt::ShortcutContext)">
2295 2296 <access modifier="private"/>
2296 2297 <modify-argument index="3">
2297 2298 <remove-default-expression/>
2298 2299 </modify-argument>
2299 2300 <modify-argument index="4">
2300 2301 <remove-default-expression/>
2301 2302 </modify-argument>
2302 2303 <modify-argument index="5">
2303 2304 <remove-default-expression/>
2304 2305 </modify-argument>
2305 2306 </modify-function>
2306 2307 </object-type>
2307 2308 <object-type name="QSizeGrip"/>
2308 2309 <object-type name="QSound"/>
2309 2310 <object-type name="QSpacerItem"/>
2310 2311 <object-type name="QStandardItem">
2311 2312 <modify-function signature="operator=(QStandardItem)" remove="all"/>
2312 2313 <modify-function signature="operator&lt;(QStandardItem)const">
2313 2314 <modify-argument index="1" invalidate-after-use="yes"/>
2314 2315 </modify-function>
2315 2316 <modify-function signature="read(QDataStream&amp;)">
2316 2317 <modify-argument index="1" invalidate-after-use="yes"/>
2317 2318 </modify-function>
2318 2319 <modify-function signature="write(QDataStream&amp;)const">
2319 2320 <modify-argument index="1" invalidate-after-use="yes"/>
2320 2321 </modify-function>
2321 2322
2322 2323
2323 2324 <modify-function signature="read(QDataStream &amp;)" remove="all"/>
2324 2325 <modify-function signature="write(QDataStream &amp;)const" remove="all"/>
2325 2326 <modify-function signature="operator=(QStandardItem)" remove="all"/>
2326 2327 <modify-function signature="operator&lt;(QStandardItem)const" remove="all"/>
2327 2328 </object-type>
2328 2329 <object-type name="QStatusBar">
2329 2330 <modify-function signature="addPermanentWidget(QWidget *, int)">
2330 2331 <modify-argument index="1">
2331 2332 <reference-count action="ignore"/>
2332 2333 </modify-argument>
2333 2334 </modify-function>
2334 2335 <modify-function signature="addWidget(QWidget *, int)">
2335 2336 <modify-argument index="1">
2336 2337 <reference-count action="ignore"/>
2337 2338 </modify-argument>
2338 2339 </modify-function>
2339 2340 <modify-function signature="removeWidget(QWidget *)">
2340 2341 <modify-argument index="1">
2341 2342 <reference-count action="ignore"/>
2342 2343 </modify-argument>
2343 2344 </modify-function>
2344 2345 <modify-function signature="insertPermanentWidget(int, QWidget *, int)">
2345 2346 <modify-argument index="2">
2346 2347 <reference-count action="ignore"/>
2347 2348 </modify-argument>
2348 2349 </modify-function>
2349 2350 <modify-function signature="insertWidget(int, QWidget *, int)">
2350 2351 <modify-argument index="2">
2351 2352 <reference-count action="ignore"/>
2352 2353 </modify-argument>
2353 2354 </modify-function>
2354 2355 </object-type>
2355 2356 <object-type name="QStringListModel"/>
2356 2357 <object-type name="QStyleFactory"/>
2357 2358 <object-type name="QStyleHintReturn"/>
2358 2359 <object-type name="QStyleHintReturnVariant"/>
2359 2360 <object-type name="QStyleHintReturnMask"/>
2360 2361 <object-type name="QStylePainter" delete-in-main-thread="yes"/>
2361 2362 <object-type name="QSyntaxHighlighter">
2362 2363 <modify-function signature="setCurrentBlockUserData(QTextBlockUserData*)">
2363 2364 <modify-argument index="1">
2364 2365 <define-ownership class="java" owner="c++"/>
2365 2366 </modify-argument>
2366 2367 </modify-function>
2367 2368 <modify-function signature="setDocument(QTextDocument*)">
2368 2369 <modify-argument index="1">
2369 2370 <reference-count action="set" variable-name="__rcDocument"/>
2370 2371 </modify-argument>
2371 2372 </modify-function>
2372 2373
2373 2374 </object-type>
2374 2375 <object-type name="QSystemTrayIcon">
2375 2376 <modify-function signature="setContextMenu(QMenu*)">
2376 2377 <modify-argument index="1">
2377 2378 <reference-count action="set" variable-name="__rcContextMenu"/>
2378 2379 </modify-argument>
2379 2380 </modify-function>
2380 2381 </object-type>
2381 2382 <object-type name="QTableView">
2382 2383 <modify-function signature="setHorizontalHeader(QHeaderView*)">
2383 2384 <modify-argument index="1">
2384 2385 <reference-count action="ignore"/>
2385 2386 </modify-argument>
2386 2387 </modify-function>
2387 2388 <modify-function signature="setVerticalHeader(QHeaderView*)">
2388 2389 <modify-argument index="1">
2389 2390 <reference-count action="ignore"/>
2390 2391 </modify-argument>
2391 2392 </modify-function>
2392 2393 <modify-function signature="setModel(QAbstractItemModel*)">
2393 2394 <modify-argument index="1">
2394 2395 <reference-count declare-variable="QAbstractItemView" action="set" variable-name="__rcItemModel"/>
2395 2396 </modify-argument>
2396 2397 </modify-function>
2397 2398 <modify-function signature="setSelectionModel(QItemSelectionModel*)">
2398 2399 <modify-argument index="1">
2399 2400 <no-null-pointer/>
2400 2401 <reference-count declare-variable="QAbstractItemView" action="set" variable-name="__rcItemSelectionModel"/>
2401 2402 </modify-argument>
2402 2403 </modify-function>
2403 2404
2404 2405 <modify-function signature="sortByColumn(int)" remove="all"/> <!--### Obsolete in 4.3-->
2405 2406 </object-type>
2406 2407 <object-type name="QTextBlockGroup" delete-in-main-thread="yes"/>
2407 2408 <object-type name="QTextBlockUserData" delete-in-main-thread="yes"/>
2408 2409 <object-type name="QTextItem" delete-in-main-thread="yes"/>
2409 2410 <object-type name="QTextList" delete-in-main-thread="yes">
2410 2411 <modify-function signature="format()const" rename="textListFormat"/>
2411 2412
2412 2413 <modify-function signature="isEmpty()const" remove="all"/> <!--### Obsolete in 4.3-->
2413 2414 </object-type>
2414 2415 <object-type name="QTextObject" delete-in-main-thread="yes"/>
2415 2416 <object-type name="QTextObjectInterface" delete-in-main-thread="yes">
2416 2417 <modify-function signature="drawObject(QPainter*,QRectF,QTextDocument*,int,QTextFormat)">
2417 2418 <modify-argument index="1" invalidate-after-use="yes"/>
2418 2419 </modify-function>
2419 2420 </object-type>
2420 2421
2421 2422 <object-type name="QTimeEdit"/>
2422 2423 <object-type name="QToolBox">
2423 2424 <modify-function signature="addItem(QWidget*,QString)">
2424 2425 <modify-argument index="1">
2425 2426 <reference-count action="ignore"/>
2426 2427 </modify-argument>
2427 2428 </modify-function>
2428 2429 <modify-function signature="addItem(QWidget*,QIcon,QString)">
2429 2430 <modify-argument index="1">
2430 2431 <reference-count action="ignore"/>
2431 2432 </modify-argument>
2432 2433 </modify-function>
2433 2434 <modify-function signature="insertItem(int,QWidget*,QIcon,QString)">
2434 2435 <modify-argument index="2">
2435 2436 <reference-count action="ignore"/>
2436 2437 </modify-argument>
2437 2438 </modify-function>
2438 2439 <modify-function signature="insertItem(int,QWidget*,QString)">
2439 2440 <modify-argument index="2">
2440 2441 <reference-count action="ignore"/>
2441 2442 </modify-argument>
2442 2443 </modify-function>
2443 2444 <modify-function signature="setCurrentWidget(QWidget*) ">
2444 2445 <modify-argument index="1">
2445 2446 <reference-count action="ignore"/>
2446 2447 </modify-argument>
2447 2448 </modify-function>
2448 2449 </object-type>
2449 2450 <object-type name="QToolButton">
2450 2451 <modify-function signature="initStyleOption(QStyleOptionToolButton*)const">
2451 2452 <access modifier="private"/>
2452 2453 </modify-function>
2453 2454
2454 2455 <modify-function signature="setDefaultAction(QAction *)">
2455 2456 <modify-argument index="1">
2456 2457 <reference-count action="set" variable-name="__rcDefaultAction"/>
2457 2458 </modify-argument>
2458 2459 </modify-function>
2459 2460 <modify-function signature="setMenu(QMenu *)">
2460 2461 <modify-argument index="1">
2461 2462 <reference-count action="set" variable-name="__rcMenu"/>
2462 2463 </modify-argument>
2463 2464 </modify-function>
2464 2465 </object-type>
2465 2466 <object-type name="QToolTip"/>
2466 2467 <object-type name="QTreeView">
2467 2468
2468 2469 <modify-function signature="drawBranches(QPainter*,QRect,QModelIndex)const">
2469 2470 <modify-argument index="1" invalidate-after-use="yes"/>
2470 2471 </modify-function>
2471 2472 <modify-function signature="drawRow(QPainter*,QStyleOptionViewItem,QModelIndex)const">
2472 2473 <modify-argument index="1" invalidate-after-use="yes"/>
2473 2474 </modify-function>
2474 2475
2475 2476 <modify-function signature="setHeader(QHeaderView*)">
2476 2477 <modify-argument index="1">
2477 2478 <reference-count action="ignore"/>
2478 2479 </modify-argument>
2479 2480 </modify-function>
2480 2481 <modify-function signature="setModel(QAbstractItemModel*)">
2481 2482 <modify-argument index="1">
2482 2483 <reference-count declare-variable="QAbstractItemView" action="set" variable-name="__rcItemModel"/>
2483 2484 </modify-argument>
2484 2485 </modify-function>
2485 2486 <modify-function signature="setSelectionModel(QItemSelectionModel*)">
2486 2487 <modify-argument index="1">
2487 2488 <no-null-pointer/>
2488 2489 <reference-count declare-variable="QAbstractItemView" action="set" variable-name="__rcItemSelectionModel"/>
2489 2490 </modify-argument>
2490 2491 </modify-function>
2491 2492
2492 2493 <modify-function signature="sortByColumn(int)" remove="all"/> <!--### Obsolete in 4.3-->
2493 2494 </object-type>
2494 2495 <object-type name="QUndoCommand">
2495 2496 <modify-function signature="mergeWith(const QUndoCommand*)">
2496 2497 <modify-argument index="1" invalidate-after-use="yes"/>
2497 2498 </modify-function>
2498 2499 </object-type>
2499 2500 <object-type name="QUndoGroup">
2500 2501 <modify-function signature="addStack(QUndoStack*)">
2501 2502 <modify-argument index="1">
2502 2503 <reference-count action="add" variable-name="__rcStacks"/>
2503 2504 </modify-argument>
2504 2505 </modify-function>
2505 2506 <modify-function signature="removeStack(QUndoStack*)">
2506 2507 <modify-argument index="1">
2507 2508 <reference-count action="remove" variable-name="__rcStacks"/>
2508 2509 </modify-argument>
2509 2510 </modify-function>
2510 2511 <modify-function signature="setActiveStack(QUndoStack*)">
2511 2512 <modify-argument index="1">
2512 2513 <reference-count action="ignore"/>
2513 2514 </modify-argument>
2514 2515 </modify-function>
2515 2516 </object-type>
2516 2517
2517 2518 <object-type name="QUndoStack"/>
2518 2519
2519 2520 <object-type name="QUndoView">
2520 2521 <modify-function signature="setGroup(QUndoGroup *)">
2521 2522 <modify-argument index="1">
2522 2523 <reference-count action="set" variable-name="__rcGroupOrStack"/>
2523 2524 </modify-argument>
2524 2525 </modify-function>
2525 2526 <modify-function signature="setStack(QUndoStack *)">
2526 2527 <modify-argument index="1">
2527 2528 <reference-count action="set" variable-name="__rcGroupOrStack"/>
2528 2529 </modify-argument>
2529 2530 </modify-function>
2530 2531 <modify-function signature="QUndoView(QUndoGroup *,QWidget *)">
2531 2532 <modify-argument index="1">
2532 2533 <reference-count action="set" variable-name="__rcGroupOrStack"/>
2533 2534 </modify-argument>
2534 2535 </modify-function>
2535 2536 <modify-function signature="QUndoView(QUndoStack *,QWidget *)">
2536 2537 <modify-argument index="1">
2537 2538 <reference-count action="set" variable-name="__rcGroupOrStack"/>
2538 2539 </modify-argument>
2539 2540 </modify-function>
2540 2541 </object-type>
2541 2542 <object-type name="QVBoxLayout"/>
2542 2543 <object-type name="QValidator"/>
2543 2544 <object-type name="QWhatsThis"/>
2544 2545 <object-type name="QWidgetAction">
2545 2546 <modify-function signature="createWidget(QWidget*)">
2546 2547 <modify-argument index="return">
2547 2548 <define-ownership class="shell" owner="c++"/>
2548 2549 </modify-argument>
2549 2550 </modify-function>
2550 2551 </object-type>
2551 2552 <object-type name="QWidgetItem"/>
2552 2553 <object-type name="QWindowsStyle">
2553 2554 <modify-function signature="standardPixmap(QStyle::StandardPixmap, const QStyleOption*, const QWidget*)const" remove="all"/> <!--### Obsolete in 4.3-->
2554 2555 <modify-function signature="standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const" virtual-slot="yes"/>
2555 2556 </object-type>
2556 2557 <object-type name="QWorkspace">
2557 2558 <modify-function signature="addWindow(QWidget*,QFlags&lt;Qt::WindowType&gt;)">
2558 2559 <modify-argument index="1">
2559 2560 <reference-count action="ignore"/>
2560 2561 </modify-argument>
2561 2562 </modify-function>
2562 2563 <modify-function signature="setActiveWindow(QWidget*)">
2563 2564 <modify-argument index="1">
2564 2565 <reference-count action="ignore"/>
2565 2566 </modify-argument>
2566 2567 </modify-function>
2567 2568 </object-type>
2568 2569
2569 2570 <object-type name="QActionEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::ActionAdded || %1-&gt;type() == QEvent::ActionRemoved || %1-&gt;type() == QEvent::ActionChanged"/>
2570 2571 <object-type name="QClipboardEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Clipboard"/>
2571 2572 <object-type name="QCloseEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Close"/>
2572 2573 <object-type name="QContextMenuEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::ContextMenu"/>
2573 2574 <object-type name="QDragEnterEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::DragEnter"/>
2574 2575 <object-type name="QDragLeaveEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::DragLeave"/>
2575 2576 <object-type name="QDragMoveEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::DragMove">
2576 2577 <modify-function signature="accept()" remove="all"/>
2577 2578 <modify-function signature="ignore()" remove="all"/>
2578 2579 </object-type>
2579 2580 <object-type name="QDropEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Drop">
2580 2581 <modify-function signature="encodedData(const char*)const">
2581 2582 <remove/>
2582 2583 </modify-function>
2583 2584
2584 2585 <modify-function signature="format(int)const">
2585 2586 <remove/>
2586 2587 </modify-function>
2587 2588
2588 2589 <modify-function signature="provides(const char*)const">
2589 2590 <remove/>
2590 2591 </modify-function>
2591 2592
2592 2593
2593 2594 </object-type>
2594 2595 <object-type name="QFileOpenEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::FileOpen">
2595 2596 <modify-function signature="openFile(QFile&amp;,QFlags&lt;QIODevice::OpenModeFlag&gt;)const" remove="all"/>
2596 2597 </object-type>
2597 2598 <object-type name="QFocusEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::FocusIn || %1-&gt;type() == QEvent::FocusOut">
2598 2599 <modify-function signature="reason()const">
2599 2600 <remove/>
2600 2601 </modify-function>
2601 2602 </object-type>
2602 2603
2603 2604 <object-type name="QGraphicsSceneContextMenuEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneContextMenu"/>
2604 2605 <object-type name="QGraphicsSceneDragDropEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneDragEnter || %1-&gt;type() == QEvent::GraphicsSceneDragLeave || %1-&gt;type() == QEvent::GraphicsSceneDragMove || %1-&gt;type() == QEvent::GraphicsSceneDrop">
2605 2606 <modify-function signature="setMimeData(const QMimeData *)">
2606 2607 <remove/>
2607 2608 </modify-function>
2608 2609 <modify-function signature="setSource(QWidget *)">
2609 2610 <remove/>
2610 2611 </modify-function>
2611 2612 </object-type>
2612 2613 <object-type name="QGraphicsSceneEvent">
2613 2614 <modify-function signature="setWidget(QWidget *)">
2614 2615 <remove/>
2615 2616 </modify-function>
2616 2617 </object-type>
2617 2618 <object-type name="QGraphicsSceneMoveEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneMove"/>
2618 2619 <object-type name="QGraphicsSceneResizeEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneResize"/>
2619 2620 <object-type name="QGraphicsSceneHelpEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneHelp"/>
2620 2621 <object-type name="QGraphicsSceneHoverEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneHoverEnter || %1-&gt;type() == QEvent::GraphicsSceneHoverLeave || %1-&gt;type() == QEvent::GraphicsSceneHoverMove"/>
2621 2622 <object-type name="QGraphicsSceneMouseEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneMouseDoubleClick || %1-&gt;type() == QEvent::GraphicsSceneMouseMove || %1-&gt;type() == QEvent::GraphicsSceneMousePress || %1-&gt;type() == QEvent::GraphicsSceneMouseRelease"/>
2622 2623 <object-type name="QGraphicsSceneWheelEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneWheel"/>
2623 2624 <object-type name="QHelpEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::ToolTip || %1-&gt;type() == QEvent::WhatsThis"/>
2624 2625 <object-type name="QHideEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Hide"/>
2625 2626 <object-type name="QHoverEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::HoverEnter || %1-&gt;type() == QEvent::HoverLeave || %1-&gt;type() == QEvent::HoverMove"/>
2626 2627 <object-type name="QIconDragEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::IconDrag"/>
2627 2628 <object-type name="QInputMethodEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::InputMethod"/>
2628 2629 <object-type name="QMoveEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Move"/>
2629 2630 <object-type name="QResizeEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Resize"/>
2630 2631 <object-type name="QShortcutEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Shortcut">
2631 2632 <!-- All these have const overloads that are used instead -->
2632 2633 <modify-function signature="isAmbiguous()">
2633 2634 <remove/>
2634 2635 </modify-function>
2635 2636 <modify-function signature="shortcutId()">
2636 2637 <remove/>
2637 2638 </modify-function>
2638 2639 <modify-function signature="key()">
2639 2640 <remove/>
2640 2641 </modify-function>
2641 2642 </object-type>
2642 2643 <object-type name="QShowEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Show"/>
2643 2644 <object-type name="QStatusTipEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::StatusTip"/>
2644 2645 <object-type name="QTabletEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::TabletMove || %1-&gt;type() == QEvent::TabletPress || %1-&gt;type() == QEvent::TabletRelease"/>
2645 2646 <object-type name="QToolBarChangeEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::ToolBarChange"/>
2646 2647 <object-type name="QWhatsThisClickedEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::WhatsThisClicked"/>
2647 2648 <object-type name="QWheelEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Wheel"/>
2648 2649 <object-type name="QWindowStateChangeEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::WindowStateChange"/>
2649 2650 <object-type name="QDragResponseEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::DragResponse"/>
2650 2651 <object-type name="QInputEvent">
2651 2652 <modify-function signature="modifiers()const" access="non-final"/>
2652 2653 </object-type>
2653 2654 <object-type name="QKeyEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::KeyPress || %1-&gt;type() == QEvent::KeyRelease"/>
2654 2655 <object-type name="QMouseEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::MouseButtonDblClick || %1-&gt;type() == QEvent::MouseButtonPress || %1-&gt;type() == QEvent::MouseButtonRelease || %1-&gt;type() == QEvent::MouseMove"/>
2655 2656 <object-type name="QPaintEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Paint"/>
2656 2657
2657 2658 <object-type name="QAbstractButton"/>
2658 2659
2659 2660 <object-type name="QStyle">
2660 2661 <modify-function signature="standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const" virtual-slot="yes"/>
2661 2662 <modify-function signature="layoutSpacingImplementation(QSizePolicy::ControlType, QSizePolicy::ControlType, Qt::Orientation, const QStyleOption *, const QWidget *) const" virtual-slot="yes"/>
2662 2663
2663 2664 <modify-function signature="drawComplexControl(QStyle::ComplexControl,const QStyleOptionComplex*,QPainter*,const QWidget*)const">
2664 2665 <modify-argument index="3" invalidate-after-use="yes"/>
2665 2666 </modify-function>
2666 2667 <modify-function signature="drawControl(QStyle::ControlElement,const QStyleOption*,QPainter*,const QWidget*)const">
2667 2668 <modify-argument index="3" invalidate-after-use="yes"/>
2668 2669 </modify-function>
2669 2670 <modify-function signature="drawPrimitive(QStyle::PrimitiveElement,const QStyleOption*,QPainter*,const QWidget*)const">
2670 2671 <modify-argument index="3" invalidate-after-use="yes"/>
2671 2672 </modify-function>
2672 2673 <modify-function signature="styleHint(QStyle::StyleHint,const QStyleOption*,const QWidget*,QStyleHintReturn*)const">
2673 2674 <modify-argument index="4" invalidate-after-use="yes"/>
2674 2675 </modify-function>
2675 2676 <modify-function signature="drawItemPixmap(QPainter*,QRect,int,QPixmap)const">
2676 2677 <modify-argument index="1" invalidate-after-use="yes"/>
2677 2678 </modify-function>
2678 2679 <modify-function signature="drawItemText(QPainter*,QRect,int,QPalette,bool,QString,QPalette::ColorRole)const">
2679 2680 <modify-argument index="1" invalidate-after-use="yes"/>
2680 2681 </modify-function>
2681 2682
2682 2683
2683 2684 <modify-function signature="itemTextRect(QFontMetrics,QRect,int,bool,QString)const" remove="all"/>
2684 2685 </object-type>
2685 2686
2686 2687 <object-type name="QColorDialog">
2687 2688
2688 2689 <modify-function signature="getColor(const QColor &amp;, QWidget *)">
2689 2690 <modify-argument index="1">
2690 2691 <replace-default-expression with="QColor.white"/>
2691 2692 </modify-argument>
2692 2693 </modify-function>
2693 2694 <modify-function signature="getRgba(uint,bool*,QWidget*)">
2694 2695 <remove/>
2695 2696 </modify-function>
2696 2697 </object-type>
2697 2698
2698 2699 <object-type name="QLayout">
2699 2700 <modify-function signature="addItem(QLayoutItem*)">
2700 2701 <modify-argument index="1" invalidate-after-use="yes"/>
2701 2702 </modify-function>
2702 2703
2703 2704 <modify-function signature="setSpacing(int)" rename="setWidgetSpacing"/>
2704 2705 <modify-function signature="spacing()const" rename="widgetSpacing"/>
2705 2706 <modify-function signature="addWidget(QWidget *)">
2706 2707 <modify-argument index="1">
2707 2708 <no-null-pointer/>
2708 2709 <reference-count variable-name="__rcWidgets" action="add"/>
2709 2710 </modify-argument>
2710 2711 </modify-function>
2711 2712 <modify-function signature="addChildWidget(QWidget *)">
2712 2713 <modify-argument index="1">
2713 2714 <no-null-pointer/>
2714 2715 <reference-count variable-name="__rcWidgets" action="add"/>
2715 2716 </modify-argument>
2716 2717 </modify-function>
2717 2718 <modify-function signature="removeWidget(QWidget *)">
2718 2719 <modify-argument index="1">
2719 2720 <no-null-pointer/>
2720 2721 <reference-count variable-name="__rcWidgets" action="remove"/>
2721 2722 </modify-argument>
2722 2723 </modify-function>
2723 2724
2724 2725 <modify-function signature="setAlignment(QWidget*,QFlags&lt;Qt::AlignmentFlag&gt;)">
2725 2726 <modify-argument index="1">
2726 2727 <reference-count action="ignore"/>
2727 2728 </modify-argument>
2728 2729 </modify-function>
2729 2730 <modify-function signature="setAlignment(QLayout*,QFlags&lt;Qt::AlignmentFlag&gt;)">
2730 2731 <modify-argument index="1">
2731 2732 <reference-count action="ignore"/>
2732 2733 </modify-argument>
2733 2734 </modify-function>
2734 2735 <modify-function signature="setMenuBar(QWidget*)">
2735 2736 <modify-argument index="1">
2736 2737 <reference-count action="set" variable-name="__rcMenuBar"/>
2737 2738 </modify-argument>
2738 2739 </modify-function>
2739 2740 <modify-function signature="getContentsMargins(int*,int*,int*,int*)const">
2740 2741 <access modifier="private"/>
2741 2742 </modify-function>
2742 2743
2743 2744 <modify-function signature="margin()const" remove="all"/> <!--### Obsolete in 4.3-->
2744 2745 <!-- <modify-function signature="setMargin(int)" remove="all"/> --> <!--### Obsolete in 4.3-->
2745 2746 </object-type>
2746 2747
2747 2748 <object-type name="QStackedLayout">
2748 2749 <modify-function signature="addItem(QLayoutItem *)">
2749 2750 <modify-argument index="1">
2750 2751 <define-ownership class="java" owner="c++"/>
2751 2752 </modify-argument>
2752 2753 </modify-function>
2753 2754 <modify-function signature="itemAt(int) const">
2754 2755 <modify-argument index="return">
2755 2756 <define-ownership class="java" owner="c++"/>
2756 2757 </modify-argument>
2757 2758 </modify-function>
2758 2759 <modify-function signature="addWidget(QWidget *)">
2759 2760 <rename to="addStackedWidget"/>
2760 2761 <modify-argument index="1">
2761 2762 <no-null-pointer/>
2762 2763 <reference-count action="add" declare-variable="QLayout" variable-name="__rcWidgets"/>
2763 2764 </modify-argument>
2764 2765 </modify-function>
2765 2766 <modify-function signature="insertWidget(int,QWidget*)">
2766 2767 <modify-argument index="2">
2767 2768 <no-null-pointer/>
2768 2769 <reference-count action="add" declare-variable="QLayout" variable-name="__rcWidgets"/>
2769 2770 </modify-argument>
2770 2771 </modify-function>
2771 2772 <modify-function signature="setCurrentWidget(QWidget*)">
2772 2773 <modify-argument index="1">
2773 2774 <!-- Safe to ignore because current widget must have been added to layout already -->
2774 2775 <reference-count action="ignore"/>
2775 2776 </modify-argument>
2776 2777 </modify-function>
2777 2778 </object-type>
2778 2779
2779 2780 <object-type name="QBoxLayout">
2780 2781 <modify-function signature="addWidget(QWidget *, int, QFlags&lt;Qt::AlignmentFlag&gt;)">
2781 2782 <modify-argument index="1">
2782 2783 <no-null-pointer/>
2783 2784 </modify-argument>
2784 2785 </modify-function>
2785 2786 <modify-function signature="addItem(QLayoutItem *)">
2786 2787 <modify-argument index="1">
2787 2788 <define-ownership class="java" owner="c++"/>
2788 2789 </modify-argument>
2789 2790 </modify-function>
2790 2791 <modify-function signature="insertLayout(int, QLayout *, int)">
2791 2792 <modify-argument index="2">
2792 2793 <define-ownership class="java" owner="c++"/>
2793 2794 </modify-argument>
2794 2795 </modify-function>
2795 2796 <modify-function signature="insertItem(int, QLayoutItem *)">
2796 2797 <modify-argument index="2">
2797 2798 <define-ownership class="java" owner="c++"/>
2798 2799 </modify-argument>
2799 2800 </modify-function>
2800 2801 <modify-function signature="addSpacerItem(QSpacerItem*)">
2801 2802 <modify-argument index="1">
2802 2803 <define-ownership class="java" owner="c++"/>
2803 2804 </modify-argument>
2804 2805 </modify-function>
2805 2806 <modify-function signature="insertSpacerItem(int,QSpacerItem*)">
2806 2807 <modify-argument index="2">
2807 2808 <define-ownership class="java" owner="c++"/>
2808 2809 </modify-argument>
2809 2810 </modify-function>
2810 2811
2811 2812 <modify-function signature="addLayout(QLayout *, int)">
2812 2813 <modify-argument index="1">
2813 2814 <define-ownership class="java" owner="c++"/>
2814 2815 </modify-argument>
2815 2816 </modify-function>
2816 2817 <modify-function signature="addWidget(QWidget*,int,QFlags&lt;Qt::AlignmentFlag&gt;)">
2817 2818 <modify-argument index="1">
2818 2819 <reference-count declare-variable="QLayout" action="add" variable-name="__rcWidgets"/>
2819 2820 </modify-argument>
2820 2821 </modify-function>
2821 2822 <modify-function signature="insertWidget(int,QWidget*,int,QFlags&lt;Qt::AlignmentFlag&gt;)">
2822 2823 <modify-argument index="2">
2823 2824 <reference-count declare-variable="QLayout" action="add" variable-name="__rcWidgets"/>
2824 2825 </modify-argument>
2825 2826 </modify-function>
2826 2827 <modify-function signature="setStretchFactor(QWidget*,int)">
2827 2828 <modify-argument index="1">
2828 2829 <reference-count action="ignore"/>
2829 2830 </modify-argument>
2830 2831 </modify-function>
2831 2832 <modify-function signature="setStretchFactor(QLayout*,int)">
2832 2833 <modify-argument index="1">
2833 2834 <reference-count action="ignore"/>
2834 2835 </modify-argument>
2835 2836 </modify-function>
2836 2837 </object-type>
2837 2838
2838 2839 <object-type name="QGridLayout">
2839 2840 <modify-function signature="addWidget(QWidget *)" remove="all"/>
2840 2841 <modify-function signature="addItem(QLayoutItem *)">
2841 2842 <modify-argument index="1">
2842 2843 <define-ownership class="java" owner="c++"/>
2843 2844 </modify-argument>
2844 2845 </modify-function>
2845 2846 <modify-function signature="addItem(QLayoutItem *, int, int, int, int, QFlags&lt;Qt::AlignmentFlag&gt;)">
2846 2847 <modify-argument index="1">
2847 2848 <define-ownership class="java" owner="c++"/>
2848 2849 </modify-argument>
2849 2850 </modify-function>
2850 2851 <modify-function signature="addLayout(QLayout *, int, int, QFlags&lt;Qt::AlignmentFlag&gt;)">
2851 2852 <modify-argument index="1">
2852 2853 <define-ownership class="java" owner="c++"/>
2853 2854 </modify-argument>
2854 2855 </modify-function>
2855 2856 <modify-function signature="addLayout(QLayout *, int, int, int, int, QFlags&lt;Qt::AlignmentFlag&gt;)">
2856 2857 <modify-argument index="1">
2857 2858 <define-ownership class="java" owner="c++"/>
2858 2859 </modify-argument>
2859 2860 </modify-function>
2860 2861 <modify-function signature="addWidget(QWidget*,int,int,QFlags&lt;Qt::AlignmentFlag&gt;)">
2861 2862 <modify-argument index="1">
2862 2863 <reference-count declare-variable="QLayout" action="add" variable-name="__rcWidgets"/>
2863 2864 </modify-argument>
2864 2865 </modify-function>
2865 2866 <modify-function signature="addWidget(QWidget*,int,int,int,int,QFlags&lt;Qt::AlignmentFlag&gt;)">
2866 2867 <modify-argument index="1">
2867 2868 <reference-count declare-variable="QLayout" action="add" variable-name="__rcWidgets"/>
2868 2869 </modify-argument>
2869 2870 </modify-function>
2870 2871 <modify-function signature="addWidget(QWidget*)">
2871 2872 <modify-argument index="1">
2872 2873 <reference-count declare-variable="QLayout" action="add" variable-name="__rcWidgets"/>
2873 2874 </modify-argument>
2874 2875 </modify-function>
2875 2876 <modify-function signature="getItemPosition(int,int*,int*,int*,int*)">
2876 2877 <access modifier="private"/>
2877 2878 </modify-function>
2878 2879 </object-type>
2879 2880
2880 2881 <object-type name="QGraphicsView">
2881 2882 <extra-includes>
2882 2883 <include file-name="QPainterPath" location="global"/>
2883 2884 <include file-name="QVarLengthArray" location="global"/>
2884 2885 </extra-includes>
2885 2886 <modify-function signature="fitInView(const QGraphicsItem *, Qt::AspectRatioMode)">
2886 2887 <modify-argument index="1">
2887 2888 <no-null-pointer/>
2888 2889 </modify-argument>
2889 2890 </modify-function>
2890 2891 <modify-function signature="setupViewport(QWidget *)" access="non-final"/>
2891 2892 <modify-function signature="setScene(QGraphicsScene*)">
2892 2893 <modify-argument index="1">
2893 2894 <reference-count action="set" variable-name="__rcScene"/>
2894 2895 </modify-argument>
2895 2896 </modify-function>
2896 2897 <modify-function signature="setupViewport(QWidget*)">
2897 2898 <modify-argument index="1">
2898 2899 <reference-count action="ignore"/>
2899 2900 </modify-argument>
2900 2901 </modify-function>
2901 2902
2902 2903 <modify-function signature="drawBackground(QPainter*,QRectF)">
2903 2904 <modify-argument index="1" invalidate-after-use="yes"/>
2904 2905 </modify-function>
2905 2906 <modify-function signature="drawForeground(QPainter*,QRectF)">
2906 2907 <modify-argument index="1" invalidate-after-use="yes"/>
2907 2908 </modify-function>
2908 2909 <modify-function signature="drawItems(QPainter*,int,QGraphicsItem**,const QStyleOptionGraphicsItem*)">
2909 2910 <modify-argument index="1" invalidate-after-use="yes"/>
2910 2911 </modify-function>
2911 2912
2912 2913 <!--
2913 2914 <modify-function signature="drawItems(QPainter*,int,QGraphicsItem**,const QStyleOptionGraphicsItem*)">
2914 2915 <modify-argument index="2">
2915 2916 <remove-argument/>
2916 2917 <conversion-rule class="shell">
2917 2918 // nothing
2918 2919 </conversion-rule>
2919 2920 <conversion-rule class="native">
2920 2921 <insert-template name="core.get_array_length">
2921 2922 <replace from="%ARRAY" to="%3"/>
2922 2923 </insert-template>
2923 2924 int __length = %out;
2924 2925 </conversion-rule>
2925 2926 </modify-argument>
2926 2927
2927 2928 <modify-argument index="3">
2928 2929 <replace-type modified-type="com.trolltech.qt.gui.QGraphicsItemInterface[]"/>
2929 2930 <conversion-rule class="shell">
2930 2931 <insert-template name="gui.convert_graphicsitem_array_to_java">
2931 2932 <replace from="%LENGTH" to="%2"/>
2932 2933 </insert-template>
2933 2934 jobjectArray graphicsItemArrayHolder = %out;
2934 2935 </conversion-rule>
2935 2936 <conversion-rule class="native">
2936 2937 <insert-template name="gui.convert_graphicsitem_array_from_java"/>
2937 2938 </conversion-rule>
2938 2939 </modify-argument>
2939 2940
2940 2941 <modify-argument index="4">
2941 2942 <replace-type modified-type="com.trolltech.qt.gui.QStyleOptionGraphicsItem[]"/>
2942 2943 <conversion-rule class="shell">
2943 2944 <insert-template name="gui.convert_styleoptiongraphicsitem_array_to_java">
2944 2945 <replace from="%LENGTH" to="%2"/>
2945 2946 </insert-template>
2946 2947 jobjectArray styleOptionArrayHolder = %out;
2947 2948 </conversion-rule>
2948 2949 <conversion-rule class="native">
2949 2950 <insert-template name="gui.convert_styleoptiongraphicsitem_array_from_java"/>
2950 2951 </conversion-rule>
2951 2952 </modify-argument>
2952 2953 </modify-function>
2953 2954 -->
2954 2955 </object-type>
2955 2956
2956 2957 <object-type name="QInputDialog">
2957 2958
2958 2959 <modify-function signature="getInt(QWidget*,QString,QString,int,int,int,int,bool*,QFlags&lt;Qt::WindowType&gt;)">
2959 2960 <rename to="getInt_private"/>
2960 2961 <access modifier="private"/>
2961 2962 <modify-argument index="4">
2962 2963 <remove-default-expression/>
2963 2964 </modify-argument>
2964 2965 <modify-argument index="5">
2965 2966 <remove-default-expression/>
2966 2967 </modify-argument>
2967 2968 <modify-argument index="6">
2968 2969 <remove-default-expression/>
2969 2970 </modify-argument>
2970 2971 <modify-argument index="7">
2971 2972 <remove-default-expression/>
2972 2973 </modify-argument>
2973 2974 <modify-argument index="8">
2974 2975 <remove-default-expression/>
2975 2976 </modify-argument>
2976 2977 <modify-argument index="9">
2977 2978 <remove-default-expression/>
2978 2979 </modify-argument>
2979 2980 </modify-function>
2980 2981
2981 2982 <modify-function signature="getDouble(QWidget *, const QString &amp;, const QString &amp;, double, double, double, int, bool *, QFlags&lt;Qt::WindowType&gt;)">
2982 2983 <!--
2983 2984 <rename to="getDouble_internal"/>
2984 2985 <access modifier="private"/>
2985 2986 -->
2986 2987 <modify-argument index="4">
2987 2988 <remove-default-expression/>
2988 2989 </modify-argument>
2989 2990 <modify-argument index="5">
2990 2991 <remove-default-expression/>
2991 2992 </modify-argument>
2992 2993 <modify-argument index="6">
2993 2994 <remove-default-expression/>
2994 2995 </modify-argument>
2995 2996 <modify-argument index="7">
2996 2997 <remove-default-expression/>
2997 2998 </modify-argument>
2998 2999 <modify-argument index="8">
2999 3000 <remove-default-expression/>
3000 3001 </modify-argument>
3001 3002 <modify-argument index="9">
3002 3003 <remove-default-expression/>
3003 3004 </modify-argument>
3004 3005 </modify-function>
3005 3006
3006 3007 <modify-function signature="getInteger(QWidget *, const QString &amp;, const QString &amp;, int, int, int, int, bool *, QFlags&lt;Qt::WindowType&gt;)">
3007 3008 <!--
3008 3009 <rename to="getInteger_internal"/>
3009 3010 <access modifier="private"/>
3010 3011 -->
3011 3012 <modify-argument index="4">
3012 3013 <remove-default-expression/>
3013 3014 </modify-argument>
3014 3015 <modify-argument index="5">
3015 3016 <remove-default-expression/>
3016 3017 </modify-argument>
3017 3018 <modify-argument index="6">
3018 3019 <remove-default-expression/>
3019 3020 </modify-argument>
3020 3021 <modify-argument index="7">
3021 3022 <remove-default-expression/>
3022 3023 </modify-argument>
3023 3024 <modify-argument index="8">
3024 3025 <remove-default-expression/>
3025 3026 </modify-argument>
3026 3027 <modify-argument index="9">
3027 3028 <remove-default-expression/>
3028 3029 </modify-argument>
3029 3030 </modify-function>
3030 3031
3031 3032 <modify-function signature="getItem(QWidget *, const QString &amp;, const QString &amp;, const QStringList&lt;QString&gt; &amp;, int, bool, bool *, QFlags&lt;Qt::WindowType&gt;)">
3032 3033 <!--
3033 3034 <rename to="getItem_internal"/>
3034 3035 <access modifier="private"/>
3035 3036 -->
3036 3037 <modify-argument index="4">
3037 3038 <remove-default-expression/>
3038 3039 </modify-argument>
3039 3040 <modify-argument index="5">
3040 3041 <remove-default-expression/>
3041 3042 </modify-argument>
3042 3043 <modify-argument index="6">
3043 3044 <remove-default-expression/>
3044 3045 </modify-argument>
3045 3046 <modify-argument index="7">
3046 3047 <remove-default-expression/>
3047 3048 </modify-argument>
3048 3049 <modify-argument index="8">
3049 3050 <remove-default-expression/>
3050 3051 </modify-argument>
3051 3052 </modify-function>
3052 3053
3053 3054 <modify-function signature="getText(QWidget *, const QString &amp;, const QString &amp;, QLineEdit::EchoMode, const QString &amp;, bool *, QFlags&lt;Qt::WindowType&gt;)">
3054 3055 <!--
3055 3056 <rename to="getText_internal"/>
3056 3057 <access modifier="private"/>
3057 3058 -->
3058 3059 <modify-argument index="4">
3059 3060 <remove-default-expression/>
3060 3061 </modify-argument>
3061 3062 <modify-argument index="5">
3062 3063 <remove-default-expression/>
3063 3064 </modify-argument>
3064 3065 <modify-argument index="6">
3065 3066 <remove-default-expression/>
3066 3067 </modify-argument>
3067 3068 <modify-argument index="7">
3068 3069 <remove-default-expression/>
3069 3070 </modify-argument>
3070 3071 </modify-function>
3071 3072
3072 3073 <inject-code class="native" position="beginning">
3073 3074 Q_DECLARE_METATYPE(QScriptValue)
3074 3075 </inject-code>
3075 3076 <modify-function signature="getDouble(QWidget *, const QString &amp;, const QString &amp;, double, double, double, int, bool *, QFlags&lt;Qt::WindowType&gt;)">
3076 3077 <modify-argument index="8">
3077 3078 <remove-argument/>
3078 3079 <conversion-rule class="native">
3079 3080 <insert-template name="core.prepare_removed_bool*_argument"/>
3080 3081 </conversion-rule>
3081 3082 </modify-argument>
3082 3083 <modify-argument index="return">
3083 3084 <conversion-rule class="native">
3084 3085 <insert-template name="core.convert_to_null_or_primitive"/>
3085 3086 </conversion-rule>
3086 3087 </modify-argument>
3087 3088 </modify-function>
3088 3089
3089 3090 <modify-function signature="getInteger(QWidget *, const QString &amp;, const QString &amp;, int, int, int, int, bool *, QFlags&lt;Qt::WindowType&gt;)">
3090 3091 <modify-argument index="8">
3091 3092 <remove-argument/>
3092 3093 <conversion-rule class="native">
3093 3094 <insert-template name="core.prepare_removed_bool*_argument"/>
3094 3095 </conversion-rule>
3095 3096 </modify-argument>
3096 3097 <modify-argument index="return">
3097 3098 <conversion-rule class="native">
3098 3099 <insert-template name="core.convert_to_null_or_primitive"/>
3099 3100 </conversion-rule>
3100 3101 </modify-argument>
3101 3102 </modify-function>
3102 3103
3103 3104 <modify-function signature="getItem(QWidget *, const QString &amp;, const QString &amp;, const QStringList&lt;QString&gt; &amp;, int, bool, bool *, QFlags&lt;Qt::WindowType&gt;)">
3104 3105 <modify-argument index="7">
3105 3106 <remove-argument/>
3106 3107 <conversion-rule class="native">
3107 3108 <insert-template name="core.prepare_removed_bool*_argument"/>
3108 3109 </conversion-rule>
3109 3110 </modify-argument>
3110 3111 <modify-argument index="return">
3111 3112 <conversion-rule class="native">
3112 3113 <insert-template name="core.convert_to_null_or_primitive"/>
3113 3114 </conversion-rule>
3114 3115 </modify-argument>
3115 3116 </modify-function>
3116 3117
3117 3118 <modify-function signature="getText(QWidget *, const QString &amp;, const QString &amp;, QLineEdit::EchoMode, const QString &amp;, bool *, QFlags&lt;Qt::WindowType&gt;)">
3118 3119 <modify-argument index="6">
3119 3120 <remove-argument/>
3120 3121 <conversion-rule class="native">
3121 3122 <insert-template name="core.prepare_removed_bool*_argument"/>
3122 3123 </conversion-rule>
3123 3124 </modify-argument>
3124 3125 <modify-argument index="return">
3125 3126 <conversion-rule class="native">
3126 3127 <insert-template name="core.convert_to_null_or_primitive"/>
3127 3128 </conversion-rule>
3128 3129 </modify-argument>
3129 3130 </modify-function>
3130 3131 </object-type>
3131 3132
3132 3133
3133 3134 <object-type name="QGraphicsScene">
3134 3135 <extra-includes>
3135 3136 <include file-name="QVarLengthArray" location="global"/>
3136 3137 </extra-includes>
3137 3138
3138 3139 <modify-function signature="contextMenuEvent(QGraphicsSceneContextMenuEvent*)">
3139 3140 <modify-argument index="1" invalidate-after-use="yes"/>
3140 3141 </modify-function>
3141 3142 <modify-function signature="dragEnterEvent(QGraphicsSceneDragDropEvent*)">
3142 3143 <modify-argument index="1" invalidate-after-use="yes"/>
3143 3144 </modify-function>
3144 3145 <modify-function signature="dragLeaveEvent(QGraphicsSceneDragDropEvent*)">
3145 3146 <modify-argument index="1" invalidate-after-use="yes"/>
3146 3147 </modify-function>
3147 3148 <modify-function signature="dragMoveEvent(QGraphicsSceneDragDropEvent*)">
3148 3149 <modify-argument index="1" invalidate-after-use="yes"/>
3149 3150 </modify-function>
3150 3151 <modify-function signature="drawBackground(QPainter*,QRectF)">
3151 3152 <modify-argument index="1" invalidate-after-use="yes"/>
3152 3153 </modify-function>
3153 3154 <modify-function signature="drawForeground(QPainter*,QRectF)">
3154 3155 <modify-argument index="1" invalidate-after-use="yes"/>
3155 3156 </modify-function>
3156 3157 <modify-function signature="drawItems(QPainter*,int,QGraphicsItem**,const QStyleOptionGraphicsItem*,QWidget*)">
3157 3158 <modify-argument index="1" invalidate-after-use="yes"/>
3158 3159 </modify-function>
3159 3160 <modify-function signature="dropEvent(QGraphicsSceneDragDropEvent*)">
3160 3161 <modify-argument index="1" invalidate-after-use="yes"/>
3161 3162 </modify-function>
3162 3163 <modify-function signature="focusInEvent(QFocusEvent*)">
3163 3164 <modify-argument index="1" invalidate-after-use="yes"/>
3164 3165 </modify-function>
3165 3166 <modify-function signature="focusOutEvent(QFocusEvent*)">
3166 3167 <modify-argument index="1" invalidate-after-use="yes"/>
3167 3168 </modify-function>
3168 3169 <modify-function signature="helpEvent(QGraphicsSceneHelpEvent*)">
3169 3170 <modify-argument index="1" invalidate-after-use="yes"/>
3170 3171 </modify-function>
3171 3172 <modify-function signature="inputMethodEvent(QInputMethodEvent*)">
3172 3173 <modify-argument index="1" invalidate-after-use="yes"/>
3173 3174 </modify-function>
3174 3175 <modify-function signature="keyPressEvent(QKeyEvent*)">
3175 3176 <modify-argument index="1" invalidate-after-use="yes"/>
3176 3177 </modify-function>
3177 3178 <modify-function signature="keyReleaseEvent(QKeyEvent*)">
3178 3179 <modify-argument index="1" invalidate-after-use="yes"/>
3179 3180 </modify-function>
3180 3181 <modify-function signature="mouseDoubleClickEvent(QGraphicsSceneMouseEvent*)">
3181 3182 <modify-argument index="1" invalidate-after-use="yes"/>
3182 3183 </modify-function>
3183 3184 <modify-function signature="mouseMoveEvent(QGraphicsSceneMouseEvent*)">
3184 3185 <modify-argument index="1" invalidate-after-use="yes"/>
3185 3186 </modify-function>
3186 3187 <modify-function signature="mousePressEvent(QGraphicsSceneMouseEvent*)">
3187 3188 <modify-argument index="1" invalidate-after-use="yes"/>
3188 3189 </modify-function>
3189 3190 <modify-function signature="mouseReleaseEvent(QGraphicsSceneMouseEvent*)">
3190 3191 <modify-argument index="1" invalidate-after-use="yes"/>
3191 3192 </modify-function>
3192 3193 <modify-function signature="wheelEvent(QGraphicsSceneWheelEvent*)">
3193 3194 <modify-argument index="1" invalidate-after-use="yes"/>
3194 3195 </modify-function>
3195 3196
3196 3197 <modify-function signature="setActiveWindow(QGraphicsWidget*)">
3197 3198 <modify-argument index="1">
3198 3199 <reference-count action="ignore"/>
3199 3200 </modify-argument>
3200 3201 </modify-function>
3201 3202 <modify-function signature="setStyle(QStyle*)">
3202 3203 <modify-argument index="1">
3203 3204 <reference-count action="ignore"/>
3204 3205 </modify-argument>
3205 3206 </modify-function>
3206 3207
3207 3208 <modify-function signature="addItem(QGraphicsItem *)">
3208 3209 <modify-argument index="1">
3209 3210 <define-ownership class="java" owner="c++"/>
3210 3211 </modify-argument>
3211 3212 </modify-function>
3212 3213 <modify-function signature="addEllipse(const QRectF &amp;, const QPen &amp;, const QBrush &amp;)">
3213 3214 <modify-argument index="return">
3214 3215 <define-ownership class="java" owner="c++"/>
3215 3216 </modify-argument>
3216 3217 </modify-function>
3217 3218 <modify-function signature="addLine(const QLineF &amp;, const QPen &amp;)">
3218 3219 <modify-argument index="return">
3219 3220 <define-ownership class="java" owner="c++"/>
3220 3221 </modify-argument>
3221 3222 </modify-function>
3222 3223 <modify-function signature="addPath(const QPainterPath &amp;, const QPen &amp;, const QBrush &amp;)">
3223 3224 <modify-argument index="return">
3224 3225 <define-ownership class="java" owner="c++"/>
3225 3226 </modify-argument>
3226 3227 </modify-function>
3227 3228 <modify-function signature="addPixmap(const QPixmap &amp;)">
3228 3229 <modify-argument index="return">
3229 3230 <define-ownership class="java" owner="c++"/>
3230 3231 </modify-argument>
3231 3232 </modify-function>
3232 3233 <modify-function signature="addPolygon(const QPolygonF &amp;, const QPen &amp;, const QBrush &amp;)">
3233 3234 <modify-argument index="return">
3234 3235 <define-ownership class="java" owner="c++"/>
3235 3236 </modify-argument>
3236 3237 </modify-function>
3237 3238 <modify-function signature="addRect(const QRectF &amp;, const QPen &amp;, const QBrush &amp;)">
3238 3239 <modify-argument index="return">
3239 3240 <define-ownership class="java" owner="c++"/>
3240 3241 </modify-argument>
3241 3242 </modify-function>
3242 3243 <modify-function signature="addText(const QString &amp;, const QFont &amp;)">
3243 3244 <modify-argument index="return">
3244 3245 <define-ownership class="java" owner="c++"/>
3245 3246 </modify-argument>
3246 3247 </modify-function>
3247 3248 <modify-function signature="addWidget(QWidget*,QFlags&lt;Qt::WindowType&gt;)">
3248 3249 <modify-argument index="return">
3249 3250 <define-ownership class="java" owner="c++"/>
3250 3251 </modify-argument>
3251 3252 <modify-argument index="1">
3252 3253 <define-ownership class="java" owner="c++"/>
3253 3254 </modify-argument>
3254 3255 </modify-function>
3255 3256 <modify-function signature="removeItem(QGraphicsItem*)">
3256 3257 <modify-argument index="1">
3257 3258 <define-ownership class="java" owner="default"/>
3258 3259 </modify-argument>
3259 3260 </modify-function>
3260 3261 <modify-function signature="setFocusItem(QGraphicsItem*,Qt::FocusReason)">
3261 3262 <modify-argument index="1">
3262 3263 <reference-count action="set" variable-name="__rcFocusItem"/>
3263 3264 </modify-argument>
3264 3265 </modify-function>
3265 3266
3266 3267 <modify-function signature="addWidget(QWidget*,QFlags&lt;Qt::WindowType&gt;)">
3267 3268 <modify-argument index="1">
3268 3269 <conversion-rule class="native">
3269 3270 QScriptValue %out%_orig = %in%;
3270 3271 QWidget* %out% = qscriptvalue_cast&lt;QWidget*&gt;(%out%_orig);
3271 3272 if (%out% != 0)
3272 3273 context-&gt;engine()-&gt;newQObject(%out%_orig, %out%, QScriptEngine::QtOwnership);
3273 3274 </conversion-rule>
3274 3275 </modify-argument>
3275 3276 </modify-function>
3276 3277 </object-type>
3277 3278
3278 3279
3279 3280 <object-type name="QCalendarWidget">
3280 3281 <extra-includes>
3281 3282 <include file-name="QTextCharFormat" location="global"/>
3282 3283 </extra-includes>
3283 3284
3284 3285 <modify-function signature="isHeaderVisible()const" remove="all"/> <!--### Obsolete in 4.3-->
3285 3286 <modify-function signature="setHeaderVisible(bool)" remove="all"/> <!--### Obsolete in 4.3-->
3286 3287
3287 3288 <modify-function signature="paintCell(QPainter*,QRect,QDate)const">
3288 3289 <modify-argument invalidate-after-use="yes" index="1"/>
3289 3290 </modify-function>
3290 3291
3291 3292 <modify-function signature="sizeHint()const" rename="getSizeHint"/>
3292 3293 <modify-function signature="minimumSizeHint()const" rename="getMinimumSizeHint"/>
3293 3294 </object-type>
3294 3295
3295 3296 <object-type name="QTreeWidget">
3296 3297 <modify-function signature="setSelectionModel(QItemSelectionModel*)">
3297 3298 <modify-argument index="1">
3298 3299 <no-null-pointer/>
3299 3300 <reference-count declare-variable="QAbstractItemView" action="set" variable-name="__rcItemSelectionModel"/>
3300 3301 </modify-argument>
3301 3302 </modify-function>
3302 3303 <modify-function signature="removeItemWidget(QTreeWidgetItem*,int)">
3303 3304 <modify-argument index="1">
3304 3305 <reference-count action="ignore"/>
3305 3306 </modify-argument>
3306 3307 </modify-function>
3307 3308 <modify-function signature="mimeData(const QList&lt;QTreeWidgetItem*&gt;)const">
3308 3309 <modify-argument index="1" invalidate-after-use="yes"/>
3309 3310 </modify-function>
3310 3311 <modify-function signature="dropMimeData(QTreeWidgetItem*,int,const QMimeData*,Qt::DropAction)">
3311 3312 <modify-argument index="1" invalidate-after-use="yes"/>
3312 3313 </modify-function>
3313 3314 <modify-function signature="isSortingEnabled()const" remove="all"/>
3314 3315 <modify-function signature="setSortingEnabled(bool)" remove="all"/>
3315 3316 <modify-function signature="indexOfTopLevelItem(QTreeWidgetItem *)">
3316 3317 <remove/>
3317 3318 </modify-function>
3318 3319 <modify-function signature="addTopLevelItem(QTreeWidgetItem *)">
3319 3320 <modify-argument index="1">
3320 3321 <define-ownership class="java" owner="c++"/>
3321 3322 </modify-argument>
3322 3323 </modify-function>
3323 3324 <modify-function signature="takeTopLevelItem(int)">
3324 3325 <modify-argument index="return">
3325 3326 <define-ownership class="java" owner="default"/>
3326 3327 </modify-argument>
3327 3328 </modify-function>
3328 3329 <modify-function signature="addTopLevelItems(const QList&lt;QTreeWidgetItem*&gt; &amp;)">
3329 3330 <modify-argument index="1">
3330 3331 <define-ownership class="java" owner="c++"/>
3331 3332 </modify-argument>
3332 3333 </modify-function>
3333 3334 <modify-function signature="insertTopLevelItem(int, QTreeWidgetItem *)">
3334 3335 <modify-argument index="2">
3335 3336 <define-ownership class="java" owner="c++"/>
3336 3337 </modify-argument>
3337 3338 </modify-function>
3338 3339 <modify-function signature="insertTopLevelItems(int, const QList&lt;QTreeWidgetItem*&gt; &amp;)">
3339 3340 <modify-argument index="2">
3340 3341 <define-ownership class="java" owner="c++"/>
3341 3342 </modify-argument>
3342 3343 </modify-function>
3343 3344 <modify-function signature="setHeaderItem(QTreeWidgetItem *)">
3344 3345 <modify-argument index="1">
3345 3346 <define-ownership class="java" owner="c++"/>
3346 3347 </modify-argument>
3347 3348 </modify-function>
3348 3349 <modify-function signature="takeTopLevelItem(int)">
3349 3350 <modify-argument index="return">
3350 3351 <define-ownership class="java" owner="default"/>
3351 3352 </modify-argument>
3352 3353 </modify-function>
3353 3354 <modify-function signature="setCurrentItem(QTreeWidgetItem*,int,QFlags&lt;QItemSelectionModel::SelectionFlag&gt;)">
3354 3355 <modify-argument index="1">
3355 3356 <reference-count action="ignore"/>
3356 3357 </modify-argument>
3357 3358 </modify-function>
3358 3359 <modify-function signature="setFirstItemColumnSpanned(const QTreeWidgetItem*,bool)">
3359 3360 <modify-argument index="1">
3360 3361 <reference-count action="ignore"/>
3361 3362 </modify-argument>
3362 3363 </modify-function>
3363 3364 <modify-function signature="setCurrentItem(QTreeWidgetItem*)">
3364 3365 <modify-argument index="1">
3365 3366 <reference-count action="ignore"/>
3366 3367 </modify-argument>
3367 3368 </modify-function>
3368 3369 <modify-function signature="setCurrentItem(QTreeWidgetItem*,int)">
3369 3370 <modify-argument index="1">
3370 3371 <reference-count action="ignore"/>
3371 3372 </modify-argument>
3372 3373 </modify-function>
3373 3374 <modify-function signature="setItemExpanded(const QTreeWidgetItem*,bool)">
3374 3375 <remove/>
3375 3376 </modify-function>
3376 3377 <modify-function signature="isItemExpanded(const QTreeWidgetItem*)const">
3377 3378 <remove/>
3378 3379 </modify-function>
3379 3380 <modify-function signature="setItemHidden(const QTreeWidgetItem*,bool)">
3380 3381 <remove/>
3381 3382 </modify-function>
3382 3383 <modify-function signature="isItemHidden(const QTreeWidgetItem*)const">
3383 3384 <remove/>
3384 3385 </modify-function>
3385 3386 <modify-function signature="isItemSelected(const QTreeWidgetItem*)const">
3386 3387 <remove/>
3387 3388 </modify-function>
3388 3389 <modify-function signature="setItemSelected(const QTreeWidgetItem*,bool)">
3389 3390 <remove/>
3390 3391 </modify-function>
3391 3392 <modify-function signature="setItemWidget(QTreeWidgetItem*,int,QWidget*)">
3392 3393 <modify-argument index="1">
3393 3394 <reference-count action="ignore"/>
3394 3395 </modify-argument>
3395 3396 <modify-argument index="3">
3396 3397 <reference-count action="ignore"/>
3397 3398 </modify-argument>
3398 3399 </modify-function>
3399 3400 <modify-function signature="setModel(QAbstractItemModel*)">
3400 3401 <modify-argument index="1">
3401 3402 <reference-count action="ignore"/>
3402 3403 </modify-argument>
3403 3404 </modify-function>
3404 3405
3405 3406 <modify-function signature="items(const QMimeData*)const" remove="all"/> <!--### Obsolete in 4.3-->
3406 3407
3407 3408 <modify-function signature="mimeData(const QList&lt;QTreeWidgetItem*&gt;)const" remove="all"/>
3408 3409 </object-type>
3409 3410
3410 3411 <object-type name="QAbstractItemDelegate">
3411 3412 <modify-function signature="setEditorData(QWidget*,QModelIndex)const">
3412 3413 <modify-argument index="1">
3413 3414 <!-- Safe to ignore because this implementation is documented to do nothing -->
3414 3415 <reference-count action="ignore"/>
3415 3416 </modify-argument>
3416 3417 </modify-function>
3417 3418 <modify-function signature="setModelData(QWidget*,QAbstractItemModel*,QModelIndex)const">
3418 3419 <modify-argument index="1">
3419 3420 <reference-count action="ignore"/>
3420 3421 </modify-argument>
3421 3422 <modify-argument index="2">
3422 3423 <reference-count action="ignore"/>
3423 3424 </modify-argument>
3424 3425 </modify-function>
3425 3426
3426 3427 <modify-function signature="paint(QPainter*,QStyleOptionViewItem,QModelIndex)const">
3427 3428 <modify-argument index="1" invalidate-after-use="yes"/>
3428 3429 </modify-function>
3429 3430 <modify-function signature="editorEvent(QEvent*,QAbstractItemModel*,QStyleOptionViewItem,QModelIndex)">
3430 3431 <modify-argument index="1" invalidate-after-use="yes"/>
3431 3432 </modify-function>
3432 3433
3433 3434 <modify-function signature="elidedText(QFontMetrics, int, Qt::TextElideMode, QString)" remove="all"/> <!--### Obsolete in 4.3-->
3434 3435 </object-type>
3435 3436
3436 3437 <object-type name="QTableWidgetItem" delete-in-main-thread="yes">
3437 3438 <modify-function signature="operator=(const QTableWidgetItem&amp;)" remove="all"/>
3438 3439 <modify-function signature="clone() const">
3439 3440 <modify-argument index="return">
3440 3441 <define-ownership class="shell" owner="c++"/>
3441 3442 </modify-argument>
3442 3443 </modify-function>
3443 3444
3444 3445 <modify-function signature="backgroundColor()const" remove="all"/> <!--### Obsolete in 4.3-->
3445 3446 <modify-function signature="setBackgroundColor(QColor)" remove="all"/> <!--### Obsolete in 4.3-->
3446 3447 <modify-function signature="setTextColor(QColor)" remove="all"/> <!--### Obsolete in 4.3-->
3447 3448 <modify-function signature="textColor()const" remove="all"/> <!--### Obsolete in 4.3-->
3448 3449
3449 3450 <modify-function signature="operator&lt;(QTableWidgetItem)const">
3450 3451 <modify-argument index="1" invalidate-after-use="yes"/>
3451 3452 </modify-function>
3452 3453 <modify-function signature="read(QDataStream&amp;)">
3453 3454 <modify-argument index="1" invalidate-after-use="yes"/>
3454 3455 </modify-function>
3455 3456 <modify-function signature="write(QDataStream&amp;)const">
3456 3457 <modify-argument index="1" invalidate-after-use="yes"/>
3457 3458 </modify-function>
3458 3459
3459 3460
3460 3461 <modify-function signature="read(QDataStream &amp;)" remove="all"/>
3461 3462 <modify-function signature="write(QDataStream &amp;)const" remove="all"/>
3462 3463 <modify-function signature="QTableWidgetItem(QTableWidgetItem)" remove="all"/>
3463 3464 <modify-function signature="operator=(QTableWidgetItem)" remove="all"/>
3464 3465 <modify-function signature="operator&lt;(QTableWidgetItem)const" remove="all"/>
3465 3466 </object-type>
3466 3467
3467 3468 <object-type name="QListWidgetItem" delete-in-main-thread="yes">
3468 3469
3469 3470 <modify-function signature="operator&lt;(QListWidgetItem)const">
3470 3471 <modify-argument index="1" invalidate-after-use="yes"/>
3471 3472 </modify-function>
3472 3473 <modify-function signature="read(QDataStream&amp;)">
3473 3474 <modify-argument index="1" invalidate-after-use="yes"/>
3474 3475 </modify-function>
3475 3476 <modify-function signature="write(QDataStream&amp;)const">
3476 3477 <modify-argument index="1" invalidate-after-use="yes"/>
3477 3478 </modify-function>
3478 3479
3479 3480
3480 3481 <modify-function signature="operator=(const QListWidgetItem&amp;)" remove="all"/>
3481 3482 <modify-function signature="QListWidgetItem(QListWidget *, int)">
3482 3483 <modify-argument index="this">
3483 3484 <define-ownership class="java" owner="c++"/>
3484 3485 </modify-argument>
3485 3486 </modify-function>
3486 3487 <modify-function signature="QListWidgetItem(const QString &amp;, QListWidget *, int)">
3487 3488 <modify-argument index="this">
3488 3489 <define-ownership class="java" owner="c++"/>
3489 3490 </modify-argument>
3490 3491 </modify-function>
3491 3492 <modify-function signature="QListWidgetItem(const QIcon &amp;, const QString &amp;, QListWidget *, int)">
3492 3493 <modify-argument index="this">
3493 3494 <define-ownership class="java" owner="c++"/>
3494 3495 </modify-argument>
3495 3496 </modify-function>
3496 3497 <modify-function signature="clone() const">
3497 3498 <modify-argument index="return">
3498 3499 <define-ownership class="shell" owner="c++"/>
3499 3500 </modify-argument>
3500 3501 </modify-function>
3501 3502
3502 3503 <modify-function signature="backgroundColor()const" remove="all"/> <!--### Obsolete in 4.3-->
3503 3504 <modify-function signature="setBackgroundColor(QColor)" remove="all"/> <!--### Obsolete in 4.3-->
3504 3505 <modify-function signature="setTextColor(QColor)" remove="all"/> <!--### Obsolete in 4.3-->
3505 3506 <modify-function signature="textColor()const" remove="all"/> <!--### Obsolete in 4.3-->
3506 3507
3507 3508 <modify-function signature="read(QDataStream &amp;)" remove="all"/>
3508 3509 <modify-function signature="write(QDataStream &amp;)const" remove="all"/>
3509 3510 <modify-function signature="QListWidgetItem(QListWidgetItem)" remove="all"/>
3510 3511 <modify-function signature="operator=(QListWidgetItem)" remove="all"/>
3511 3512 <modify-function signature="operator&lt;(QListWidgetItem)const" remove="all"/>
3512 3513 </object-type>
3513 3514
3514 3515 <object-type name="QGraphicsTextItem"> <!-- a QObject so main-thread delete redundant -->
3515 3516 <extra-includes>
3516 3517 <include file-name="QTextCursor" location="global"/>
3517 3518 </extra-includes>
3518 3519 <modify-function signature="QGraphicsTextItem(QGraphicsItem*,QGraphicsScene*)">
3519 3520 <inject-code position="end">
3520 3521 <argument-map index="1" meta-name="%1"/>
3521 3522 if (%1 != null) disableGarbageCollection();
3522 3523 </inject-code>
3523 3524 </modify-function>
3524 3525 <modify-function signature="QGraphicsTextItem(const QString &amp;,QGraphicsItem*,QGraphicsScene*)">
3525 3526 <inject-code position="end">
3526 3527 <argument-map index="2" meta-name="%2"/>
3527 3528 if (%2 != null) disableGarbageCollection();
3528 3529 </inject-code>
3529 3530 </modify-function>
3530 3531 <modify-function signature="setDocument(QTextDocument*)">
3531 3532 <modify-argument index="1">
3532 3533 <reference-count action="set" variable-name="__rcDocument"/>
3533 3534 </modify-argument>
3534 3535 </modify-function>
3535 3536
3536 3537 <modify-function signature="matrix()const" remove="all"/> <!--### Obsolete in 4.3-->
3537 3538 <modify-function signature="resetMatrix()" remove="all"/> <!--### Obsolete in 4.3-->
3538 3539 <modify-function signature="sceneMatrix()const" remove="all"/> <!--### Obsolete in 4.3-->
3539 3540 <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/> <!--### Obsolete in 4.3-->
3540 3541 </object-type>
3541 3542
3542 3543 <object-type name="QCompleter">
3543 3544 <modify-function signature="activated(const QModelIndex &amp;)">
3544 3545 <rename to="activatedIndex"/>
3545 3546 </modify-function>
3546 3547 <modify-function signature="highlighted(const QModelIndex &amp;)">
3547 3548 <rename to="highlightedIndex"/>
3548 3549 </modify-function>
3549 3550 <modify-function signature="setModel(QAbstractItemModel *)">
3550 3551 <modify-argument index="1">
3551 3552 <reference-count action="set" variable-name="__rcModel"/>
3552 3553 </modify-argument>
3553 3554 </modify-function>
3554 3555 <modify-function signature="setPopup(QAbstractItemView *)">
3555 3556 <modify-argument index="1">
3556 3557 <no-null-pointer/>
3557 3558 <define-ownership class="java" owner="c++"/>
3558 3559 </modify-argument>
3559 3560 </modify-function>
3560 3561 <modify-function signature="setWidget(QWidget *)">
3561 3562 <modify-argument index="1">
3562 3563 <reference-count action="set" variable-name="__rcWidget"/>
3563 3564 </modify-argument>
3564 3565 </modify-function>
3565 3566 </object-type>
3566 3567
3567 3568
3568 3569 <object-type name="QTreeWidgetItem" delete-in-main-thread="yes">
3569 3570
3570 3571 <modify-function signature="operator&lt;(QTreeWidgetItem)const">
3571 3572 <modify-argument index="1" invalidate-after-use="yes"/>
3572 3573 </modify-function>
3573 3574 <modify-function signature="read(QDataStream&amp;)">
3574 3575 <modify-argument index="1" invalidate-after-use="yes"/>
3575 3576 </modify-function>
3576 3577 <modify-function signature="write(QDataStream&amp;)const">
3577 3578 <modify-argument index="1" invalidate-after-use="yes"/>
3578 3579 </modify-function>
3579 3580
3580 3581 <modify-function signature="QTreeWidgetItem(const QTreeWidgetItem &amp;)" remove="all"/>
3581 3582 <modify-function signature="operator=(const QTreeWidgetItem&amp;)" remove="all"/>
3582 3583
3583 3584 <modify-function signature="QTreeWidgetItem(QTreeWidget *,int)">
3584 3585 <modify-argument index="this">
3585 3586 <define-ownership class="java" owner="c++"/>
3586 3587 </modify-argument>
3587 3588 </modify-function>
3588 3589 <modify-function signature="QTreeWidgetItem(QTreeWidget *,const QStringList&lt;QString&gt; &amp;,int)">
3589 3590 <modify-argument index="this">
3590 3591 <define-ownership class="java" owner="c++"/>
3591 3592 </modify-argument>
3592 3593 </modify-function>
3593 3594 <modify-function signature="QTreeWidgetItem(QTreeWidget *,QTreeWidgetItem *,int)">
3594 3595 <modify-argument index="this">
3595 3596 <define-ownership class="java" owner="c++"/>
3596 3597 </modify-argument>
3597 3598 </modify-function>
3598 3599 <modify-function signature="QTreeWidgetItem(QTreeWidgetItem *,int)">
3599 3600 <modify-argument index="this">
3600 3601 <define-ownership class="java" owner="c++"/>
3601 3602 </modify-argument>
3602 3603 </modify-function>
3603 3604 <modify-function signature="QTreeWidgetItem(QTreeWidgetItem *,const QStringList&lt;QString&gt; &amp;,int)">
3604 3605 <modify-argument index="this">
3605 3606 <define-ownership class="java" owner="c++"/>
3606 3607 </modify-argument>
3607 3608 </modify-function>
3608 3609 <modify-function signature="QTreeWidgetItem(QTreeWidgetItem *,QTreeWidgetItem *,int)">
3609 3610 <modify-argument index="this">
3610 3611 <define-ownership class="java" owner="c++"/>
3611 3612 </modify-argument>
3612 3613 </modify-function>
3613 3614 <modify-function signature="clone() const">
3614 3615 <modify-argument index="return">
3615 3616 <define-ownership class="shell" owner="c++"/>
3616 3617 </modify-argument>
3617 3618 </modify-function>
3618 3619 <modify-function signature="addChild(QTreeWidgetItem *)">
3619 3620 <modify-argument index="1">
3620 3621 <define-ownership class="java" owner="c++"/>
3621 3622 </modify-argument>
3622 3623 </modify-function>
3623 3624 <modify-function signature="addChildren(const QList&lt;QTreeWidgetItem*&gt; &amp;)">
3624 3625 <modify-argument index="1">
3625 3626 <define-ownership class="java" owner="c++"/>
3626 3627 </modify-argument>
3627 3628 </modify-function>
3628 3629 <modify-function signature="insertChild(int, QTreeWidgetItem *)">
3629 3630 <modify-argument index="2">
3630 3631 <define-ownership class="java" owner="c++"/>
3631 3632 </modify-argument>
3632 3633 </modify-function>
3633 3634 <modify-function signature="insertChildren(int, const QList&lt;QTreeWidgetItem*&gt; &amp;)">
3634 3635 <modify-argument index="2">
3635 3636 <define-ownership class="java" owner="c++"/>
3636 3637 </modify-argument>
3637 3638 </modify-function>
3638 3639 <modify-function signature="removeChild(QTreeWidgetItem*)">
3639 3640 <modify-argument index="1">
3640 3641 <define-ownership class="java" owner="default"/>
3641 3642 </modify-argument>
3642 3643 </modify-function>
3643 3644 <modify-function signature="takeChild(int)">
3644 3645 <modify-argument index="return">
3645 3646 <define-ownership class="java" owner="default"/>
3646 3647 </modify-argument>
3647 3648 </modify-function>
3648 3649 <modify-function signature="takeChildren()">
3649 3650 <modify-argument index="return">
3650 3651 <define-ownership class="java" owner="default"/>
3651 3652 </modify-argument>
3652 3653 </modify-function>
3653 3654
3654 3655 <modify-function signature="backgroundColor(int)const" remove="all"/> <!--### Obsolete in 4.3-->
3655 3656 <modify-function signature="setBackgroundColor(int, QColor)" remove="all"/> <!--### Obsolete in 4.3-->
3656 3657 <modify-function signature="setTextColor(int, QColor)" remove="all"/> <!--### Obsolete in 4.3-->
3657 3658 <modify-function signature="textColor(int)const" remove="all"/> <!--### Obsolete in 4.3-->
3658 3659
3659 3660 <modify-function signature="read(QDataStream &amp;)" remove="all"/>
3660 3661 <modify-function signature="write(QDataStream &amp;)const" remove="all"/>
3661 3662 <modify-function signature="QTreeWidgetItem(QTreeWidgetItem)" remove="all"/>
3662 3663 <modify-function signature="operator=(QTreeWidgetItem)" remove="all"/>
3663 3664 <modify-function signature="operator&lt;(QTreeWidgetItem)const" remove="all"/>
3664 3665 </object-type>
3665 3666
3666 3667 <object-type name="QListWidget">
3667 3668 <modify-function signature="mimeData(const QList&lt;QListWidgetItem *&gt;)const">
3668 3669 <modify-argument index="1" invalidate-after-use="yes"/>
3669 3670 </modify-function>
3670 3671 <modify-function signature="addItem(QListWidgetItem *)">
3671 3672 <modify-argument index="1">
3672 3673 <define-ownership class="java" owner="c++"/>
3673 3674 </modify-argument>
3674 3675 </modify-function>
3675 3676 <modify-function signature="insertItem(int, QListWidgetItem *)">
3676 3677 <modify-argument index="2">
3677 3678 <define-ownership class="java" owner="c++"/>
3678 3679 </modify-argument>
3679 3680 </modify-function>
3680 3681 <modify-function signature="setCurrentItem(QListWidgetItem*)">
3681 3682 <modify-argument index="1">
3682 3683 <reference-count action="ignore"/>
3683 3684 </modify-argument>
3684 3685 </modify-function>
3685 3686 <modify-function signature="setCurrentItem(QListWidgetItem*,QFlags&lt;QItemSelectionModel::SelectionFlag&gt;)">
3686 3687 <modify-argument index="1">
3687 3688 <reference-count action="ignore"/>
3688 3689 </modify-argument>
3689 3690 </modify-function>
3690 3691 <modify-function signature="setItemHidden(const QListWidgetItem*,bool)">
3691 3692 <remove/>
3692 3693 </modify-function>
3693 3694 <modify-function signature="isItemHidden(const QListWidgetItem*)const">
3694 3695 <remove/>
3695 3696 </modify-function>
3696 3697 <modify-function signature="setItemSelected(const QListWidgetItem*,bool)">
3697 3698 <remove/>
3698 3699 </modify-function>
3699 3700 <modify-function signature="isItemSelected(const QListWidgetItem*)const">
3700 3701 <remove/>
3701 3702 </modify-function>
3702 3703 <modify-function signature="takeItem(int)">
3703 3704 <modify-argument index="return">
3704 3705 <define-ownership class="java" owner="default"/>
3705 3706 </modify-argument>
3706 3707 </modify-function>
3707 3708 <modify-function signature="setItemWidget(QListWidgetItem*,QWidget*)">
3708 3709 <modify-argument index="1">
3709 3710 <reference-count action="ignore"/>
3710 3711 </modify-argument>
3711 3712 <modify-argument index="2">
3712 3713 <reference-count action="ignore"/>
3713 3714 </modify-argument>
3714 3715 </modify-function>
3715 3716 <modify-function signature="removeItemWidget(QListWidgetItem*)">
3716 3717 <modify-argument index="1">
3717 3718 <reference-count action="ignore"/>
3718 3719 </modify-argument>
3719 3720 </modify-function>
3720 3721 <modify-function signature="setModel(QAbstractItemModel*)">
3721 3722 <modify-argument index="1">
3722 3723 <reference-count action="ignore"/>
3723 3724 </modify-argument>
3724 3725 </modify-function>
3725 3726
3726 3727
3727 3728 <modify-function signature="mimeData(const QList&lt;QListWidgetItem*&gt;)const" remove="all"/>
3728 3729 </object-type>
3729 3730
3730 3731 <object-type name="QWidget">
3731 3732 <extra-includes>
3732 3733 <include file-name="QGesture" location="global"/>
3733 3734 <include file-name="QIcon" location="global"/>
3734 3735 <include file-name="QMessageBox" location="global"/>
3735 3736 </extra-includes>
3736 3737
3737 3738 <modify-function signature="actionEvent(QActionEvent*)">
3738 3739 <modify-argument index="1" invalidate-after-use="yes"/>
3739 3740 </modify-function>
3740 3741 <modify-function signature="changeEvent(QEvent*)">
3741 3742 <modify-argument index="1" invalidate-after-use="yes"/>
3742 3743 </modify-function>
3743 3744 <modify-function signature="closeEvent(QCloseEvent*)">
3744 3745 <modify-argument index="1" invalidate-after-use="yes"/>
3745 3746 </modify-function>
3746 3747 <modify-function signature="contextMenuEvent(QContextMenuEvent*)">
3747 3748 <modify-argument index="1" invalidate-after-use="yes"/>
3748 3749 </modify-function>
3749 3750 <modify-function signature="dragEnterEvent(QDragEnterEvent*)">
3750 3751 <modify-argument index="1" invalidate-after-use="yes"/>
3751 3752 </modify-function>
3752 3753 <modify-function signature="dragLeaveEvent(QDragLeaveEvent*)">
3753 3754 <modify-argument index="1" invalidate-after-use="yes"/>
3754 3755 </modify-function>
3755 3756 <modify-function signature="dragMoveEvent(QDragMoveEvent*)">
3756 3757 <modify-argument index="1" invalidate-after-use="yes"/>
3757 3758 </modify-function>
3758 3759 <modify-function signature="dropEvent(QDropEvent*)">
3759 3760 <modify-argument index="1" invalidate-after-use="yes"/>
3760 3761 </modify-function>
3761 3762 <modify-function signature="enterEvent(QEvent*)">
3762 3763 <modify-argument index="1" invalidate-after-use="yes"/>
3763 3764 </modify-function>
3764 3765 <modify-function signature="focusInEvent(QFocusEvent*)">
3765 3766 <modify-argument index="1" invalidate-after-use="yes"/>
3766 3767 </modify-function>
3767 3768 <modify-function signature="focusOutEvent(QFocusEvent*)">
3768 3769 <modify-argument index="1" invalidate-after-use="yes"/>
3769 3770 </modify-function>
3770 3771 <modify-function signature="hideEvent(QHideEvent*)">
3771 3772 <modify-argument index="1" invalidate-after-use="yes"/>
3772 3773 </modify-function>
3773 3774 <modify-function signature="inputMethodEvent(QInputMethodEvent*)">
3774 3775 <modify-argument index="1" invalidate-after-use="yes"/>
3775 3776 </modify-function>
3776 3777 <modify-function signature="keyPressEvent(QKeyEvent*)">
3777 3778 <modify-argument index="1" invalidate-after-use="yes"/>
3778 3779 </modify-function>
3779 3780 <modify-function signature="keyReleaseEvent(QKeyEvent*)">
3780 3781 <modify-argument index="1" invalidate-after-use="yes"/>
3781 3782 </modify-function>
3782 3783 <modify-function signature="leaveEvent(QEvent*)">
3783 3784 <modify-argument index="1" invalidate-after-use="yes"/>
3784 3785 </modify-function>
3785 3786 <modify-function signature="mouseDoubleClickEvent(QMouseEvent*)">
3786 3787 <modify-argument index="1" invalidate-after-use="yes"/>
3787 3788 </modify-function>
3788 3789 <modify-function signature="mouseMoveEvent(QMouseEvent*)">
3789 3790 <modify-argument index="1" invalidate-after-use="yes"/>
3790 3791 </modify-function>
3791 3792 <modify-function signature="mousePressEvent(QMouseEvent*)">
3792 3793 <modify-argument index="1" invalidate-after-use="yes"/>
3793 3794 </modify-function>
3794 3795 <modify-function signature="mouseReleaseEvent(QMouseEvent*)">
3795 3796 <modify-argument index="1" invalidate-after-use="yes"/>
3796 3797 </modify-function>
3797 3798 <modify-function signature="moveEvent(QMoveEvent*)">
3798 3799 <modify-argument index="1" invalidate-after-use="yes"/>
3799 3800 </modify-function>
3800 3801 <modify-function signature="paintEvent(QPaintEvent*)">
3801 3802 <modify-argument index="1" invalidate-after-use="yes"/>
3802 3803 </modify-function>
3803 3804 <modify-function signature="resizeEvent(QResizeEvent*)">
3804 3805 <modify-argument index="1" invalidate-after-use="yes"/>
3805 3806 </modify-function>
3806 3807 <modify-function signature="showEvent(QShowEvent*)">
3807 3808 <modify-argument index="1" invalidate-after-use="yes"/>
3808 3809 </modify-function>
3809 3810 <modify-function signature="tabletEvent(QTabletEvent*)">
3810 3811 <modify-argument index="1" invalidate-after-use="yes"/>
3811 3812 </modify-function>
3812 3813 <modify-function signature="wheelEvent(QWheelEvent*)">
3813 3814 <modify-argument index="1" invalidate-after-use="yes"/>
3814 3815 </modify-function>
3815 3816
3816 3817 <modify-function signature="render(QPainter*,QPoint,QRegion,QFlags&lt;QWidget::RenderFlag&gt;)">
3817 3818 <modify-argument index="2">
3818 3819 <!-- Removed because the render(QPainter*) overload conflicts with the identical function in QGraphicsView -->
3819 3820 <remove-default-expression/>
3820 3821 </modify-argument>
3821 3822 </modify-function>
3822 3823
3823 3824 <!--
3824 3825 <inject-code class="native">
3825 3826 extern "C" JNIEXPORT void JNICALL QTJAMBI_FUNCTION_PREFIX(Java_com_trolltech_qt_gui_QWidget__1_1qt_1QMessageBox_1setWindowTitle)
3826 3827 (JNIEnv *__jni_env,
3827 3828 jclass,
3828 3829 jlong __this_nativeId,
3829 3830 jobject title0)
3830 3831 {
3831 3832 QTJAMBI_DEBUG_TRACE("(native) entering: QMessageBox::setWindowTitle(const QString &amp; title)");
3832 3833 QString __qt_title0 = qtjambi_to_qstring(__jni_env, (jstring) title0);
3833 3834 QTJAMBI_EXCEPTION_CHECK(__jni_env);
3834 3835 QMessageBox *__qt_this = (QMessageBox *) qtjambi_from_jlong(__this_nativeId);
3835 3836 QTJAMBI_EXCEPTION_CHECK(__jni_env);
3836 3837 Q_ASSERT(__qt_this);
3837 3838 __qt_this-&gt;setWindowTitle((const QString&amp; )__qt_title0);
3838 3839 QTJAMBI_DEBUG_TRACE("(native) -&gt; leaving: QMessageBox::setWindowTitle(const QString &amp; title)");
3839 3840 }
3840 3841 </inject-code>
3841 3842
3842 3843 <inject-code class="native">
3843 3844 extern "C" JNIEXPORT void JNICALL QTJAMBI_FUNCTION_PREFIX(Java_com_trolltech_qt_gui_QWidget__1_1qt_1QMessageBox_1setWindowModality)
3844 3845 (JNIEnv *__jni_env,
3845 3846 jclass,
3846 3847 jlong __this_nativeId,
3847 3848 jint windowModality0)
3848 3849 {
3849 3850 Q_UNUSED(__jni_env);
3850 3851 QTJAMBI_DEBUG_TRACE("(native) entering: QMessageBox::setWindowModality(Qt::WindowModality modality)");
3851 3852 Qt::WindowModality __qt_windowModality0 = (Qt::WindowModality) windowModality0;
3852 3853 QTJAMBI_EXCEPTION_CHECK(__jni_env);
3853 3854 QMessageBox *__qt_this = (QMessageBox *) qtjambi_from_jlong(__this_nativeId);
3854 3855 QTJAMBI_EXCEPTION_CHECK(__jni_env);
3855 3856 Q_ASSERT(__qt_this);
3856 3857 __qt_this-&gt;setWindowModality((Qt::WindowModality )__qt_windowModality0);
3857 3858 QTJAMBI_DEBUG_TRACE("(native) -&gt; leaving: QMessageBox::setWindowModality(Qt::WindowModality modality)");
3858 3859 }
3859 3860 </inject-code>
3860 3861 -->
3861 3862
3862 3863 <modify-function signature="render(QPaintDevice *, const QPoint &amp;, const QRegion &amp;, QFlags&lt;QWidget::RenderFlag&gt;)">
3863 3864 <modify-argument index="4">
3864 3865 <replace-default-expression with="RenderFlag.DrawWindowBackground, RenderFlag.DrawChildren"/>
3865 3866 </modify-argument>
3866 3867 </modify-function>
3867 3868 <modify-function signature="render(QPainter *, const QPoint &amp;, const QRegion &amp;, QFlags&lt;QWidget::RenderFlag&gt;)">
3868 3869 <modify-argument index="4">
3869 3870 <replace-default-expression with="RenderFlag.DrawWindowBackground, RenderFlag.DrawChildren"/>
3870 3871 </modify-argument>
3871 3872 </modify-function>
3872 3873 <modify-function signature="setFocusProxy(QWidget*)">
3873 3874 <modify-argument index="1">
3874 3875 <reference-count action="set" variable-name="__rcFocusProxy"/>
3875 3876 </modify-argument>
3876 3877 </modify-function>
3877 3878 <modify-function signature="setInputContext(QInputContext*)">
3878 3879 <modify-argument index="1">
3879 3880 <define-ownership class="java" owner="c++"/>
3880 3881 </modify-argument>
3881 3882 </modify-function>
3882 3883 <modify-function signature="setLayout(QLayout*)">
3883 3884 <modify-argument index="1">
3884 3885 <no-null-pointer/>
3885 3886 <reference-count action="ignore"/>
3886 3887 </modify-argument>
3887 3888 </modify-function>
3888 3889 <modify-function signature="setParent(QWidget*,QFlags&lt;Qt::WindowType&gt;)">
3889 3890 <modify-argument index="1">
3890 3891 <reference-count action="ignore"/>
3891 3892 </modify-argument>
3892 3893 </modify-function>
3893 3894 <modify-function signature="setParent(QWidget*)">
3894 3895 <modify-argument index="1">
3895 3896 <reference-count action="ignore"/>
3896 3897 </modify-argument>
3897 3898 </modify-function>
3898 3899 <modify-function signature="setStyle(QStyle*)">
3899 3900 <modify-argument index="1">
3900 3901 <reference-count action="set" variable-name="__rcStyle"/>
3901 3902 </modify-argument>
3902 3903 </modify-function>
3903 3904 <modify-function signature="setTabOrder(QWidget*,QWidget*)">
3904 3905 <modify-argument index="1">
3905 3906 <reference-count action="ignore"/>
3906 3907 </modify-argument>
3907 3908 <modify-argument index="2">
3908 3909 <reference-count action="ignore"/>
3909 3910 </modify-argument>
3910 3911 </modify-function>
3911 3912 <modify-function signature="getContentsMargins(int*,int*,int*,int*)const">
3912 3913 <access modifier="private"/>
3913 3914 </modify-function>
3914 3915
3915 3916 <modify-function signature="addAction(QAction *)">
3916 3917 <modify-argument index="1">
3917 3918 <reference-count action="add" variable-name="__rcActions"/>
3918 3919 </modify-argument>
3919 3920 </modify-function>
3920 3921
3921 3922 <modify-function signature="insertAction(QAction *, QAction *)">
3922 3923 <modify-argument index="2">
3923 3924 <reference-count action="add" variable-name="__rcActions"/>
3924 3925 </modify-argument>
3925 3926 </modify-function>
3926 3927
3927 3928 <modify-function signature="addActions(const QList&lt;QAction *&gt; &amp;)">
3928 3929 <modify-argument index="1">
3929 3930 <reference-count action="add-all" variable-name="__rcActions"/>
3930 3931 </modify-argument>
3931 3932 </modify-function>
3932 3933
3933 3934 <modify-function signature="insertActions(QAction *, const QList&lt;QAction *&gt; &amp;)">
3934 3935 <modify-argument index="2">
3935 3936 <reference-count action="add-all" variable-name="__rcActions"/>
3936 3937 </modify-argument>
3937 3938 </modify-function>
3938 3939
3939 3940 <modify-function signature="removeAction(QAction *)">
3940 3941 <modify-argument index="1">
3941 3942 <reference-count action="remove" variable-name="__rcActions"/>
3942 3943 </modify-argument>
3943 3944 </modify-function>
3944 3945 <modify-function signature="enabledChange(bool)" remove="all"/> <!--### Obsolete in 4.3-->
3945 3946 <modify-function signature="fontChange(QFont)" remove="all"/> <!--### Obsolete in 4.3-->
3946 3947 <modify-function signature="isEnabledToTLW()const" remove="all"/> <!--### Obsolete in 4.3-->
3947 3948 <modify-function signature="isTopLevel()const" remove="all"/> <!--### Obsolete in 4.3-->
3948 3949 <modify-function signature="paletteChange(QPalette)" remove="all"/> <!--### Obsolete in 4.3-->
3949 3950 <modify-function signature="setShown(bool)" remove="all"/> <!--### Obsolete in 4.3-->
3950 3951 <modify-function signature="topLevelWidget()const" remove="all"/> <!--### Obsolete in 4.3-->
3951 3952 <modify-function signature="windowActivationChange(bool)" remove="all"/> <!--### Obsolete in 4.3-->
3952 3953
3953 3954 <modify-function signature="fontInfo()const" remove="all"/>
3954 3955 <modify-function signature="fontMetrics()const" remove="all"/>
3955 3956 <modify-function signature="sizeHint()const" rename="getSizeHint"/>
3956 3957 <modify-function signature="minimumSizeHint()const" rename="getMinimumSizeHint"/>
3957 3958 <modify-function signature="setVisible(bool)" remove="all"/>
3958 3959 <modify-function signature="grabGesture(Qt::GestureType type,Qt::GestureFlags)">
3959 3960 <modify-argument index="2"> <remove-default-expression/> </modify-argument>
3960 3961 </modify-function>
3961 3962 </object-type>
3962 3963
3963 3964 <object-type name="QMessageBox">
3964 3965
3965 3966
3966 3967 <modify-function signature="setWindowTitle(const QString &amp;)" remove="all"/>
3967 3968 <modify-function signature="setWindowModality(Qt::WindowModality)" remove="all"/>
3968 3969 <extra-includes>
3969 3970 <include file-name="QPixmap" location="global"/>
3970 3971 </extra-includes>
3971 3972 <modify-function signature="addButton(QAbstractButton*,QMessageBox::ButtonRole)">
3972 3973 <modify-argument index="1">
3973 3974 <reference-count action="ignore"/>
3974 3975 </modify-argument>
3975 3976 </modify-function>
3976 3977 <modify-function signature="removeButton(QAbstractButton*)">
3977 3978 <modify-argument index="1">
3978 3979 <reference-count action="ignore"/>
3979 3980 </modify-argument>
3980 3981 </modify-function>
3981 3982 <modify-function signature="setDefaultButton(QPushButton*)">
3982 3983 <modify-argument index="1">
3983 3984 <reference-count action="ignore"/>
3984 3985 </modify-argument>
3985 3986 </modify-function>
3986 3987 <modify-function signature="setEscapeButton(QAbstractButton*)">
3987 3988 <modify-argument index="1">
3988 3989 <reference-count action="ignore"/>
3989 3990 </modify-argument>
3990 3991 </modify-function>
3991 3992
3992 3993 <modify-function signature="QMessageBox(QString,QString,QMessageBox::Icon,int,int,int,QWidget*,QFlags&lt;Qt::WindowType&gt;)" remove="all"/> <!--### Obsolete in 4.3-->
3993 3994 <modify-function signature="buttonText(int)const" remove="all"/> <!--### Obsolete in 4.3-->
3994 3995 <modify-function signature="setButtonText(int, QString)" remove="all"/> <!--### Obsolete in 4.3-->
3995 3996 <modify-function signature="standardIcon(QMessageBox::Icon)" remove="all"/> <!--### Obsolete in 4.3-->
3996 3997
3997 3998 <modify-function signature="critical(QWidget*,QString,QString,int,int,int)" remove="all"/> <!--### Obsolete in 4.3-->
3998 3999 <modify-function signature="critical(QWidget*,QString,QString,QString,QString,QString,int,int)" remove="all"/> <!--### Obsolete in 4.3-->
3999 4000 <modify-function signature="information(QWidget*,QString,QString,int,int,int)" remove="all"/> <!--### Obsolete in 4.3-->
4000 4001 <modify-function signature="information(QWidget*,QString,QString,QString,QString,QString,int,int)" remove="all"/> <!--### Obsolete in 4.3-->
4001 4002 <modify-function signature="question(QWidget*, QString, QString, int, int, int)" remove="all"/> <!--### Obsolete in 4.3-->
4002 4003 <modify-function signature="question(QWidget*, QString, QString, QString, QString, QString, int, int)" remove="all"/> <!--### Obsolete in 4.3-->
4003 4004 <modify-function signature="warning(QWidget*, QString, QString, int, int, int)" remove="all"/> <!--### Obsolete in 4.3-->
4004 4005 <modify-function signature="warning(QWidget*, QString, QString, QString, QString, QString, int, int)" remove="all"/> <!--### Obsolete in 4.3-->
4005 4006 </object-type>
4006 4007
4007 4008 <object-type name="QAbstractSpinBox">
4008 4009 <modify-function signature="initStyleOption(QStyleOptionSpinBox*)const">
4009 4010 <access modifier="private"/>
4010 4011 </modify-function>
4011 4012 <modify-function signature="setLineEdit(QLineEdit*)">
4012 4013 <modify-argument index="1">
4013 4014 <!-- Safe to ignore because the spinbox reparents the line edit -->
4014 4015 <reference-count action="ignore"/>
4015 4016 <no-null-pointer/>
4016 4017 </modify-argument>
4017 4018 </modify-function>
4018 4019 </object-type>
4019 4020
4020 4021 <object-type name="QTextFrame" delete-in-main-thread="yes">
4021 4022 <extra-includes>
4022 4023 <include file-name="QTextCursor" location="global"/>
4023 4024 </extra-includes>
4024 4025 </object-type>
4025 4026
4026 4027 <object-type name="QImageIOHandler">
4027 4028 <extra-includes>
4028 4029 <include file-name="QRect" location="global"/>
4029 4030 </extra-includes>
4030 4031 <modify-function signature="setFormat(const QByteArray &amp;)const">
4031 4032 <remove/>
4032 4033 </modify-function>
4033 4034 <modify-function signature="setDevice(QIODevice*)">
4034 4035 <modify-argument index="1">
4035 4036 <reference-count action="set" variable-name="__rcDevice"/>
4036 4037 </modify-argument>
4037 4038 </modify-function>
4038 4039 <!--
4039 4040 <modify-function signature="read(QImage*)">
4040 4041 <modify-argument index="1">
4041 4042 <replace-type modified-type="com.trolltech.qt.gui.QImage"/>
4042 4043 <conversion-rule class="shell">
4043 4044 jobject %out = qtjambi_from_object(__jni_env, %in, "QImage", "com/trolltech/qt/gui/", false);
4044 4045
4045 4046 QtJambiLink *__link = %out != 0 ? QtJambiLink::findLink(__jni_env, %out) : 0;
4046 4047 </conversion-rule>
4047 4048 <conversion-rule class="native">
4048 4049 QImage *%out = (QImage *) qtjambi_to_object(__jni_env, %in);
4049 4050 </conversion-rule>
4050 4051 </modify-argument>
4051 4052 <modify-argument index="0">
4052 4053 <conversion-rule class="shell">
4053 4054 // Invalidate object
4054 4055 if (__link != 0) __link-&gt;resetObject(__jni_env);
4055 4056 bool %out = (bool) %in;
4056 4057 </conversion-rule>
4057 4058 </modify-argument>
4058 4059 </modify-function>
4059 4060 -->
4060 4061
4061 4062 <modify-function signature="name()const" remove="all"/> <!--### Obsolete in 4.3-->
4062 4063 </object-type>
4063 4064
4064 4065 <object-type name="QProxyModel">
4065 4066 <modify-function signature="parent()const" remove="all"/>
4066 4067 <extra-includes>
4067 4068 <include file-name="QPixmap" location="global"/>
4068 4069 <include file-name="QStringList" location="global"/>
4069 4070 <include file-name="QSize" location="global"/>
4070 4071 </extra-includes>
4071 4072 <modify-function signature="setModel(QAbstractItemModel*)">
4072 4073 <modify-argument index="1">
4073 4074 <reference-count action="set" variable-name="__rcModel"/>
4074 4075 </modify-argument>
4075 4076 </modify-function>
4076 4077 </object-type>
4077 4078
4078 4079 <object-type name="QImageReader">
4079 4080 <extra-includes>
4080 4081 <include file-name="QColor" location="global"/>
4081 4082 <include file-name="QRect" location="global"/>
4082 4083 <include file-name="QSize" location="global"/>
4083 4084 <include file-name="QStringList" location="global"/>
4084 4085 <include file-name="QImage" location="global"/>
4085 4086 </extra-includes>
4086 4087 <modify-function signature="read(QImage*) ">
4087 4088 <remove/>
4088 4089 </modify-function>
4089 4090 <modify-function signature="setDevice(QIODevice*)">
4090 4091 <modify-argument index="1">
4091 4092 <reference-count action="set" variable-name="__rcDevice"/>
4092 4093 </modify-argument>
4093 4094 </modify-function>
4094 4095 </object-type>
4095 4096
4096 4097 <object-type name="QMovie">
4097 4098 <extra-includes>
4098 4099 <include file-name="QColor" location="global"/>
4099 4100 <include file-name="QImage" location="global"/>
4100 4101 <include file-name="QPixmap" location="global"/>
4101 4102 <include file-name="QRect" location="global"/>
4102 4103 <include file-name="QSize" location="global"/>
4103 4104 </extra-includes>
4104 4105 <modify-function signature="cacheMode()">
4105 4106 <remove/>
4106 4107 </modify-function>
4107 4108 <modify-function signature="setDevice(QIODevice*)">
4108 4109 <modify-argument index="1">
4109 4110 <reference-count action="set" variable-name="__rcDevice"/>
4110 4111 </modify-argument>
4111 4112 </modify-function>
4112 4113 </object-type>
4113 4114
4114 4115 <object-type name="QPageSetupDialog"/>
4115 4116
4116 4117 <object-type name="QTabWidget">
4117 4118 <modify-function signature="initStyleOption(QStyleOptionTabWidgetFrame*)const">
4118 4119 <access modifier="private"/>
4119 4120 </modify-function>
4120 4121 <inject-code>
4121 4122 <insert-template name="gui.init_style_option">
4122 4123 <replace from="%TYPE" to="QStyleOptionTabWidgetFrame"/>
4123 4124 </insert-template>
4124 4125 </inject-code>
4125 4126 <modify-function signature="addTab(QWidget*,QIcon,QString)">
4126 4127 <modify-argument index="1">
4127 4128 <reference-count action="ignore"/>
4128 4129 </modify-argument>
4129 4130 </modify-function>
4130 4131 <modify-function signature="addTab(QWidget*,QString)">
4131 4132 <modify-argument index="1">
4132 4133 <reference-count action="ignore"/>
4133 4134 </modify-argument>
4134 4135 </modify-function>
4135 4136 <modify-function signature="insertTab(int,QWidget*,QString)">
4136 4137 <modify-argument index="2">
4137 4138 <reference-count action="ignore"/>
4138 4139 </modify-argument>
4139 4140 </modify-function>
4140 4141 <modify-function signature="insertTab(int,QWidget*,QIcon,QString)">
4141 4142 <modify-argument index="2">
4142 4143 <reference-count action="ignore"/>
4143 4144 </modify-argument>
4144 4145 </modify-function>
4145 4146 <modify-function signature="setCornerWidget(QWidget*,Qt::Corner)">
4146 4147 <modify-argument index="1">
4147 4148 <reference-count action="ignore"/>
4148 4149 </modify-argument>
4149 4150 </modify-function>
4150 4151 <modify-function signature="setCurrentWidget(QWidget*)">
4151 4152 <modify-argument index="1">
4152 4153 <reference-count action="ignore"/>
4153 4154 </modify-argument>
4154 4155 </modify-function>
4155 4156 <modify-function signature="setTabBar(QTabBar*)">
4156 4157 <modify-argument index="1">
4157 4158 <reference-count action="ignore"/>
4158 4159 </modify-argument>
4159 4160 </modify-function>
4160 4161 </object-type>
4161 4162 <object-type name="QDrag">
4162 4163 <extra-includes>
4163 4164 <include file-name="QPoint" location="global"/>
4164 4165 <include file-name="QPixmap" location="global"/>
4165 4166 </extra-includes>
4166 4167 <modify-function signature="setMimeData(QMimeData*)">
4167 4168 <modify-argument index="1">
4168 4169 <define-ownership class="java" owner="c++"/>
4169 4170 </modify-argument>
4170 4171 </modify-function>
4171 4172
4172 4173 <modify-function signature="start(QFlags&lt;Qt::DropAction&gt;)" remove="all"/> <!--### Obsolete in 4.3-->
4173 4174 </object-type>
4174 4175
4175 4176 <object-type name="QDateTimeEdit">
4176 4177 <modify-function signature="initStyleOption(QStyleOptionSpinBox*)const" access="private" rename="initDateTimeEditStyleOption"/>
4177 4178 <modify-function signature="setCalendarWidget(QCalendarWidget*)">
4178 4179 <modify-argument index="1">
4179 4180 <!-- Safe to ignore because widget is reparented -->
4180 4181 <reference-count action="ignore"/>
4181 4182 </modify-argument>
4182 4183 </modify-function>
4183 4184
4184 4185 </object-type>
4185 4186
4186 4187 <object-type name="QSortFilterProxyModel">
4187 4188 <modify-function signature="parent()const" remove="all"/>
4188 4189 <extra-includes>
4189 4190 <include file-name="QItemSelection" location="global"/>
4190 4191 <include file-name="QStringList" location="global"/>
4191 4192 <include file-name="QSize" location="global"/>
4192 4193 </extra-includes>
4193 4194
4194 4195 <modify-function signature="setSourceModel(QAbstractItemModel *)">
4195 4196 <modify-argument index="1">
4196 4197 <reference-count action="set" variable-name="__rcSourceModel"/>
4197 4198 </modify-argument>
4198 4199 </modify-function>
4199 4200
4200 4201 <modify-function signature="clear()" remove="all"/> <!--### Obsolete in 4.3-->
4201 4202 <modify-function signature="filterChanged()" remove="all"/> <!--### Obsolete in 4.3-->
4202 4203 </object-type>
4203 4204
4204 4205 <object-type name="QSlider">
4205 4206 <modify-function signature="initStyleOption(QStyleOptionSlider*)const">
4206 4207 <access modifier="private"/>
4207 4208 </modify-function>
4208 4209 </object-type>
4209 4210
4210 4211 <object-type name="QInputContext">
4211 4212 <extra-includes>
4212 4213 <include file-name="QTextFormat" location="global"/>
4213 4214 </extra-includes>
4214 4215 <modify-function signature="setFocusWidget(QWidget*)">
4215 4216 <remove/>
4216 4217 </modify-function>
4217 4218 <modify-function signature="filterEvent(const QEvent*)">
4218 4219 <modify-argument index="1" invalidate-after-use="yes"/>
4219 4220 </modify-function>
4220 4221 <modify-function signature="mouseHandler(int,QMouseEvent*)">
4221 4222 <modify-argument index="2" invalidate-after-use="yes"/>
4222 4223 </modify-function>
4223 4224
4224 4225 </object-type>
4225 4226
4226 4227 <object-type name="QProgressDialog">
4227 4228
4228 4229 <modify-function signature="setBar(QProgressBar*)">
4229 4230 <modify-argument index="1">
4230 4231 <define-ownership class="java" owner="c++"/>
4231 4232 </modify-argument>
4232 4233 </modify-function>
4233 4234 <modify-function signature="setCancelButton(QPushButton*)">
4234 4235 <modify-argument index="1">
4235 4236 <!-- Safe to ignore because button is reparented -->
4236 4237 <reference-count action="ignore"/>
4237 4238 </modify-argument>
4238 4239 </modify-function>
4239 4240 <modify-function signature="setLabel(QLabel*)">
4240 4241 <modify-argument index="1">
4241 4242 <!-- Safe to ignore because label is reparented -->
4242 4243 <reference-count action="ignore"/>
4243 4244 </modify-argument>
4244 4245 </modify-function>
4245 4246
4246 4247 </object-type>
4247 4248
4248 4249 <object-type name="QLabel">
4249 4250 <modify-function signature="picture()const">
4250 4251 <access modifier="private"/>
4251 4252 <rename to="picture_private"/>
4252 4253 </modify-function>
4253 4254
4254 4255 <modify-function signature="setBuddy(QWidget *)">
4255 4256 <modify-argument index="1">
4256 4257 <reference-count action="set" variable-name="__rcBuddy"/>
4257 4258 </modify-argument>
4258 4259 </modify-function>
4259 4260 <modify-function signature="setMovie(QMovie *)">
4260 4261 <modify-argument index="1">
4261 4262 <reference-count action="set" variable-name="__rcMovie"/>
4262 4263 </modify-argument>
4263 4264 </modify-function>
4264 4265 <modify-function signature="pixmap()const">
4265 4266 <access modifier="private"/>
4266 4267 <rename to="pixmap_private"/>
4267 4268 </modify-function>
4268 4269 </object-type>
4269 4270
4270 4271 <object-type name="QFileDialog">
4271 4272 <extra-includes>
4272 4273 <include file-name="QUrl" location="global"/>
4273 4274 <include file-name="QAbstractProxyModel" location="global"/>
4274 4275 </extra-includes>
4275 4276 <!--
4276 4277 <modify-function signature="getOpenFileName(QWidget*,QString,QString,QString,QString*,QFlags&lt;QFileDialog::Option&gt;)">
4277 4278 <access modifier="private"/>
4278 4279 <modify-argument index="1">
4279 4280 <remove-default-expression/>
4280 4281 </modify-argument>
4281 4282 <modify-argument index="2">
4282 4283 <remove-default-expression/>
4283 4284 </modify-argument>
4284 4285 <modify-argument index="3">
4285 4286 <remove-default-expression/>
4286 4287 </modify-argument>
4287 4288 <modify-argument index="4">
4288 4289 <remove-default-expression/>
4289 4290 </modify-argument>
4290 4291 <modify-argument index="5">
4291 4292 <remove-default-expression/>
4292 4293 </modify-argument>
4293 4294 <modify-argument index="6">
4294 4295 <remove-default-expression/>
4295 4296 </modify-argument>
4296 4297 </modify-function>
4297 4298
4298 4299 <modify-function signature="getOpenFileNames(QWidget*,QString,QString,QString,QString*,QFlags&lt;QFileDialog::Option&gt;)">
4299 4300 <access modifier="private"/>
4300 4301 <modify-argument index="1">
4301 4302 <remove-default-expression/>
4302 4303 </modify-argument>
4303 4304 <modify-argument index="2">
4304 4305 <remove-default-expression/>
4305 4306 </modify-argument>
4306 4307 <modify-argument index="3">
4307 4308 <remove-default-expression/>
4308 4309 </modify-argument>
4309 4310 <modify-argument index="4">
4310 4311 <remove-default-expression/>
4311 4312 </modify-argument>
4312 4313 <modify-argument index="5">
4313 4314 <remove-default-expression/>
4314 4315 </modify-argument>
4315 4316 <modify-argument index="6">
4316 4317 <remove-default-expression/>
4317 4318 </modify-argument>
4318 4319 </modify-function>
4319 4320
4320 4321 <modify-function signature="getSaveFileName(QWidget*,QString,QString,QString,QString*,QFlags&lt;QFileDialog::Option&gt;)">
4321 4322 <access modifier="private"/>
4322 4323 <modify-argument index="1">
4323 4324 <remove-default-expression/>
4324 4325 </modify-argument>
4325 4326 <modify-argument index="2">
4326 4327 <remove-default-expression/>
4327 4328 </modify-argument>
4328 4329 <modify-argument index="3">
4329 4330 <remove-default-expression/>
4330 4331 </modify-argument>
4331 4332 <modify-argument index="4">
4332 4333 <remove-default-expression/>
4333 4334 </modify-argument>
4334 4335 <modify-argument index="5">
4335 4336 <remove-default-expression/>
4336 4337 </modify-argument>
4337 4338 <modify-argument index="6">
4338 4339 <remove-default-expression/>
4339 4340 </modify-argument>
4340 4341 </modify-function>
4341 4342 -->
4342 4343
4343 4344 <modify-function signature="setIconProvider(QFileIconProvider*)">
4344 4345 <modify-argument index="1">
4345 4346 <reference-count action="set" variable-name="__rcIconProvider"/>
4346 4347 </modify-argument>
4347 4348 </modify-function>
4348 4349
4349 4350 <modify-function signature="setItemDelegate(QAbstractItemDelegate*)">
4350 4351 <modify-argument index="1">
4351 4352 <reference-count action="set" variable-name="__rcItemDelegate"/>
4352 4353 </modify-argument>
4353 4354 </modify-function>
4354 4355
4355 4356 <modify-function signature="setProxyModel(QAbstractProxyModel*)">
4356 4357 <modify-argument index="1">
4357 4358 <!-- Reparented -->
4358 4359 <reference-count action="ignore"/>
4359 4360 </modify-argument>
4360 4361 </modify-function>
4361 4362
4362 4363 </object-type>
4363 4364
4364 4365 <object-type name="QErrorMessage"/>
4365 4366
4366 4367 <object-type name="QTabBar">
4367 4368 <extra-includes>
4368 4369 <include file-name="QIcon" location="global"/>
4369 4370 </extra-includes>
4370 4371 <modify-function signature="initStyleOption(QStyleOptionTab*,int)const">
4371 4372 <access modifier="private"/>
4372 4373 </modify-function>
4373 4374 <modify-function signature="setTabButton(int,QTabBar::ButtonPosition,QWidget*)">
4374 4375 <modify-argument index="3">
4375 4376 <reference-count action="ignore"/>
4376 4377 </modify-argument>
4377 4378 </modify-function>
4378 4379 </object-type>
4379 4380
4380 4381 <object-type name="QStandardItemModel">
4381 4382 <modify-function signature="insertColumn(int,const QModelIndex &amp;)" remove="all"/>
4382 4383 <modify-function signature="insertRow(int,const QModelIndex &amp;)" remove="all"/>
4383 4384 <modify-function signature="parent()const" remove="all"/>
4384 4385 <extra-includes>
4385 4386 <include file-name="QStringList" location="global"/>
4386 4387 <include file-name="QSize" location="global"/>
4387 4388 </extra-includes>
4388 4389
4389 4390 <modify-function signature="appendColumn(const QList&lt;QStandardItem *&gt;&amp;)">
4390 4391 <modify-argument index="1">
4391 4392 <define-ownership class="java" owner="c++"/>
4392 4393 </modify-argument>
4393 4394 </modify-function>
4394 4395 <modify-function signature="takeColumn(int)">
4395 4396 <modify-argument index="return">
4396 4397 <define-ownership class="java" owner="default"/>
4397 4398 </modify-argument>
4398 4399 </modify-function>
4399 4400 <modify-function signature="takeRow(int)">
4400 4401 <modify-argument index="return">
4401 4402 <define-ownership class="java" owner="default"/>
4402 4403 </modify-argument>
4403 4404 </modify-function>
4404 4405 <modify-function signature="takeHorizontalHeaderItem(int)">
4405 4406 <modify-argument index="return">
4406 4407 <define-ownership class="java" owner="default"/>
4407 4408 </modify-argument>
4408 4409 </modify-function>
4409 4410 <modify-function signature="takeVerticalHeaderItem(int)">
4410 4411 <modify-argument index="return">
4411 4412 <define-ownership class="java" owner="default"/>
4412 4413 </modify-argument>
4413 4414 </modify-function>
4414 4415 <modify-function signature="takeItem(int,int)">
4415 4416 <modify-argument index="return">
4416 4417 <define-ownership class="java" owner="default"/>
4417 4418 </modify-argument>
4418 4419 </modify-function>
4419 4420 <modify-function signature="appendRow(const QList&lt;QStandardItem *&gt;&amp;)">
4420 4421 <modify-argument index="1">
4421 4422 <define-ownership class="java" owner="c++"/>
4422 4423 </modify-argument>
4423 4424 </modify-function>
4424 4425 <modify-function signature="appendRow(QStandardItem *)">
4425 4426 <modify-argument index="1">
4426 4427 <define-ownership class="java" owner="c++"/>
4427 4428 </modify-argument>
4428 4429 </modify-function>
4429 4430 <modify-function signature="insertColumn(int, const QList&lt;QStandardItem *&gt;&amp;)">
4430 4431 <modify-argument index="2">
4431 4432 <define-ownership class="java" owner="c++"/>
4432 4433 </modify-argument>
4433 4434 </modify-function>
4434 4435 <modify-function signature="insertRow(int, const QList&lt;QStandardItem *&gt;&amp;)">
4435 4436 <modify-argument index="2">
4436 4437 <define-ownership class="java" owner="c++"/>
4437 4438 </modify-argument>
4438 4439 </modify-function>
4439 4440 <modify-function signature="insertRow(int, QStandardItem *)">
4440 4441 <modify-argument index="2">
4441 4442 <define-ownership class="java" owner="c++"/>
4442 4443 </modify-argument>
4443 4444 </modify-function>
4444 4445 <modify-function signature="setHorizontalHeaderItem(int, QStandardItem *)">
4445 4446 <modify-argument index="2">
4446 4447 <define-ownership class="java" owner="c++"/>
4447 4448 </modify-argument>
4448 4449 </modify-function>
4449 4450 <modify-function signature="setItem(int, int, QStandardItem *)">
4450 4451 <modify-argument index="3">
4451 4452 <define-ownership class="java" owner="c++"/>
4452 4453 </modify-argument>
4453 4454 </modify-function>
4454 4455 <modify-function signature="setItem(int, QStandardItem *)">
4455 4456 <modify-argument index="2">
4456 4457 <define-ownership class="java" owner="c++"/>
4457 4458 </modify-argument>
4458 4459 </modify-function>
4459 4460 <modify-function signature="setItemPrototype(const QStandardItem *)">
4460 4461 <modify-argument index="1">
4461 4462 <define-ownership class="java" owner="c++"/>
4462 4463 </modify-argument>
4463 4464 </modify-function>
4464 4465 <modify-function signature="setVerticalHeaderItem(int, QStandardItem *)">
4465 4466 <modify-argument index="2">
4466 4467 <define-ownership class="java" owner="c++"/>
4467 4468 </modify-argument>
4468 4469 </modify-function>
4469 4470 </object-type>
4470 4471
4471 4472 <object-type name="QRadioButton">
4472 4473 <modify-function signature="initStyleOption(QStyleOptionButton*)const">
4473 4474 <access modifier="private"/>
4474 4475 </modify-function>
4475 4476 </object-type>
4476 4477
4477 4478 <object-type name="QScrollBar">
4478 4479 <modify-function signature="initStyleOption(QStyleOptionSlider*)const">
4479 4480 <access modifier="private"/>
4480 4481 </modify-function>
4481 4482 </object-type>
4482 4483
4483 4484 <object-type name="QClipboard">
4484 4485 <extra-includes>
4485 4486 <include file-name="QImage" location="global"/>
4486 4487 <include file-name="QPixmap" location="global"/>
4487 4488 </extra-includes>
4488 4489 <modify-function signature="setMimeData(QMimeData *, QClipboard::Mode)">
4489 4490 <modify-argument index="1">
4490 4491 <define-ownership class="java" owner="c++"/>
4491 4492 </modify-argument>
4492 4493 </modify-function>
4493 4494 <modify-function signature="text(QString&amp;,QClipboard::Mode)const">
4494 4495 <access modifier="private"/>
4495 4496 <modify-argument index="2">
4496 4497 <remove-default-expression/>
4497 4498 </modify-argument>
4498 4499 </modify-function>
4499 4500
4500 4501 </object-type>
4501 4502
4502 4503 <object-type name="QAbstractScrollArea">
4503 4504 <modify-function signature="setupViewport(QWidget *)" access="non-final"/>
4504 4505 <modify-function signature="addScrollBarWidget(QWidget*,QFlags&lt;Qt::AlignmentFlag&gt;)">
4505 4506 <modify-argument index="1">
4506 4507 <reference-count action="ignore"/>
4507 4508 </modify-argument>
4508 4509 </modify-function>
4509 4510 <modify-function signature="setCornerWidget(QWidget*)">
4510 4511 <modify-argument index="1">
4511 4512 <reference-count action="ignore"/>
4512 4513 </modify-argument>
4513 4514 </modify-function>
4514 4515 <modify-function signature="setHorizontalScrollBar(QScrollBar*)">
4515 4516 <modify-argument index="1">
4516 4517 <reference-count action="ignore"/>
4517 4518 </modify-argument>
4518 4519 </modify-function>
4519 4520
4520 4521 <modify-function signature="setVerticalScrollBar(QScrollBar*)">
4521 4522 <modify-argument index="1">
4522 4523 <reference-count action="ignore"/>
4523 4524 </modify-argument>
4524 4525 </modify-function>
4525 4526
4526 4527 <modify-function signature="setViewport(QWidget*)">
4527 4528 <modify-argument index="1">
4528 4529 <reference-count action="ignore"/>
4529 4530 </modify-argument>
4530 4531 </modify-function>
4531 4532
4532 4533 <modify-function signature="setupViewport(QWidget*)">
4533 4534 <modify-argument index="1">
4534 4535 <reference-count action="ignore"/>
4535 4536 </modify-argument>
4536 4537 </modify-function>
4537 4538
4538 4539 <modify-function signature="viewportEvent(QEvent*)">
4539 4540 <modify-argument index="1" invalidate-after-use="yes"/>
4540 4541 </modify-function>
4541 4542
4542 4543 </object-type>
4543 4544
4544 4545 <object-type name="QPaintEngineState">
4545 4546 <extra-includes>
4546 4547 <include file-name="QPainterPath" location="global"/>
4547 4548 </extra-includes>
4548 4549 </object-type>
4549 4550
4550 4551 <object-type name="QRubberBand">
4551 4552 <modify-function signature="initStyleOption(QStyleOptionRubberBand*)const">
4552 4553 <access modifier="private"/>
4553 4554 </modify-function>
4554 4555 <modify-function signature="move(int,int)" rename="moveRubberBand"/>
4555 4556 <modify-function signature="move(const QPoint &amp;)" rename="moveRubberBand"/>
4556 4557 <modify-function signature="resize(int,int)" rename="resizeRubberBand"/>
4557 4558 <modify-function signature="resize(const QSize &amp;)" rename="resizeRubberBand"/>
4558 4559 <modify-function signature="setGeometry(int,int,int,int)" rename="setRubberBandGeometry"/>
4559 4560 <modify-function signature="setGeometry(const QRect &amp;)" rename="setRubberBandGeometry"/>
4560 4561 </object-type>
4561 4562
4562 4563 <object-type name="QTextLayout">
4563 4564 <extra-includes>
4564 4565 <include file-name="QTextOption" location="global"/>
4565 4566 </extra-includes>
4566 4567 </object-type>
4567 4568
4568 4569 <object-type name="QTableWidget">
4569 4570 <modify-function signature="mimeData(const QList&lt;QTableWidgetItem*&gt;)const">
4570 4571 <modify-argument index="1" invalidate-after-use="yes"/>
4571 4572 </modify-function>
4572 4573 <modify-function signature="isSortingEnabled()const" remove="all"/>
4573 4574 <modify-function signature="setSortingEnabled(bool)" remove="all"/>
4574 4575 <modify-function signature="setHorizontalHeaderItem(int, QTableWidgetItem *)">
4575 4576 <modify-argument index="2">
4576 4577 <define-ownership class="java" owner="c++"/>
4577 4578 </modify-argument>
4578 4579 </modify-function>
4579 4580 <modify-function signature="setItem(int, int, QTableWidgetItem *)">
4580 4581 <modify-argument index="3">
4581 4582 <define-ownership class="java" owner="c++"/>
4582 4583 </modify-argument>
4583 4584 </modify-function>
4584 4585 <modify-function signature="takeHorizontalHeaderItem(int)">
4585 4586 <modify-argument index="return">
4586 4587 <define-ownership class="java" owner="default"/>
4587 4588 </modify-argument>
4588 4589 </modify-function>
4589 4590 <modify-function signature="takeVerticalHeaderItem(int)">
4590 4591 <modify-argument index="return">
4591 4592 <define-ownership class="java" owner="default"/>
4592 4593 </modify-argument>
4593 4594 </modify-function>
4594 4595 <modify-function signature="takeItem(int,int)">
4595 4596 <modify-argument index="return">
4596 4597 <define-ownership class="java" owner="default"/>
4597 4598 </modify-argument>
4598 4599 </modify-function>
4599 4600 <modify-function signature="setItemPrototype(const QTableWidgetItem *)">
4600 4601 <modify-argument index="1">
4601 4602 <define-ownership class="java" owner="c++"/>
4602 4603 </modify-argument>
4603 4604 </modify-function>
4604 4605 <modify-function signature="setVerticalHeaderItem(int, QTableWidgetItem *)">
4605 4606 <modify-argument index="2">
4606 4607 <define-ownership class="java" owner="c++"/>
4607 4608 </modify-argument>
4608 4609 </modify-function>
4609 4610 <modify-function signature="setCellWidget(int,int,QWidget*)">
4610 4611 <modify-argument index="3">
4611 4612 <reference-count action="ignore"/>
4612 4613 </modify-argument>
4613 4614 </modify-function>
4614 4615 <modify-function signature="setCurrentItem(QTableWidgetItem*)">
4615 4616 <modify-argument index="1">
4616 4617 <reference-count action="ignore"/>
4617 4618 </modify-argument>
4618 4619 </modify-function>
4619 4620 <modify-function signature="setCurrentItem(QTableWidgetItem*,QFlags&lt;QItemSelectionModel::SelectionFlag&gt;)">
4620 4621 <modify-argument index="1">
4621 4622 <reference-count action="ignore"/>
4622 4623 </modify-argument>
4623 4624 </modify-function>
4624 4625 <modify-function signature="setItemSelected(const QTableWidgetItem*,bool)">
4625 4626 <remove/>
4626 4627 </modify-function>
4627 4628 <modify-function signature="isItemSelected(const QTableWidgetItem*)const">
4628 4629 <remove/>
4629 4630 </modify-function>
4630 4631 <modify-function signature="setModel(QAbstractItemModel*)">
4631 4632 <modify-argument index="1">
4632 4633 <reference-count action="ignore"/>
4633 4634 </modify-argument>
4634 4635 </modify-function>
4635 4636
4636 4637 <modify-function signature="mimeData(const QList&lt;QTableWidgetItem*&gt;)const" remove="all"/>
4637 4638 </object-type>
4638 4639 <object-type name="QTextDocument">
4639 4640 <extra-includes>
4640 4641 <include file-name="QTextBlock" location="global"/>
4641 4642 <include file-name="QTextFormat" location="global"/>
4642 4643 <include file-name="QTextCursor" location="global"/>
4643 4644 <include file-name="qabstracttextdocumentlayout.h" location="global"/>
4644 4645 </extra-includes>
4645 4646 <modify-function signature="redo(QTextCursor*)">
4646 4647 <access modifier="private"/>
4647 4648 </modify-function>
4648 4649 <modify-function signature="setDocumentLayout(QAbstractTextDocumentLayout*)">
4649 4650 <modify-argument index="1">
4650 4651 <define-ownership class="java" owner="c++"/>
4651 4652 </modify-argument>
4652 4653 </modify-function>
4653 4654
4654 4655 <modify-function signature="undo(QTextCursor*)">
4655 4656 <access modifier="private"/>
4656 4657 </modify-function>
4657 4658 </object-type>
4658 4659
4659 4660 <object-type name="QTextDocumentWriter">
4660 4661 <modify-function signature="setCodec(QTextCodec*)">
4661 4662 <modify-argument index="1">
4662 4663 <reference-count action="set" variable-name="__rcCodec"/>
4663 4664 </modify-argument>
4664 4665 </modify-function>
4665 4666 <modify-function signature="setDevice(QIODevice*)">
4666 4667 <modify-argument index="1">
4667 4668 <reference-count action="set" variable-name="__rcDevice"/>
4668 4669 </modify-argument>
4669 4670 </modify-function>
4670 4671 </object-type>
4671 4672
4672 4673 <object-type name="QSplitter">
4673 4674
4674 4675 <modify-function signature="getRange(int,int*,int*)const">
4675 4676 <access modifier="private"/>
4676 4677 </modify-function>
4677 4678 <modify-function signature="addWidget(QWidget *)">
4678 4679 <modify-argument index="1">
4679 4680 <reference-count action="ignore"/>
4680 4681 </modify-argument>
4681 4682 </modify-function>
4682 4683 <modify-function signature="insertWidget(int, QWidget *)">
4683 4684 <modify-argument index="2">
4684 4685 <reference-count action="ignore"/>
4685 4686 </modify-argument>
4686 4687 </modify-function>
4687 4688 </object-type>
4688 4689
4689 4690 <object-type name="QGroupBox">
4690 4691 <modify-function signature="initStyleOption(QStyleOptionGroupBox*)const">
4691 4692 <access modifier="private"/>
4692 4693 </modify-function>
4693 4694 </object-type>
4694 4695
4695 4696 <object-type name="QStackedWidget">
4696 4697 <modify-function signature="addWidget(QWidget*)">
4697 4698 <modify-argument index="1">
4698 4699 <reference-count action="ignore"/>
4699 4700 </modify-argument>
4700 4701 </modify-function>
4701 4702 <modify-function signature="insertWidget(int,QWidget*)">
4702 4703 <modify-argument index="2">
4703 4704 <reference-count action="ignore"/>
4704 4705 </modify-argument>
4705 4706 </modify-function>
4706 4707 <modify-function signature="removeWidget(QWidget*)">
4707 4708 <modify-argument index="1">
4708 4709 <reference-count action="ignore"/>
4709 4710 </modify-argument>
4710 4711 </modify-function>
4711 4712 <modify-function signature="setCurrentWidget(QWidget*)">
4712 4713 <modify-argument index="1">
4713 4714 <reference-count action="ignore"/>
4714 4715 </modify-argument>
4715 4716 </modify-function>
4716 4717 </object-type>
4717 4718
4718 4719 <object-type name="QSplitterHandle">
4719 4720 </object-type>
4720 4721
4721 4722 <object-type name="QDial">
4722 4723 <modify-function signature="initStyleOption(QStyleOptionSlider*)const">
4723 4724 <access modifier="private"/>
4724 4725 </modify-function>
4725 4726 </object-type>
4726 4727
4727 4728 <object-type name="QLineEdit">
4728 4729 <modify-function signature="initStyleOption(QStyleOptionFrame*)const">
4729 4730 <access modifier="private"/>
4730 4731 </modify-function>
4731 4732 <modify-function signature="setCompleter(QCompleter *)">
4732 4733 <modify-argument index="1">
4733 4734 <reference-count action="set" variable-name="__rcCompleter"/>
4734 4735 </modify-argument>
4735 4736 </modify-function>
4736 4737 <modify-function signature="setValidator(const QValidator *)">
4737 4738 <modify-argument index="1">
4738 4739 <reference-count action="set" variable-name="__rcValidator"/>
4739 4740 </modify-argument>
4740 4741 </modify-function>
4741 4742 </object-type>
4742 4743
4743 4744 <object-type name="QLCDNumber"/>
4744 4745
4745 4746 <object-type name="QSplashScreen">
4746 4747 <modify-function signature="showMessage(const QString &amp;, int, const QColor &amp;)">
4747 4748 <modify-argument index="3">
4748 4749 <replace-default-expression with="QColor.black"/>
4749 4750 </modify-argument>
4750 4751 </modify-function>
4751 4752 <modify-function signature="repaint()" remove="all"/>
4752 4753 <modify-function signature="drawContents(QPainter*)">
4753 4754 <modify-argument index="1" invalidate-after-use="yes"/>
4754 4755 </modify-function>
4755 4756 </object-type>
4756 4757
4757 4758 <object-type name="QDockWidget">
4758 4759 <modify-function signature="initStyleOption(QStyleOptionDockWidget*)const">
4759 4760 <access modifier="private"/>
4760 4761 </modify-function>
4761 4762 <inject-code>
4762 4763 <insert-template name="gui.init_style_option">
4763 4764 <replace from="%TYPE" to="QStyleOptionDockWidget"/>
4764 4765 </insert-template>
4765 4766 </inject-code>
4766 4767 <modify-function signature="setTitleBarWidget(QWidget*)">
4767 4768 <modify-argument index="1">
4768 4769 <reference-count action="ignore"/>
4769 4770 </modify-argument>
4770 4771 </modify-function>
4771 4772 <modify-function signature="setWidget(QWidget*)">
4772 4773 <modify-argument index="1">
4773 4774 <reference-count action="ignore"/>
4774 4775 </modify-argument>
4775 4776 </modify-function>
4776 4777 </object-type>
4777 4778
4778 4779 <object-type name="QAbstractProxyModel">
4779 4780 <extra-includes>
4780 4781 <include file-name="QItemSelection" location="global"/>
4781 4782 <include file-name="QStringList" location="global"/>
4782 4783 <include file-name="QSize" location="global"/>
4783 4784 </extra-includes>
4784 4785
4785 4786 <modify-function signature="setSourceModel(QAbstractItemModel *)">
4786 4787 <modify-argument index="1">
4787 4788 <reference-count action="set" variable-name="__rcSourceModel"/>
4788 4789 </modify-argument>
4789 4790 </modify-function>
4790 4791
4791 4792 </object-type>
4792 4793
4793 4794 <object-type name="QDesktopWidget">
4794 4795 </object-type>
4795 4796
4796 4797 <object-type name="QFrame">
4797 4798 </object-type>
4798 4799
4799 4800 <object-type name="QTextTable">
4800 4801 <modify-function signature="format() const">
4801 4802 <rename to="tableFormat"/>
4802 4803 </modify-function>
4803 4804 <extra-includes>
4804 4805 <include file-name="QTextCursor" location="global"/>
4805 4806 </extra-includes>
4806 4807 </object-type>
4807 4808
4808 4809 <object-type name="QSpinBox">
4809 4810 <modify-function signature="valueChanged(const QString &amp;)">
4810 4811 <rename to="valueStringChanged"/>
4811 4812 </modify-function>
4812 4813 </object-type>
4813 4814
4814 4815 <object-type name="QTextBrowser">
4815 4816 <modify-function signature="highlighted(const QString &amp;)">
4816 4817 <rename to="highlightedString"/>
4817 4818 </modify-function>
4818 4819 </object-type>
4819 4820
4820 4821 <object-type name="QDoubleSpinBox">
4821 4822 <modify-function signature="valueChanged(const QString &amp;)">
4822 4823 <rename to="valueStringChanged"/>
4823 4824 </modify-function>
4824 4825 </object-type>
4825 4826
4826 4827 <object-type name="QButtonGroup">
4827 4828 <modify-function signature="buttonClicked(int)">
4828 4829 <rename to="buttonIdClicked"/>
4829 4830 </modify-function>
4830 4831 <modify-function signature="buttonPressed(int)">
4831 4832 <rename to="buttonIdPressed"/>
4832 4833 </modify-function>
4833 4834 <modify-function signature="buttonReleased(int)">
4834 4835 <rename to="buttonIdReleased"/>
4835 4836 </modify-function>
4836 4837 <modify-function signature="addButton(QAbstractButton *)">
4837 4838 <modify-argument index="1">
4838 4839 <reference-count action="add" variable-name="__rcButtons"/>
4839 4840 <no-null-pointer/>
4840 4841 </modify-argument>
4841 4842 </modify-function>
4842 4843 <modify-function signature="addButton(QAbstractButton *, int)">
4843 4844 <modify-argument index="1">
4844 4845 <reference-count action="add" variable-name="__rcButtons"/>
4845 4846 <no-null-pointer/>
4846 4847 </modify-argument>
4847 4848 </modify-function>
4848 4849 <modify-function signature="removeButton(QAbstractButton *)">
4849 4850 <modify-argument index="1">
4850 4851 <reference-count action="remove" variable-name="__rcButtons"/>
4851 4852 <no-null-pointer/>
4852 4853 </modify-argument>
4853 4854 </modify-function>
4854 4855 <modify-function signature="setId(QAbstractButton *,int)">
4855 4856 <modify-argument index="1">
4856 4857 <reference-count action="ignore"/>
4857 4858 </modify-argument>
4858 4859 </modify-function>
4859 4860 </object-type>
4860 4861
4861 4862 <object-type name="QToolBar">
4862 4863 <modify-function signature="addAction(QAction *)" remove="all"/>
4863 4864 <modify-function signature="initStyleOption(QStyleOptionToolBar*)const">
4864 4865 <access modifier="private"/>
4865 4866 </modify-function>
4866 4867 <modify-function signature="addAction(QIcon,QString,const QObject*,const char*)">
4867 4868 <remove/>
4868 4869 </modify-function>
4869 4870 <modify-function signature="addAction(QString,const QObject*,const char*)">
4870 4871 <remove/>
4871 4872 </modify-function>
4872 4873 <modify-function signature="addWidget(QWidget*)">
4873 4874 <modify-argument index="1">
4874 4875 <define-ownership class="java" owner="c++"/>
4875 4876 </modify-argument>
4876 4877 </modify-function>
4877 4878 <modify-function signature="insertWidget(QAction*,QWidget*)">
4878 4879 <modify-argument index="1">
4879 4880 <reference-count action="ignore"/>
4880 4881 </modify-argument>
4881 4882 <modify-argument index="2">
4882 4883 <define-ownership class="java" owner="c++"/>
4883 4884 </modify-argument>
4884 4885 </modify-function>
4885 4886 <modify-function signature="insertSeparator(QAction*)">
4886 4887 <modify-argument index="1">
4887 4888 <reference-count action="ignore"/>
4888 4889 </modify-argument>
4889 4890 </modify-function>
4891
4890 4892 <inject-code class="pywrap-h">
4891 4893 QAction* addAction (QToolBar* menu, const QString &amp; text, PyObject* callable)
4892 4894 {
4893 4895 QAction* a = menu-&gt;addAction(text);
4894 4896 PythonQt::self()-&gt;addSignalHandler(a, SIGNAL(triggered(bool)), callable);
4895 4897 return a;
4896 4898 }
4897 4899
4898 4900 QAction* addAction (QToolBar* menu, const QIcon&amp; icon, const QString&amp; text, PyObject* callable)
4899 4901 {
4900 4902 QAction* a = menu-&gt;addAction(text);
4901 4903 a-&gt;setIcon(icon);
4902 4904 PythonQt::self()-&gt;addSignalHandler(a, SIGNAL(triggered(bool)), callable);
4903 4905 return a;
4904 4906 }
4905 4907 </inject-code>
4906 4908 </object-type>
4907 4909
4908 4910 <object-type name="QPaintEngine">
4909 4911
4910 4912 <modify-function signature="begin(QPaintDevice*)">
4911 4913 <modify-argument index="1" invalidate-after-use="yes"/>
4912 4914 </modify-function>
4913 4915 <modify-function signature="updateState(QPaintEngineState)">
4914 4916 <modify-argument index="1" invalidate-after-use="yes"/>
4915 4917 </modify-function>
4916 4918 <modify-function signature="drawTextItem(QPointF,QTextItem)">
4917 4919 <modify-argument index="2" invalidate-after-use="yes"/>
4918 4920 </modify-function>
4919 4921
4920 4922 <extra-includes>
4921 4923 <include file-name="QVarLengthArray" location="global"/>
4922 4924 </extra-includes>
4923 4925 <modify-function signature="setPaintDevice(QPaintDevice*)">
4924 4926 <remove/>
4925 4927 </modify-function>
4926 4928 <modify-field name="state" read="false" write="false"/>
4927 4929 </object-type>
4928 4930
4929 4931 <object-type name="QGuiSignalMapper"/>
4930 4932
4931 4933 <object-type name="QComboBox">
4932 4934 <modify-function signature="initStyleOption(QStyleOptionComboBox*)const">
4933 4935 <access modifier="private"/>
4934 4936 </modify-function>
4935 4937 <modify-function signature="setCompleter(QCompleter*)">
4936 4938 <modify-argument index="1">
4937 4939 <reference-count variable-name="__rcCompleter" action="set"/>
4938 4940 </modify-argument>
4939 4941 </modify-function>
4940 4942 <modify-function signature="setValidator(const QValidator*)">
4941 4943 <modify-argument index="1">
4942 4944 <reference-count variable-name="__rcValidator" action="set"/>
4943 4945 </modify-argument>
4944 4946 </modify-function>
4945 4947 <modify-function signature="setItemDelegate(QAbstractItemDelegate *)">
4946 4948 <modify-argument index="1">
4947 4949 <define-ownership class="java" owner="c++"/>
4948 4950 <no-null-pointer/>
4949 4951 </modify-argument>
4950 4952 </modify-function>
4951 4953 <modify-function signature="setView(QAbstractItemView *)">
4952 4954 <modify-argument index="1">
4953 4955 <no-null-pointer/>
4954 4956 <!-- Safe to ignore because combo box reparents view -->
4955 4957 <reference-count action="ignore"/>
4956 4958 </modify-argument>
4957 4959 </modify-function>
4958 4960 <modify-function signature="setLineEdit(QLineEdit *)">
4959 4961 <modify-argument index="1">
4960 4962 <no-null-pointer/>
4961 4963 <!-- Safe to ignore because combo box reparents line edit -->
4962 4964 <reference-count action="ignore"/>
4963 4965 </modify-argument>
4964 4966 </modify-function>
4965 4967 <modify-function signature="setModel(QAbstractItemModel *)">
4966 4968 <modify-argument index="1">
4967 4969 <no-null-pointer/>
4968 4970 <reference-count action="set" variable-name="__rcModel"/>
4969 4971 </modify-argument>
4970 4972 </modify-function>
4971 4973 <inject-code>
4972 4974 <insert-template name="gui.init_style_option">
4973 4975 <replace from="%TYPE" to="QStyleOptionComboBox"/>
4974 4976 </insert-template>
4975 4977 </inject-code>
4976 4978 <modify-function signature="activated(int)">&gt;
4977 4979 <rename to="activatedIndex"/>
4978 4980 </modify-function>
4979 4981 <modify-function signature="currentIndexChanged(const QString &amp;)">
4980 4982 <rename to="currentStringChanged"/>
4981 4983 </modify-function>
4982 4984 <modify-function signature="highlighted(int)">
4983 4985 <rename to="highlightedIndex"/>
4984 4986 </modify-function>
4985 4987
4986 4988 <modify-function signature="autoCompletion()const" remove="all"/> <!--### Obsolete in 4.3-->
4987 4989 <modify-function signature="autoCompletionCaseSensitivity()const" remove="all"/> <!--### Obsolete in 4.3-->
4988 4990 <modify-function signature="setAutoCompletion(bool)" remove="all"/> <!--### Obsolete in 4.3-->
4989 4991 <modify-function signature="setAutoCompletionCaseSensitivity(Qt::CaseSensitivity)" remove="all"/> <!--### Obsolete in 4.3-->
4990 4992 </object-type>
4991 4993
4992 4994 <object-type name="QTextEdit">
4993 4995 <extra-includes>
4994 4996 <include file-name="QTextCursor" location="global"/>
4995 4997 </extra-includes>
4996 4998 <modify-function signature="setDocument(QTextDocument*)">
4997 4999 <modify-argument index="1">
4998 5000 <reference-count action="set" variable-name="__rcDocument"/>
4999 5001 </modify-argument>
5000 5002 </modify-function>
5001 5003 <modify-function signature="insertFromMimeData(const QMimeData*) ">
5002 5004 <modify-argument index="1">
5003 5005 <reference-count action="ignore"/>
5004 5006 </modify-argument>
5005 5007 </modify-function>
5006 5008 </object-type>
5007 5009
5008 5010 <object-type name="QPrinter" delete-in-main-thread="yes">
5009 5011 <modify-function signature="setEngines(QPrintEngine*,QPaintEngine*)">
5010 5012 <modify-argument index="1">
5011 5013 <reference-count action="set" variable-name="__rcPrintEngine"/>
5012 5014 </modify-argument>
5013 5015 <modify-argument index="2">
5014 5016 <reference-count action="set" variable-name="__rcPaintEngine"/>
5015 5017 </modify-argument>
5016 5018 </modify-function>
5017 5019
5018 5020 <extra-includes>
5019 5021 <include file-name="QPrinterInfo" location="global"/>
5020 5022 </extra-includes>
5021 5023 </object-type>
5022 5024
5023 5025 <object-type name="QAction">
5024 5026 <modify-function signature="setMenu(QMenu*)">
5025 5027 <modify-argument index="1">
5026 5028 <reference-count action="set" variable-name="__rcMenu"/>
5027 5029 </modify-argument>
5028 5030 </modify-function>
5029 5031
5030 5032 </object-type>
5031 5033
5032 5034 <object-type name="QPainter">
5033 5035 <extra-includes>
5034 5036 <include file-name="QWidget" location="global"/>
5035 5037 <include file-name="QPainterPath" location="global"/>
5036 5038 <include file-name="QPixmap" location="global"/>
5037 5039 </extra-includes>
5038 5040
5039 5041 <modify-function signature="drawText(const QPointF &amp;, const QString &amp;, int, int)" remove="all"/>
5040 5042
5041 5043 <modify-function signature="drawConvexPolygon(const QPoint *, int)">
5042 5044 <remove/>
5043 5045 </modify-function>
5044 5046 <modify-function signature="drawConvexPolygon(const QPointF *, int)">
5045 5047 <remove/>
5046 5048 </modify-function>
5047 5049 <modify-function signature="drawLines(const QLine *, int)">
5048 5050 <remove/>
5049 5051 </modify-function>
5050 5052 <modify-function signature="drawLines(const QLineF *, int)">
5051 5053 <remove/>
5052 5054 </modify-function>
5053 5055 <modify-function signature="drawLines(const QPoint *, int)">
5054 5056 <remove/>
5055 5057 </modify-function>
5056 5058 <modify-function signature="drawLines(const QPointF *, int)">
5057 5059 <remove/>
5058 5060 </modify-function>
5059 5061 <modify-function signature="drawPoints(const QPoint *, int)">
5060 5062 <remove/>
5061 5063 </modify-function>
5062 5064 <modify-function signature="drawPoints(const QPointF *, int)">
5063 5065 <remove/>
5064 5066 </modify-function>
5065 5067 <modify-function signature="drawPolygon(const QPoint *, int, Qt::FillRule)">
5066 5068 <remove/>
5067 5069 </modify-function>
5068 5070 <modify-function signature="drawPolygon(const QPointF *, int, Qt::FillRule)">
5069 5071 <remove/>
5070 5072 </modify-function>
5071 5073 <modify-function signature="drawPolyline(const QPoint *, int)">
5072 5074 <remove/>
5073 5075 </modify-function>
5074 5076 <modify-function signature="drawPolyline(const QPointF *, int)">
5075 5077 <remove/>
5076 5078 </modify-function>
5077 5079 <modify-function signature="drawRects(const QRect *, int)">
5078 5080 <remove/>
5079 5081 </modify-function>
5080 5082 <modify-function signature="drawRects(const QRectF *, int)">
5081 5083 <remove/>
5082 5084 </modify-function>
5083 5085 <modify-function signature="drawLines(const QVector&lt;QPoint&gt; &amp;)">
5084 5086 <rename to="drawLinesFromPoints"/>
5085 5087 </modify-function>
5086 5088 <modify-function signature="drawLines(const QVector&lt;QPointF&gt; &amp;)">
5087 5089 <rename to="drawLinesFromPointsF"/>
5088 5090 </modify-function>
5089 5091 <modify-function signature="drawLines(const QVector&lt;QLineF&gt; &amp;)">
5090 5092 <rename to="drawLinesF"/>
5091 5093 </modify-function>
5092 5094 <modify-function signature="drawRects(const QVector&lt;QRectF&gt; &amp;)">
5093 5095 <rename to="drawRectsF"/>
5094 5096 </modify-function>
5095 5097
5096 5098 <modify-function signature="QPainter(QPaintDevice *)">
5097 5099 <modify-argument index="1">
5098 5100 <no-null-pointer/>
5099 5101 </modify-argument>
5100 5102 </modify-function>
5101 5103 <modify-function signature="begin(QPaintDevice *)">
5102 5104 <modify-argument index="1">
5103 5105 <no-null-pointer/>
5104 5106 </modify-argument>
5105 5107 </modify-function>
5106 5108 <modify-function signature="initFrom(const QWidget *)">
5107 5109 <modify-argument index="1">
5108 5110 <no-null-pointer/>
5109 5111 </modify-argument>
5110 5112 </modify-function>
5111 5113 <modify-function signature="setRedirected(const QPaintDevice *, QPaintDevice *, const QPoint &amp;)">
5112 5114 <modify-argument index="1">
5113 5115 <no-null-pointer/>
5114 5116 </modify-argument>
5115 5117 </modify-function>
5116 5118 <modify-function signature="restoreRedirected(const QPaintDevice *)">
5117 5119 <modify-argument index="1">
5118 5120 <no-null-pointer/>
5119 5121 </modify-argument>
5120 5122 </modify-function>
5121 5123
5122 5124 <modify-function signature="drawText(QRect,int,QString,QRect*)">
5123 5125 <access modifier="private"/>
5124 5126 <modify-argument index="4">
5125 5127 <remove-default-expression/>
5126 5128 </modify-argument>
5127 5129 </modify-function>
5128 5130
5129 5131 <modify-function signature="drawText(QRectF,int,QString,QRectF*)">
5130 5132 <access modifier="private"/>
5131 5133 <modify-argument index="4">
5132 5134 <remove-default-expression/>
5133 5135 </modify-argument>
5134 5136 </modify-function>
5135 5137
5136 5138 <modify-function signature="drawText(int,int,int,int,int,QString,QRect*)">
5137 5139 <access modifier="private"/>
5138 5140 <modify-argument index="7">
5139 5141 <remove-default-expression/>
5140 5142 </modify-argument>
5141 5143 </modify-function>
5142 5144
5143 5145 <modify-function signature="redirected(const QPaintDevice*,QPoint*)">
5144 5146 <access modifier="private"/>
5145 5147 <modify-argument index="2">
5146 5148 <remove-default-expression/>
5147 5149 </modify-argument>
5148 5150 </modify-function>
5149 5151 <modify-function signature="matrix()const" remove="all"/> <!--### Obsolete in 4.3-->
5150 5152 <modify-function signature="matrixEnabled()const" remove="all"/> <!--### Obsolete in 4.3-->
5151 5153 <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/> <!--### Obsolete in 4.3-->
5152 5154 <modify-function signature="setMatrixEnabled(bool)" remove="all"/> <!--### Obsolete in 4.3-->
5153 5155
5154 5156 <modify-function signature="fontInfo()const" remove="all"/>
5155 5157 <modify-function signature="fontMetrics()const" remove="all"/>
5156 5158 <modify-function signature="QPainter(QPaintDevice*)" remove="all"/>
5157 5159
5158 5160 <modify-function signature="begin(QPaintDevice*)">
5159 5161 <modify-argument index="1">
5160 5162 <conversion-rule class="native">
5161 5163 <insert-template name="core.convert_pointer_arg_and_check_null">
5162 5164 <replace from="%TYPE%" to="QPaintDevice*"/>
5163 5165 <replace from="%CLASS_NAME%" to="QPainter"/>
5164 5166 <replace from="%FUNCTION_NAME%" to="begin"/>
5165 5167 </insert-template>
5166 5168 </conversion-rule>
5167 5169 </modify-argument>
5168 5170 </modify-function>
5169 5171 </object-type>
5170 5172
5171 5173 <object-type name="QGuiApplication"/>
5172 5174 <object-type name="QApplication">
5173 5175 <extra-includes>
5174 5176 <include file-name="QBasicTimer" location="global"/>
5175 5177 <include file-name="QFont" location="global"/>
5176 5178 <include file-name="QFontMetrics" location="global"/>
5177 5179 <include file-name="QPalette" location="global"/>
5178 5180 <include file-name="QIcon" location="global"/>
5179 5181 <include file-name="QLocale" location="global"/>
5180 5182 </extra-includes>
5181 5183
5182 5184 <modify-function signature="QApplication(int &amp;, char **, int)">
5183 5185 <access modifier="private"/>
5184 5186 </modify-function>
5185 5187 <modify-function signature="QApplication(int &amp;, char **, QApplication::Type, int)">
5186 5188 <remove/>
5187 5189 </modify-function>
5188 5190 <modify-function signature="QApplication(int &amp;, char **, bool, int)">
5189 5191 <remove/>
5190 5192 </modify-function>
5191 5193
5192 5194 <modify-function signature="font(const char*)">
5193 5195 <remove/>
5194 5196 </modify-function>
5195 5197
5196 5198 <modify-function signature="palette(const char*)">
5197 5199 <remove/>
5198 5200 </modify-function>
5199 5201 <modify-function signature="setPalette(QPalette,const char*)">
5200 5202 <access modifier="private"/>
5201 5203 <modify-argument index="2">
5202 5204 <remove-default-expression/>
5203 5205 </modify-argument>
5204 5206 </modify-function>
5205 5207
5206 5208 <modify-function signature="overrideCursor()">
5207 5209 <access modifier="private"/>
5208 5210 <rename to="overrideCursor_private"/>
5209 5211 </modify-function>
5210 5212
5211 5213 <modify-function signature="setInputContext(QInputContext*)">
5212 5214 <modify-argument index="1">
5213 5215 <define-ownership class="java" owner="c++"/>
5214 5216 </modify-argument>
5215 5217 </modify-function>
5216 5218 <modify-function signature="setActiveWindow(QWidget*)">
5217 5219 <modify-argument index="1">
5218 5220 <reference-count action="ignore"/>
5219 5221 </modify-argument>
5220 5222 </modify-function>
5221 5223 <modify-function signature="setStyle(QStyle*)">
5222 5224 <modify-argument index="1">
5223 5225 <reference-count action="ignore"/>
5224 5226 </modify-argument>
5225 5227 </modify-function>
5226 5228
5227 5229 <modify-function signature="QApplication(int&amp;,char**,QApplication::Type,int)" remove="all"/>
5228 5230 <modify-function signature="QApplication(int&amp;,char**,bool,int)" remove="all"/>
5229 5231 <modify-function signature="QApplication(int&amp;,char**,int)" remove="all"/>
5230 5232 <modify-function signature="commitData(QSessionManager&amp;)" remove="all"/>
5231 5233 <modify-function signature="saveState(QSessionManager&amp;)" remove="all"/>
5232 5234 <modify-function signature="fontMetrics()" remove="all"/>
5233 5235 <modify-function signature="setFont(QFont,const char*)">
5234 5236 <modify-argument index="2">
5235 5237 <replace-type modified-type="QString"/>
5236 5238 <conversion-rule class="native">
5237 5239 <insert-template name="core.convert_string_arg_to_char*"/>
5238 5240 </conversion-rule>
5239 5241 </modify-argument>
5240 5242 </modify-function>
5241 5243 <modify-function signature="setPalette(QPalette,const char*)">
5242 5244 <modify-argument index="2">
5243 5245 <replace-type modified-type="QString"/>
5244 5246 <conversion-rule class="native">
5245 5247 <insert-template name="core.convert_string_arg_to_char*"/>
5246 5248 </conversion-rule>
5247 5249 </modify-argument>
5248 5250 </modify-function>
5249 5251 </object-type>
5250 5252
5251 5253 <object-type name="QMouseEventTransition"/>
5252 5254 <object-type name="QKeyEventTransition"/>
5253 5255 <value-type name="QQuaternion"/>
5254 5256
5255 5257 <object-type name="QCommandLinkButton"/>
5256 5258 <object-type name="QFileSystemModel">
5257 5259 <modify-function signature="setIconProvider(QFileIconProvider*)">
5258 5260 <modify-argument index="1">
5259 5261 <reference-count action="set" variable-name="__rcIconProvider"/>
5260 5262 </modify-argument>
5261 5263 </modify-function>
5262 5264 </object-type>
5263 5265 <object-type name="QFormLayout">
5264 5266 <modify-function signature="addRow(QWidget*,QWidget*)">
5265 5267 <modify-argument index="1">
5266 5268 <reference-count action="ignore"/>
5267 5269 </modify-argument>
5268 5270 <modify-argument index="2">
5269 5271 <reference-count action="ignore"/>
5270 5272 </modify-argument>
5271 5273 </modify-function>
5272 5274 <modify-function signature="addRow(QLayout*)">
5273 5275 <modify-argument index="1">
5274 5276 <reference-count action="ignore"/>
5275 5277 </modify-argument>
5276 5278 </modify-function>
5277 5279 <modify-function signature="addRow(QWidget*,QLayout*)">
5278 5280 <modify-argument index="1">
5279 5281 <reference-count action="ignore"/>
5280 5282 </modify-argument>
5281 5283 <modify-argument index="2">
5282 5284 <reference-count action="ignore"/>
5283 5285 </modify-argument>
5284 5286 </modify-function>
5285 5287
5286 5288 <modify-function signature="addRow(QWidget*)">
5287 5289 <modify-argument index="1">
5288 5290 <reference-count action="ignore"/>
5289 5291 </modify-argument>
5290 5292 </modify-function>
5291 5293 <modify-function signature="addRow(QString,QLayout*)">
5292 5294 <modify-argument index="2">
5293 5295 <reference-count action="ignore"/>
5294 5296 </modify-argument>
5295 5297 </modify-function>
5296 5298 <modify-function signature="addRow(QString,QWidget*)">
5297 5299 <modify-argument index="2">
5298 5300 <reference-count action="ignore"/>
5299 5301 </modify-argument>
5300 5302 </modify-function>
5301 5303 <modify-function signature="insertRow(int,QLayout*)">
5302 5304 <modify-argument index="2">
5303 5305 <reference-count action="ignore"/>
5304 5306 </modify-argument>
5305 5307 </modify-function>
5306 5308 <modify-function signature="insertRow(int,QWidget*,QLayout*)">
5307 5309 <modify-argument index="2">
5308 5310 <reference-count action="ignore"/>
5309 5311 </modify-argument>
5310 5312 <modify-argument index="3">
5311 5313 <reference-count action="ignore"/>
5312 5314 </modify-argument>
5313 5315 </modify-function>
5314 5316 <modify-function signature="insertRow(int,QWidget*,QWidget*)">
5315 5317 <modify-argument index="2">
5316 5318 <reference-count action="ignore"/>
5317 5319 </modify-argument>
5318 5320 <modify-argument index="3">
5319 5321 <reference-count action="ignore"/>
5320 5322 </modify-argument>
5321 5323 </modify-function>
5322 5324 <modify-function signature="insertRow(int,QWidget*)">
5323 5325 <modify-argument index="2">
5324 5326 <reference-count action="ignore"/>
5325 5327 </modify-argument>
5326 5328 </modify-function>
5327 5329 <modify-function signature="insertRow(int,QString,QLayout*)">
5328 5330 <modify-argument index="3">
5329 5331 <reference-count action="ignore"/>
5330 5332 </modify-argument>
5331 5333 </modify-function>
5332 5334 <modify-function signature="insertRow(int,QString,QWidget*)">
5333 5335 <modify-argument index="3">
5334 5336 <reference-count action="ignore"/>
5335 5337 </modify-argument>
5336 5338 </modify-function>
5337 5339 <modify-function signature="setLayout(int,QFormLayout::ItemRole,QLayout*)">
5338 5340 <modify-argument index="3">
5339 5341 <reference-count action="ignore"/>
5340 5342 </modify-argument>
5341 5343 </modify-function>
5342 5344 <modify-function signature="setWidget(int,QFormLayout::ItemRole,QWidget*)">
5343 5345 <modify-argument index="3">
5344 5346 <reference-count action="ignore"/>
5345 5347 </modify-argument>
5346 5348 </modify-function>
5347 5349 <modify-function signature="setItem(int,QFormLayout::ItemRole,QLayoutItem*)" access="private" rename="setItem_private">
5348 5350 <modify-argument index="3">
5349 5351 <define-ownership class="java" owner="c++"/>
5350 5352 </modify-argument>
5351 5353 </modify-function>
5352 5354 <modify-function signature="addItem(QLayoutItem*)">
5353 5355 <modify-argument index="1">
5354 5356 <define-ownership class="java" owner="c++"/>
5355 5357 </modify-argument>
5356 5358 </modify-function>
5357 5359 </object-type>
5358 5360 <object-type name="QGraphicsGridLayout" delete-in-main-thread="yes">
5359 5361 <modify-function signature="addItem(QGraphicsLayoutItem*,int,int,QFlags&lt;Qt::AlignmentFlag&gt;)">
5360 5362 <modify-argument index="1">
5361 5363 <reference-count action="add" variable-name="__rcItems"/>
5362 5364 </modify-argument>
5363 5365 </modify-function>
5364 5366 <modify-function signature="addItem(QGraphicsLayoutItem*,int,int,int,int,QFlags&lt;Qt::AlignmentFlag&gt;)">
5365 5367 <modify-argument index="1">
5366 5368 <reference-count action="add" variable-name="__rcItems"/>
5367 5369 </modify-argument>
5368 5370 </modify-function>
5369 5371 <modify-function signature="setAlignment(QGraphicsLayoutItem*,QFlags&lt;Qt::AlignmentFlag&gt;)">
5370 5372 <modify-argument index="1">
5371 5373 <reference-count action="ignore"/>
5372 5374 </modify-argument>
5373 5375 </modify-function>
5374 5376 </object-type>
5375 5377 <object-type name="QGraphicsLayout" delete-in-main-thread="yes">
5376 5378
5377 5379 <modify-function signature="widgetEvent(QEvent*)">
5378 5380 <modify-argument index="1" invalidate-after-use="yes"/>
5379 5381 </modify-function>
5380 5382 <modify-function signature="setParentLayoutItem(QGraphicsLayoutItem*)">
5381 5383 <modify-argument index="1">
5382 5384 <reference-count action="set" variable-name="__rcParentLayoutItem"/>
5383 5385 </modify-argument>
5384 5386 </modify-function>
5385 5387 <modify-function signature="setGraphicsItem(QGraphicsItem*)">
5386 5388 <modify-argument index="1">
5387 5389 <reference-count action="set" variable-name="__rcItem"/>
5388 5390 </modify-argument>
5389 5391 </modify-function>
5390 5392 </object-type>
5391 5393 <interface-type name="QGraphicsLayoutItem" delete-in-main-thread="yes">
5392 5394 <modify-function signature="setParentLayoutItem(QGraphicsLayoutItem*)">
5393 5395 <modify-argument index="1">
5394 5396 <reference-count action="set" variable-name="__rcParentLayoutItem"/>
5395 5397 </modify-argument>
5396 5398 </modify-function>
5397 5399 <modify-function signature="setGraphicsItem(QGraphicsItem*)">
5398 5400 <modify-argument index="1">
5399 5401 <reference-count action="set" variable-name="__rcItem"/>
5400 5402 </modify-argument>
5401 5403 </modify-function>
5402 5404 </interface-type>
5403 5405 <object-type name="QGraphicsLinearLayout" delete-in-main-thread="yes">
5404 5406 <modify-function signature="addItem(QGraphicsLayoutItem*)">
5405 5407 <modify-argument index="1">
5406 5408 <reference-count action="add" variable-name="__rcItems"/>
5407 5409 </modify-argument>
5408 5410 </modify-function>
5409 5411 <modify-function signature="insertItem(int,QGraphicsLayoutItem*)">
5410 5412 <modify-argument index="2">
5411 5413 <reference-count action="add" variable-name="__rcItems"/>
5412 5414 </modify-argument>
5413 5415 </modify-function>
5414 5416 <modify-function signature="removeItem(QGraphicsLayoutItem*)">
5415 5417 <modify-argument index="1">
5416 5418 <reference-count action="remove" variable-name="__rcItems"/>
5417 5419 </modify-argument>
5418 5420 </modify-function>
5419 5421 <modify-function signature="setAlignment(QGraphicsLayoutItem*,QFlags&lt;Qt::AlignmentFlag&gt;)">
5420 5422 <modify-argument index="1">
5421 5423 <reference-count action="ignore"/>
5422 5424 </modify-argument>
5423 5425 </modify-function>
5424 5426 <modify-function signature="setStretchFactor(QGraphicsLayoutItem*,int)">
5425 5427 <modify-argument index="1">
5426 5428 <reference-count action="ignore"/>
5427 5429 </modify-argument>
5428 5430 </modify-function>
5429 5431 </object-type>
5430 5432 <object-type name="QGraphicsProxyWidget"/> <!-- a QObject so main-thread delete redundant -->
5431 5433 <object-type name="QGraphicsWidget"> <!-- a QObject so main-thread delete redundant -->
5432 5434 <!-- Duplicate function to QObject::children() to override accidental shadowing which is not present in Jambi -->
5433 5435 <modify-function signature="children()const" remove="all"/>
5434 5436 <modify-function signature="setLayout(QGraphicsLayout*)">
5435 5437 <modify-argument index="1">
5436 5438 <reference-count action="set" variable-name="__rcLayout"/>
5437 5439 </modify-argument>
5438 5440 </modify-function>
5439 5441
5440 5442 <modify-function signature="addAction(QAction*)">
5441 5443 <modify-argument index="1">
5442 5444 <reference-count action="add" variable-name="__rcActions"/>
5443 5445 </modify-argument>
5444 5446 </modify-function>
5445 5447 <modify-function signature="insertAction(QAction*,QAction*)">
5446 5448 <modify-argument index="2">
5447 5449 <reference-count action="add" variable-name="__rcActions"/>
5448 5450 </modify-argument>
5449 5451 </modify-function>
5450 5452 <modify-function signature="insertActions(QAction*,QList&lt;QAction*&gt;)">
5451 5453 <modify-argument index="2">
5452 5454 <reference-count action="add" variable-name="__rcActions"/>
5453 5455 </modify-argument>
5454 5456 </modify-function>
5455 5457 <modify-function signature="removeAction(QAction*)">
5456 5458 <modify-argument index="1">
5457 5459 <reference-count action="remove" variable-name="__rcActions"/>
5458 5460 </modify-argument>
5459 5461 </modify-function>
5460 5462
5461 5463
5462 5464 <modify-function signature="changeEvent(QEvent*)">
5463 5465 <modify-argument index="1" invalidate-after-use="yes"/>
5464 5466 </modify-function>
5465 5467 <modify-function signature="closeEvent(QCloseEvent*)">
5466 5468 <modify-argument index="1" invalidate-after-use="yes"/>
5467 5469 </modify-function>
5468 5470 <modify-function signature="grabKeyboardEvent(QEvent*)">
5469 5471 <modify-argument index="1" invalidate-after-use="yes"/>
5470 5472 </modify-function>
5471 5473 <modify-function signature="grabMouseEvent(QEvent*)">
5472 5474 <modify-argument index="1" invalidate-after-use="yes"/>
5473 5475 </modify-function>
5474 5476 <modify-function signature="hideEvent(QHideEvent*)">
5475 5477 <modify-argument index="1" invalidate-after-use="yes"/>
5476 5478 </modify-function>
5477 5479 <modify-function signature="moveEvent(QGraphicsSceneMoveEvent*)">
5478 5480 <modify-argument index="1" invalidate-after-use="yes"/>
5479 5481 </modify-function>
5480 5482 <modify-function signature="paintWindowFrame(QPainter*,const QStyleOptionGraphicsItem*,QWidget*)">
5481 5483 <modify-argument index="1" invalidate-after-use="yes"/>
5482 5484 </modify-function>
5483 5485 <modify-function signature="resizeEvent(QGraphicsSceneResizeEvent*)">
5484 5486 <modify-argument index="1" invalidate-after-use="yes"/>
5485 5487 </modify-function>
5486 5488 <modify-function signature="showEvent(QShowEvent*)">
5487 5489 <modify-argument index="1" invalidate-after-use="yes"/>
5488 5490 </modify-function>
5489 5491 <modify-function signature="ungrabKeyboardEvent(QEvent*)">
5490 5492 <modify-argument index="1" invalidate-after-use="yes"/>
5491 5493 </modify-function>
5492 5494 <modify-function signature="ungrabMouseEvent(QEvent*)">
5493 5495 <modify-argument index="1" invalidate-after-use="yes"/>
5494 5496 </modify-function>
5495 5497 <modify-function signature="windowFrameEvent(QEvent*)">
5496 5498 <modify-argument index="1" invalidate-after-use="yes"/>
5497 5499 </modify-function>
5498 5500
5499 5501 <modify-function signature="setStyle(QStyle*)">
5500 5502 <modify-argument index="1">
5501 5503 <reference-count action="set" variable-name="__rcStyle"/>
5502 5504 </modify-argument>
5503 5505 </modify-function>
5504 5506 <modify-function signature="setTabOrder(QGraphicsWidget*,QGraphicsWidget*)">
5505 5507 <modify-argument index="1">
5506 5508 <reference-count action="ignore"/>
5507 5509 </modify-argument>
5508 5510 <modify-argument index="2">
5509 5511 <reference-count action="ignore"/>
5510 5512 </modify-argument>
5511 5513 </modify-function>
5512 5514 </object-type>
5513 5515 <object-type name="QPlainTextDocumentLayout"/>
5514 5516 <object-type name="QPlainTextEdit">
5515 5517 <modify-function signature="setDocument(QTextDocument*)">
5516 5518 <modify-argument index="1">
5517 5519 <reference-count action="set" variable-name="__rcDocument"/>
5518 5520 </modify-argument>
5519 5521 </modify-function>
5520 5522 <modify-function signature="insertFromMimeData(const QMimeData*)">
5521 5523 <modify-argument index="1">
5522 5524 <reference-count action="ignore"/>
5523 5525 </modify-argument>
5524 5526 </modify-function>
5525 5527 </object-type>
5526 5528 <object-type name="QPrintPreviewDialog">
5527 5529 </object-type>
5528 5530 <object-type name="QPrintPreviewWidget"/>
5529 5531 <object-type name="QStyledItemDelegate">
5530 5532 <modify-function signature="setItemEditorFactory(QItemEditorFactory*)">
5531 5533 <modify-argument index="1">
5532 5534 <reference-count action="set" variable-name="__rcItemEditorFactory"/>
5533 5535 </modify-argument>
5534 5536 </modify-function>
5535 5537 <modify-function signature="setEditorData(QWidget*,QModelIndex)const">
5536 5538 <modify-argument index="1">
5537 5539 <reference-count action="ignore"/>
5538 5540 </modify-argument>
5539 5541 </modify-function>
5540 5542 <modify-function signature="setModelData(QWidget*,QAbstractItemModel*,QModelIndex)const">
5541 5543 <modify-argument index="1">
5542 5544 <reference-count action="ignore"/>
5543 5545 </modify-argument>
5544 5546 </modify-function>
5545 5547 </object-type>
5546 5548
5547 5549 <interface-type name="QIconEngineFactoryInterfaceV2" java-name="QAbstractIconEngineFactoryV2"/>
5548 5550 <interface-type name="QImageIOHandlerFactoryInterface" java-name="QAbstractImageIOHandlerFactory"/>
5549 5551 <interface-type name="QInputContextFactoryInterface" java-name="QAbstractInputContextFactory"/>
5550 5552 <interface-type name="QStyleFactoryInterface" java-name="QAbstractStyleFactory"/>
5551 5553 <interface-type name="QPictureFormatInterface" java-name="QAbstractPictureFormat"/>
5552 5554
5553 5555 <object-type name="QIconEnginePluginV2"/>
5554 5556 <object-type name="QImageIOPlugin"/>
5555 5557 <object-type name="QInputContextPlugin"/>
5556 5558 <object-type name="QPictureFormatPlugin"/>
5557 5559 <object-type name="QStylePlugin"/>
5558 5560 <object-type name="QGesture"/>
5559 5561 <object-type name="QGraphicsAnchorLayout"/>
5560 5562 <object-type name="QGraphicsAnchor"/>
5561 5563 <object-type name="QGraphicsBloomEffect"/>
5562 5564 <object-type name="QGraphicsBlurEffect"/>
5563 5565 <object-type name="QGraphicsColorizeEffect"/>
5564 5566 <object-type name="QGraphicsDropShadowEffect"/>
5565 5567 <object-type name="QGraphicsEffect"/>
5566 5568 <rejection class="QGraphicsEffectSource"/>
5567 5569 <object-type name="QGraphicsGrayscaleEffect"/>
5568 5570 <object-type name="QGraphicsObject">
5569 5571 <!-- Duplicate function to QObject::children() to override accidental shadowing which is not present in Jambi -->
5570 5572 <modify-function signature="children()const" remove="all"/>
5571 5573 <extra-includes>
5572 5574 <include file-name="QGesture" location="global"/>
5573 5575 </extra-includes>
5574 5576 </object-type>
5575 5577 <object-type name="QGraphicsOpacityEffect"/>
5576 5578 <object-type name="QGraphicsPixelizeEffect"/>
5577 5579 <object-type name="QGraphicsRotation"/>
5578 5580 <object-type name="QGraphicsScale"/>
5579 5581 <object-type name="QGraphicsTransform"/>
5580 5582 <object-type name="QPanGesture"/>
5581 5583 <!-- QtScript: Doesn't compile because of redefinition of metatypeid -->
5582 5584 <!-- <object-type name="QPinchGesture" /> -->
5583 5585 <!-- QtScript: Doesn't compile because it's trying to call QFontMetrics default constructor -->
5584 5586 <!-- <object-type name="QProxyStyle" /> -->
5585 5587 <object-type name="QSwipeGesture"/>
5586 5588 <object-type name="QTouchEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::TouchBegin || %1-&gt;type() == QEvent::TouchUpdate || %1-&gt;type() == QEvent::TouchEnd"/>
5587 5589
5588 5590 <enum-type name="QGesture::GestureCancelPolicy"/>
5589 5591 <enum-type name="QGraphicsEffect::PixmapPadMode"/>
5590 5592 <enum-type name="QGraphicsBlurEffect::BlurHint" flags="QGraphicsBlurEffect::BlurHints"/>
5591 5593 <enum-type name="QPinchGesture::ChangeFlag" flags="QPinchGesture::ChangeFlags"/>
5592 5594 <rejection class="QAccessibleActionInterface"/>
5593 5595 <rejection class="QAccessibleImageInterface"/>
5594 5596 <value-type name="QMatrix3x3">
5595 5597 <modify-function signature="toGenericMatrix()const" remove="all"/>
5596 5598 </value-type>
5597 5599
5598 5600 <!-- Inefficient hash codes -->
5599 5601 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextFrame_iterator' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5600 5602 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextTableCell' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5601 5603 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextOption_Tab' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5602 5604 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextLength' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5603 5605 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextBlock_iterator' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5604 5606 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextBlock' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5605 5607 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextCursor' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5606 5608 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QPainterPath_Element' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5607 5609 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QPainterPath' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5608 5610 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QItemSelection' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5609 5611 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QKeySequence' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5610 5612 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QSizePolicy' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5611 5613 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextFragment' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5612 5614 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QFontMetrics' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5613 5615 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QGradient' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5614 5616 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QFontMetricsF' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5615 5617 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextFormat' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5616 5618 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QEasingCurve' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5617 5619 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QGenericMatrix' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5618 5620 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QMatrix4x4' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5619 5621 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QMargins' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5620 5622 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QPixmapCache_Key' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5621 5623 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QVector4D' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5622 5624 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QQuaternion' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5623 5625 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QVector2D' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5624 5626 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QVector3D' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5625 5627
5626 5628 <suppress-warning text="WARNING(MetaJavaBuilder) :: private virtual function 'eventFilter(QObject * receiver, QEvent * event)' in 'QPanGesture'"/>
5627 5629 <suppress-warning text="WARNING(MetaJavaBuilder) :: private virtual function 'event(QEvent * event)' in 'QPanGesture'"/>
5628 5630 <suppress-warning text="WARNING(MetaJavaBuilder) :: private virtual function 'eventFilter(QObject * receiver, QEvent * event)' in 'QSwipeGesture'"/>
5629 5631 <suppress-warning text="WARNING(MetaJavaBuilder) :: private virtual function 'eventFilter(QObject * receiver, QEvent * event)' in 'QPinchGesture'"/>
5630 5632 <suppress-warning text="WARNING(MetaJavaBuilder) :: private virtual function 'event(QEvent * event)' in 'QPinchGesture'"/>
5631 5633
5632 5634 <!-- Intentional omissions. See explanation for QtJambiTextObjectInterface class in typesystem and headers. -->
5633 5635 <suppress-warning text="WARNING(MetaJavaBuilder) :: class 'QTextObjectInterface' inherits from unknown base class 'QTextObjectInterface'"/>
5634 5636 <suppress-warning text="WARNING(MetaJavaBuilder) :: unknown interface for 'QTextObjectInterface': 'QTextObjectInterfaceInterface'"/>
5635 5637
5636 5638 <suppress-warning text="WARNING(MetaInfoGenerator) :: class 'QPixmapFilter' inherits from polymorphic class 'QPixmapFilter', but has no polymorphic id set"/>
5637 5639 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QPixmap::QPixmap', unmatched parameter type 'QPixmapData*'"/>
5638 5640 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type '*Private&amp;'"/>
5639 5641 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type '*Private\*'"/>
5640 5642 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type '*Private const\*'"/>
5641 5643 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QTextEngine\*'"/>
5642 5644 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QFontEngine\*'"/>
5643 5645 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QPixmap::Type'"/>
5644 5646 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QInputDialog::Type'"/>
5645 5647 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QTextFrameLayoutData\*'"/>
5646 5648 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QAbstractUndoItem\*'"/>
5647 5649 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type '*QImageTextKeyLang*'"/>
5648 5650 <suppress-warning text="WARNING(MetaJavaBuilder) :: non-public function '*' in interface '*'"/>
5649 5651 <suppress-warning text="WARNING(MetaJavaBuilder) :: visibility of function '*' modified in class '*'"/>
5650 5652 <suppress-warning text="WARNING(MetaJavaBuilder) :: hiding of function '*' in class '*'"/>
5651 5653 <suppress-warning text="WARNING(MetaJavaBuilder) :: unsupported default value 'QVector&lt;FormatRange&gt;()' of argument in function '*', class '*'"/>
5652 5654 <suppress-warning text="WARNING(MetaJavaBuilder) :: unsupported default value 'QVariantList()' of argument in function '*', class '*'"/>
5653 5655 <suppress-warning text="WARNING(CppImplGenerator) :: protected function '*' in final class '*'"/>
5654 5656 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QTextLayout::QTextLayout', unmatched parameter type 'QTextEngine*'"/>
5655 5657 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QFileDialog::QFileDialog', unmatched parameter type 'QFileDialogArgs const&amp;'"/>
5656 5658 <suppress-warning text="WARNING(MetaJavaBuilder) :: unsupported default value '0., 0., 1000000000., 1000000000.' of argument in function 'update', class 'QAbstractTextDocumentLayout'"/>
5657 5659 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QWidget::windowSurface', unmatched return type 'QWindowSurface*'"/>
5658 5660 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QWidget::setWindowSurface', unmatched parameter type 'QWindowSurface*'"/>
5659 5661 <suppress-warning text="WARNING(MetaJavaBuilder) :: enum 'QStyleOption::StyleOptionType' does not have a type entry or is not an enum"/>
5660 5662 <suppress-warning text="WARNING(MetaJavaBuilder) :: unhandled enum value: ~FlagMask in QMessageBox::StandardButton"/>
5661 5663 <suppress-warning text="WARNING(MetaJavaBuilder) :: unmatched enum ~FlagMask"/>
5662 5664 <suppress-warning text="WARNING(MetaInfoGenerator) :: class 'QGraphicsSceneEvent' inherits from polymorphic class 'QEvent', but has no polymorphic id set"/>
5663 5665 <suppress-warning text="WARNING(MetaInfoGenerator) :: class 'QInputEvent' inherits from polymorphic class 'QEvent', but has no polymorphic id set"/>
5664 5666 <suppress-warning text="WARNING(JavaGenerator) :: either add or remove specified for reference count variable '__rcMenus' in 'com.trolltech.qt.gui.QMenu' but not both"/>
5665 5667 <suppress-warning text="WARNING(JavaGenerator) :: either add or remove specified for reference count variable '__rcMenus' in 'com.trolltech.qt.gui.QMenuBar' but not both"/>
5666 5668
5667 5669 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QPixmap::pixmapData', unmatched return type 'QPixmapData*'"/>
5670 <suppress-warning text="WARNING(MetaJavaBuilder) :: object type 'QAccessible' extended by interface type 'QAbstractAccessibleFactory'. The resulting API will be less expressive than the original."/>
5668 5671
5669 5672 <suppress-warning text="WARNING(MetaJavaBuilder) :: Rejected enum has no alternative...: QPalette::NColorRoles"/>
5670 5673
5671 5674 <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'QtSharedPointer' does not have a type entry"/>
5672 5675
5673 5676 </typesystem>
@@ -1,106 +1,99
1 1 <?xml version="1.0"?>
2 2 <typesystem package="com.trolltech.qt.opengl"><rejection class="QGL"/><rejection class="QGLFormat"/><suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QGLFormat' has equals operators but no qHash() function"/>
3 3 <rejection class="QGLColormap::QGLColormapData"/>
4 4 <rejection class="QGLWidget" function-name="setMouseTracking"/>
5 5
6 6 <enum-type name="QGL::FormatOption" flags="QGL::FormatOptions"/>
7 7 <enum-type name="QGLFormat::OpenGLVersionFlag" flags="QGLFormat::OpenGLVersionFlags"/>
8 8 <enum-type name="QGLFramebufferObject::Attachment"/>
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"/>
17 12
18 13 <namespace-type name="QGL">
19 14 <include file-name="qgl.h" location="global"/>
20 15 </namespace-type>
21 16
22 17 <value-type name="QGLColormap">
23 18 <modify-function signature="operator=(QGLColormap)" remove="all"/>
24 19
25 20 <modify-function signature="setEntries(int,const unsigned int*,int)">
26 21 <access modifier="private"/>
27 22 </modify-function>
28 23 </value-type>
29 24
30 25 <value-type name="QGLFormat">
31 26 <modify-function signature="operator=(QGLFormat)" remove="all"/>
32 27 </value-type>
33 28
34 29 <value-type name="QGLFramebufferObjectFormat"/>
35 <object-type name="QGLFunctions"/>
36 <object-type name="QGLBuffer"/>
37 30 <object-type name="QGLShader"/>
38 31 <object-type name="QGLShaderProgram">
39 32 <!-- Should be disambiguated later by fixing the native pointer API -->
40 33 <modify-function signature="setAttributeArray(int, const QVector2D *, int)" rename="setAttributeArray_QVector2D"/>
41 34 <modify-function signature="setAttributeArray(int, const QVector3D *, int)" rename="setAttributeArray_QVector3D"/>
42 35 <modify-function signature="setAttributeArray(int, const QVector4D *, int)" rename="setAttributeArray_QVector4D"/>
43 36 <modify-function signature="setAttributeArray(const char *, const QVector2D *, int)" rename="setAttributeArray_QVector2D"/>
44 37 <modify-function signature="setAttributeArray(const char *, const QVector3D *, int)" rename="setAttributeArray_QVector3D"/>
45 38 <modify-function signature="setAttributeArray(const char *, const QVector4D *, int)" rename="setAttributeArray_QVector4D"/>
46 39 <modify-function signature="setUniformValueArray(int, const GLint *, int)" rename="setUniformValueArray_int"/>
47 40 <modify-function signature="setUniformValueArray(int, const GLuint *, int)" rename="setUniformValueArray_uint"/>
48 41 <modify-function signature="setUniformValueArray(int, const QVector2D *, int)" rename="setUniformValueArray_QVector2D"/>
49 42 <modify-function signature="setUniformValueArray(int, const QVector3D *, int)" rename="setUniformValueArray_QVector3D"/>
50 43 <modify-function signature="setUniformValueArray(int, const QVector4D *, int)" rename="setUniformValueArray_QVector4D"/>
51 44
52 45 <modify-function signature="setUniformValueArray(const char*, const GLint *, int)" rename="setUniformValueArray_int"/>
53 46 <modify-function signature="setUniformValueArray(const char*, const GLuint *, int)" remove="all"/>
54 47 <modify-function signature="setUniformValueArray(const char*, const QVector2D *, int)" rename="setUniformValueArray_QVector2D"/>
55 48 <modify-function signature="setUniformValueArray(const char*, const QVector3D *, int)" rename="setUniformValueArray_QVector3D"/>
56 49 <modify-function signature="setUniformValueArray(const char*, const QVector4D *, int)" rename="setUniformValueArray_QVector4D"/>
57 50 <modify-function signature="setUniformValue(int, GLuint)" remove="all"/>
58 51 <modify-function signature="setUniformValue(const char*, GLuint)" remove="all"/>
59 52 <modify-function signature="setUniformValue(int, Array)" remove="all"/>
60 53 <modify-function signature="setUniformValue(const char*, Array)" remove="all"/>
61 54 </object-type>
62 55 <object-type name="QGLContext">
63 56
64 57 <modify-function signature="chooseContext(const QGLContext*)">
65 58 <modify-argument index="1" invalidate-after-use="yes"/>
66 59 </modify-function>
67 60 <modify-function signature="create(const QGLContext*)">
68 61 <modify-argument index="1" invalidate-after-use="yes"/>
69 62 </modify-function>
70 63
71 64 <modify-function signature="getProcAddress(QString)const">
72 65 <remove/>
73 66 </modify-function>
74 67 <modify-field name="currentCtx" read="false" write="false"/>
75 68 <modify-function signature="setDevice(QPaintDevice*)">
76 69 <remove/>
77 70 </modify-function>
78 71 <modify-function signature="generateFontDisplayLists(QFont, int)" remove="all"/>
79 72 </object-type>
80 73 <object-type name="QGLFramebufferObject"/>
81 74 <object-type name="QGLPixelBuffer">
82 75 <extra-includes>
83 76 <include file-name="QImage" location="global"/>
84 77 </extra-includes>
85 78 </object-type>
86 79 <object-type name="QGLWidget">
87 80 <extra-includes>
88 81 <include file-name="QImage" location="global"/>
89 82 <include file-name="QPixmap" location="global"/>
90 83 </extra-includes>
91 84 <modify-function signature="setContext(QGLContext*,const QGLContext*,bool)">
92 85 <remove/> <!--- Obsolete -->
93 86 </modify-function>
94 87 <modify-function signature="fontDisplayListBase(QFont, int)" remove="all"/>
95 88 <modify-function signature="setFormat(QGLFormat)" remove="all"/>
96 89 </object-type>
97 90
98 91 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QGLFormat' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
99 92 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QGLFramebufferObjectFormat' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
100 93
101 94 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QGLColormap::QGLColormapData\*'"/>
102 95 <suppress-warning text="WARNING(MetaJavaBuilder) :: visibility of function '*' modified in class '*'"/>
103 96 <suppress-warning text="WARNING(MetaJavaBuilder) :: hiding of function '*' in class '*'"/>
104 97 <suppress-warning text="WARNING(CppImplGenerator) :: protected function '*' in final class '*'"/>
105 98
106 99 </typesystem>
@@ -1,113 +1,113
1 1 project(PythonQt_Core)
2 2 cmake_minimum_required(VERSION 2.8.10)
3 3
4 4 #-----------------------------------------------------------------------------
5 5 # Sources
6 6
7 7 set(SOURCES
8 8 PythonQtClassInfo.cpp
9 9 PythonQtClassWrapper.cpp
10 10 PythonQtConversion.cpp
11 11 PythonQt.cpp
12 12 PythonQtImporter.cpp
13 13 PythonQtInstanceWrapper.cpp
14 14 PythonQtMethodInfo.cpp
15 15 PythonQtMisc.cpp
16 16 PythonQtObjectPtr.cpp
17 17 PythonQtQFileImporter.cpp
18 18 PythonQtSignalReceiver.cpp
19 19 PythonQtSlot.cpp
20 20 PythonQtSignal.cpp
21 21 PythonQtStdDecorators.cpp
22 22 PythonQtStdIn.cpp
23 23 PythonQtStdOut.cpp
24 24 gui/PythonQtScriptingConsole.cpp
25 25
26 26 ../generated_cpp${generated_cpp_suffix}/PythonQt_QtBindings.cpp
27 27
28 28 ../generated_cpp${generated_cpp_suffix}/com_trolltech_qt_core_builtin/com_trolltech_qt_core_builtin0.cpp
29 29 ../generated_cpp${generated_cpp_suffix}/com_trolltech_qt_core_builtin/com_trolltech_qt_core_builtin_init.cpp
30 30 ../generated_cpp${generated_cpp_suffix}/com_trolltech_qt_gui_builtin/com_trolltech_qt_gui_builtin0.cpp
31 31 ../generated_cpp${generated_cpp_suffix}/com_trolltech_qt_gui_builtin/com_trolltech_qt_gui_builtin_init.cpp
32 32 )
33 33
34 34 #-----------------------------------------------------------------------------
35 35 # List headers. This is list is used for the install command.
36 36
37 37 set(HEADERS
38 38 PythonQtClassInfo.h
39 39 PythonQtClassWrapper.h
40 40 PythonQtConversion.h
41 41 PythonQtCppWrapperFactory.h
42 42 PythonQtDoc.h
43 43 PythonQt.h
44 44 PythonQtImporter.h
45 45 PythonQtImportFileInterface.h
46 46 PythonQtInstanceWrapper.h
47 47 PythonQtMethodInfo.h
48 48 PythonQtMisc.h
49 49 PythonQtObjectPtr.h
50 50 PythonQtQFileImporter.h
51 51 PythonQtSignalReceiver.h
52 52 PythonQtSlot.h
53 53 PythonQtSignal.h
54 54 PythonQtStdDecorators.h
55 55 PythonQtStdIn.h
56 56 PythonQtStdOut.h
57 57 PythonQtSystem.h
58 58 PythonQtVariants.h
59 59 PythonQtPythonInclude.h
60 60 ../generated_cpp${generated_cpp_suffix}/PythonQt_QtBindings.h
61 61 )
62 62
63 63 #-----------------------------------------------------------------------------
64 64 # Headers that should run through moc
65 65
66 66 set(SOURCES_MOC
67 67 PythonQt.h
68 68 PythonQtSignalReceiver.h
69 69 PythonQtStdDecorators.h
70 70 gui/PythonQtScriptingConsole.h
71 71
72 72 ../generated_cpp${generated_cpp_suffix}/com_trolltech_qt_core_builtin/com_trolltech_qt_core_builtin0.h
73 73 ../generated_cpp${generated_cpp_suffix}/com_trolltech_qt_gui_builtin/com_trolltech_qt_gui_builtin0.h
74 74 )
75 75
76 76 #-----------------------------------------------------------------------------
77 77 # Resources
78 78 set(SOURCES_QRC )
79 79
80 80 #-----------------------------------------------------------------------------
81 81 # Do wrapping
82 82 qt_wrap_cpp(GEN_MOC ${SOURCES_MOC})
83 83 qt_add_resources(GEN_QRC ${SOURCES_QRC})
84 84
85 85 #-----------------------------------------------------------------------------
86 86 # Build the library
87 87
88 88 include_directories(${CMAKE_CURRENT_SOURCE_DIR})
89 89
90 add_definitions(-DQT_NO_KEYWORDS) # recent python versions use them :(
90 #add_definitions(-DQT_NO_KEYWORDS) # recent python versions use them :(
91 91
92 add_library(PythonQt SHARED ${SOURCES} ${GEN_MOC} ${GEN_QRC})
92 add_library(PythonQt SHARED ${SOURCES} ${GEN_MOC} ${GEN_QRC} ${HEADERS})
93 93 if(PythonQt_Qt5)
94 94 qt_use_modules(PythonQt Core Gui Widgets)
95 95 else()
96 96 qt_use_modules(PythonQt Core Gui)
97 97 endif()
98 98 target_link_libraries(PythonQt ${PYTHON_LIBRARIES})
99 99
100 100 #
101 101 # That should solve linkage error on Mac when the project is used in a superbuild setup
102 102 # See http://blog.onesadcookie.com/2008/01/installname-magic.html
103 103 #
104 104 set_target_properties(PythonQt PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
105 105
106 106 #-----------------------------------------------------------------------------
107 107 # Install library (on windows, put the dll in 'bin' and the archive in 'lib')
108 108
109 109 install(TARGETS PythonQt
110 110 RUNTIME DESTINATION bin
111 111 LIBRARY DESTINATION lib
112 112 ARCHIVE DESTINATION lib)
113 113 install(FILES ${headers} DESTINATION include/PythonQt)
@@ -1,1911 +1,2064
1 1 /*
2 2 *
3 3 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
4 4 *
5 5 * This library is free software; you can redistribute it and/or
6 6 * modify it under the terms of the GNU Lesser General Public
7 7 * License as published by the Free Software Foundation; either
8 8 * version 2.1 of the License, or (at your option) any later version.
9 9 *
10 10 * This library is distributed in the hope that it will be useful,
11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 13 * Lesser General Public License for more details.
14 14 *
15 15 * Further, this software is distributed without any warranty that it is
16 16 * free of the rightful claim of any third person regarding infringement
17 17 * or the like. Any license provided herein, whether implied or
18 18 * otherwise, applies only to this software file. Patent licenses, if
19 19 * any, provided herein do not apply to combinations of this program with
20 20 * other software, or any other product whatsoever.
21 21 *
22 22 * You should have received a copy of the GNU Lesser General Public
23 23 * License along with this library; if not, write to the Free Software
24 24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 25 *
26 26 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
27 27 * 28359 Bremen, Germany or:
28 28 *
29 29 * http://www.mevis.de
30 30 *
31 31 */
32 32
33 33 //----------------------------------------------------------------------------------
34 34 /*!
35 35 // \file PythonQt.cpp
36 36 // \author Florian Link
37 37 // \author Last changed by $Author: florian $
38 38 // \date 2006-05
39 39 */
40 40 //----------------------------------------------------------------------------------
41 41
42 42 #include "PythonQt.h"
43 43 #include "PythonQtImporter.h"
44 44 #include "PythonQtClassInfo.h"
45 45 #include "PythonQtMethodInfo.h"
46 46 #include "PythonQtSignal.h"
47 47 #include "PythonQtSignalReceiver.h"
48 48 #include "PythonQtConversion.h"
49 49 #include "PythonQtStdIn.h"
50 50 #include "PythonQtStdOut.h"
51 51 #include "PythonQtCppWrapperFactory.h"
52 52 #include "PythonQtVariants.h"
53 53 #include "PythonQtStdDecorators.h"
54 54 #include "PythonQtQFileImporter.h"
55 55 #include <pydebug.h>
56 56 #include <vector>
57 57
58 58 PythonQt* PythonQt::_self = NULL;
59 59 int PythonQt::_uniqueModuleCount = 0;
60 60
61 61 void PythonQt_init_QtGuiBuiltin(PyObject*);
62 62 void PythonQt_init_QtCoreBuiltin(PyObject*);
63 63
64 64
65 65 PyObject* PythonQtConvertFromStringRef(const void* inObject, int /*metaTypeId*/)
66 66 {
67 67 return PythonQtConv::QStringToPyObject(((QStringRef*)inObject)->toString());
68 68 }
69 69
70 70 void PythonQt::init(int flags, const QByteArray& pythonQtModuleName)
71 71 {
72 72 if (!_self) {
73 73 _self = new PythonQt(flags, pythonQtModuleName);
74 74
75 75 PythonQt::priv()->setupSharedLibrarySuffixes();
76 76
77 77 PythonQtMethodInfo::addParameterTypeAlias("QObjectList", "QList<QObject*>");
78 78 qRegisterMetaType<QList<QObject*> >("QList<void*>");
79 79
80 80 int stringRefId = qRegisterMetaType<QStringRef>("QStringRef");
81 81 PythonQtConv::registerMetaTypeToPythonConverter(stringRefId, PythonQtConvertFromStringRef);
82 82
83 83 PythonQtRegisterToolClassesTemplateConverter(int);
84 84 PythonQtRegisterToolClassesTemplateConverter(float);
85 85 PythonQtRegisterToolClassesTemplateConverter(double);
86 86 PythonQtRegisterToolClassesTemplateConverter(qint32);
87 87 PythonQtRegisterToolClassesTemplateConverter(quint32);
88 88 PythonQtRegisterToolClassesTemplateConverter(qint64);
89 89 PythonQtRegisterToolClassesTemplateConverter(quint64);
90 90 // TODO: which other POD types should be available for QList etc.
91 91
92 92 PythonQt_init_QtCoreBuiltin(NULL);
93 93 PythonQt_init_QtGuiBuiltin(NULL);
94 94
95 95 PythonQt::self()->addDecorators(new PythonQtStdDecorators());
96 96 PythonQt::self()->registerCPPClass("QMetaObject",0, "QtCore", PythonQtCreateObject<PythonQtWrapper_QMetaObject>);
97 97
98 98 PythonQtRegisterToolClassesTemplateConverter(QByteArray);
99 99 PythonQtRegisterToolClassesTemplateConverter(QDate);
100 100 PythonQtRegisterToolClassesTemplateConverter(QTime);
101 101 PythonQtRegisterToolClassesTemplateConverter(QDateTime);
102 102 PythonQtRegisterToolClassesTemplateConverter(QUrl);
103 103 PythonQtRegisterToolClassesTemplateConverter(QLocale);
104 104 PythonQtRegisterToolClassesTemplateConverter(QRect);
105 105 PythonQtRegisterToolClassesTemplateConverter(QRectF);
106 106 PythonQtRegisterToolClassesTemplateConverter(QSize);
107 107 PythonQtRegisterToolClassesTemplateConverter(QSizeF);
108 108 PythonQtRegisterToolClassesTemplateConverter(QLine);
109 109 PythonQtRegisterToolClassesTemplateConverter(QLineF);
110 110 PythonQtRegisterToolClassesTemplateConverter(QPoint);
111 111 PythonQtRegisterToolClassesTemplateConverter(QPointF);
112 112 PythonQtRegisterToolClassesTemplateConverter(QRegExp);
113 113
114 114 PythonQtRegisterToolClassesTemplateConverter(QFont);
115 115 PythonQtRegisterToolClassesTemplateConverter(QPixmap);
116 116 PythonQtRegisterToolClassesTemplateConverter(QBrush);
117 117 PythonQtRegisterToolClassesTemplateConverter(QColor);
118 118 PythonQtRegisterToolClassesTemplateConverter(QPalette);
119 119 PythonQtRegisterToolClassesTemplateConverter(QIcon);
120 120 PythonQtRegisterToolClassesTemplateConverter(QImage);
121 121 PythonQtRegisterToolClassesTemplateConverter(QPolygon);
122 122 PythonQtRegisterToolClassesTemplateConverter(QRegion);
123 123 PythonQtRegisterToolClassesTemplateConverter(QBitmap);
124 124 PythonQtRegisterToolClassesTemplateConverter(QCursor);
125 125 PythonQtRegisterToolClassesTemplateConverter(QSizePolicy);
126 126 PythonQtRegisterToolClassesTemplateConverter(QKeySequence);
127 127 PythonQtRegisterToolClassesTemplateConverter(QPen);
128 128 PythonQtRegisterToolClassesTemplateConverter(QTextLength);
129 129 PythonQtRegisterToolClassesTemplateConverter(QTextFormat);
130 130 PythonQtRegisterToolClassesTemplateConverter(QMatrix);
131 131
132 132
133 133 PyObject* pack = PythonQt::priv()->packageByName("QtCore");
134 134 PyObject* pack2 = PythonQt::priv()->packageByName("Qt");
135 135 PyObject* qtNamespace = PythonQt::priv()->getClassInfo("Qt")->pythonQtClassWrapper();
136 136 const char* names[16] = {"SIGNAL", "SLOT", "qAbs", "qBound","qDebug","qWarning","qCritical","qFatal"
137 137 ,"qFuzzyCompare", "qMax","qMin","qRound","qRound64","qVersion","qrand","qsrand"};
138 138 for (unsigned int i = 0;i<16; i++) {
139 139 PyObject* obj = PyObject_GetAttrString(qtNamespace, names[i]);
140 140 if (obj) {
141 141 PyModule_AddObject(pack, names[i], obj);
142 142 Py_INCREF(obj);
143 143 PyModule_AddObject(pack2, names[i], obj);
144 144 } else {
145 145 std::cerr << "method not found " << names[i];
146 146 }
147 147 }
148 148 }
149 149 }
150 150
151 151 void PythonQt::cleanup()
152 152 {
153 153 if (_self) {
154 154 delete _self;
155 155 _self = NULL;
156 156 }
157 157 }
158 158
159 159 PythonQt* PythonQt::self() { return _self; }
160 160
161 161 PythonQt::PythonQt(int flags, const QByteArray& pythonQtModuleName)
162 162 {
163 163 _p = new PythonQtPrivate;
164 164 _p->_initFlags = flags;
165 165
166 166 _p->_PythonQtObjectPtr_metaId = qRegisterMetaType<PythonQtObjectPtr>("PythonQtObjectPtr");
167 167
168 168 if ((flags & PythonAlreadyInitialized) == 0) {
169 #ifdef PY3K
170 Py_SetProgramName(const_cast<wchar_t*>(L"PythonQt"));
171 #else
169 172 Py_SetProgramName(const_cast<char*>("PythonQt"));
173 #endif
170 174 if (flags & IgnoreSiteModule) {
171 175 // this prevents the automatic importing of Python site files
172 176 Py_NoSiteFlag = 1;
173 177 }
174 178 Py_Initialize();
175 179 }
176 180
177 181 // add our own python object types for qt object slots
178 182 if (PyType_Ready(&PythonQtSlotFunction_Type) < 0) {
179 183 std::cerr << "could not initialize PythonQtSlotFunction_Type" << ", in " << __FILE__ << ":" << __LINE__ << std::endl;
180 184 }
181 185 Py_INCREF(&PythonQtSlotFunction_Type);
182 186
183 187 if (PyType_Ready(&PythonQtSignalFunction_Type) < 0) {
184 188 std::cerr << "could not initialize PythonQtSignalFunction_Type" << ", in " << __FILE__ << ":" << __LINE__ << std::endl;
185 189 }
186 190 Py_INCREF(&PythonQtSignalFunction_Type);
187 191
188 192 // according to Python docs, set the type late here, since it can not safely be stored in the struct when declaring it
189 193 PythonQtClassWrapper_Type.tp_base = &PyType_Type;
190 194 // add our own python object types for classes
191 195 if (PyType_Ready(&PythonQtClassWrapper_Type) < 0) {
192 196 std::cerr << "could not initialize PythonQtClassWrapper_Type" << ", in " << __FILE__ << ":" << __LINE__ << std::endl;
193 197 }
194 198 Py_INCREF(&PythonQtClassWrapper_Type);
195 199
196 200 // add our own python object types for CPP instances
197 201 if (PyType_Ready(&PythonQtInstanceWrapper_Type) < 0) {
198 202 PythonQt::handleError();
199 203 std::cerr << "could not initialize PythonQtInstanceWrapper_Type" << ", in " << __FILE__ << ":" << __LINE__ << std::endl;
200 204 }
201 205 Py_INCREF(&PythonQtInstanceWrapper_Type);
202 206
203 207 // add our own python object types for redirection of stdout
204 208 if (PyType_Ready(&PythonQtStdOutRedirectType) < 0) {
205 209 std::cerr << "could not initialize PythonQtStdOutRedirectType" << ", in " << __FILE__ << ":" << __LINE__ << std::endl;
206 210 }
207 211 Py_INCREF(&PythonQtStdOutRedirectType);
208 212
209 213 // add our own python object types for redirection of stdin
210 214 if (PyType_Ready(&PythonQtStdInRedirectType) < 0) {
211 215 std::cerr << "could not initialize PythonQtStdInRedirectType" << ", in " << __FILE__ << ":" << __LINE__ << std::endl;
212 216 }
213 217 Py_INCREF(&PythonQtStdInRedirectType);
214 218
215 219 initPythonQtModule(flags & RedirectStdOut, pythonQtModuleName);
216 220
217 221 }
218 222
219 223 PythonQt::~PythonQt() {
220 224 delete _p;
221 225 _p = NULL;
222 226 }
223 227
224 228 PythonQtPrivate::~PythonQtPrivate() {
225 229 delete _defaultImporter;
226 230 _defaultImporter = NULL;
227 231
228 232 {
229 233 QHashIterator<QByteArray, PythonQtClassInfo *> i(_knownClassInfos);
230 234 while (i.hasNext()) {
231 235 delete i.next().value();
232 236 }
233 237 }
234 238 PythonQtConv::global_valueStorage.clear();
235 239 PythonQtConv::global_ptrStorage.clear();
236 240 PythonQtConv::global_variantStorage.clear();
237 241
238 242 PythonQtMethodInfo::cleanupCachedMethodInfos();
239 243 }
240 244
241 245 void PythonQt::setRedirectStdInCallback(PythonQtInputChangedCB* callback, void * callbackData)
242 246 {
243 247 if (!callback)
244 248 {
245 249 std::cerr << "PythonQt::setRedirectStdInCallback - callback parameter is NULL !" << std::endl;
246 250 return;
247 251 }
248 252
249 253 PythonQtObjectPtr sys;
250 254 PythonQtObjectPtr in;
251 255 sys.setNewRef(PyImport_ImportModule("sys"));
252 256
253 257 // Backup original 'sys.stdin' if not yet done
254 258 if( !PyObject_HasAttrString(sys.object(), "pythonqt_original_stdin") )
255 259 PyObject_SetAttrString(sys.object(), "pythonqt_original_stdin", PyObject_GetAttrString(sys.object(), "stdin"));
256 260
257 261 in = PythonQtStdInRedirectType.tp_new(&PythonQtStdInRedirectType, NULL, NULL);
258 262 ((PythonQtStdInRedirect*)in.object())->_cb = callback;
259 263 ((PythonQtStdInRedirect*)in.object())->_callData = callbackData;
260 264 // replace the built in file objects with our own objects
261 265 PyModule_AddObject(sys.object(), "stdin", in);
262 266
263 267 // Backup custom 'stdin' into 'pythonqt_stdin'
264 268 Py_IncRef(in);
265 269 PyModule_AddObject(sys.object(), "pythonqt_stdin", in);
266 270 }
267 271
268 272 void PythonQt::setRedirectStdInCallbackEnabled(bool enabled)
269 273 {
270 274 PythonQtObjectPtr sys;
271 275 sys.setNewRef(PyImport_ImportModule("sys"));
272 276
273 277 if (enabled)
274 278 {
275 279 if( !PyObject_HasAttrString(sys.object(), "pythonqt_stdin") )
276 280 PyObject_SetAttrString(sys.object(), "stdin", PyObject_GetAttrString(sys.object(), "pythonqt_stdin"));
277 281 }
278 282 else
279 283 {
280 284 if( !PyObject_HasAttrString(sys.object(), "pythonqt_original_stdin") )
281 285 PyObject_SetAttrString(sys.object(), "stdin", PyObject_GetAttrString(sys.object(), "pythonqt_original_stdin"));
282 286 }
283 287 }
284 288
285 289 PythonQtImportFileInterface* PythonQt::importInterface()
286 290 {
287 291 return _self->_p->_importInterface?_self->_p->_importInterface:_self->_p->_defaultImporter;
288 292 }
289 293
290 294 void PythonQt::qObjectNoLongerWrappedCB(QObject* o)
291 295 {
292 296 if (_self->_p->_noLongerWrappedCB) {
293 297 (*_self->_p->_noLongerWrappedCB)(o);
294 298 };
295 299 }
296 300
297 301 void PythonQt::registerClass(const QMetaObject* metaobject, const char* package, PythonQtQObjectCreatorFunctionCB* wrapperCreator, PythonQtShellSetInstanceWrapperCB* shell)
298 302 {
299 303 _p->registerClass(metaobject, package, wrapperCreator, shell);
300 304 }
301 305
302 306 void PythonQtPrivate::registerClass(const QMetaObject* metaobject, const char* package, PythonQtQObjectCreatorFunctionCB* wrapperCreator, PythonQtShellSetInstanceWrapperCB* shell, PyObject* module, int typeSlots)
303 307 {
304 308 // we register all classes in the hierarchy
305 309 const QMetaObject* m = metaobject;
306 310 bool first = true;
307 311 while (m) {
308 312 PythonQtClassInfo* info = lookupClassInfoAndCreateIfNotPresent(m->className());
309 313 if (!info->pythonQtClassWrapper()) {
310 314 info->setTypeSlots(typeSlots);
311 315 info->setupQObject(m);
312 316 createPythonQtClassWrapper(info, package, module);
313 317 if (m->superClass()) {
314 318 PythonQtClassInfo* parentInfo = lookupClassInfoAndCreateIfNotPresent(m->superClass()->className());
315 319 info->addParentClass(PythonQtClassInfo::ParentClassInfo(parentInfo));
316 320 }
317 321 } else if (first && module) {
318 322 // There is a wrapper already, but if we got a module, we want to place the wrapper into that module as well,
319 323 // since it might have been placed into "private" earlier on.
320 324 // If the wrapper was already added to module before, it is just readded, which does no harm.
321 325 PyObject* classWrapper = info->pythonQtClassWrapper();
322 326 // AddObject steals a reference, so we need to INCREF
323 327 Py_INCREF(classWrapper);
324 328 PyModule_AddObject(module, info->className(), classWrapper);
325 329 }
326 330 if (first) {
327 331 first = false;
328 332 if (wrapperCreator) {
329 333 info->setDecoratorProvider(wrapperCreator);
330 334 }
331 335 if (shell) {
332 336 info->setShellSetInstanceWrapperCB(shell);
333 337 }
334 338 }
335 339 m = m->superClass();
336 340 }
337 341 }
338 342
339 343 void PythonQtPrivate::createPythonQtClassWrapper(PythonQtClassInfo* info, const char* package, PyObject* module)
340 344 {
341 345 PyObject* pack = module?module:packageByName(package);
342 346 PyObject* pyobj = (PyObject*)createNewPythonQtClassWrapper(info, pack);
343 347 PyModule_AddObject(pack, info->className(), pyobj);
344 348 if (!module && package && strncmp(package,"Qt",2)==0) {
345 349 // since PyModule_AddObject steals the reference, we need a incref once more...
346 350 Py_INCREF(pyobj);
347 351 // put all qt objects into Qt as well
348 352 PyModule_AddObject(packageByName("Qt"), info->className(), pyobj);
349 353 }
350 354 info->setPythonQtClassWrapper(pyobj);
351 355 }
352 356
353 357 PyObject* PythonQtPrivate::wrapQObject(QObject* obj)
354 358 {
355 359 if (!obj) {
356 360 Py_INCREF(Py_None);
357 361 return Py_None;
358 362 }
359 363 PythonQtInstanceWrapper* wrap = findWrapperAndRemoveUnused(obj);
360 364 if (wrap && wrap->_wrappedPtr) {
361 365 // uh oh, we want to wrap a QObject, but have a C++ wrapper at that
362 366 // address, so probably that C++ wrapper has been deleted earlier and
363 367 // now we see a QObject with the same address.
364 368 // Do not use the old wrapper anymore.
365 369 wrap = NULL;
366 370 }
367 371 if (!wrap) {
368 372 // smuggling it in...
369 373 PythonQtClassInfo* classInfo = _knownClassInfos.value(obj->metaObject()->className());
370 374 if (!classInfo || classInfo->pythonQtClassWrapper()==NULL) {
371 375 registerClass(obj->metaObject());
372 376 classInfo = _knownClassInfos.value(obj->metaObject()->className());
373 377 }
374 378 wrap = createNewPythonQtInstanceWrapper(obj, classInfo);
375 379 // mlabDebugConst("MLABPython","new qobject wrapper added " << " " << wrap->_obj->className() << " " << wrap->classInfo()->wrappedClassName().latin1());
376 380 } else {
377 381 Py_INCREF(wrap);
378 382 // mlabDebugConst("MLABPython","qobject wrapper reused " << wrap->_obj->className() << " " << wrap->classInfo()->wrappedClassName().latin1());
379 383 }
380 384 return (PyObject*)wrap;
381 385 }
382 386
383 387 PyObject* PythonQtPrivate::wrapPtr(void* ptr, const QByteArray& name)
384 388 {
385 389 if (!ptr) {
386 390 Py_INCREF(Py_None);
387 391 return Py_None;
388 392 }
389 393
390 394 PythonQtInstanceWrapper* wrap = findWrapperAndRemoveUnused(ptr);
391 395 PythonQtInstanceWrapper* possibleStillAliveWrapper = NULL;
392 396 if (wrap && wrap->_wrappedPtr) {
393 397 // we have a previous C++ wrapper... if the wrapper is for a C++ object,
394 398 // we are not sure if it may have been deleted earlier and we just see the same C++
395 399 // pointer once again. To make sure that we do not reuse a wrapper of the wrong type,
396 400 // we compare the classInfo() pointer and only reuse the wrapper if it has the same
397 401 // info. This is only needed for non-QObjects, since we know it when a QObject gets deleted.
398 402 possibleStillAliveWrapper = wrap;
399 403 wrap = NULL;
400 404 }
401 405 if (!wrap) {
402 406 PythonQtClassInfo* info = _knownClassInfos.value(name);
403 407 if (!info) {
404 408 // maybe it is a PyObject, which we can return directly
405 409 if (name == "PyObject") {
406 410 PyObject* p = (PyObject*)ptr;
407 411 Py_INCREF(p);
408 412 return p;
409 413 }
410 414
411 415 // we do not know the metaobject yet, but we might know it by its name:
412 416 if (_knownQObjectClassNames.find(name)!=_knownQObjectClassNames.end()) {
413 417 // yes, we know it, so we can convert to QObject
414 418 QObject* qptr = (QObject*)ptr;
415 419 registerClass(qptr->metaObject());
416 420 info = _knownClassInfos.value(qptr->metaObject()->className());
417 421 }
418 422 }
419 423 if (info && info->isQObject()) {
420 424 QObject* qptr = (QObject*)ptr;
421 425 // if the object is a derived object, we want to switch the class info to the one of the derived class:
422 426 if (name!=(qptr->metaObject()->className())) {
423 427 info = _knownClassInfos.value(qptr->metaObject()->className());
424 428 if (!info) {
425 429 registerClass(qptr->metaObject());
426 430 info = _knownClassInfos.value(qptr->metaObject()->className());
427 431 }
428 432 }
429 433 wrap = createNewPythonQtInstanceWrapper(qptr, info);
430 434 // mlabDebugConst("MLABPython","new qobject wrapper added " << " " << wrap->_obj->className() << " " << wrap->classInfo()->wrappedClassName().latin1());
431 435 return (PyObject*)wrap;
432 436 }
433 437
434 438 // not a known QObject, try to wrap via foreign wrapper factories
435 439 PyObject* foreignWrapper = NULL;
436 440 for (int i=0; i<_foreignWrapperFactories.size(); i++) {
437 441 foreignWrapper = _foreignWrapperFactories.at(i)->wrap(name, ptr);
438 442 if (foreignWrapper) {
439 443 return foreignWrapper;
440 444 }
441 445 }
442 446
443 447 // not a known QObject, so try our wrapper factory:
444 448 QObject* wrapper = NULL;
445 449 for (int i=0; i<_cppWrapperFactories.size(); i++) {
446 450 wrapper = _cppWrapperFactories.at(i)->create(name, ptr);
447 451 if (wrapper) {
448 452 break;
449 453 }
450 454 }
451 455
452 456 if (info) {
453 457 // try to downcast in the class hierarchy, which will modify info and ptr if it is successfull
454 458 ptr = info->castDownIfPossible(ptr, &info);
455 459
456 460 // if downcasting found out that the object is a QObject,
457 461 // handle it like one:
458 462 if (info && info->isQObject()) {
459 463 QObject* qptr = (QObject*)ptr;
460 464 // if the object is a derived object, we want to switch the class info to the one of the derived class:
461 465 if (name!=(qptr->metaObject()->className())) {
462 466 registerClass(qptr->metaObject());
463 467 info = _knownClassInfos.value(qptr->metaObject()->className());
464 468 }
465 469 wrap = createNewPythonQtInstanceWrapper(qptr, info);
466 470 // mlabDebugConst("MLABPython","new qobject wrapper added " << " " << wrap->_obj->className() << " " << wrap->classInfo()->wrappedClassName().latin1());
467 471 return (PyObject*)wrap;
468 472 }
469 473 }
470 474
471 475 if (!info || info->pythonQtClassWrapper()==NULL) {
472 476 // still unknown, register as CPP class
473 477 registerCPPClass(name.constData());
474 478 info = _knownClassInfos.value(name);
475 479 }
476 480 if (wrapper && (info->metaObject() != wrapper->metaObject())) {
477 481 // if we a have a QObject wrapper and the metaobjects do not match, set the metaobject again!
478 482 info->setMetaObject(wrapper->metaObject());
479 483 }
480 484
481 485 if (possibleStillAliveWrapper && possibleStillAliveWrapper->classInfo() == info) {
482 486 wrap = possibleStillAliveWrapper;
483 487 Py_INCREF(wrap);
484 488 } else {
485 489 wrap = createNewPythonQtInstanceWrapper(wrapper, info, ptr);
486 490 }
487 491 // mlabDebugConst("MLABPython","new c++ wrapper added " << wrap->_wrappedPtr << " " << wrap->_obj->className() << " " << wrap->classInfo()->wrappedClassName().latin1());
488 492 } else {
489 493 Py_INCREF(wrap);
490 494 //mlabDebugConst("MLABPython","c++ wrapper reused " << wrap->_wrappedPtr << " " << wrap->_obj->className() << " " << wrap->classInfo()->wrappedClassName().latin1());
491 495 }
492 496 return (PyObject*)wrap;
493 497 }
494 498
495 499 PyObject* PythonQtPrivate::dummyTuple() {
496 500 static PyObject* dummyTuple = NULL;
497 501 if (dummyTuple==NULL) {
498 502 dummyTuple = PyTuple_New(1);
503 #ifdef PY3K
504 PyTuple_SET_ITEM(dummyTuple, 0, PyUnicode_FromString("dummy"));
505 #else
499 506 PyTuple_SET_ITEM(dummyTuple, 0 , PyString_FromString("dummy"));
507 #endif
500 508 }
501 509 return dummyTuple;
502 510 }
503 511
504 512
505 513 PythonQtInstanceWrapper* PythonQtPrivate::createNewPythonQtInstanceWrapper(QObject* obj, PythonQtClassInfo* info, void* wrappedPtr) {
506 514 // call the associated class type to create a new instance...
507 515 PythonQtInstanceWrapper* result = (PythonQtInstanceWrapper*)PyObject_Call(info->pythonQtClassWrapper(), dummyTuple(), NULL);
508 516
509 517 result->setQObject(obj);
510 518 result->_wrappedPtr = wrappedPtr;
511 519 result->_ownedByPythonQt = false;
512 520 result->_useQMetaTypeDestroy = false;
513 521
514 522 if (wrappedPtr) {
515 523 _wrappedObjects.insert(wrappedPtr, result);
516 524 } else {
517 525 _wrappedObjects.insert(obj, result);
518 526 if (obj->parent()== NULL && _wrappedCB) {
519 527 // tell someone who is interested that the qobject is wrapped the first time, if it has no parent
520 528 (*_wrappedCB)(obj);
521 529 }
522 530 }
523 531 return result;
524 532 }
525 533
526 534 PythonQtClassWrapper* PythonQtPrivate::createNewPythonQtClassWrapper(PythonQtClassInfo* info, PyObject* parentModule) {
527 535 PythonQtClassWrapper* result;
528 536
537 #ifdef PY3K
538 PyObject* className = PyUnicode_FromString(info->className());
539 #else
529 540 PyObject* className = PyString_FromString(info->className());
541 #endif
530 542
531 543 PyObject* baseClasses = PyTuple_New(1);
532 544 PyTuple_SET_ITEM(baseClasses, 0, (PyObject*)&PythonQtInstanceWrapper_Type);
533 545
534 546 PyObject* typeDict = PyDict_New();
535 547 PyObject* moduleName = PyObject_GetAttrString(parentModule, "__name__");
536 548 PyDict_SetItemString(typeDict, "__module__", moduleName);
537 549
538 550 PyObject* args = Py_BuildValue("OOO", className, baseClasses, typeDict);
539 551
540 552 // set the class info so that PythonQtClassWrapper_new can read it
541 553 _currentClassInfoForClassWrapperCreation = info;
542 554 // create the new type object by calling the type
543 555 result = (PythonQtClassWrapper *)PyObject_Call((PyObject *)&PythonQtClassWrapper_Type, args, NULL);
544 556
545 557 Py_DECREF(baseClasses);
546 558 Py_DECREF(typeDict);
547 559 Py_DECREF(args);
548 560 Py_DECREF(className);
549 561
550 562 return result;
551 563 }
552 564
553 565 PyObject* PythonQtPrivate::createEnumValueInstance(PyObject* enumType, unsigned int enumValue)
554 566 {
555 567 PyObject* args = Py_BuildValue("(i)", enumValue);
556 568 PyObject* result = PyObject_Call(enumType, args, NULL);
557 569 Py_DECREF(args);
558 570 return result;
559 571 }
560 572
561 573 PyObject* PythonQtPrivate::createNewPythonQtEnumWrapper(const char* enumName, PyObject* parentObject) {
562 574 PyObject* result;
563 575
576 #ifdef PY3K
577 PyObject* className = PyUnicode_FromString(enumName);
578 #else
564 579 PyObject* className = PyString_FromString(enumName);
580 #endif
565 581
566 582 PyObject* baseClasses = PyTuple_New(1);
583 #ifdef PY3K
584 PyTuple_SET_ITEM(baseClasses, 0, (PyObject*)&PyLong_Type);
585 #else
567 586 PyTuple_SET_ITEM(baseClasses, 0, (PyObject*)&PyInt_Type);
587 #endif
568 588
569 589 PyObject* module = PyObject_GetAttrString(parentObject, "__module__");
570 590 PyObject* typeDict = PyDict_New();
571 591 PyDict_SetItemString(typeDict, "__module__", module);
572 592
573 593 PyObject* args = Py_BuildValue("OOO", className, baseClasses, typeDict);
574 594
575 595 // create the new int derived type object by calling the core type
576 596 result = PyObject_Call((PyObject *)&PyType_Type, args, NULL);
577 597
578 598 Py_DECREF(baseClasses);
579 599 Py_DECREF(typeDict);
580 600 Py_DECREF(args);
581 601 Py_DECREF(className);
582 602
583 603 return result;
584 604 }
585 605
586 606 PythonQtSignalReceiver* PythonQt::getSignalReceiver(QObject* obj)
587 607 {
588 608 PythonQtSignalReceiver* r = _p->_signalReceivers[obj];
589 609 if (!r) {
590 610 r = new PythonQtSignalReceiver(obj);
591 611 _p->_signalReceivers.insert(obj, r);
592 612 }
593 613 return r;
594 614 }
595 615
596 616 bool PythonQt::addSignalHandler(QObject* obj, const char* signal, PyObject* module, const QString& objectname)
597 617 {
598 618 bool flag = false;
599 619 PythonQtObjectPtr callable = lookupCallable(module, objectname);
600 620 if (callable) {
601 621 PythonQtSignalReceiver* r = getSignalReceiver(obj);
602 622 flag = r->addSignalHandler(signal, callable);
603 623 if (!flag) {
604 624 // signal not found
605 625 }
606 626 } else {
607 627 // callable not found
608 628 }
609 629 return flag;
610 630 }
611 631
612 632 bool PythonQt::addSignalHandler(QObject* obj, const char* signal, PyObject* receiver)
613 633 {
614 634 bool flag = false;
615 635 PythonQtSignalReceiver* r = getSignalReceiver(obj);
616 636 if (r) {
617 637 flag = r->addSignalHandler(signal, receiver);
618 638 }
619 639 return flag;
620 640 }
621 641
622 642 bool PythonQt::removeSignalHandler(QObject* obj, const char* signal, PyObject* module, const QString& objectname)
623 643 {
624 644 bool flag = false;
625 645 PythonQtObjectPtr callable = lookupCallable(module, objectname);
626 646 if (callable) {
627 647 PythonQtSignalReceiver* r = _p->_signalReceivers[obj];
628 648 if (r) {
629 649 flag = r->removeSignalHandler(signal, callable);
630 650 }
631 651 } else {
632 652 // callable not found
633 653 }
634 654 return flag;
635 655 }
636 656
637 657 bool PythonQt::removeSignalHandler(QObject* obj, const char* signal, PyObject* receiver)
638 658 {
639 659 bool flag = false;
640 660 PythonQtSignalReceiver* r = _p->_signalReceivers[obj];
641 661 if (r) {
642 662 flag = r->removeSignalHandler(signal, receiver);
643 663 }
644 664 return flag;
645 665 }
646 666
647 667 PythonQtObjectPtr PythonQt::lookupCallable(PyObject* module, const QString& name)
648 668 {
649 669 PythonQtObjectPtr p = lookupObject(module, name);
650 670 if (p) {
651 671 if (PyCallable_Check(p)) {
652 672 return p;
653 673 }
654 674 }
655 675 PyErr_Clear();
656 676 return NULL;
657 677 }
658 678
659 679 PythonQtObjectPtr PythonQt::lookupObject(PyObject* module, const QString& name)
660 680 {
661 681 QStringList l = name.split('.');
662 682 PythonQtObjectPtr p = module;
663 683 PythonQtObjectPtr prev;
664 684 QByteArray b;
665 685 for (QStringList::ConstIterator i = l.begin(); i!=l.end() && p; ++i) {
666 686 prev = p;
667 687 b = (*i).toLatin1();
668 688 if (PyDict_Check(p)) {
669 689 p = PyDict_GetItemString(p, b.data());
670 690 } else {
671 691 p.setNewRef(PyObject_GetAttrString(p, b.data()));
672 692 }
673 693 }
674 694 PyErr_Clear();
675 695 return p;
676 696 }
677 697
678 698 PythonQtObjectPtr PythonQt::getMainModule() {
679 699 //both borrowed
680 700 PythonQtObjectPtr dict = PyImport_GetModuleDict();
681 701 return PyDict_GetItemString(dict, "__main__");
682 702 }
683 703
684 704 PythonQtObjectPtr PythonQt::importModule(const QString& name)
685 705 {
686 706 PythonQtObjectPtr mod;
687 707 mod.setNewRef(PyImport_ImportModule(name.toLatin1().constData()));
688 708 return mod;
689 709 }
690 710
691 711
692 712 QVariant PythonQt::evalCode(PyObject* object, PyObject* pycode) {
693 713 QVariant result;
694 714 clearError();
695 715 if (pycode) {
696 716 PyObject* dict = NULL;
697 717 PyObject* globals = NULL;
698 718 if (PyModule_Check(object)) {
699 719 dict = PyModule_GetDict(object);
700 720 globals = dict;
701 721 } else if (PyDict_Check(object)) {
702 722 dict = object;
703 723 globals = dict;
704 724 } else {
705 725 dict = PyObject_GetAttrString(object, "__dict__");
706 globals = PyObject_GetAttrString(PyImport_ImportModule(PyString_AS_STRING(PyObject_GetAttrString(object, "__module__"))),"__dict__");
726 globals = PyObject_GetAttrString(PyImport_ImportModule(
727 #ifdef PY3K
728 PyUnicode_AsUTF8(
729 #else
730 PyString_AS_STRING(
731 #endif
732 PyObject_GetAttrString(object, "__module__"))),"__dict__");
707 733 }
708 734 PyObject* r = NULL;
709 735 if (dict) {
736 #ifdef PY3K
737 r = PyEval_EvalCode(pycode, globals, dict);
738 #else
710 739 r = PyEval_EvalCode((PyCodeObject*)pycode, globals , dict);
740 #endif
711 741 }
712 742 if (r) {
713 743 result = PythonQtConv::PyObjToQVariant(r);
714 744 Py_DECREF(r);
715 745 } else {
716 746 handleError();
717 747 }
718 748 } else {
719 749 handleError();
720 750 }
721 751 return result;
722 752 }
723 753
724 754 QVariant PythonQt::evalScript(PyObject* object, const QString& script, int start)
725 755 {
726 756 QVariant result;
727 757 PythonQtObjectPtr p;
728 758 PyObject* dict = NULL;
729 759 clearError();
730 760 if (PyModule_Check(object)) {
731 761 dict = PyModule_GetDict(object);
732 762 } else if (PyDict_Check(object)) {
733 763 dict = object;
734 764 }
735 765 if (dict) {
736 766 p.setNewRef(PyRun_String(script.toLatin1().data(), start, dict, dict));
737 767 }
738 768 if (p) {
739 769 result = PythonQtConv::PyObjToQVariant(p);
740 770 } else {
741 771 handleError();
742 772 }
743 773 return result;
744 774 }
745 775
746 776 void PythonQt::evalFile(PyObject* module, const QString& filename)
747 777 {
748 778 PythonQtObjectPtr code = parseFile(filename);
749 779 clearError();
750 780 if (code) {
751 781 evalCode(module, code);
752 782 } else {
753 783 handleError();
754 784 }
755 785 }
756 786
757 787 PythonQtObjectPtr PythonQt::parseFile(const QString& filename)
758 788 {
759 789 PythonQtObjectPtr p;
760 790 p.setNewRef(PythonQtImport::getCodeFromPyc(filename));
761 791 clearError();
762 792 if (!p) {
763 793 handleError();
764 794 }
765 795 return p;
766 796 }
767 797
768 798 PythonQtObjectPtr PythonQt::createModuleFromFile(const QString& name, const QString& filename)
769 799 {
770 800 PythonQtObjectPtr code = parseFile(filename);
771 801 PythonQtObjectPtr module = _p->createModule(name, code);
772 802 return module;
773 803 }
774 804
775 805 PythonQtObjectPtr PythonQt::createModuleFromScript(const QString& name, const QString& script)
776 806 {
777 807 PyErr_Clear();
778 808 QString scriptCode = script;
779 809 if (scriptCode.isEmpty()) {
780 810 // we always need at least a linefeed
781 811 scriptCode = "\n";
782 812 }
783 813 PythonQtObjectPtr pycode;
784 814 pycode.setNewRef(Py_CompileString((char*)scriptCode.toLatin1().data(), "", Py_file_input));
785 815 PythonQtObjectPtr module = _p->createModule(name, pycode);
786 816 return module;
787 817 }
788 818
789 819 PythonQtObjectPtr PythonQt::createUniqueModule()
790 820 {
791 821 static QString pyQtStr("PythonQt_module");
792 822 QString moduleName = pyQtStr+QString::number(_uniqueModuleCount++);
793 823 return createModuleFromScript(moduleName);
794 824 }
795 825
796 826 void PythonQt::addObject(PyObject* object, const QString& name, QObject* qObject)
797 827 {
798 828 if (PyModule_Check(object)) {
799 829 PyModule_AddObject(object, name.toLatin1().data(), _p->wrapQObject(qObject));
800 830 } else if (PyDict_Check(object)) {
801 831 PyDict_SetItemString(object, name.toLatin1().data(), _p->wrapQObject(qObject));
802 832 } else {
803 833 PyObject_SetAttrString(object, name.toLatin1().data(), _p->wrapQObject(qObject));
804 834 }
805 835 }
806 836
807 837 void PythonQt::addVariable(PyObject* object, const QString& name, const QVariant& v)
808 838 {
809 839 if (PyModule_Check(object)) {
810 840 PyModule_AddObject(object, name.toLatin1().data(), PythonQtConv::QVariantToPyObject(v));
811 841 } else if (PyDict_Check(object)) {
812 842 PyDict_SetItemString(object, name.toLatin1().data(), PythonQtConv::QVariantToPyObject(v));
813 843 } else {
814 844 PyObject_SetAttrString(object, name.toLatin1().data(), PythonQtConv::QVariantToPyObject(v));
815 845 }
816 846 }
817 847
818 848 void PythonQt::removeVariable(PyObject* object, const QString& name)
819 849 {
820 850 if (PyDict_Check(object)) {
821 851 PyDict_DelItemString(object, name.toLatin1().data());
822 852 } else {
823 853 PyObject_DelAttrString(object, name.toLatin1().data());
824 854 }
825 855 }
826 856
827 857 QVariant PythonQt::getVariable(PyObject* object, const QString& objectname)
828 858 {
829 859 QVariant result;
830 860 PythonQtObjectPtr obj = lookupObject(object, objectname);
831 861 if (obj) {
832 862 result = PythonQtConv::PyObjToQVariant(obj);
833 863 }
834 864 return result;
835 865 }
836 866
837 867 QStringList PythonQt::introspection(PyObject* module, const QString& objectname, PythonQt::ObjectType type)
838 868 {
839 869 QStringList results;
840 870
841 871 PythonQtObjectPtr object;
842 872 if (objectname.isEmpty()) {
843 873 object = module;
844 874 } else {
845 875 object = lookupObject(module, objectname);
846 876 if (!object && type == CallOverloads) {
847 877 PyObject* dict = lookupObject(module, "__builtins__");
848 878 if (dict) {
849 879 object = PyDict_GetItemString(dict, objectname.toLatin1().constData());
850 880 }
851 881 }
852 882 }
853 883
854 884 if (object) {
855 885 results = introspectObject(object, type);
856 886 }
857 887
858 888 return results;
859 889 }
860 890
861 891 QStringList PythonQt::introspectObject(PyObject* object, ObjectType type)
862 892 {
863 893 QStringList results;
864 894
865 895 if (type == CallOverloads) {
866 896 if (PythonQtSlotFunction_Check(object)) {
867 897 PythonQtSlotFunctionObject* o = (PythonQtSlotFunctionObject*)object;
868 898 PythonQtSlotInfo* info = o->m_ml;
869 899
870 900 while (info) {
871 901 results << info->fullSignature();
872 902 info = info->nextInfo();
873 903 }
874 904 } else if (PythonQtSignalFunction_Check(object)) {
875 905 PythonQtSignalFunctionObject* o = (PythonQtSignalFunctionObject*)object;
876 906 PythonQtSlotInfo* info = o->m_ml;
877 907
878 908 while (info) {
879 909 results << info->fullSignature();
880 910 info = info->nextInfo();
881 911 }
882 912 } else if (object->ob_type == &PythonQtClassWrapper_Type) {
883 913 PythonQtClassWrapper* o = (PythonQtClassWrapper*)object;
884 914 PythonQtSlotInfo* info = o->classInfo()->constructors();
885 915
886 916 while (info) {
887 917 results << info->fullSignature();
888 918 info = info->nextInfo();
889 919 }
890 920 } else {
891 921 QString signature = _p->getSignature(object);
892 922 if (!signature.isEmpty()) {
893 923 results << signature;
894 924 } else {
895 925 PyObject* doc = PyObject_GetAttrString(object, "__doc__");
896 926 if (doc) {
927 #ifdef PY3K
928 results << PyUnicode_AsUTF8(doc);
929 #else
897 930 results << PyString_AsString(doc);
931 #endif
898 932 Py_DECREF(doc);
899 933 }
900 934 }
901 935 }
902 936 } else {
903 937 PyObject* keys = NULL;
904 938 bool isDict = false;
905 939 if (PyDict_Check(object)) {
906 940 keys = PyDict_Keys(object);
907 941 isDict = true;
908 942 } else {
909 943 keys = PyObject_Dir(object);
910 944 }
911 945 if (keys) {
912 946 int count = PyList_Size(keys);
913 947 PyObject* key;
914 948 PyObject* value;
915 949 QString keystr;
916 950 for (int i = 0;i<count;i++) {
917 951 key = PyList_GetItem(keys,i);
918 952 if (isDict) {
919 953 value = PyDict_GetItem(object, key);
920 954 Py_INCREF(value);
921 955 } else {
922 956 value = PyObject_GetAttr(object, key);
923 957 }
924 958 if (!value) continue;
959 #ifdef PY3K
960 keystr = PyUnicode_AsUTF8(key);
961 #else
925 962 keystr = PyString_AsString(key);
963 #endif
926 964 static const QString underscoreStr("__tmp");
927 965 if (!keystr.startsWith(underscoreStr)) {
928 966 switch (type) {
929 967 case Anything:
930 968 results << keystr;
931 969 break;
932 970 case Class:
971 #ifdef PY3K
972 if(PyType_Check(value)) {
973 #else
933 974 if (value->ob_type == &PyClass_Type || value->ob_type == &PyType_Type) {
975 #endif
934 976 results << keystr;
935 977 }
936 978 break;
937 979 case Variable:
938 if (value->ob_type != &PyClass_Type
939 && value->ob_type != &PyCFunction_Type
940 && value->ob_type != &PyFunction_Type
941 && value->ob_type != &PyMethod_Type
942 && value->ob_type != &PyModule_Type
943 && value->ob_type != &PyType_Type
944 && value->ob_type != &PythonQtSlotFunction_Type
980 if (
981 #ifndef PY3K
982 value->ob_type != &PyClass_Type &&
983 #endif
984 value->ob_type != &PyCFunction_Type &&
985 value->ob_type != &PyFunction_Type &&
986 value->ob_type != &PyMethod_Type &&
987 value->ob_type != &PyModule_Type &&
988 value->ob_type != &PyType_Type &&
989 value->ob_type != &PythonQtSlotFunction_Type
945 990 ) {
946 991 results << keystr;
947 992 }
948 993 break;
949 994 case Function:
950 995 if (value->ob_type == &PyCFunction_Type ||
951 996 value->ob_type == &PyFunction_Type ||
952 997 value->ob_type == &PyMethod_Type ||
953 998 value->ob_type == &PythonQtSlotFunction_Type
954 999 ) {
955 1000 results << keystr;
956 1001 }
957 1002 break;
958 1003 case Module:
959 1004 if (value->ob_type == &PyModule_Type) {
960 1005 results << keystr;
961 1006 }
962 1007 break;
963 1008 default:
964 1009 std::cerr << "PythonQt: introspection: unknown case" << ", in " << __FILE__ << ":" << __LINE__ << std::endl;
965 1010 }
966 1011 }
967 1012 Py_DECREF(value);
968 1013 }
969 1014 Py_DECREF(keys);
970 1015 }
971 1016 if ((type == Anything) || (type == Variable)) {
972 1017 if (object->ob_type == &PythonQtClassWrapper_Type) {
973 1018 PythonQtClassWrapper* o = (PythonQtClassWrapper*)object;
974 1019 PythonQtClassInfo* info = o->classInfo();
975 1020 results += info->propertyList();
976 1021 }
977 1022 }
978 1023 }
979 1024 return results;
980 1025 }
981 1026
982 1027 PyObject* PythonQt::getObjectByType(const QString& typeName)
983 1028 {
984 1029 PythonQtObjectPtr sys;
985 1030 sys.setNewRef(PyImport_ImportModule("sys"));
986 1031 PythonQtObjectPtr modules = lookupObject(sys, "modules");
987 1032 Q_ASSERT(PyDict_Check(modules));
988 1033
989 1034 QStringList tmp = typeName.split(".");
990 1035 QString simpleTypeName = tmp.takeLast();
991 1036 QString moduleName = tmp.join(".");
992 1037
993 1038 PyObject* object = NULL;
994 1039 PyObject* moduleObject = PyDict_GetItemString(modules, moduleName.toLatin1().constData());
995 1040 if (moduleObject) {
996 1041 object = PyObject_GetAttrString(moduleObject, simpleTypeName.toLatin1().constData());
997 1042 }
998 1043
999 1044 if (!object) {
1000 1045 moduleObject = PyDict_GetItemString(modules, "__builtin__");
1001 1046 if (moduleObject) {
1002 1047 object = PyObject_GetAttrString(moduleObject, simpleTypeName.toLatin1().constData());
1003 1048 }
1004 1049 }
1005 1050
1006 1051 return object;
1007 1052 }
1008 1053
1009 1054 QStringList PythonQt::introspectType(const QString& typeName, ObjectType type)
1010 1055 {
1011 1056 QStringList results;
1012 1057 PyObject* object = getObjectByType(typeName);
1013 1058 if (!object) {
1014 1059 // the last item may be a member, split it away and try again
1015 1060 QStringList tmp = typeName.split(".");
1016 1061 QString memberName = tmp.takeLast();
1017 1062 QString typeName;
1018 1063 if (tmp.isEmpty()) {
1019 1064 typeName = memberName;
1020 1065 memberName.clear();
1021 1066 } else {
1022 1067 typeName = tmp.takeLast();
1023 1068 }
1024 1069 PyObject* typeObject = getObjectByType(typeName);
1025 1070 if (typeObject) {
1026 1071 object = PyObject_GetAttrString(typeObject, memberName.toLatin1().constData());
1027 1072 }
1028 1073 }
1029 1074 if (object) {
1030 1075 results = introspectObject(object, type);
1031 1076 Py_DECREF(object);
1032 1077 }
1033 1078 return results;
1034 1079 }
1035 1080
1036 1081 QVariant PythonQt::call(PyObject* object, const QString& name, const QVariantList& args, const QVariantMap& kwargs)
1037 1082 {
1038 1083 PythonQtObjectPtr callable = lookupCallable(object, name);
1039 1084 if (callable) {
1040 1085 return call(callable, args, kwargs);
1041 1086 } else {
1042 1087 return QVariant();
1043 1088 }
1044 1089 }
1045 1090
1046 1091 QVariant PythonQt::call(PyObject* callable, const QVariantList& args, const QVariantMap& kwargs)
1047 1092 {
1048 1093 QVariant r;
1049 1094 PythonQtObjectPtr result;
1050 1095 result.setNewRef(callAndReturnPyObject(callable, args, kwargs));
1051 1096 clearError();
1052 1097 if (result) {
1053 1098 r = PythonQtConv::PyObjToQVariant(result);
1054 1099 } else {
1055 1100 PythonQt::self()->handleError();
1056 1101 }
1057 1102 return r;
1058 1103 }
1059 1104
1060 1105 PyObject* PythonQt::callAndReturnPyObject(PyObject* callable, const QVariantList& args, const QVariantMap& kwargs)
1061 1106 {
1062 1107 PyObject* result = NULL;
1063 1108 if (callable) {
1064 1109 bool err = false;
1065 1110 PythonQtObjectPtr pargs;
1066 1111 int count = args.size();
1067 1112 if ((count > 0) || (kwargs.count() > 0)) { // create empty tuple if kwargs are given
1068 1113 pargs.setNewRef(PyTuple_New(count));
1069 1114
1070 1115 // transform QVariant arguments to Python
1071 1116 for (int i = 0; i < count; i++) {
1072 1117 PyObject* arg = PythonQtConv::QVariantToPyObject(args.at(i));
1073 1118 if (arg) {
1074 1119 // steals reference, no unref
1075 1120 PyTuple_SetItem(pargs, i,arg);
1076 1121 } else {
1077 1122 err = true;
1078 1123 break;
1079 1124 }
1080 1125 }
1081 1126 }
1082 1127 if (!err) {
1083 1128 if (kwargs.isEmpty()) {
1084 1129 // do a direct call if we have no keyword arguments
1085 1130 PyErr_Clear();
1086 1131 result = PyObject_CallObject(callable, pargs);
1087 1132 } else {
1088 1133 // convert keyword arguments to Python
1089 1134 PythonQtObjectPtr pkwargs;
1090 1135 pkwargs.setNewRef(PyDict_New());
1091 1136 QMapIterator<QString, QVariant> it(kwargs);
1092 1137 while (it.hasNext()) {
1093 1138 it.next();
1094 1139 PyObject* arg = PythonQtConv::QVariantToPyObject(it.value());
1095 1140 if (arg) {
1096 1141 PyDict_SetItemString(pkwargs, it.key().toLatin1().constData(), arg);
1097 1142 } else {
1098 1143 err = true;
1099 1144 break;
1100 1145 }
1101 1146 }
1102 1147 if (!err) {
1103 1148 // call with arguments and keyword arguments
1104 1149 PyErr_Clear();
1105 1150 result = PyObject_Call(callable, pargs, pkwargs);
1106 1151 }
1107 1152 }
1108 1153 }
1109 1154 }
1110 1155 return result;
1111 1156 }
1112 1157
1113 1158 void PythonQt::addInstanceDecorators(QObject* o)
1114 1159 {
1115 1160 _p->addDecorators(o, PythonQtPrivate::InstanceDecorator);
1116 1161 }
1117 1162
1118 1163 void PythonQt::addClassDecorators(QObject* o)
1119 1164 {
1120 1165 _p->addDecorators(o, PythonQtPrivate::StaticDecorator | PythonQtPrivate::ConstructorDecorator | PythonQtPrivate::DestructorDecorator);
1121 1166 }
1122 1167
1123 1168 void PythonQt::addDecorators(QObject* o)
1124 1169 {
1125 1170 _p->addDecorators(o, PythonQtPrivate::AllDecorators);
1126 1171 }
1127 1172
1128 1173 void PythonQt::registerQObjectClassNames(const QStringList& names)
1129 1174 {
1130 1175 _p->registerQObjectClassNames(names);
1131 1176 }
1132 1177
1133 1178 void PythonQt::setImporter(PythonQtImportFileInterface* importInterface)
1134 1179 {
1135 1180 _p->_importInterface = importInterface;
1136 1181 PythonQtImport::init();
1137 1182 }
1138 1183
1139 1184 void PythonQt::setImporterIgnorePaths(const QStringList& paths)
1140 1185 {
1141 1186 _p->_importIgnorePaths = paths;
1142 1187 }
1143 1188
1144 1189 const QStringList& PythonQt::getImporterIgnorePaths()
1145 1190 {
1146 1191 return _p->_importIgnorePaths;
1147 1192 }
1148 1193
1149 1194 void PythonQt::addWrapperFactory(PythonQtCppWrapperFactory* factory)
1150 1195 {
1151 1196 _p->_cppWrapperFactories.append(factory);
1152 1197 }
1153 1198
1154 1199 void PythonQt::addWrapperFactory( PythonQtForeignWrapperFactory* factory )
1155 1200 {
1156 1201 _p->_foreignWrapperFactories.append(factory);
1157 1202 }
1158 1203
1159 1204 //---------------------------------------------------------------------------------------------------
1160 1205 PythonQtPrivate::PythonQtPrivate()
1161 1206 {
1162 1207 _importInterface = NULL;
1163 1208 _defaultImporter = new PythonQtQFileImporter;
1164 1209 _noLongerWrappedCB = NULL;
1165 1210 _wrappedCB = NULL;
1166 1211 _currentClassInfoForClassWrapperCreation = NULL;
1167 1212 _profilingCB = NULL;
1168 1213 _hadError = false;
1169 1214 _systemExitExceptionHandlerEnabled = false;
1170 1215 }
1171 1216
1172 1217 void PythonQtPrivate::setupSharedLibrarySuffixes()
1173 1218 {
1174 1219 _sharedLibrarySuffixes.clear();
1175 1220 PythonQtObjectPtr imp;
1176 1221 imp.setNewRef(PyImport_ImportModule("imp"));
1177 1222 int cExtensionCode = imp.getVariable("C_EXTENSION").toInt();
1178 1223 QVariant result = imp.call("get_suffixes");
1179 1224 #ifdef __linux
1180 1225 #ifdef _DEBUG
1181 1226 // First look for shared libraries with the '_d' suffix in debug mode on Linux.
1182 1227 // This is a workaround, because python does not append the '_d' suffix on Linux
1183 1228 // and would always load the release library otherwise.
1184 1229 _sharedLibrarySuffixes << "_d.so";
1185 1230 #endif
1186 1231 #endif
1187 1232 Q_FOREACH (QVariant entry, result.toList()) {
1188 1233 QVariantList suffixEntry = entry.toList();
1189 1234 if (suffixEntry.count()==3) {
1190 1235 int code = suffixEntry.at(2).toInt();
1191 1236 if (code == cExtensionCode) {
1192 1237 _sharedLibrarySuffixes << suffixEntry.at(0).toString();
1193 1238 }
1194 1239 }
1195 1240 }
1196 1241 }
1197 1242
1198 1243 PythonQtClassInfo* PythonQtPrivate::currentClassInfoForClassWrapperCreation()
1199 1244 {
1200 1245 PythonQtClassInfo* info = _currentClassInfoForClassWrapperCreation;
1201 1246 _currentClassInfoForClassWrapperCreation = NULL;
1202 1247 return info;
1203 1248 }
1204 1249
1205 1250 void PythonQtPrivate::addDecorators(QObject* o, int decoTypes)
1206 1251 {
1207 1252 o->setParent(this);
1208 1253 int numMethods = o->metaObject()->methodCount();
1209 1254 for (int i = 0; i < numMethods; i++) {
1210 1255 QMetaMethod m = o->metaObject()->method(i);
1211 1256 if ((m.methodType() == QMetaMethod::Method ||
1212 1257 m.methodType() == QMetaMethod::Slot) && m.access() == QMetaMethod::Public) {
1213 1258 // QMetaMethod::signature changed to QMetaMethod::methodSignature in QT5
1214 1259 #if( QT_VERSION >= QT_VERSION_CHECK(5,0,0) )
1215 1260 QByteArray signature = m.methodSignature();
1216 1261 #else
1217 1262 QByteArray signature = m.signature();
1218 1263 #endif
1219 1264 if (signature.startsWith("new_")) {
1220 1265 if ((decoTypes & ConstructorDecorator) == 0) continue;
1221 1266 const PythonQtMethodInfo* info = PythonQtMethodInfo::getCachedMethodInfo(m, NULL);
1222 1267 if (info->parameters().at(0).pointerCount == 1) {
1223 1268 QByteArray nameOfClass = signature.mid(4, signature.indexOf('(')-4);
1224 1269 PythonQtClassInfo* classInfo = lookupClassInfoAndCreateIfNotPresent(nameOfClass);
1225 1270 PythonQtSlotInfo* newSlot = new PythonQtSlotInfo(NULL, m, i, o, PythonQtSlotInfo::ClassDecorator);
1226 1271 classInfo->addConstructor(newSlot);
1227 1272 }
1228 1273 } else if (signature.startsWith("delete_")) {
1229 1274 if ((decoTypes & DestructorDecorator) == 0) continue;
1230 1275 QByteArray nameOfClass = signature.mid(7, signature.indexOf('(')-7);
1231 1276 PythonQtClassInfo* classInfo = lookupClassInfoAndCreateIfNotPresent(nameOfClass);
1232 1277 PythonQtSlotInfo* newSlot = new PythonQtSlotInfo(NULL, m, i, o, PythonQtSlotInfo::ClassDecorator);
1233 1278 classInfo->setDestructor(newSlot);
1234 1279 } else if (signature.startsWith("static_")) {
1235 1280 if ((decoTypes & StaticDecorator) == 0) continue;
1236 1281 QByteArray nameOfClass = signature.mid(7);
1237 1282 nameOfClass = nameOfClass.mid(0, nameOfClass.indexOf('_'));
1238 1283 PythonQtClassInfo* classInfo = lookupClassInfoAndCreateIfNotPresent(nameOfClass);
1239 1284 PythonQtSlotInfo* newSlot = new PythonQtSlotInfo(NULL, m, i, o, PythonQtSlotInfo::ClassDecorator);
1240 1285 classInfo->addDecoratorSlot(newSlot);
1241 1286 } else {
1242 1287 if ((decoTypes & InstanceDecorator) == 0) continue;
1243 1288 const PythonQtMethodInfo* info = PythonQtMethodInfo::getCachedMethodInfo(m, NULL);
1244 1289 if (info->parameters().count()>1) {
1245 1290 PythonQtMethodInfo::ParameterInfo p = info->parameters().at(1);
1246 1291 if (p.pointerCount==1) {
1247 1292 PythonQtClassInfo* classInfo = lookupClassInfoAndCreateIfNotPresent(p.name);
1248 1293 PythonQtSlotInfo* newSlot = new PythonQtSlotInfo(NULL, m, i, o, PythonQtSlotInfo::InstanceDecorator);
1249 1294 classInfo->addDecoratorSlot(newSlot);
1250 1295 }
1251 1296 }
1252 1297 }
1253 1298 }
1254 1299 }
1255 1300 }
1256 1301
1257 1302 void PythonQtPrivate::registerQObjectClassNames(const QStringList& names)
1258 1303 {
1259 1304 Q_FOREACH(QString name, names) {
1260 1305 _knownQObjectClassNames.insert(name.toLatin1(), true);
1261 1306 }
1262 1307 }
1263 1308
1264 1309 void PythonQtPrivate::removeSignalEmitter(QObject* obj)
1265 1310 {
1266 1311 _signalReceivers.remove(obj);
1267 1312 }
1268 1313
1269 1314 namespace
1270 1315 {
1271 1316 //! adapted from python source file "pythonrun.c", function "handle_system_exit"
1272 1317 //! return the exitcode instead of calling "Py_Exit".
1273 1318 //! it gives the application an opportunity to properly terminate.
1274 1319 int custom_system_exit_exception_handler()
1275 1320 {
1276 1321 PyObject *exception, *value, *tb;
1277 1322 int exitcode = 0;
1278 1323
1279 1324 // if (Py_InspectFlag)
1280 1325 // /* Don't exit if -i flag was given. This flag is set to 0
1281 1326 // * when entering interactive mode for inspecting. */
1282 1327 // return exitcode;
1283 1328
1284 1329 PyErr_Fetch(&exception, &value, &tb);
1330 #ifdef PY3K
1331 std::cout << std::endl;
1332 #else
1285 1333 if (Py_FlushLine())
1286 1334 PyErr_Clear();
1335 #endif
1287 1336 fflush(stdout);
1288 1337 if (value == NULL || value == Py_None)
1289 1338 goto done;
1290 1339 if (PyExceptionInstance_Check(value)) {
1291 1340 /* The error code should be in the `code' attribute. */
1292 1341 PyObject *code = PyObject_GetAttrString(value, "code");
1293 1342 if (code) {
1294 1343 Py_DECREF(value);
1295 1344 value = code;
1296 1345 if (value == Py_None)
1297 1346 goto done;
1298 1347 }
1299 1348 /* If we failed to dig out the 'code' attribute,
1300 1349 just let the else clause below print the error. */
1301 1350 }
1351 #ifdef PY3K
1352 if (PyLong_Check(value))
1353 exitcode = (int)PyLong_AsLong(value);
1354 #else
1302 1355 if (PyInt_Check(value))
1303 1356 exitcode = (int)PyInt_AsLong(value);
1357 #endif
1304 1358 else {
1305 1359 PyObject *sys_stderr = PySys_GetObject(const_cast<char*>("stderr"));
1306 1360 if (sys_stderr != NULL && sys_stderr != Py_None) {
1307 1361 PyFile_WriteObject(value, sys_stderr, Py_PRINT_RAW);
1308 1362 } else {
1309 1363 PyObject_Print(value, stderr, Py_PRINT_RAW);
1310 1364 fflush(stderr);
1311 1365 }
1312 1366 PySys_WriteStderr("\n");
1313 1367 exitcode = 1;
1314 1368 }
1315 1369 done:
1316 1370 /* Restore and clear the exception info, in order to properly decref
1317 1371 * the exception, value, and traceback. If we just exit instead,
1318 1372 * these leak, which confuses PYTHONDUMPREFS output, and may prevent
1319 1373 * some finalizers from running.
1320 1374 */
1321 1375 PyErr_Restore(exception, value, tb);
1322 1376 PyErr_Clear();
1323 1377 return exitcode;
1324 1378 //Py_Exit(exitcode);
1325 1379 }
1326 1380 }
1327 1381
1328 1382 bool PythonQt::handleError()
1329 1383 {
1330 1384 bool flag = false;
1331 1385 if (PyErr_Occurred()) {
1332 1386
1333 1387 if (_p->_systemExitExceptionHandlerEnabled &&
1334 1388 PyErr_ExceptionMatches(PyExc_SystemExit)) {
1335 1389 int exitcode = custom_system_exit_exception_handler();
1336 1390 Q_EMIT PythonQt::self()->systemExitExceptionRaised(exitcode);
1337 1391 }
1338 1392 else
1339 1393 {
1340 1394 // currently we just print the error and the stderr handler parses the errors
1341 1395 PyErr_Print();
1342 1396
1343 1397 /*
1344 1398 // EXTRA: the format of the ptype and ptraceback is not really documented, so I use PyErr_Print() above
1345 1399 PyObject *ptype;
1346 1400 PyObject *pvalue;
1347 1401 PyObject *ptraceback;
1348 1402 PyErr_Fetch( &ptype, &pvalue, &ptraceback);
1349 1403
1350 1404 Py_XDECREF(ptype);
1351 1405 Py_XDECREF(pvalue);
1352 1406 Py_XDECREF(ptraceback);
1353 1407 */
1354 1408 PyErr_Clear();
1355 1409 }
1356 1410 flag = true;
1357 1411 }
1358 1412 _p->_hadError = flag;
1359 1413 return flag;
1360 1414 }
1361 1415
1362 1416 bool PythonQt::hadError()const
1363 1417 {
1364 1418 return _p->_hadError;
1365 1419 }
1366 1420
1367 1421 void PythonQt::clearError()
1368 1422 {
1369 1423 _p->_hadError = false;
1370 1424 }
1371 1425
1372 1426 void PythonQt::setSystemExitExceptionHandlerEnabled(bool value)
1373 1427 {
1374 1428 _p->_systemExitExceptionHandlerEnabled = value;
1375 1429 }
1376 1430
1377 1431 bool PythonQt::systemExitExceptionHandlerEnabled() const
1378 1432 {
1379 1433 return _p->_systemExitExceptionHandlerEnabled;
1380 1434 }
1381 1435
1382 1436 void PythonQt::addSysPath(const QString& path)
1383 1437 {
1384 1438 PythonQtObjectPtr sys;
1385 1439 sys.setNewRef(PyImport_ImportModule("sys"));
1386 1440 PythonQtObjectPtr obj = lookupObject(sys, "path");
1387 1441 PyList_Insert(obj, 0, PythonQtConv::QStringToPyObject(path));
1388 1442 }
1389 1443
1390 1444 void PythonQt::overwriteSysPath(const QStringList& paths)
1391 1445 {
1392 1446 PythonQtObjectPtr sys;
1393 1447 sys.setNewRef(PyImport_ImportModule("sys"));
1394 1448 PyModule_AddObject(sys, "path", PythonQtConv::QStringListToPyList(paths));
1395 1449 }
1396 1450
1397 1451 void PythonQt::setModuleImportPath(PyObject* module, const QStringList& paths)
1398 1452 {
1399 1453 PyModule_AddObject(module, "__path__", PythonQtConv::QStringListToPyList(paths));
1400 1454 }
1401 1455
1402 1456 void PythonQt::stdOutRedirectCB(const QString& str)
1403 1457 {
1404 1458 if (!PythonQt::self()) {
1405 1459 std::cout << str.toLatin1().data() << std::endl;
1406 1460 return;
1407 1461 }
1408 1462 Q_EMIT PythonQt::self()->pythonStdOut(str);
1409 1463 }
1410 1464
1411 1465 void PythonQt::stdErrRedirectCB(const QString& str)
1412 1466 {
1413 1467 if (!PythonQt::self()) {
1414 1468 std::cerr << str.toLatin1().data() << std::endl;
1415 1469 return;
1416 1470 }
1417 1471 Q_EMIT PythonQt::self()->pythonStdErr(str);
1418 1472 }
1419 1473
1420 1474 void PythonQt::setQObjectWrappedCallback(PythonQtQObjectWrappedCB* cb)
1421 1475 {
1422 1476 _p->_wrappedCB = cb;
1423 1477 }
1424 1478
1425 1479 void PythonQt::setQObjectNoLongerWrappedCallback(PythonQtQObjectNoLongerWrappedCB* cb)
1426 1480 {
1427 1481 _p->_noLongerWrappedCB = cb;
1428 1482 }
1429 1483
1430 1484 void PythonQt::setProfilingCallback(ProfilingCB* cb)
1431 1485 {
1432 1486 _p->_profilingCB = cb;
1433 1487 }
1434 1488
1435 1489
1436 1490 static PyMethodDef PythonQtMethods[] = {
1437 1491 {NULL, NULL, 0, NULL}
1438 1492 };
1439 1493
1494 #ifdef PY3K
1495 static PyModuleDef PythonQtModule = {
1496 PyModuleDef_HEAD_INIT,
1497 "",
1498 NULL,
1499 -1,
1500 PythonQtMethods,
1501 NULL,
1502 NULL,
1503 NULL,
1504 NULL
1505 };
1506 #endif
1507
1440 1508 void PythonQt::initPythonQtModule(bool redirectStdOut, const QByteArray& pythonQtModuleName)
1441 1509 {
1442 1510 QByteArray name = "PythonQt";
1443 1511 if (!pythonQtModuleName.isEmpty()) {
1444 1512 name = pythonQtModuleName;
1445 1513 }
1514 #ifdef PY3K
1515 PythonQtModule.m_name = name.constData();
1516 _p->_pythonQtModule = PyModule_Create(&PythonQtModule);
1517 #else
1446 1518 _p->_pythonQtModule = Py_InitModule(name.constData(), PythonQtMethods);
1519 #endif
1447 1520 _p->_pythonQtModuleName = name;
1448 1521
1449 1522 if (redirectStdOut) {
1450 1523 PythonQtObjectPtr sys;
1451 1524 PythonQtObjectPtr out;
1452 1525 PythonQtObjectPtr err;
1453 1526 sys.setNewRef(PyImport_ImportModule("sys"));
1454 1527 // create a redirection object for stdout and stderr
1455 1528 out = PythonQtStdOutRedirectType.tp_new(&PythonQtStdOutRedirectType,NULL, NULL);
1456 1529 ((PythonQtStdOutRedirect*)out.object())->_cb = stdOutRedirectCB;
1457 1530 err = PythonQtStdOutRedirectType.tp_new(&PythonQtStdOutRedirectType,NULL, NULL);
1458 1531 ((PythonQtStdOutRedirect*)err.object())->_cb = stdErrRedirectCB;
1459 1532 // replace the built in file objects with our own objects
1460 1533 PyModule_AddObject(sys, "stdout", out);
1461 1534 PyModule_AddObject(sys, "stderr", err);
1462 1535 }
1463 1536
1464 1537 // add PythonQt to the list of builtin module names
1465 1538 PythonQtObjectPtr sys;
1466 1539 sys.setNewRef(PyImport_ImportModule("sys"));
1467 1540 PyObject *old_module_names = PyObject_GetAttrString(sys.object(),"builtin_module_names");
1468 1541 Py_ssize_t old_size = PyTuple_Size(old_module_names);
1469 1542 PyObject *module_names = PyTuple_New(old_size+1);
1470 1543 for(Py_ssize_t i = 0; i < old_size; i++)
1471 1544 PyTuple_SetItem(module_names, i, PyTuple_GetItem(old_module_names, i));
1545 #ifdef PY3K
1546 PyTuple_SetItem(module_names, old_size, PyUnicode_FromString(name.constData()));
1547 #else
1472 1548 PyTuple_SetItem(module_names, old_size, PyString_FromString(name.constData()));
1549 #endif
1473 1550 PyModule_AddObject(sys.object(),"builtin_module_names",module_names);
1474 1551 Py_DecRef(old_module_names);
1475 1552 }
1476 1553
1477 1554 QString PythonQt::getReturnTypeOfWrappedMethod(PyObject* module, const QString& name)
1478 1555 {
1479 1556 QStringList tmp = name.split(".");
1480 1557 QString methodName = tmp.takeLast();
1481 1558 QString variableName = tmp.join(".");
1482 1559 // TODO: the variableName may be a type name, this needs to be handled differently,
1483 1560 // because it is not necessarily known in the module context
1484 1561 PythonQtObjectPtr variableObject = lookupObject(module, variableName);
1485 1562 if (variableObject.isNull()) {
1486 1563 return "";
1487 1564 }
1488 1565
1489 1566 return getReturnTypeOfWrappedMethodHelper(variableObject, methodName, name);
1490 1567 }
1491 1568
1492 1569 QString PythonQt::getReturnTypeOfWrappedMethod(const QString& typeName, const QString& methodName)
1493 1570 {
1494 1571 PythonQtObjectPtr typeObject = getObjectByType(typeName);
1495 1572 if (typeObject.isNull()) {
1496 1573 return "";
1497 1574 }
1498 1575 return getReturnTypeOfWrappedMethodHelper(typeObject, methodName, typeName + "." + methodName);
1499 1576 }
1500 1577
1501 1578 QString PythonQt::getReturnTypeOfWrappedMethodHelper(const PythonQtObjectPtr& variableObject, const QString& methodName, const QString& context)
1502 1579 {
1503 1580 PythonQtObjectPtr methodObject;
1504 1581 if (PyDict_Check(variableObject)) {
1505 1582 methodObject = PyDict_GetItemString(variableObject, methodName.toLatin1().constData());
1506 1583 } else {
1507 1584 methodObject.setNewRef(PyObject_GetAttrString(variableObject, methodName.toLatin1().constData()));
1508 1585 }
1509 1586 if (methodObject.isNull()) {
1510 1587 return "";
1511 1588 }
1512 1589
1513 1590 QString type;
1514 1591
1592 #ifdef PY3K
1593 if (PyType_Check(methodObject)) {
1594 #else
1515 1595 if (methodObject->ob_type == &PyClass_Type || methodObject->ob_type == &PyType_Type) {
1596 #endif
1516 1597 // the methodObject is not a method, but the name of a type/class. This means
1517 1598 // a constructor is called. Return the context.
1518 1599 type = context;
1519 1600 } else if (methodObject->ob_type == &PythonQtSlotFunction_Type) {
1520 1601 QString className;
1521 1602
1522 1603 if (PyObject_TypeCheck(variableObject, &PythonQtInstanceWrapper_Type)) {
1523 1604 // the type name of wrapped instance is the class name
1524 1605 className = variableObject->ob_type->tp_name;
1525 1606 } else {
1526 1607 PyObject* classNameObject = PyObject_GetAttrString(variableObject, "__name__");
1527 1608 if (classNameObject) {
1609 #ifdef PY3K
1610 Q_ASSERT(PyUnicode_Check(classNameObject));
1611 className = PyUnicode_AsUTF8(classNameObject);
1612 #else
1528 1613 Q_ASSERT(PyString_Check(classNameObject));
1529 1614 className = PyString_AsString(classNameObject);
1615 #endif
1530 1616 Py_DECREF(classNameObject);
1531 1617 }
1532 1618 }
1533 1619
1534 1620 if (!className.isEmpty()) {
1535 1621 PythonQtClassInfo* info = _p->_knownClassInfos.value(className.toLatin1().constData());
1536 1622 if (info) {
1537 1623 PythonQtSlotInfo* slotInfo = info->member(methodName.toLatin1().constData())._slot;
1538 1624 if (slotInfo) {
1539 1625 if (slotInfo->metaMethod()) {
1540 1626 type = slotInfo->metaMethod()->typeName();
1541 1627 if (!type.isEmpty()) {
1542 1628 QChar c = type.at(type.length()-1);
1543 1629 while (c == '*' || c == '&') {
1544 1630 type.truncate(type.length()-1);
1545 1631 if (!type.isEmpty()) {
1546 1632 c = type.at(type.length()-1);
1547 1633 } else {
1548 1634 break;
1549 1635 }
1550 1636 }
1551 1637 // split away template arguments
1552 1638 type = type.split("<").first();
1553 1639 // split away const
1554 1640 type = type.split(" ").last().trimmed();
1555 1641
1556 1642 // if the type is a known class info, then create the full type name, i.e. include the
1557 1643 // module name. For example, the slot may return a QDate, then this looks up the
1558 1644 // name _PythonQt.QtCore.QDate.
1559 1645 PythonQtClassInfo* typeInfo = _p->_knownClassInfos.value(type.toLatin1().constData());
1560 1646 if (typeInfo && typeInfo->pythonQtClassWrapper()) {
1561 1647 PyObject* s = PyObject_GetAttrString(typeInfo->pythonQtClassWrapper(), "__module__");
1648 #ifdef PY3K
1649 Q_ASSERT(PyUnicode_Check(s));
1650 type = QString(PyUnicode_AsUTF8(s));
1651 #else
1562 1652 Q_ASSERT(PyString_Check(s));
1563 1653 type = QString(PyString_AsString(s)) + "." + type;
1654 #endif
1564 1655 Py_DECREF(s);
1565 1656 s = PyObject_GetAttrString(typeInfo->pythonQtClassWrapper(), "__name__");
1657 #ifdef PY3K
1658 Q_ASSERT(PyUnicode_Check(s));
1659 #else
1566 1660 Q_ASSERT(PyString_Check(s));
1661 #endif
1567 1662 Py_DECREF(s);
1568 1663 }
1569 1664 }
1570 1665 }
1571 1666 }
1572 1667 }
1573 1668 }
1574 1669 }
1575 1670 return type;
1576 1671 }
1577 1672
1578 1673 void PythonQt::registerCPPClass(const char* typeName, const char* parentTypeName, const char* package, PythonQtQObjectCreatorFunctionCB* wrapperCreator, PythonQtShellSetInstanceWrapperCB* shell)
1579 1674 {
1580 1675 _p->registerCPPClass(typeName, parentTypeName, package, wrapperCreator, shell);
1581 1676 }
1582 1677
1583 1678
1584 1679 PythonQtClassInfo* PythonQtPrivate::lookupClassInfoAndCreateIfNotPresent(const char* typeName)
1585 1680 {
1586 1681 PythonQtClassInfo* info = _knownClassInfos.value(typeName);
1587 1682 if (!info) {
1588 1683 info = new PythonQtClassInfo();
1589 1684 info->setupCPPObject(typeName);
1590 1685 _knownClassInfos.insert(typeName, info);
1591 1686 }
1592 1687 return info;
1593 1688 }
1594 1689
1595 1690 void PythonQt::addPolymorphicHandler(const char* typeName, PythonQtPolymorphicHandlerCB* cb)
1596 1691 {
1597 1692 _p->addPolymorphicHandler(typeName, cb);
1598 1693 }
1599 1694
1600 1695 void PythonQtPrivate::addPolymorphicHandler(const char* typeName, PythonQtPolymorphicHandlerCB* cb)
1601 1696 {
1602 1697 PythonQtClassInfo* info = lookupClassInfoAndCreateIfNotPresent(typeName);
1603 1698 info->addPolymorphicHandler(cb);
1604 1699 }
1605 1700
1606 1701 bool PythonQt::addParentClass(const char* typeName, const char* parentTypeName, int upcastingOffset)
1607 1702 {
1608 1703 return _p->addParentClass(typeName, parentTypeName, upcastingOffset);
1609 1704 }
1610 1705
1611 1706 bool PythonQtPrivate::addParentClass(const char* typeName, const char* parentTypeName, int upcastingOffset)
1612 1707 {
1613 1708 PythonQtClassInfo* info = _knownClassInfos.value(typeName);
1614 1709 if (info) {
1615 1710 PythonQtClassInfo* parentInfo = lookupClassInfoAndCreateIfNotPresent(parentTypeName);
1616 1711 info->addParentClass(PythonQtClassInfo::ParentClassInfo(parentInfo, upcastingOffset));
1617 1712 return true;
1618 1713 } else {
1619 1714 return false;
1620 1715 }
1621 1716 }
1622 1717
1623 1718 void PythonQtPrivate::registerCPPClass(const char* typeName, const char* parentTypeName, const char* package, PythonQtQObjectCreatorFunctionCB* wrapperCreator, PythonQtShellSetInstanceWrapperCB* shell, PyObject* module, int typeSlots)
1624 1719 {
1625 1720 PythonQtClassInfo* info = lookupClassInfoAndCreateIfNotPresent(typeName);
1626 1721 if (!info->pythonQtClassWrapper()) {
1627 1722 info->setTypeSlots(typeSlots);
1628 1723 info->setupCPPObject(typeName);
1629 1724 createPythonQtClassWrapper(info, package, module);
1630 1725 }
1631 1726 if (parentTypeName && strcmp(parentTypeName,"")!=0) {
1632 1727 addParentClass(typeName, parentTypeName, 0);
1633 1728 }
1634 1729 if (wrapperCreator) {
1635 1730 info->setDecoratorProvider(wrapperCreator);
1636 1731 }
1637 1732 if (shell) {
1638 1733 info->setShellSetInstanceWrapperCB(shell);
1639 1734 }
1640 1735 }
1641 1736
1642 1737 PyObject* PythonQtPrivate::packageByName(const char* name)
1643 1738 {
1644 1739 if (name==NULL || name[0]==0) {
1645 1740 name = "private";
1646 1741 }
1647 1742 PyObject* v = _packages.value(name);
1648 1743 if (!v) {
1649 1744 v = PyImport_AddModule((_pythonQtModuleName + "." + name).constData());
1650 1745 _packages.insert(name, v);
1651 1746 // AddObject steals the reference, so increment it!
1652 1747 Py_INCREF(v);
1653 1748 PyModule_AddObject(_pythonQtModule, name, v);
1654 1749 }
1655 1750 return v;
1656 1751 }
1657 1752
1658 1753 void PythonQtPrivate::handleVirtualOverloadReturnError(const char* signature, const PythonQtMethodInfo* methodInfo, PyObject* result)
1659 1754 {
1660 1755 QString error = "Return value '" + PythonQtConv::PyObjGetString(result) + "' can not be converted to expected C++ type '" + methodInfo->parameters().at(0).name + "' as return value of virtual method " + signature;
1661 1756 PyErr_SetString(PyExc_AttributeError, error.toLatin1().data());
1662 1757 PythonQt::self()->handleError();
1663 1758 }
1664 1759
1665 1760 PyObject* PythonQt::helpCalled(PythonQtClassInfo* info)
1666 1761 {
1667 1762 if (_p->_initFlags & ExternalHelp) {
1668 1763 Q_EMIT pythonHelpRequest(QByteArray(info->className()));
1669 1764 return Py_BuildValue("");
1670 1765 } else {
1766 #ifdef PY3K
1767 return PyUnicode_FromString(info->help().toLatin1().data());
1768 #else
1671 1769 return PyString_FromString(info->help().toLatin1().data());
1770 #endif
1672 1771 }
1673 1772 }
1674 1773
1675 1774 void PythonQt::clearNotFoundCachedMembers()
1676 1775 {
1677 1776 Q_FOREACH(PythonQtClassInfo* info, _p->_knownClassInfos) {
1678 1777 info->clearNotFoundCachedMembers();
1679 1778 }
1680 1779 }
1681 1780
1682 1781 void PythonQt::removeWrapperFactory( PythonQtCppWrapperFactory* factory )
1683 1782 {
1684 1783 _p->_cppWrapperFactories.removeAll(factory);
1685 1784 }
1686 1785
1687 1786 void PythonQt::removeWrapperFactory( PythonQtForeignWrapperFactory* factory )
1688 1787 {
1689 1788 _p->_foreignWrapperFactories.removeAll(factory);
1690 1789 }
1691 1790
1692 1791 void PythonQtPrivate::removeWrapperPointer(void* obj)
1693 1792 {
1694 1793 _wrappedObjects.remove(obj);
1695 1794 }
1696 1795
1697 1796 void PythonQtPrivate::addWrapperPointer(void* obj, PythonQtInstanceWrapper* wrapper)
1698 1797 {
1699 1798 _wrappedObjects.insert(obj, wrapper);
1700 1799 }
1701 1800
1702 1801 PythonQtInstanceWrapper* PythonQtPrivate::findWrapperAndRemoveUnused(void* obj)
1703 1802 {
1704 1803 PythonQtInstanceWrapper* wrap = _wrappedObjects.value(obj);
1705 1804 if (wrap && !wrap->_wrappedPtr && wrap->_obj == NULL) {
1706 1805 // this is a wrapper whose QObject was already removed due to destruction
1707 1806 // so the obj pointer has to be a new QObject with the same address...
1708 1807 // we remove the old one and set the copy to NULL
1709 1808 wrap->_objPointerCopy = NULL;
1710 1809 removeWrapperPointer(obj);
1711 1810 wrap = NULL;
1712 1811 }
1713 1812 return wrap;
1714 1813 }
1715 1814
1716 1815 PythonQtObjectPtr PythonQtPrivate::createModule(const QString& name, PyObject* pycode)
1717 1816 {
1718 1817 PythonQtObjectPtr result;
1719 1818 PythonQt::self()->clearError();
1720 1819 if (pycode) {
1721 1820 result.setNewRef(PyImport_ExecCodeModule((char*)name.toLatin1().data(), pycode));
1722 1821 } else {
1723 1822 PythonQt::self()->handleError();
1724 1823 }
1725 1824 return result;
1726 1825 }
1727 1826
1728 1827 void* PythonQtPrivate::unwrapForeignWrapper( const QByteArray& classname, PyObject* obj )
1729 1828 {
1730 1829 void* foreignObject = NULL;
1731 1830 for (int i=0; i<_foreignWrapperFactories.size(); i++) {
1732 1831 foreignObject = _foreignWrapperFactories.at(i)->unwrap(classname, obj);
1733 1832 if (foreignObject) {
1734 1833 return foreignObject;
1735 1834 }
1736 1835 }
1737 1836 return NULL;
1738 1837 }
1739 1838
1740 1839 bool PythonQtPrivate::isMethodDescriptor(PyObject* object) const
1741 1840 {
1742 1841 // This implementation is the same as in inspect.ismethoddescriptor(), inspect.py.
1743 1842 if (PyObject_HasAttrString(object, "__get__") &&
1744 1843 !PyObject_HasAttrString(object, "__set__") &&
1745 1844 !PyMethod_Check(object) &&
1746 !PyFunction_Check(object) &&
1747 !PyClass_Check(object)) {
1845 !PyFunction_Check(object)
1846 #ifndef PY3K
1847 && !PyClass_Check(object)
1848 #endif
1849 ) {
1748 1850 return true;
1749 1851 }
1750 1852 return false;
1751 1853 }
1752 1854
1753 1855 QString PythonQtPrivate::getSignature(PyObject* object)
1754 1856 {
1755 1857 QString signature;
1756 1858
1757 1859 if (object) {
1758 1860 PyMethodObject* method = NULL;
1759 1861 PyFunctionObject* func = NULL;
1760 1862
1761 1863 bool decrefMethod = false;
1762 1864
1865 #ifdef PY3K
1866 if (PyType_Check(object)) {
1867 #else
1763 1868 if (object->ob_type == &PyClass_Type || object->ob_type == &PyType_Type) {
1869 #endif
1764 1870 method = (PyMethodObject*)PyObject_GetAttrString(object, "__init__");
1765 1871 decrefMethod = true;
1766 1872 } else if (object->ob_type == &PyFunction_Type) {
1767 1873 func = (PyFunctionObject*)object;
1768 1874 } else if (object->ob_type == &PyMethod_Type) {
1769 1875 method = (PyMethodObject*)object;
1770 1876 }
1771 1877 if (method) {
1772 1878 if (PyFunction_Check(method->im_func)) {
1773 1879 func = (PyFunctionObject*)method->im_func;
1774 1880 } else if (isMethodDescriptor((PyObject*)method)) {
1775 1881 QString docstr;
1776 1882 PyObject* doc = PyObject_GetAttrString(object, "__doc__");
1777 1883 if (doc) {
1884 #ifdef PY3K
1885 docstr = PyUnicode_AsUTF8(doc);
1886 #else
1778 1887 docstr = PyString_AsString(doc);
1888 #endif
1779 1889 Py_DECREF(doc);
1780 1890 }
1781 1891
1782 1892 PyObject* s = PyObject_GetAttrString(object, "__name__");
1783 1893 if (s) {
1894 #ifdef PY3K
1895 Q_ASSERT(PyUnicode_Check(s));
1896 signature = PyUnicode_AsUTF8(s);
1897 #else
1784 1898 Q_ASSERT(PyString_Check(s));
1785 1899 signature = PyString_AsString(s);
1900 #endif
1786 1901 if (docstr.startsWith(signature + "(")) {
1787 1902 signature = docstr;
1788 1903 } else {
1789 1904 signature += "(...)";
1790 1905 if (!docstr.isEmpty()) {
1791 1906 signature += "\n\n" + docstr;
1792 1907 }
1793 1908 }
1794 1909 Py_DECREF(s);
1795 1910 }
1796 1911 }
1797 1912 }
1798 1913
1799 1914 if (func) {
1800 1915 QString funcName;
1801 1916 PyObject* s = PyObject_GetAttrString((PyObject*)func, "__name__");
1802 1917 if (s) {
1918 #ifdef PY3K
1919 Q_ASSERT(PyUnicode_Check(s));
1920 funcName = PyUnicode_AsUTF8(s);
1921 #else
1803 1922 Q_ASSERT(PyString_Check(s));
1804 1923 funcName = PyString_AsString(s);
1924 #endif
1805 1925 Py_DECREF(s);
1806 1926 }
1807 1927 if (method && funcName == "__init__") {
1808 1928 PyObject* s = PyObject_GetAttrString(object, "__name__");
1809 1929 if (s) {
1930 #ifdef PY3K
1931 Q_ASSERT(PyUnicode_Check(s));
1932 funcName = PyUnicode_AsUTF8(s);
1933 #else
1810 1934 Q_ASSERT(PyString_Check(s));
1811 1935 funcName = PyString_AsString(s);
1936 #endif
1812 1937 Py_DECREF(s);
1813 1938 }
1814 1939 }
1815 1940
1816 1941 QStringList arguments;
1817 1942 QStringList defaults;
1818 1943 QString varargs;
1819 1944 QString varkeywords;
1820 1945 // NOTE: This implementation is based on function getargs() in inspect.py.
1821 1946 // inspect.getargs() can handle anonymous (tuple) arguments, while this code does not.
1822 1947 // It can be implemented, but it may be rarely needed and not necessary.
1823 1948 PyCodeObject* code = (PyCodeObject*)func->func_code;
1824 1949 if (code->co_varnames) {
1825 1950 int nargs = code->co_argcount;
1826 1951 Q_ASSERT(PyTuple_Check(code->co_varnames));
1827 1952 for (int i=0; i<nargs; i++) {
1828 1953 PyObject* name = PyTuple_GetItem(code->co_varnames, i);
1954 #ifdef PY3K
1955 Q_ASSERT(PyUnicode_Check(name));
1956 arguments << PyUnicode_AsUTF8(name);
1957 #else
1829 1958 Q_ASSERT(PyString_Check(name));
1830 1959 arguments << PyString_AsString(name);
1960 #endif
1831 1961 }
1832 1962 if (code->co_flags & CO_VARARGS) {
1833 1963 PyObject* s = PyTuple_GetItem(code->co_varnames, nargs);
1964 #ifdef PY3K
1965 Q_ASSERT(PyUnicode_Check(s));
1966 varargs = PyUnicode_AsUTF8(s);
1967 #else
1834 1968 Q_ASSERT(PyString_Check(s));
1835 1969 varargs = PyString_AsString(s);
1970 #endif
1836 1971 nargs += 1;
1837 1972 }
1838 1973 if (code->co_flags & CO_VARKEYWORDS) {
1839 1974 PyObject* s = PyTuple_GetItem(code->co_varnames, nargs);
1975 #ifdef PY3K
1976 Q_ASSERT(PyUnicode_Check(s));
1977 varkeywords = PyUnicode_AsUTF8(s);
1978 #else
1840 1979 Q_ASSERT(PyString_Check(s));
1841 1980 varkeywords = PyString_AsString(s);
1981 #endif
1842 1982 }
1843 1983 }
1844 1984
1845 1985 PyObject* defaultsTuple = func->func_defaults;
1846 1986 if (defaultsTuple) {
1847 1987 Q_ASSERT(PyTuple_Check(defaultsTuple));
1848 1988 for (Py_ssize_t i=0; i<PyTuple_Size(defaultsTuple); i++) {
1849 1989 PyObject* d = PyTuple_GetItem(defaultsTuple, i);
1850 1990 PyObject* s = PyObject_Repr(d);
1991 #ifdef PY3K
1992 Q_ASSERT(PyUnicode_Check(s));
1993 defaults << PyUnicode_AsUTF8(s);
1994 #else
1851 1995 Q_ASSERT(PyString_Check(s));
1852 1996 defaults << PyString_AsString(s);
1997 #endif
1853 1998 Py_DECREF(s);
1854 1999 }
1855 2000 }
1856 2001
1857 2002 int firstdefault = arguments.size() - defaults.size();
1858 2003 for (int i=0; i<arguments.size(); i++) {
1859 2004 if (!signature.isEmpty()) { signature += ", "; }
1860 2005 if (!method || i>0 || arguments[i] != "self") {
1861 2006 signature += arguments[i];
1862 2007 if (i >= firstdefault) {
1863 2008 signature += "=" + defaults[i-firstdefault];
1864 2009 }
1865 2010 }
1866 2011 }
1867 2012 if (!varargs.isEmpty()) {
1868 2013 if (!signature.isEmpty()) { signature += ", "; }
1869 2014 signature += "*" + varargs;
1870 2015 }
1871 2016 if (!varkeywords.isEmpty()) {
1872 2017 if (!signature.isEmpty()) { signature += ", "; }
1873 2018 signature += "**" + varkeywords;
1874 2019 }
1875 2020 signature = funcName + "(" + signature + ")";
1876 2021 }
1877 2022
1878 2023 if (method && decrefMethod) {
1879 2024 Py_DECREF(method);
1880 2025 }
1881 2026 }
1882 2027
1883 2028 return signature;
1884 2029 }
1885 2030
1886 2031 void PythonQtPrivate::shellClassDeleted( void* shellClass )
1887 2032 {
1888 2033 PythonQtInstanceWrapper* wrap = _wrappedObjects.value(shellClass);
1889 2034 if (wrap && wrap->_wrappedPtr) {
1890 2035 // this is a pure C++ wrapper and the shell has gone, so we need
1891 2036 // to set the _wrappedPtr to NULL on the wrapper
1892 2037 wrap->_wrappedPtr = NULL;
1893 2038 // and then we remove the wrapper, since the wrapped class is gone
1894 2039 _wrappedObjects.remove(shellClass);
1895 2040 }
1896 2041 // if the wrapper is a QObject, we do not handle this here,
1897 2042 // it will be handled by the QPointer<> to the QObject, which becomes NULL
1898 2043 // via the QObject destructor.
1899 2044 }
1900 2045
1901 2046 PyObject* PythonQtPrivate::wrapMemoryAsBuffer( const void* data, Py_ssize_t size )
1902 2047 {
1903 // P3K port needed later on!
1904 return PyBuffer_FromMemory((void*)data, size);
2048 // P3K port needed later on! -- not anymore :D
2049 #ifdef PY3K
2050 return PyMemoryView_FromMemory((char*)data, size, PyBUF_READ);
2051 #else
2052 return PyBuffer_FromMemory((char*)data, size);
2053 #endif
1905 2054 }
1906 2055
1907 2056 PyObject* PythonQtPrivate::wrapMemoryAsBuffer( void* data, Py_ssize_t size )
1908 2057 {
1909 // P3K port needed later on!
1910 return PyBuffer_FromReadWriteMemory(data, size);
2058 // P3K port needed later on! -- not anymore :D
2059 #ifdef PY3K
2060 return PyMemoryView_FromMemory((char*)data, size, PyBUF_READ | PyBUF_WRITE);
2061 #else
2062 return PyBuffer_FromReadWriteMemory((char*)data, size);
2063 #endif
1911 2064 }
@@ -1,481 +1,504
1 1 /*
2 2 *
3 3 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
4 4 *
5 5 * This library is free software; you can redistribute it and/or
6 6 * modify it under the terms of the GNU Lesser General Public
7 7 * License as published by the Free Software Foundation; either
8 8 * version 2.1 of the License, or (at your option) any later version.
9 9 *
10 10 * This library is distributed in the hope that it will be useful,
11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 13 * Lesser General Public License for more details.
14 14 *
15 15 * Further, this software is distributed without any warranty that it is
16 16 * free of the rightful claim of any third person regarding infringement
17 17 * or the like. Any license provided herein, whether implied or
18 18 * otherwise, applies only to this software file. Patent licenses, if
19 19 * any, provided herein do not apply to combinations of this program with
20 20 * other software, or any other product whatsoever.
21 21 *
22 22 * You should have received a copy of the GNU Lesser General Public
23 23 * License along with this library; if not, write to the Free Software
24 24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 25 *
26 26 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
27 27 * 28359 Bremen, Germany or:
28 28 *
29 29 * http://www.mevis.de
30 30 *
31 31 */
32 32
33 33 //----------------------------------------------------------------------------------
34 34 /*!
35 35 // \file PythonQtClassWrapper.cpp
36 36 // \author Florian Link
37 37 // \author Last changed by $Author: florian $
38 38 // \date 2006-05
39 39 */
40 40 //----------------------------------------------------------------------------------
41 41
42 42 #include "PythonQtClassWrapper.h"
43 43 #include <QObject>
44 44
45 45 #include "PythonQt.h"
46 46 #include "PythonQtSlot.h"
47 47 #include "PythonQtSignal.h"
48 48 #include "PythonQtClassInfo.h"
49 49 #include "PythonQtConversion.h"
50 50 #include "PythonQtInstanceWrapper.h"
51 51
52 52 static PyObject* PythonQtInstanceWrapper_invert(PythonQtInstanceWrapper* wrapper)
53 53 {
54 54 PyObject* result = NULL;
55 55 static QByteArray memberName = "__invert__";
56 56 PythonQtMemberInfo opSlot = wrapper->classInfo()->member(memberName);
57 57 if (opSlot._type == PythonQtMemberInfo::Slot) {
58 58 result = PythonQtSlotFunction_CallImpl(wrapper->classInfo(), wrapper->_obj, opSlot._slot, NULL, NULL, wrapper->_wrappedPtr);
59 59 }
60 60 return result;
61 61 }
62 62
63 63 static int PythonQtInstanceWrapper_nonzero(PythonQtInstanceWrapper* wrapper)
64 64 {
65 65 int result = (wrapper->_wrappedPtr == NULL && wrapper->_obj == NULL)?0:1;
66 66 if (result) {
67 67 static QByteArray memberName = "__nonzero__";
68 68 PythonQtMemberInfo opSlot = wrapper->classInfo()->member(memberName);
69 69 if (opSlot._type == PythonQtMemberInfo::Slot) {
70 70 PyObject* resultObj = PythonQtSlotFunction_CallImpl(wrapper->classInfo(), wrapper->_obj, opSlot._slot, NULL, NULL, wrapper->_wrappedPtr);
71 71 if (resultObj == Py_False) {
72 72 result = 0;
73 73 }
74 74 Py_XDECREF(resultObj);
75 75 }
76 76 }
77 77 return result;
78 78 }
79 79
80 80
81 81 static PyObject* PythonQtInstanceWrapper_binaryfunc(PyObject* self, PyObject* other, const QByteArray& opName, const QByteArray& fallbackOpName = QByteArray())
82 82 {
83 83 // since we disabled type checking, we can receive any object as self, but we currently only support
84 84 // different objects on the right. Otherwise we would need to generate __radd__ etc. methods.
85 85 if (!PyObject_TypeCheck(self, &PythonQtInstanceWrapper_Type)) {
86 86 QString error = "Unsupported operation " + opName + "(" + self->ob_type->tp_name + ", " + other->ob_type->tp_name + ")";
87 87 PyErr_SetString(PyExc_ArithmeticError, error.toLatin1().data());
88 88 return NULL;
89 89 }
90 90 PythonQtInstanceWrapper* wrapper = (PythonQtInstanceWrapper*)self;
91 91 PyObject* result = NULL;
92 92 PythonQtMemberInfo opSlot = wrapper->classInfo()->member(opName);
93 93 if (opSlot._type == PythonQtMemberInfo::Slot) {
94 94 // TODO get rid of tuple
95 95 PyObject* args = PyTuple_New(1);
96 96 Py_INCREF(other);
97 97 PyTuple_SET_ITEM(args, 0, other);
98 98 result = PythonQtSlotFunction_CallImpl(wrapper->classInfo(), wrapper->_obj, opSlot._slot, args, NULL, wrapper->_wrappedPtr);
99 99 Py_DECREF(args);
100 100 if (!result && !fallbackOpName.isEmpty()) {
101 101 // try fallback if we did not get a result
102 102 result = PythonQtInstanceWrapper_binaryfunc(self, other, fallbackOpName);
103 103 }
104 104 }
105 105 return result;
106 106 }
107 107
108 108 #define BINARY_OP(NAME) \
109 109 static PyObject* PythonQtInstanceWrapper_ ## NAME(PyObject* self, PyObject* other) \
110 110 { \
111 111 static const QByteArray opName("__" #NAME "__"); \
112 112 return PythonQtInstanceWrapper_binaryfunc(self, other, opName); \
113 113 }
114 114
115 115 #define BINARY_OP_INPLACE(NAME) \
116 116 static PyObject* PythonQtInstanceWrapper_i ## NAME(PyObject* self, PyObject* other) \
117 117 { \
118 118 static const QByteArray opName("__i" #NAME "__"); \
119 119 static const QByteArray fallbackName("__" #NAME "__"); \
120 120 return PythonQtInstanceWrapper_binaryfunc(self, other, opName, fallbackName); \
121 121 }
122 122
123 123 BINARY_OP(add)
124 124 BINARY_OP(sub)
125 125 BINARY_OP(mul)
126 126 BINARY_OP(div)
127 127 BINARY_OP(and)
128 128 BINARY_OP(or)
129 129 BINARY_OP(xor)
130 130 BINARY_OP(mod)
131 131 BINARY_OP(lshift)
132 132 BINARY_OP(rshift)
133 133
134 134 BINARY_OP_INPLACE(add)
135 135 BINARY_OP_INPLACE(sub)
136 136 BINARY_OP_INPLACE(mul)
137 137 BINARY_OP_INPLACE(div)
138 138 BINARY_OP_INPLACE(and)
139 139 BINARY_OP_INPLACE(or)
140 140 BINARY_OP_INPLACE(xor)
141 141 BINARY_OP_INPLACE(mod)
142 142 BINARY_OP_INPLACE(lshift)
143 143 BINARY_OP_INPLACE(rshift)
144 144
145 145 static void initializeSlots(PythonQtClassWrapper* wrap)
146 146 {
147 147 int typeSlots = wrap->classInfo()->typeSlots();
148 148 if (typeSlots) {
149 149 if (typeSlots & PythonQt::Type_Add) {
150 150 wrap->_base.as_number.nb_add = (binaryfunc)PythonQtInstanceWrapper_add;
151 151 }
152 152 if (typeSlots & PythonQt::Type_Subtract) {
153 153 wrap->_base.as_number.nb_subtract = (binaryfunc)PythonQtInstanceWrapper_sub;
154 154 }
155 155 if (typeSlots & PythonQt::Type_Multiply) {
156 156 wrap->_base.as_number.nb_multiply = (binaryfunc)PythonQtInstanceWrapper_mul;
157 157 }
158 158 if (typeSlots & PythonQt::Type_Divide) {
159 #ifndef PY3K
159 160 wrap->_base.as_number.nb_divide = (binaryfunc)PythonQtInstanceWrapper_div;
161 #endif
160 162 wrap->_base.as_number.nb_true_divide = (binaryfunc)PythonQtInstanceWrapper_div;
161 163 }
162 164 if (typeSlots & PythonQt::Type_And) {
163 165 wrap->_base.as_number.nb_and = (binaryfunc)PythonQtInstanceWrapper_and;
164 166 }
165 167 if (typeSlots & PythonQt::Type_Or) {
166 168 wrap->_base.as_number.nb_or = (binaryfunc)PythonQtInstanceWrapper_or;
167 169 }
168 170 if (typeSlots & PythonQt::Type_Xor) {
169 171 wrap->_base.as_number.nb_xor = (binaryfunc)PythonQtInstanceWrapper_xor;
170 172 }
171 173 if (typeSlots & PythonQt::Type_Mod) {
172 174 wrap->_base.as_number.nb_remainder = (binaryfunc)PythonQtInstanceWrapper_mod;
173 175 }
174 176 if (typeSlots & PythonQt::Type_LShift) {
175 177 wrap->_base.as_number.nb_lshift = (binaryfunc)PythonQtInstanceWrapper_lshift;
176 178 }
177 179 if (typeSlots & PythonQt::Type_RShift) {
178 180 wrap->_base.as_number.nb_rshift = (binaryfunc)PythonQtInstanceWrapper_rshift;
179 181 }
180 182
181 183 if (typeSlots & PythonQt::Type_InplaceAdd) {
182 184 wrap->_base.as_number.nb_add = (binaryfunc)PythonQtInstanceWrapper_iadd;
183 185 }
184 186 if (typeSlots & PythonQt::Type_InplaceSubtract) {
185 187 wrap->_base.as_number.nb_subtract = (binaryfunc)PythonQtInstanceWrapper_isub;
186 188 }
187 189 if (typeSlots & PythonQt::Type_InplaceMultiply) {
188 190 wrap->_base.as_number.nb_multiply = (binaryfunc)PythonQtInstanceWrapper_imul;
189 191 }
190 192 if (typeSlots & PythonQt::Type_InplaceDivide) {
193 #ifndef PY3K
191 194 wrap->_base.as_number.nb_inplace_divide = (binaryfunc)PythonQtInstanceWrapper_idiv;
195 #endif
192 196 wrap->_base.as_number.nb_inplace_true_divide = (binaryfunc)PythonQtInstanceWrapper_idiv;
193 197 }
194 198 if (typeSlots & PythonQt::Type_InplaceAnd) {
195 199 wrap->_base.as_number.nb_inplace_and = (binaryfunc)PythonQtInstanceWrapper_iand;
196 200 }
197 201 if (typeSlots & PythonQt::Type_InplaceOr) {
198 202 wrap->_base.as_number.nb_inplace_or = (binaryfunc)PythonQtInstanceWrapper_ior;
199 203 }
200 204 if (typeSlots & PythonQt::Type_InplaceXor) {
201 205 wrap->_base.as_number.nb_inplace_xor = (binaryfunc)PythonQtInstanceWrapper_ixor;
202 206 }
203 207 if (typeSlots & PythonQt::Type_InplaceMod) {
204 208 wrap->_base.as_number.nb_inplace_remainder = (binaryfunc)PythonQtInstanceWrapper_imod;
205 209 }
206 210 if (typeSlots & PythonQt::Type_InplaceLShift) {
207 211 wrap->_base.as_number.nb_inplace_lshift = (binaryfunc)PythonQtInstanceWrapper_ilshift;
208 212 }
209 213 if (typeSlots & PythonQt::Type_InplaceRShift) {
210 214 wrap->_base.as_number.nb_inplace_rshift = (binaryfunc)PythonQtInstanceWrapper_irshift;
211 215 }
212 216 if (typeSlots & PythonQt::Type_Invert) {
213 217 wrap->_base.as_number.nb_invert = (unaryfunc)PythonQtInstanceWrapper_invert;
214 218 }
215 219 if (typeSlots & PythonQt::Type_NonZero) {
220 #ifdef PY3K
221 wrap->_base.as_number.nb_bool = (inquiry)PythonQtInstanceWrapper_nonzero;
222 #else
216 223 wrap->_base.as_number.nb_nonzero = (inquiry)PythonQtInstanceWrapper_nonzero;
224 #endif
217 225 }
218 226 }
219 227 }
220 228
221 229 static PyObject* PythonQtClassWrapper_alloc(PyTypeObject *self, Py_ssize_t nitems)
222 230 {
223 231 // call the default type alloc
224 232 PyObject* obj = PyType_Type.tp_alloc(self, nitems);
225 233
226 234 // take current class type, if we are called via newPythonQtClassWrapper()
227 235 PythonQtClassWrapper* wrap = (PythonQtClassWrapper*)obj;
228 236 wrap->_classInfo = PythonQt::priv()->currentClassInfoForClassWrapperCreation();
229 237 if (wrap->_classInfo) {
230 238 initializeSlots(wrap);
231 239 }
232 240
233 241 return obj;
234 242 }
235 243
236 244
237 245 static int PythonQtClassWrapper_init(PythonQtClassWrapper* self, PyObject* args, PyObject* kwds)
238 246 {
239 247 // call the default type init
240 248 if (PyType_Type.tp_init((PyObject *)self, args, kwds) < 0) {
241 249 return -1;
242 250 }
243 251
244 252 // if we have no CPP class information, try our base class
245 253 if (!self->classInfo()) {
246 254 PyTypeObject* superType = ((PyTypeObject *)self)->tp_base;
247 255
248 256 // recursively search for PythonQtClassWrapper superclass,
249 257 // this is needed for multiple levels of inheritance in python,
250 258 // e.g.
251 259 // class MyWidgetBase(QWidget):
252 260 // ...
253 261 // class MyWidget(MyWidgetBase):
254 262 // ...
255 while( superType && superType->ob_type != &PythonQtClassWrapper_Type )
263 while( superType && Py_TYPE(superType) != &PythonQtClassWrapper_Type )
256 264 superType = superType->tp_base;
257 265
258 if (!superType || (superType->ob_type != &PythonQtClassWrapper_Type)) {
266 if (!superType || (Py_TYPE(superType) != &PythonQtClassWrapper_Type)) {
259 267 PyErr_Format(PyExc_TypeError, "type %s is not derived from PythonQtClassWrapper", ((PyTypeObject*)self)->tp_name);
260 268 return -1;
261 269 }
262 270
263 271 // take the class info from the superType
264 272 self->_classInfo = ((PythonQtClassWrapper*)superType)->classInfo();
265 273 }
266 274
267 275 return 0;
268 276 }
269 277
270 278 static PyObject *PythonQtClassWrapper_classname(PythonQtClassWrapper* type)
271 279 {
280 #ifdef PY3K
281 return PyUnicode_FromString((QString("Class_") + type->classInfo()->className()).toLatin1().data());
282 #else
272 283 return PyString_FromString((QString("Class_") + type->classInfo()->className()).toLatin1().data());
284 #endif
273 285 }
274 286
275 287 static PyObject *PythonQtClassWrapper_help(PythonQtClassWrapper* type)
276 288 {
277 289 return PythonQt::self()->helpCalled(type->classInfo());
278 290 }
279 291
280 292 PyObject *PythonQtClassWrapper_delete(PythonQtClassWrapper *type, PyObject *args)
281 293 {
282 294 Q_UNUSED(type);
283 295
284 296 Py_ssize_t argc = PyTuple_Size(args);
285 297 if (argc>0) {
286 298 PyObject* self = PyTuple_GET_ITEM(args, 0);
287 299 if (PyObject_TypeCheck(self, &PythonQtInstanceWrapper_Type)) {
288 300 return PythonQtInstanceWrapper_delete((PythonQtInstanceWrapper*)self);
289 301 }
290 302 }
291 303 return NULL;
292 304 }
293 305
294 306 PyObject *PythonQtClassWrapper_inherits(PythonQtClassWrapper *type, PyObject *args)
295 307 {
296 308 Q_UNUSED(type);
297 309 PythonQtInstanceWrapper* wrapper = NULL;
298 310 char *name = NULL;
299 311 if (!PyArg_ParseTuple(args, "O!s:PythonQtClassWrapper.inherits",&PythonQtInstanceWrapper_Type, &wrapper, &name)) {
300 312 return NULL;
301 313 }
302 314 return PythonQtConv::GetPyBool(wrapper->classInfo()->inherits(name));
303 315 }
304 316
305 317
306 318 static PyMethodDef PythonQtClassWrapper_methods[] = {
307 319 {"className", (PyCFunction)PythonQtClassWrapper_classname, METH_NOARGS,
308 320 "Return the classname of the object"
309 321 },
310 322 {"inherits", (PyCFunction)PythonQtClassWrapper_inherits, METH_VARARGS,
311 323 "Returns if the class inherits or is of given type name"
312 324 },
313 325 {"help", (PyCFunction)PythonQtClassWrapper_help, METH_NOARGS,
314 326 "Shows the help of available methods for this class"
315 327 },
316 328 {"delete", (PyCFunction)PythonQtClassWrapper_delete, METH_VARARGS,
317 329 "Deletes the given C++ object"
318 330 },
319 331 {NULL, NULL, 0 , NULL} /* Sentinel */
320 332 };
321 333
322 334
323 335 static PyObject *PythonQtClassWrapper_getattro(PyObject *obj, PyObject *name)
324 336 {
325 337 const char *attributeName;
326 338 PythonQtClassWrapper *wrapper = (PythonQtClassWrapper *)obj;
327 339
340 #ifdef PY3K
341 if ((attributeName = PyUnicode_AsUTF8(name)) == NULL) {
342 #else
328 343 if ((attributeName = PyString_AsString(name)) == NULL) {
344 #endif
329 345 return NULL;
330 346 }
331 347 if (obj == (PyObject*)&PythonQtInstanceWrapper_Type) {
332 348 return NULL;
333 349 }
334 350
335 351 if (qstrcmp(attributeName, "__dict__")==0) {
336 352 PyObject* objectDict = ((PyTypeObject *)wrapper)->tp_dict;
337 353 if (!wrapper->classInfo()) {
338 354 Py_INCREF(objectDict);
339 355 return objectDict;
340 356 }
341 357 PyObject* dict = PyDict_New();
342 358
343 359 QStringList l = wrapper->classInfo()->memberList();
344 360 Q_FOREACH (QString name, l) {
345 361 PyObject* o = PyObject_GetAttrString(obj, name.toLatin1().data());
346 362 if (o) {
347 363 PyDict_SetItemString(dict, name.toLatin1().data(), o);
348 364 Py_DECREF(o);
349 365 } else {
350 366 // it must have been a property or child, which we do not know as a class object...
351 367 PyErr_Clear();
352 368 }
353 369 }
354 370 if (wrapper->classInfo()->constructors()) {
371 #ifdef PY3K
372 PyObject* initName = PyUnicode_FromString("__init__");
373 #else
355 374 PyObject* initName = PyString_FromString("__init__");
375 #endif
356 376 PyObject* func = PyType_Type.tp_getattro(obj, initName);
357 377 Py_DECREF(initName);
358 378 PyDict_SetItemString(dict, "__init__", func);
359 379 Py_DECREF(func);
360 380 }
361 381 for (int i = 0; PythonQtClassWrapper_methods[i].ml_name != NULL; i++) {
362 382 PyObject* func = PyCFunction_New(&PythonQtClassWrapper_methods[i], obj);
363 383 PyDict_SetItemString(dict, PythonQtClassWrapper_methods[i].ml_name, func);
364 384 Py_DECREF(func);
365 385 }
366 386
367 387 PyDict_Update(dict, objectDict);
368 388 return dict;
369 389 }
370 390
371 391 // look in Python to support derived Python classes
392 #ifdef PY3K
393 return PyObject_GenericGetAttr(obj, name);
394 #else
372 395 PyObject* superAttr = PyType_Type.tp_getattro(obj, name);
373 396 if (superAttr) {
374 397 return superAttr;
375 398 }
376 399 PyErr_Clear();
377 400
378 401 if (wrapper->classInfo()) {
379 402 PythonQtMemberInfo member = wrapper->classInfo()->member(attributeName);
380 403 if (member._type == PythonQtMemberInfo::EnumValue) {
381 404 PyObject* enumValue = member._enumValue;
382 405 Py_INCREF(enumValue);
383 406 return enumValue;
384 407 } else if (member._type == PythonQtMemberInfo::EnumWrapper) {
385 408 PyObject* enumWrapper = member._enumWrapper;
386 409 Py_INCREF(enumWrapper);
387 410 return enumWrapper;
388 411 } else if (member._type == PythonQtMemberInfo::Slot) {
389 412 // we return all slots, even the instance slots, since they are callable as unbound slots with self argument
390 413 return PythonQtSlotFunction_New(member._slot, obj, NULL);
391 414 } else if (member._type == PythonQtMemberInfo::Signal) {
392 415 // we return all signals, even the instance signals, since they are callable as unbound signals with self argument
393 416 return PythonQtSignalFunction_New(member._slot, obj, NULL);
394 417 }
395 418 }
396 419
397 420 // look for the internal methods (className(), help())
398 421 PyObject* internalMethod = Py_FindMethod( PythonQtClassWrapper_methods, obj, (char*)attributeName);
399 422 if (internalMethod) {
400 423 return internalMethod;
401 424 }
402 425
403 426 QString error = QString(wrapper->classInfo()->className()) + " has no attribute named '" + QString(attributeName) + "'";
404 427 PyErr_SetString(PyExc_AttributeError, error.toLatin1().data());
405 428 return NULL;
429 #endif
406 430 }
407 431
408 432 static int PythonQtClassWrapper_setattro(PyObject *obj,PyObject *name,PyObject *value)
409 433 {
410 434 return PyType_Type.tp_setattro(obj,name,value);
411 435 }
412 436
413 437 /*
414 438 static PyObject * PythonQtClassWrapper_repr(PyObject * obj)
415 439 {
416 440 PythonQtClassWrapper* wrapper = (PythonQtClassWrapper*)obj;
417 441 if (wrapper->classInfo()->isCPPWrapper()) {
418 442 const QMetaObject* meta = wrapper->classInfo()->metaObject();
419 443 if (!meta) {
420 444 QObject* decorator = wrapper->classInfo()->decorator();
421 445 if (decorator) {
422 446 meta = decorator->metaObject();
423 447 }
424 448 }
425 449 if (meta) {
426 450 return PyString_FromFormat("%s Class (C++ wrapped by %s)", wrapper->classInfo()->className(), meta->className());
427 451 } else {
428 452 return PyString_FromFormat("%s Class (C++ unwrapped)", wrapper->classInfo()->className());
429 453 }
430 454 } else {
431 455 return PyString_FromFormat("%s Class", wrapper->classInfo()->className());
432 456 }
433 457 }
434 458
435 459 */
436 460
437 461 PyTypeObject PythonQtClassWrapper_Type = {
438 PyObject_HEAD_INIT(NULL)
439 0, /*ob_size*/
462 PyVarObject_HEAD_INIT(NULL, 0)
440 463 "PythonQt.PythonQtClassWrapper", /*tp_name*/
441 464 sizeof(PythonQtClassWrapper), /*tp_basicsize*/
442 465 0, /*tp_itemsize*/
443 466 0, /*tp_dealloc*/
444 467 0, /*tp_print*/
445 468 0, /*tp_getattr*/
446 469 0, /*tp_setattr*/
447 470 0, /*tp_compare*/
448 471 0, //PythonQtClassWrapper_repr, /*tp_repr*/
449 472 0, /*tp_as_number*/
450 473 0, /*tp_as_sequence*/
451 474 0, /*tp_as_mapping*/
452 475 0, /*tp_hash */
453 476 0, /*tp_call*/
454 477 0, /*tp_str*/
455 478 PythonQtClassWrapper_getattro, /*tp_getattro*/
456 479 PythonQtClassWrapper_setattro, /*tp_setattro*/
457 480 0, /*tp_as_buffer*/
458 481 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
459 482 0, /* tp_doc */
460 483 0, /* tp_traverse */
461 484 0, /* tp_clear */
462 485 0, /* tp_richcompare */
463 486 0, /* tp_weaklistoffset */
464 487 0, /* tp_iter */
465 488 0, /* tp_iternext */
466 489 0, /* tp_methods */
467 490 0, /* tp_members */
468 491 0, /* tp_getset */
469 492 0, /* tp_base */
470 493 0, /* tp_dict */
471 494 0, /* tp_descr_get */
472 495 0, /* tp_descr_set */
473 496 0, /* tp_dictoffset */
474 497 (initproc)PythonQtClassWrapper_init, /* tp_init */
475 498 PythonQtClassWrapper_alloc, /* tp_alloc */
476 499 0, /* tp_new */
477 500 0, /* tp_free */
478 501 };
479 502
480 503 //-------------------------------------------------------
481 504
@@ -1,1295 +1,1378
1 1 /*
2 2 *
3 3 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
4 4 *
5 5 * This library is free software; you can redistribute it and/or
6 6 * modify it under the terms of the GNU Lesser General Public
7 7 * License as published by the Free Software Foundation; either
8 8 * version 2.1 of the License, or (at your option) any later version.
9 9 *
10 10 * This library is distributed in the hope that it will be useful,
11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 13 * Lesser General Public License for more details.
14 14 *
15 15 * Further, this software is distributed without any warranty that it is
16 16 * free of the rightful claim of any third person regarding infringement
17 17 * or the like. Any license provided herein, whether implied or
18 18 * otherwise, applies only to this software file. Patent licenses, if
19 19 * any, provided herein do not apply to combinations of this program with
20 20 * other software, or any other product whatsoever.
21 21 *
22 22 * You should have received a copy of the GNU Lesser General Public
23 23 * License along with this library; if not, write to the Free Software
24 24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 25 *
26 26 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
27 27 * 28359 Bremen, Germany or:
28 28 *
29 29 * http://www.mevis.de
30 30 *
31 31 */
32 32
33 33 //----------------------------------------------------------------------------------
34 34 /*!
35 35 // \file PythonQtConversion.cpp
36 36 // \author Florian Link
37 37 // \author Last changed by $Author: florian $
38 38 // \date 2006-05
39 39 */
40 40 //----------------------------------------------------------------------------------
41 41
42 42 #include "PythonQtConversion.h"
43 43 #include "PythonQtVariants.h"
44 44 #include <QDateTime>
45 45 #include <QTime>
46 46 #include <QDate>
47 47
48 #if PY_MAJOR_VERSION >= 3
49 #define PY3K
50 #endif
51
48 52 PythonQtValueStorage<qint64, 128> PythonQtConv::global_valueStorage;
49 53 PythonQtValueStorage<void*, 128> PythonQtConv::global_ptrStorage;
50 54 PythonQtValueStorageWithCleanup<QVariant, 128> PythonQtConv::global_variantStorage;
51 55
52 56 QHash<int, PythonQtConvertMetaTypeToPythonCB*> PythonQtConv::_metaTypeToPythonConverters;
53 57 QHash<int, PythonQtConvertPythonToMetaTypeCB*> PythonQtConv::_pythonToMetaTypeConverters;
54 58
55 59 PyObject* PythonQtConv::GetPyBool(bool val)
56 60 {
57 61 PyObject* r = val?Py_True:Py_False;
58 62 Py_INCREF(r);
59 63 return r;
60 64 }
61 65
62 66 PyObject* PythonQtConv::ConvertQtValueToPython(const PythonQtMethodInfo::ParameterInfo& info, const void* data) {
63 67 // is it an enum value?
64 68 if (info.enumWrapper) {
65 69 if (info.pointerCount==0) {
66 70 return PythonQtPrivate::createEnumValueInstance(info.enumWrapper, *((unsigned int*)data));
67 71 } else {
68 72 // we do not support pointers to enums (who needs them?)
69 73 Py_INCREF(Py_None);
70 74 return Py_None;
71 75 }
72 76 }
73 77
74 78 if (info.typeId == QMetaType::Void) {
75 79 Py_INCREF(Py_None);
76 80 return Py_None;
77 81 } else if ((info.pointerCount == 1) && (info.typeId == QMetaType::Char)) {
78 82 // a char ptr will probably be a null terminated string, so we support that:
79 83 char* charPtr = *((char**)data);
80 84 if (charPtr) {
85 #ifdef PY3K
86 return PyUnicode_FromString(charPtr);
87 #else
81 88 return PyString_FromString(charPtr);
89 #endif
82 90 } else {
83 91 Py_INCREF(Py_None);
84 92 return Py_None;
85 93 }
86 94 } else if ((info.typeId == PythonQtMethodInfo::Unknown || info.typeId >= QMetaType::User) &&
87 95 info.name.startsWith("QList<")) {
88 96 // it is a QList template:
89 97 QByteArray innerType = info.name.mid(6,info.name.length()-7);
90 98 if (innerType.endsWith("*")) {
91 99 innerType.truncate(innerType.length()-1);
92 100 QList<void*>* listPtr = NULL;
93 101 if (info.pointerCount == 1) {
94 102 listPtr = *((QList<void*>**)data);
95 103 } else if (info.pointerCount == 0) {
96 104 listPtr = (QList<void*>*)data;
97 105 }
98 106 if (listPtr) {
99 107 return ConvertQListOfPointerTypeToPythonList(listPtr, innerType);
100 108 } else {
101 109 return NULL;
102 110 }
103 111 }
104 112 }
105 113
106 114 if (info.typeId >= QMetaType::User) {
107 115 // if a converter is registered, we use is:
108 116 PythonQtConvertMetaTypeToPythonCB* converter = _metaTypeToPythonConverters.value(info.typeId);
109 117 if (converter) {
110 118 return (*converter)(data, info.typeId);
111 119 }
112 120 }
113 121
114 122 // special handling did not match, so we convert the usual way (either pointer or value version):
115 123 if (info.pointerCount == 1) {
116 124 // convert the pointer to a Python Object (we can handle ANY C++ object, in the worst case we just know the type and the pointer)
117 125 return PythonQt::priv()->wrapPtr(*((void**)data), info.name);
118 126 } else if (info.pointerCount == 0) {
119 127 // handle values that are not yet handled and not pointers
120 128 return ConvertQtValueToPythonInternal(info.typeId, data);
121 129 } else {
122 130 return NULL;
123 131 }
124 132 }
125 133
126 134 PyObject* PythonQtConv::ConvertQtValueToPythonInternal(int type, const void* data) {
127 135 switch (type) {
128 136 case QMetaType::Void:
129 137 Py_INCREF(Py_None);
130 138 return Py_None;
131 139 case QMetaType::Char:
132 return PyInt_FromLong(*((char*)data));
140 return PyLong_FromLong(*((char*)data));
133 141 case QMetaType::UChar:
134 return PyInt_FromLong(*((unsigned char*)data));
142 return PyLong_FromLong(*((unsigned char*)data));
135 143 case QMetaType::Short:
136 return PyInt_FromLong(*((short*)data));
144 return PyLong_FromLong(*((short*)data));
137 145 case QMetaType::UShort:
138 return PyInt_FromLong(*((unsigned short*)data));
146 return PyLong_FromLong(*((unsigned short*)data));
139 147 case QMetaType::Long:
140 return PyInt_FromLong(*((long*)data));
148 return PyLong_FromLong(*((long*)data));
141 149 case QMetaType::ULong:
142 150 // does not fit into simple int of python
143 151 return PyLong_FromUnsignedLong(*((unsigned long*)data));
144 152 case QMetaType::Bool:
145 153 return PythonQtConv::GetPyBool(*((bool*)data));
146 154 case QMetaType::Int:
147 return PyInt_FromLong(*((int*)data));
155 return PyLong_FromLong(*((int*)data));
148 156 case QMetaType::UInt:
149 157 // does not fit into simple int of python
150 158 return PyLong_FromUnsignedLong(*((unsigned int*)data));
151 159 case QMetaType::QChar:
152 return PyInt_FromLong(*((short*)data));
160 return PyLong_FromLong(*((short*)data));
153 161 case QMetaType::Float:
154 162 return PyFloat_FromDouble(*((float*)data));
155 163 case QMetaType::Double:
156 164 return PyFloat_FromDouble(*((double*)data));
157 165 case QMetaType::LongLong:
158 166 return PyLong_FromLongLong(*((qint64*)data));
159 167 case QMetaType::ULongLong:
160 168 return PyLong_FromUnsignedLongLong(*((quint64*)data));
161 169 // implicit conversion from QByteArray to str has been removed:
162 170 //case QMetaType::QByteArray: {
163 171 // QByteArray* v = (QByteArray*) data;
164 172 // return PyString_FromStringAndSize(*v, v->size());
165 173 // }
166 174 case QMetaType::QVariantMap:
167 175 return PythonQtConv::QVariantMapToPyObject(*((QVariantMap*)data));
168 176 case QMetaType::QVariantList:
169 177 return PythonQtConv::QVariantListToPyObject(*((QVariantList*)data));
170 178 case QMetaType::QString:
171 179 return PythonQtConv::QStringToPyObject(*((QString*)data));
172 180 case QMetaType::QStringList:
173 181 return PythonQtConv::QStringListToPyObject(*((QStringList*)data));
174 182
175 183 case PythonQtMethodInfo::Variant:
176 184 return PythonQtConv::QVariantToPyObject(*((QVariant*)data));
177 185 case QMetaType::QObjectStar:
178 186 #if( QT_VERSION < QT_VERSION_CHECK(5,0,0) )
179 187 case QMetaType::QWidgetStar:
180 188 #endif
181 189 return PythonQt::priv()->wrapQObject(*((QObject**)data));
182 190
183 191 default:
184 192 if (PythonQt::priv()->isPythonQtObjectPtrMetaId(type)) {
185 193 // special case, it is a PythonQtObjectPtr which contains a PyObject, take it directly:
186 194 PyObject* o = ((PythonQtObjectPtr*)data)->object();
187 195 Py_INCREF(o);
188 196 return o;
189 197 } else {
190 198 if (type > 0) {
191 199 // if the type is known, we can construct it via QMetaType::construct
192 200 #if( QT_VERSION >= QT_VERSION_CHECK(5,0,0) )
193 201 void* newCPPObject = QMetaType::create(type, data);
194 202 #else
195 203 void* newCPPObject = QMetaType::construct(type, data);
196 204 #endif
197 205 // XXX this could be optimized by using metatypeid directly
198 206 PythonQtInstanceWrapper* wrap = (PythonQtInstanceWrapper*)PythonQt::priv()->wrapPtr(newCPPObject, QMetaType::typeName(type));
199 207 wrap->_ownedByPythonQt = true;
200 208 wrap->_useQMetaTypeDestroy = true;
201 209 return (PyObject*)wrap;
202 210 }
203 211 std::cerr << "Unknown type that can not be converted to Python: " << type << ", in " << __FILE__ << ":" << __LINE__ << std::endl;
204 212 }
205 213 }
206 214 Py_INCREF(Py_None);
207 215 return Py_None;
208 216 }
209 217
210 218 void* PythonQtConv::CreateQtReturnValue(const PythonQtMethodInfo::ParameterInfo& info) {
211 219 void* ptr = NULL;
212 220 if (info.pointerCount>1) {
213 221 return NULL;
214 222 } else if (info.pointerCount==1) {
215 223 PythonQtValueStorage_ADD_VALUE(global_ptrStorage, void*, NULL, ptr);
216 224 } else if (info.enumWrapper) {
217 225 // create enum return value
218 226 PythonQtValueStorage_ADD_VALUE(PythonQtConv::global_valueStorage, long, 0, ptr);
219 227 } else {
220 228 switch (info.typeId) {
221 229 case QMetaType::Char:
222 230 case QMetaType::UChar:
223 231 case QMetaType::Short:
224 232 case QMetaType::UShort:
225 233 case QMetaType::Long:
226 234 case QMetaType::ULong:
227 235 case QMetaType::Bool:
228 236 case QMetaType::Int:
229 237 case QMetaType::UInt:
230 238 case QMetaType::QChar:
231 239 case QMetaType::Float:
232 240 case QMetaType::Double:
233 241 PythonQtValueStorage_ADD_VALUE(global_valueStorage, qint64, 0, ptr);
234 242 break;
235 243 case PythonQtMethodInfo::Variant:
236 244 PythonQtValueStorage_ADD_VALUE(global_variantStorage, QVariant, 0, ptr);
237 245 // return the ptr to the variant
238 246 break;
239 247 default:
240 248 if (info.typeId == PythonQtMethodInfo::Unknown) {
241 249 // check if we have a QList of pointers, which we can circumvent with a QList<void*>
242 250 if (info.name.startsWith("QList<")) {
243 251 QByteArray innerType = info.name.mid(6,info.name.length()-7);
244 252 if (innerType.endsWith("*")) {
245 253 static int id = QMetaType::type("QList<void*>");
246 254 PythonQtValueStorage_ADD_VALUE(global_variantStorage, QVariant, QVariant::Type(id), ptr);
247 255 // return the constData pointer that will be filled with the result value later on
248 256 ptr = (void*)((QVariant*)ptr)->constData();
249 257 }
250 258 }
251 259 }
252 260
253 261 if (!ptr && info.typeId!=PythonQtMethodInfo::Unknown) {
254 262 // everything else is stored in a QVariant, if we know the meta type...
255 263 PythonQtValueStorage_ADD_VALUE(global_variantStorage, QVariant, QVariant::Type(info.typeId), ptr);
256 264 // return the constData pointer that will be filled with the result value later on
257 265 ptr = (void*)((QVariant*)ptr)->constData();
258 266 }
259 267 }
260 268 }
261 269 return ptr;
262 270 }
263 271
264 272 void* PythonQtConv::castWrapperTo(PythonQtInstanceWrapper* wrapper, const QByteArray& className, bool& ok)
265 273 {
266 274 void* object;
267 275 if (wrapper->classInfo()->isCPPWrapper()) {
268 276 object = wrapper->_wrappedPtr;
269 277 } else {
270 278 QObject* tmp = wrapper->_obj;
271 279 object = tmp;
272 280 }
273 281 if (object) {
274 282 // if we can be upcasted to the given name, we pass the casted pointer in:
275 283 object = wrapper->classInfo()->castTo(object, className);
276 284 ok = object!=NULL;
277 285 } else {
278 286 // if it is a NULL ptr, we need to check if it inherits, so that we might pass the NULL ptr
279 287 ok = wrapper->classInfo()->inherits(className);
280 288 }
281 289 return object;
282 290 }
283 291
284 292 void* PythonQtConv::handlePythonToQtAutoConversion(int typeId, PyObject* obj, void* alreadyAllocatedCPPObject)
285 293 {
286 294 void* ptr = alreadyAllocatedCPPObject;
287 295
288 296 static int penId = QMetaType::type("QPen");
289 297 static int brushId = QMetaType::type("QBrush");
290 298 static int cursorId = QMetaType::type("QCursor");
291 299 static int colorId = QMetaType::type("QColor");
292 300 static PyObject* qtGlobalColorEnum = PythonQtClassInfo::findEnumWrapper("Qt::GlobalColor", NULL);
293 301 if (typeId == cursorId) {
294 302 static PyObject* qtCursorShapeEnum = PythonQtClassInfo::findEnumWrapper("Qt::CursorShape", NULL);
295 303 if ((PyObject*)obj->ob_type == qtCursorShapeEnum) {
296 Qt::CursorShape val = (Qt::CursorShape)PyInt_AS_LONG(obj);
304 Qt::CursorShape val = (Qt::CursorShape)PyLong_AsLong(obj);
297 305 if (!ptr) {
298 306 PythonQtValueStorage_ADD_VALUE(global_variantStorage, QVariant, QCursor(), ptr);
299 307 ptr = (void*)((QVariant*)ptr)->constData();
300 308 }
301 309 *((QCursor*)ptr) = QCursor(val);
302 310 return ptr;
303 311 }
304 312 } else if (typeId == penId) {
305 313 // brushes can be created from QColor and from Qt::GlobalColor (and from brushes, but that's the default)
306 314 static PyObject* qtColorClass = PythonQt::priv()->getClassInfo("QColor")->pythonQtClassWrapper();
307 315 if ((PyObject*)obj->ob_type == qtGlobalColorEnum) {
308 Qt::GlobalColor val = (Qt::GlobalColor)PyInt_AS_LONG(obj);
316 Qt::GlobalColor val = (Qt::GlobalColor)PyLong_AsLong(obj);
309 317 if (!ptr) {
310 318 PythonQtValueStorage_ADD_VALUE(global_variantStorage, QVariant, QPen(), ptr);
311 319 ptr = (void*)((QVariant*)ptr)->constData();
312 320 }
313 321 *((QPen*)ptr) = QPen(QColor(val));
314 322 return ptr;
315 323 } else if ((PyObject*)obj->ob_type == qtColorClass) {
316 324 if (!ptr) {
317 325 PythonQtValueStorage_ADD_VALUE(global_variantStorage, QVariant, QPen(), ptr);
318 326 ptr = (void*)((QVariant*)ptr)->constData();
319 327 }
320 328 *((QPen*)ptr) = QPen(*((QColor*)((PythonQtInstanceWrapper*)obj)->_wrappedPtr));
321 329 return ptr;
322 330 }
323 331 } else if (typeId == brushId) {
324 332 // brushes can be created from QColor and from Qt::GlobalColor (and from brushes, but that's the default)
325 333 static PyObject* qtColorClass = PythonQt::priv()->getClassInfo("QColor")->pythonQtClassWrapper();
326 334 if ((PyObject*)obj->ob_type == qtGlobalColorEnum) {
327 Qt::GlobalColor val = (Qt::GlobalColor)PyInt_AS_LONG(obj);
335 Qt::GlobalColor val = (Qt::GlobalColor)PyLong_AsLong(obj);
328 336 if (!ptr) {
329 337 PythonQtValueStorage_ADD_VALUE(global_variantStorage, QVariant, QBrush(), ptr);
330 338 ptr = (void*)((QVariant*)ptr)->constData();
331 339 }
332 340 *((QBrush*)ptr) = QBrush(QColor(val));
333 341 return ptr;
334 342 } else if ((PyObject*)obj->ob_type == qtColorClass) {
335 343 if (!ptr) {
336 344 PythonQtValueStorage_ADD_VALUE(global_variantStorage, QVariant, QBrush(), ptr);
337 345 ptr = (void*)((QVariant*)ptr)->constData();
338 346 }
339 347 *((QBrush*)ptr) = QBrush(*((QColor*)((PythonQtInstanceWrapper*)obj)->_wrappedPtr));
340 348 return ptr;
341 349 }
342 350 } else if (typeId == colorId) {
343 351 // colors can be created from Qt::GlobalColor (and from colors, but that's the default)
344 352 if ((PyObject*)obj->ob_type == qtGlobalColorEnum) {
345 Qt::GlobalColor val = (Qt::GlobalColor)PyInt_AS_LONG(obj);
353 Qt::GlobalColor val = (Qt::GlobalColor)PyLong_AsLong(obj);
346 354 if (!ptr) {
347 355 PythonQtValueStorage_ADD_VALUE(global_variantStorage, QVariant, QColor(), ptr);
348 356 ptr = (void*)((QVariant*)ptr)->constData();
349 357 }
350 358 *((QColor*)ptr) = QColor(val);
351 359 return ptr;
352 360 }
353 361 }
354 362 return NULL;
355 363 }
356 364
357 365 void* PythonQtConv::ConvertPythonToQt(const PythonQtMethodInfo::ParameterInfo& info, PyObject* obj, bool strict, PythonQtClassInfo* /*classInfo*/, void* alreadyAllocatedCPPObject)
358 366 {
359 367 bool ok = false;
360 368 void* ptr = NULL;
361 369
362 370 // autoconversion of QPen/QBrush/QCursor/QColor from different type
363 371 if (info.pointerCount==0 && !strict) {
364 372 ptr = handlePythonToQtAutoConversion(info.typeId, obj, alreadyAllocatedCPPObject);
365 373 if (ptr) {
366 374 return ptr;
367 375 }
368 376 }
369 377
370 378 if (PyObject_TypeCheck(obj, &PythonQtInstanceWrapper_Type) && info.typeId != PythonQtMethodInfo::Variant) {
371 379 // if we have a Qt wrapper object and if we do not need a QVariant, we do the following:
372 380 // (the Variant case is handled below in a switch)
373 381
374 382 // a C++ wrapper (can be passed as pointer or reference)
375 383 PythonQtInstanceWrapper* wrap = (PythonQtInstanceWrapper*)obj;
376 384 void* object = castWrapperTo(wrap, info.name, ok);
377 385 if (ok) {
378 386 if (info.pointerCount==1) {
379 387 // store the wrapped pointer in an extra pointer and let ptr point to the extra pointer
380 388 PythonQtValueStorage_ADD_VALUE_IF_NEEDED(alreadyAllocatedCPPObject,global_ptrStorage, void*, object, ptr);
381 389 } else if (info.pointerCount==0) {
382 390 // store the wrapped pointer directly, since we are a reference
383 391 ptr = object;
384 392 }
385 393 } else {
386 394 // not matching, maybe a PyObject*?
387 395 if (info.name == "PyObject" && info.pointerCount==1) {
388 396 // handle low level PyObject directly
389 397 PythonQtValueStorage_ADD_VALUE_IF_NEEDED(alreadyAllocatedCPPObject,global_ptrStorage, void*, obj, ptr);
390 398 }
391 399 }
392 400 } else if (info.pointerCount == 1) {
393 401 // a pointer
394 402 if (info.typeId == QMetaType::Char || info.typeId == QMetaType::UChar)
395 403 {
404 #ifdef PY3K
405 if (PyUnicode_Check(obj)) {
406 QByteArray bytes(PyUnicode_AsUTF8(obj));
407 void* ptr2 = NULL;
408 PythonQtValueStorage_ADD_VALUE_IF_NEEDED(NULL,global_variantStorage, QVariant, QVariant(bytes), ptr2);
409 PythonQtValueStorage_ADD_VALUE_IF_NEEDED(alreadyAllocatedCPPObject,global_ptrStorage, void*, (((QByteArray*)((QVariant*)ptr2)->constData())->data()), ptr);
410 #else
396 411 if (obj->ob_type == &PyString_Type) {
397 412 // take direct reference to string data
398 413 const char* data = PyString_AS_STRING(obj);
399 414 PythonQtValueStorage_ADD_VALUE_IF_NEEDED(alreadyAllocatedCPPObject,global_ptrStorage, void*, (void*)data, ptr);
415 #endif
400 416 } else {
401 417 // convert to string
402 418 QString str = PyObjGetString(obj, strict, ok);
403 419 if (ok) {
404 420 QByteArray bytes;
405 421 bytes = str.toUtf8();
406 422 if (ok) {
407 423 void* ptr2 = NULL;
408 424 PythonQtValueStorage_ADD_VALUE_IF_NEEDED(NULL,global_variantStorage, QVariant, QVariant(bytes), ptr2);
409 425 PythonQtValueStorage_ADD_VALUE_IF_NEEDED(alreadyAllocatedCPPObject,global_ptrStorage, void*, (((QByteArray*)((QVariant*)ptr2)->constData())->data()), ptr);
410 426 }
411 427 }
412 428 }
413 429 } else if (info.typeId == QMetaType::QString) {
414 430 // TODO: this is a special case for bad Qt APIs which take a QString*, like QtGui.QFileDialog.getSaveFileName
415 431 // In general we would need to decide to either support * args for all basic types (ignoring the fact that the
416 432 // result value is not useable in Python), or if all these APIs need to be wrapped manually/differently, like PyQt/PySide do.
417 433 QString str = PyObjGetString(obj, strict, ok);
418 434 if (ok) {
419 435 void* ptr2 = NULL;
420 436 PythonQtValueStorage_ADD_VALUE_IF_NEEDED(NULL,global_variantStorage, QVariant, QVariant(str), ptr2);
421 437 PythonQtValueStorage_ADD_VALUE_IF_NEEDED(alreadyAllocatedCPPObject,global_ptrStorage, void*, (void*)((QVariant*)ptr2)->constData(), ptr);
422 438 }
423 439 } else if (info.name == "PyObject") {
424 440 // handle low level PyObject directly
425 441 PythonQtValueStorage_ADD_VALUE_IF_NEEDED(alreadyAllocatedCPPObject,global_ptrStorage, void*, obj, ptr);
426 442 } else if (obj == Py_None) {
427 443 // None is treated as a NULL ptr
428 444 PythonQtValueStorage_ADD_VALUE_IF_NEEDED(alreadyAllocatedCPPObject,global_ptrStorage, void*, NULL, ptr);
429 445 } else {
430 446 void* foreignWrapper = PythonQt::priv()->unwrapForeignWrapper(info.name, obj);
431 447 if (foreignWrapper) {
432 448 PythonQtValueStorage_ADD_VALUE_IF_NEEDED(alreadyAllocatedCPPObject,global_ptrStorage, void*, foreignWrapper, ptr);
433 449 } else {
434 450 // if we are not strict, we try if we are passed a 0 integer
435 451 if (!strict) {
436 452 bool ok;
437 453 int value = PyObjGetInt(obj, true, ok);
438 454 if (ok && value==0) {
439 455 // TODOXXX is this wise? or should it be expected from the programmer to use None?
440 456 PythonQtValueStorage_ADD_VALUE_IF_NEEDED(alreadyAllocatedCPPObject,global_ptrStorage, void*, NULL, ptr);
441 457 }
442 458 }
443 459 }
444 460 }
445 461 } else if (info.pointerCount == 0) {
446 462 // not a pointer
447 463 switch (info.typeId) {
448 464 case QMetaType::Char:
449 465 {
450 466 int val = PyObjGetInt(obj, strict, ok);
451 467 if (ok) {
452 468 PythonQtValueStorage_ADD_VALUE_IF_NEEDED(alreadyAllocatedCPPObject,global_valueStorage, char, val, ptr);
453 469 }
454 470 }
455 471 break;
456 472 case QMetaType::UChar:
457 473 {
458 474 int val = PyObjGetInt(obj, strict, ok);
459 475 if (ok) {
460 476 PythonQtValueStorage_ADD_VALUE_IF_NEEDED(alreadyAllocatedCPPObject,global_valueStorage, unsigned char, val, ptr);
461 477 }
462 478 }
463 479 break;
464 480 case QMetaType::Short:
465 481 {
466 482 int val = PyObjGetInt(obj, strict, ok);
467 483 if (ok) {
468 484 PythonQtValueStorage_ADD_VALUE_IF_NEEDED(alreadyAllocatedCPPObject,global_valueStorage, short, val, ptr);
469 485 }
470 486 }
471 487 break;
472 488 case QMetaType::UShort:
473 489 {
474 490 int val = PyObjGetInt(obj, strict, ok);
475 491 if (ok) {
476 492 PythonQtValueStorage_ADD_VALUE_IF_NEEDED(alreadyAllocatedCPPObject,global_valueStorage, unsigned short, val, ptr);
477 493 }
478 494 }
479 495 break;
480 496 case QMetaType::Long:
481 497 {
482 498 long val = (long)PyObjGetLongLong(obj, strict, ok);
483 499 if (ok) {
484 500 PythonQtValueStorage_ADD_VALUE_IF_NEEDED(alreadyAllocatedCPPObject,global_valueStorage, long, val, ptr);
485 501 }
486 502 }
487 503 break;
488 504 case QMetaType::ULong:
489 505 {
490 506 unsigned long val = (unsigned long)PyObjGetLongLong(obj, strict, ok);
491 507 if (ok) {
492 508 PythonQtValueStorage_ADD_VALUE_IF_NEEDED(alreadyAllocatedCPPObject,global_valueStorage, unsigned long, val, ptr);
493 509 }
494 510 }
495 511 break;
496 512 case QMetaType::Bool:
497 513 {
498 514 bool val = PyObjGetBool(obj, strict, ok);
499 515 if (ok) {
500 516 PythonQtValueStorage_ADD_VALUE_IF_NEEDED(alreadyAllocatedCPPObject,global_valueStorage, bool, val, ptr);
501 517 }
502 518 }
503 519 break;
504 520 case QMetaType::Int:
505 521 {
506 522 int val = PyObjGetInt(obj, strict, ok);
507 523 if (ok) {
508 524 PythonQtValueStorage_ADD_VALUE_IF_NEEDED(alreadyAllocatedCPPObject,global_valueStorage, int, val, ptr);
509 525 }
510 526 }
511 527 break;
512 528 case QMetaType::UInt:
513 529 {
514 530 unsigned int val = (unsigned int)PyObjGetLongLong(obj, strict, ok);
515 531 if (ok) {
516 532 PythonQtValueStorage_ADD_VALUE_IF_NEEDED(alreadyAllocatedCPPObject,global_valueStorage, unsigned int, val, ptr);
517 533 }
518 534 }
519 535 break;
520 536 case QMetaType::QChar:
521 537 {
522 538 int val = PyObjGetInt(obj, strict, ok);
523 539 if (ok) {
524 540 PythonQtValueStorage_ADD_VALUE_IF_NEEDED(alreadyAllocatedCPPObject,global_valueStorage, short, val, ptr);
525 541 }
526 542 }
527 543 break;
528 544 case QMetaType::Float:
529 545 {
530 546 float val = (float)PyObjGetDouble(obj, strict, ok);
531 547 if (ok) {
532 548 PythonQtValueStorage_ADD_VALUE_IF_NEEDED(alreadyAllocatedCPPObject,global_valueStorage, float, val, ptr);
533 549 }
534 550 }
535 551 break;
536 552 case QMetaType::Double:
537 553 {
538 554 double val = (double)PyObjGetDouble(obj, strict, ok);
539 555 if (ok) {
540 556 PythonQtValueStorage_ADD_VALUE_IF_NEEDED(alreadyAllocatedCPPObject,global_valueStorage, double, val, ptr);
541 557 }
542 558 }
543 559 break;
544 560 case QMetaType::LongLong:
545 561 {
546 562 qint64 val = PyObjGetLongLong(obj, strict, ok);
547 563 if (ok) {
548 564 PythonQtValueStorage_ADD_VALUE_IF_NEEDED(alreadyAllocatedCPPObject,global_valueStorage, qint64, val, ptr);
549 565 }
550 566 }
551 567 break;
552 568 case QMetaType::ULongLong:
553 569 {
554 570 quint64 val = PyObjGetULongLong(obj, strict, ok);
555 571 if (ok) {
556 572 PythonQtValueStorage_ADD_VALUE_IF_NEEDED(alreadyAllocatedCPPObject,global_valueStorage, quint64, val, ptr);
557 573 }
558 574 }
559 575 break;
560 576 case QMetaType::QByteArray:
561 577 {
562 578 QByteArray bytes = PyObjGetBytes(obj, strict, ok);
563 579 if (ok) {
564 580 PythonQtValueStorage_ADD_VALUE_IF_NEEDED(alreadyAllocatedCPPObject,global_variantStorage, QVariant, QVariant(bytes), ptr);
565 581 ptr = (void*)((QVariant*)ptr)->constData();
566 582 }
567 583 }
568 584 break;
569 585 case QMetaType::QString:
570 586 {
571 587 QString str = PyObjGetString(obj, strict, ok);
572 588 if (ok) {
573 589 PythonQtValueStorage_ADD_VALUE_IF_NEEDED(alreadyAllocatedCPPObject,global_variantStorage, QVariant, QVariant(str), ptr);
574 590 ptr = (void*)((QVariant*)ptr)->constData();
575 591 }
576 592 }
577 593 break;
578 594 case QMetaType::QStringList:
579 595 {
580 596 QStringList l = PyObjToStringList(obj, strict, ok);
581 597 if (ok) {
582 598 PythonQtValueStorage_ADD_VALUE_IF_NEEDED(alreadyAllocatedCPPObject,global_variantStorage, QVariant, QVariant(l), ptr);
583 599 ptr = (void*)((QVariant*)ptr)->constData();
584 600 }
585 601 }
586 602 break;
587 603
588 604 case PythonQtMethodInfo::Variant:
589 605 {
590 606 QVariant v = PyObjToQVariant(obj);
591 607 // the only case where conversion can fail it None and we want to pass that to, e.g. setProperty(),
592 608 // so we do not check v.isValid() here
593 609 PythonQtValueStorage_ADD_VALUE_IF_NEEDED(alreadyAllocatedCPPObject,global_variantStorage, QVariant, v, ptr);
594 610 }
595 611 break;
596 612 default:
597 613 {
598 614 // check for enum case
599 615 if (info.enumWrapper) {
600 616 unsigned int val;
601 617 ok = false;
602 618 if ((PyObject*)obj->ob_type == info.enumWrapper) {
603 619 // we have a exact enum type match:
604 val = PyInt_AS_LONG(obj);
620 val = PyLong_AsLong(obj);
605 621 ok = true;
606 622 } else if (!strict) {
607 623 // we try to get any integer, when not being strict. If we are strict, integers are not wanted because
608 624 // we want an integer overload to be taken first!
609 625 val = (unsigned int)PyObjGetLongLong(obj, false, ok);
610 626 }
611 627 if (ok) {
612 628 PythonQtValueStorage_ADD_VALUE_IF_NEEDED(alreadyAllocatedCPPObject,global_valueStorage, unsigned int, val, ptr);
613 629 return ptr;
614 630 } else {
615 631 return NULL;
616 632 }
617 633 }
618 634
619 635 if (info.typeId == PythonQtMethodInfo::Unknown || info.typeId >= QMetaType::User) {
620 636 // check for QList<AnyPtr*> case, where we will use a QList<void*> QVariant
621 637 if (info.name.startsWith("QList<")) {
622 638 QByteArray innerType = info.name.mid(6,info.name.length()-7);
623 639 if (innerType.endsWith("*")) {
624 640 innerType.truncate(innerType.length()-1);
625 641 static int id = QMetaType::type("QList<void*>");
626 642 if (!alreadyAllocatedCPPObject) {
627 643 PythonQtValueStorage_ADD_VALUE_IF_NEEDED(alreadyAllocatedCPPObject,global_variantStorage, QVariant, QVariant::Type(id), ptr);
628 644 ptr = (void*)((QVariant*)ptr)->constData();
629 645 } else {
630 646 ptr = alreadyAllocatedCPPObject;
631 647 }
632 648 ok = ConvertPythonListToQListOfPointerType(obj, (QList<void*>*)ptr, innerType, strict);
633 649 if (ok) {
634 650 return ptr;
635 651 } else {
636 652 return NULL;
637 653 }
638 654 }
639 655 }
640 656 }
641 657
642 658 // We only do this for registered type > QMetaType::User for performance reasons.
643 659 if (info.typeId >= QMetaType::User) {
644 660 // Maybe we have a special converter that is registered for that type:
645 661 PythonQtConvertPythonToMetaTypeCB* converter = _pythonToMetaTypeConverters.value(info.typeId);
646 662 if (converter) {
647 663 if (!alreadyAllocatedCPPObject) {
648 664 // create a new empty variant of concrete type:
649 665 PythonQtValueStorage_ADD_VALUE_IF_NEEDED(alreadyAllocatedCPPObject,global_variantStorage, QVariant, QVariant::Type(info.typeId), ptr);
650 666 ptr = (void*)((QVariant*)ptr)->constData();
651 667 } else {
652 668 ptr = alreadyAllocatedCPPObject;
653 669 }
654 670 // now call the converter, passing the internal object of the variant
655 671 ok = (*converter)(obj, ptr, info.typeId, strict);
656 672 if (ok) {
657 673 return ptr;
658 674 } else {
659 675 return NULL;
660 676 }
661 677 }
662 678 }
663 679 // if no type id is available, conversion to a QVariant makes no sense/is not possible
664 680 if (info.typeId != PythonQtMethodInfo::Unknown) {
665 681 // for all other types, we use the same qvariant conversion and pass out the constData of the variant:
666 682 QVariant v = PyObjToQVariant(obj, info.typeId);
667 683 if (v.isValid()) {
668 684 PythonQtValueStorage_ADD_VALUE_IF_NEEDED(alreadyAllocatedCPPObject,global_variantStorage, QVariant, v, ptr);
669 685 ptr = (void*)((QVariant*)ptr)->constData();
670 686 }
671 687 }
672 688 }
673 689 }
674 690 }
675 691 return ptr;
676 692 }
677 693
678 694
679 695 QStringList PythonQtConv::PyObjToStringList(PyObject* val, bool strict, bool& ok) {
680 696 QStringList v;
681 697 ok = false;
682 698 // if we are strict, we do not want to convert a string to a stringlist
683 699 // (strings in python are detected to be sequences)
684 if (strict &&
685 (val->ob_type == &PyString_Type ||
700 if (strict && (
701 #ifndef PY3K
702 val->ob_type == &PyString_Type ||
703 #endif
686 704 PyUnicode_Check(val))) {
687 705 ok = false;
688 706 return v;
689 707 }
690 708 if (PySequence_Check(val)) {
691 709 int count = PySequence_Size(val);
692 710 for (int i = 0;i<count;i++) {
693 711 PyObject* value = PySequence_GetItem(val,i);
694 712 v.append(PyObjGetString(value,false,ok));
695 713 }
696 714 ok = true;
697 715 }
698 716 return v;
699 717 }
700 718
701 719 QString PythonQtConv::PyObjGetRepresentation(PyObject* val)
702 720 {
703 721 QString r;
704 722 PyObject* str = PyObject_Repr(val);
705 723 if (str) {
724 #ifdef PY3K
725 Py_UCS4 *x = PyUnicode_AsUCS4Copy(str);
726 r = QString::fromUcs4(x, PyUnicode_GetLength(str));
727 PyMem_Free(x);
728 #else
706 729 r = QString(PyString_AS_STRING(str));
730 #endif
707 731 Py_DECREF(str);
708 732 }
709 733 return r;
710 734 }
711 735
712 736 QString PythonQtConv::PyObjGetString(PyObject* val, bool strict, bool& ok) {
713 737 QString r;
714 738 ok = true;
715 if (val->ob_type == &PyString_Type) {
739 #ifndef PY3K
740 if (Py_TYPE(val) == &PyString_Type) {
716 741 r = QString(PyString_AS_STRING(val));
717 } else if (PyUnicode_Check(val)) {
742 } else
743 #endif
744 if (PyUnicode_Check(val)) {
745 #ifdef PY3K
746 Py_UCS4 *x = PyUnicode_AsUCS4Copy(val);
747 r = QString::fromUcs4(x, PyUnicode_GetLength(val));
748 PyMem_Free(x);
749 #else
718 750 PyObject *ptmp = PyUnicode_AsUTF8String(val);
719 751 if(ptmp) {
720 752 r = QString::fromUtf8(PyString_AS_STRING(ptmp));
721 753 Py_DECREF(ptmp);
722 754 }
755 #endif
723 756 } else if (!strict) {
724 757 // EXTRA: could also use _Unicode, but why should we?
725 758 PyObject* str = PyObject_Str(val);
726 759 if (str) {
760 #ifdef PY3K
761 Py_UCS4 *x = PyUnicode_AsUCS4Copy(str);
762 r = QString::fromUcs4(x, PyUnicode_GetLength(str));
763 PyMem_Free(x);
764 #else
727 765 r = QString(PyString_AS_STRING(str));
766 #endif
728 767 Py_DECREF(str);
729 768 } else {
730 769 ok = false;
731 770 }
732 771 } else {
733 772 ok = false;
734 773 }
735 774 return r;
736 775 }
737 776
738 777 QByteArray PythonQtConv::PyObjGetBytes(PyObject* val, bool /*strict*/, bool& ok) {
739 778 // TODO: support buffer objects in general
740 779 QByteArray r;
741 780 ok = true;
742 if (val->ob_type == &PyString_Type) {
781 #ifdef PY3K
782 if (PyBytes_Check(val)) {
783 r = QByteArray(PyBytes_AS_STRING(val), PyBytes_GET_SIZE(val));
784 #else
785 if (Py_TYPE(val) == &PyString_Type) {
743 786 long size = PyString_GET_SIZE(val);
744 787 r = QByteArray(PyString_AS_STRING(val), size);
788 #endif
745 789 } else {
746 790 ok = false;
747 791 }
748 792 return r;
749 793 }
750 794
751 795 bool PythonQtConv::PyObjGetBool(PyObject* val, bool strict, bool &ok) {
752 796 bool d = false;
753 797 ok = false;
754 798 if (val == Py_False) {
755 799 d = false;
756 800 ok = true;
757 801 } else if (val == Py_True) {
758 802 d = true;
759 803 ok = true;
760 804 } else if (!strict) {
761 805 int result = PyObject_IsTrue(val);
762 806 d = (result == 1);
763 807 // the result is -1 if an error occurred, handle this:
764 808 ok = (result != -1);
765 809 }
766 810 return d;
767 811 }
768 812
769 813 int PythonQtConv::PyObjGetInt(PyObject* val, bool strict, bool &ok) {
770 814 int d = 0;
771 815 ok = true;
816 #ifndef PY3K
772 817 if (val->ob_type == &PyInt_Type) {
773 818 d = PyInt_AS_LONG(val);
819 } else
820 #endif
821 if (Py_TYPE(val) == &PyLong_Type) {
822 // handle error on overflow!
823 d = PyLong_AsLong(val);
774 824 } else if (!strict) {
825 #ifndef PY3K
775 826 if (PyObject_TypeCheck(val, &PyInt_Type)) {
776 827 // support for derived int classes, e.g. for our enums
777 828 d = PyInt_AS_LONG(val);
778 } else if (val->ob_type == &PyFloat_Type) {
779 d = floor(PyFloat_AS_DOUBLE(val));
780 } else if (val->ob_type == &PyLong_Type) {
781 // handle error on overflow!
829 } else
830 #endif
831 if (PyObject_TypeCheck(val, &PyLong_Type)) {
782 832 d = PyLong_AsLong(val);
833 } else if (Py_TYPE(val) == &PyFloat_Type) {
834 d = floor(PyFloat_AS_DOUBLE(val));
783 835 } else if (val == Py_False) {
784 836 d = 0;
785 837 } else if (val == Py_True) {
786 838 d = 1;
787 839 } else {
788 840 PyErr_Clear();
789 841 // PyInt_AsLong will try conversion to an int if the object is not an int:
790 d = PyInt_AsLong(val);
842 d = PyLong_AsLong(val);
791 843 if (PyErr_Occurred()) {
792 844 ok = false;
793 845 PyErr_Clear();
794 846 }
795 847 }
796 848 } else {
797 849 ok = false;
798 850 }
799 851 return d;
800 852 }
801 853
802 854 qint64 PythonQtConv::PyObjGetLongLong(PyObject* val, bool strict, bool &ok) {
803 855 qint64 d = 0;
804 856 ok = true;
857 #ifndef PY3K
805 858 if (val->ob_type == &PyInt_Type) {
806 859 d = PyInt_AS_LONG(val);
807 } else if (val->ob_type == &PyLong_Type) {
860 } else
861 #endif
862 if (Py_TYPE(val) == &PyLong_Type) {
808 863 d = PyLong_AsLongLong(val);
809 864 } else if (!strict) {
865 #ifndef PY3K
810 866 if (PyObject_TypeCheck(val, &PyInt_Type)) {
811 867 // support for derived int classes, e.g. for our enums
812 868 d = PyInt_AS_LONG(val);
813 } else if (val->ob_type == &PyFloat_Type) {
869 } else
870 #endif
871 if (PyObject_TypeCheck(val, &PyLong_Type)) {
872 d = PyLong_AsLong(val);
873 } else if (Py_TYPE(val) == &PyFloat_Type) {
814 874 d = floor(PyFloat_AS_DOUBLE(val));
815 875 } else if (val == Py_False) {
816 876 d = 0;
817 877 } else if (val == Py_True) {
818 878 d = 1;
819 879 } else {
820 880 PyErr_Clear();
821 881 // PyLong_AsLongLong will try conversion to an int if the object is not an int:
822 882 d = PyLong_AsLongLong(val);
823 883 if (PyErr_Occurred()) {
824 884 ok = false;
825 885 PyErr_Clear();
826 886 }
827 887 }
828 888 } else {
829 889 ok = false;
830 890 }
831 891 return d;
832 892 }
833 893
834 894 quint64 PythonQtConv::PyObjGetULongLong(PyObject* val, bool strict, bool &ok) {
835 895 quint64 d = 0;
836 896 ok = true;
837 if (PyObject_TypeCheck(val, &PyInt_Type)) {
897 #ifndef PY3K
898 if (Py_TYPE(val) == &PyInt_Type) {
838 899 d = PyInt_AS_LONG(val);
839 } else if (val->ob_type == &PyLong_Type) {
900 } else
901 #endif
902 if (Py_TYPE(val) == &PyLong_Type) {
840 903 d = PyLong_AsLongLong(val);
841 904 } else if (!strict) {
905 #ifndef PY3K
842 906 if (PyObject_TypeCheck(val, &PyInt_Type)) {
843 907 // support for derived int classes, e.g. for our enums
844 908 d = PyInt_AS_LONG(val);
845 } else if (val->ob_type == &PyFloat_Type) {
909 } else
910 #endif
911 if (PyObject_TypeCheck(val, &PyLong_Type)) {
912 d = PyLong_AsLong(val);
913 } else if (Py_TYPE(val) == &PyFloat_Type) {
846 914 d = floor(PyFloat_AS_DOUBLE(val));
847 915 } else if (val == Py_False) {
848 916 d = 0;
849 917 } else if (val == Py_True) {
850 918 d = 1;
851 919 } else {
852 920 PyErr_Clear();
853 921 // PyLong_AsLongLong will try conversion to an int if the object is not an int:
854 922 d = PyLong_AsLongLong(val);
855 923 if (PyErr_Occurred()) {
856 924 PyErr_Clear();
857 925 ok = false;
858 926 }
859 927 }
860 928 } else {
861 929 ok = false;
862 930 }
863 931 return d;
864 932 }
865 933
866 934 double PythonQtConv::PyObjGetDouble(PyObject* val, bool strict, bool &ok) {
867 935 double d = 0;
868 936 ok = true;
869 937 if (val->ob_type == &PyFloat_Type) {
870 938 d = PyFloat_AS_DOUBLE(val);
871 939 } else if (!strict) {
940 #ifndef PY3K
872 941 if (PyObject_TypeCheck(val, &PyInt_Type)) {
873 942 d = PyInt_AS_LONG(val);
874 } else if (val->ob_type == &PyLong_Type) {
943 } else
944 #endif
945 if (PyLong_Check(val)) {
875 946 d = PyLong_AsLong(val);
876 947 } else if (val == Py_False) {
877 948 d = 0;
878 949 } else if (val == Py_True) {
879 950 d = 1;
880 951 } else {
881 952 PyErr_Clear();
882 953 // PyFloat_AsDouble will try conversion to a double if the object is not a float:
883 954 d = PyFloat_AsDouble(val);
884 955 if (PyErr_Occurred()) {
885 956 PyErr_Clear();
886 957 ok = false;
887 958 }
888 959 }
889 960 } else {
890 961 ok = false;
891 962 }
892 963 return d;
893 964 }
894 965
895 966 QVariant PythonQtConv::PyObjToQVariant(PyObject* val, int type)
896 967 {
897 968 QVariant v;
898 969 bool ok = true;
899 970
900 971 if (type==-1) {
901 972 // no special type requested
973 #ifdef PY3K
974 if (PyBytes_Check(val)) {
975 type = QVariant::ByteArray;
976 } else if (PyUnicode_Check(val)) {
977 #else
902 978 if (val->ob_type==&PyString_Type || val->ob_type==&PyUnicode_Type) {
979 #endif
903 980 type = QVariant::String;
904 981 } else if (val == Py_False || val == Py_True) {
905 982 type = QVariant::Bool;
983 #ifndef PY3K
906 984 } else if (PyObject_TypeCheck(val, &PyInt_Type)) {
907 985 type = QVariant::Int;
908 } else if (val->ob_type==&PyLong_Type) {
986 #endif
987 } else if (PyLong_Check(val)) {
909 988 type = QVariant::LongLong;
910 } else if (val->ob_type==&PyFloat_Type) {
989 } else if (PyFloat_Check(val)) {
911 990 type = QVariant::Double;
912 991 } else if (PyObject_TypeCheck(val, &PythonQtInstanceWrapper_Type)) {
913 992 PythonQtInstanceWrapper* wrap = (PythonQtInstanceWrapper*)val;
914 993 // c++ wrapper, check if the class names of the c++ objects match
915 994 if (wrap->classInfo()->isCPPWrapper()) {
916 995 if (wrap->classInfo()->metaTypeId()>0) {
917 996 // construct a new variant from the C++ object if it has a meta type (this will COPY the object!)
918 997 v = QVariant(wrap->classInfo()->metaTypeId(), wrap->_wrappedPtr);
919 998 } else {
920 999 // TODOXXX we could as well check if there is a registered meta type for "classname*", so that we may pass
921 1000 // the pointer here...
922 1001 // is this worth anything? we loose the knowledge of the cpp object type
923 1002 v = qVariantFromValue(wrap->_wrappedPtr);
924 1003 }
925 1004 } else {
926 1005 // this gives us a QObject pointer
927 1006 QObject* myObject = wrap->_obj;
928 1007 v = qVariantFromValue(myObject);
929 1008 }
930 1009 return v;
931 } else if (val->ob_type==&PyDict_Type) {
1010 } else if (PyDict_Check(val)) {
932 1011 type = QVariant::Map;
933 } else if (val->ob_type==&PyList_Type || val->ob_type==&PyTuple_Type || PySequence_Check(val)) {
1012 } else if (PyList_Check(val) || PyTuple_Check(val) || PySequence_Check(val)) {
934 1013 type = QVariant::List;
935 1014 } else if (val == Py_None) {
936 1015 // none is invalid
937 1016 type = QVariant::Invalid;
938 1017 } else {
939 1018 // this used to be:
940 1019 // type = QVariant::String;
941 1020 // but now we want to transport the Python Objects directly:
942 1021 PythonQtObjectPtr o(val);
943 1022 v = qVariantFromValue(o);
944 1023 return v;
945 1024 }
946 1025 }
947 1026 // special type request:
948 1027 switch (type) {
949 1028 case QVariant::Invalid:
950 1029 return v;
951 1030 break;
952 1031 case QVariant::Int:
953 1032 {
954 1033 int d = PyObjGetInt(val, false, ok);
955 1034 if (ok) return QVariant(d);
956 1035 }
957 1036 break;
958 1037 case QVariant::UInt:
959 1038 {
960 1039 int d = PyObjGetInt(val, false,ok);
961 1040 if (ok) v = QVariant((unsigned int)d);
962 1041 }
963 1042 break;
964 1043 case QVariant::Bool:
965 1044 {
966 1045 int d = PyObjGetBool(val,false,ok);
967 1046 if (ok) v = QVariant((bool)(d!=0));
968 1047 }
969 1048 break;
970 1049 case QVariant::Double:
971 1050 {
972 1051 double d = PyObjGetDouble(val,false,ok);
973 1052 if (ok) v = QVariant(d);
974 1053 break;
975 1054 }
976 1055 case QMetaType::Float:
977 1056 {
978 1057 float d = (float) PyObjGetDouble(val,false,ok);
979 1058 if (ok) v = qVariantFromValue(d);
980 1059 break;
981 1060 }
982 1061 case QMetaType::Long:
983 1062 {
984 1063 long d = (long) PyObjGetLongLong(val,false,ok);
985 1064 if (ok) v = qVariantFromValue(d);
986 1065 break;
987 1066 }
988 1067 case QMetaType::ULong:
989 1068 {
990 1069 unsigned long d = (unsigned long) PyObjGetLongLong(val,false,ok);
991 1070 if (ok) v = qVariantFromValue(d);
992 1071 break;
993 1072 }
994 1073 case QMetaType::LongLong:
995 1074 {
996 1075 qint64 d = PyObjGetLongLong(val, false, ok);
997 1076 if (ok) v = qVariantFromValue(d);
998 1077 }
999 1078 break;
1000 1079 case QMetaType::ULongLong:
1001 1080 {
1002 1081 quint64 d = PyObjGetULongLong(val, false, ok);
1003 1082 if (ok) v = qVariantFromValue(d);
1004 1083 }
1005 1084 break;
1006 1085 case QMetaType::Short:
1007 1086 {
1008 1087 short d = (short) PyObjGetInt(val,false,ok);
1009 1088 if (ok) v = qVariantFromValue(d);
1010 1089 break;
1011 1090 }
1012 1091 case QMetaType::UShort:
1013 1092 {
1014 1093 unsigned short d = (unsigned short) PyObjGetInt(val,false,ok);
1015 1094 if (ok) v = qVariantFromValue(d);
1016 1095 break;
1017 1096 }
1018 1097 case QMetaType::Char:
1019 1098 {
1020 1099 char d = (char) PyObjGetInt(val,false,ok);
1021 1100 if (ok) v = qVariantFromValue(d);
1022 1101 break;
1023 1102 }
1024 1103 case QMetaType::UChar:
1025 1104 {
1026 1105 unsigned char d = (unsigned char) PyObjGetInt(val,false,ok);
1027 1106 if (ok) v = qVariantFromValue(d);
1028 1107 break;
1029 1108 }
1030 1109
1031 1110 case QVariant::ByteArray:
1032 1111 case QVariant::String:
1033 1112 {
1034 1113 bool ok;
1035 1114 v = QVariant(PyObjGetString(val, false, ok));
1036 1115 }
1037 1116 break;
1038 1117
1039 1118 // these are important for MeVisLab
1040 1119 case QVariant::Map:
1041 1120 {
1042 1121 if (PyMapping_Check(val)) {
1043 1122 QMap<QString,QVariant> map;
1044 1123 PyObject* items = PyMapping_Items(val);
1045 1124 if (items) {
1046 1125 int count = PyList_Size(items);
1047 1126 PyObject* value;
1048 1127 PyObject* key;
1049 1128 PyObject* tuple;
1050 1129 for (int i = 0;i<count;i++) {
1051 1130 tuple = PyList_GetItem(items,i);
1052 1131 key = PyTuple_GetItem(tuple, 0);
1053 1132 value = PyTuple_GetItem(tuple, 1);
1054 1133 map.insert(PyObjGetString(key), PyObjToQVariant(value,-1));
1055 1134 }
1056 1135 Py_DECREF(items);
1057 1136 v = map;
1058 1137 }
1059 1138 }
1060 1139 }
1061 1140 break;
1062 1141 case QVariant::List:
1063 1142 if (PySequence_Check(val)) {
1064 1143 QVariantList list;
1065 1144 int count = PySequence_Size(val);
1066 1145 PyObject* value;
1067 1146 for (int i = 0;i<count;i++) {
1068 1147 value = PySequence_GetItem(val,i);
1069 1148 list.append(PyObjToQVariant(value, -1));
1070 1149 }
1071 1150 v = list;
1072 1151 }
1073 1152 break;
1074 1153 case QVariant::StringList:
1075 1154 {
1076 1155 bool ok;
1077 1156 QStringList l = PyObjToStringList(val, false, ok);
1078 1157 if (ok) {
1079 1158 v = l;
1080 1159 }
1081 1160 }
1082 1161 break;
1083 1162
1084 1163 default:
1085 1164 if (PyObject_TypeCheck(val, &PythonQtInstanceWrapper_Type)) {
1086 1165 PythonQtInstanceWrapper* wrap = (PythonQtInstanceWrapper*)val;
1087 1166 if (wrap->classInfo()->isCPPWrapper() && wrap->classInfo()->metaTypeId() == type) {
1088 1167 // construct a new variant from the C++ object if it has the same meta type
1089 1168 v = QVariant(type, wrap->_wrappedPtr);
1090 1169 } else {
1091 1170 v = QVariant();
1092 1171 }
1093 1172 } else {
1094 1173 v = QVariant();
1095 1174 }
1096 1175 }
1097 1176 return v;
1098 1177 }
1099 1178
1100 1179 PyObject* PythonQtConv::QStringToPyObject(const QString& str)
1101 1180 {
1102 1181 if (str.isNull()) {
1182 #ifdef PY3K
1183 return PyUnicode_New(0, 0);
1184 #else
1103 1185 return PyString_FromString("");
1186 #endif
1104 1187 } else {
1105 1188 return PyUnicode_DecodeUTF16((const char*)str.utf16(), str.length()*2, NULL, NULL);
1106 1189 }
1107 1190 }
1108 1191
1109 1192 PyObject* PythonQtConv::QStringListToPyObject(const QStringList& list)
1110 1193 {
1111 1194 PyObject* result = PyTuple_New(list.count());
1112 1195 int i = 0;
1113 1196 QString str;
1114 1197 Q_FOREACH (str, list) {
1115 1198 PyTuple_SET_ITEM(result, i, PythonQtConv::QStringToPyObject(str));
1116 1199 i++;
1117 1200 }
1118 1201 // why is the error state bad after this?
1119 1202 PyErr_Clear();
1120 1203 return result;
1121 1204 }
1122 1205
1123 1206 PyObject* PythonQtConv::QStringListToPyList(const QStringList& list)
1124 1207 {
1125 1208 PyObject* result = PyList_New(list.count());
1126 1209 int i = 0;
1127 1210 for (QStringList::ConstIterator it = list.begin(); it!=list.end(); ++it) {
1128 1211 PyList_SET_ITEM(result, i, PythonQtConv::QStringToPyObject(*it));
1129 1212 i++;
1130 1213 }
1131 1214 return result;
1132 1215 }
1133 1216
1134 1217 PyObject* PythonQtConv::QVariantToPyObject(const QVariant& v)
1135 1218 {
1136 1219 return ConvertQtValueToPythonInternal(v.userType(), (void*)v.constData());
1137 1220 }
1138 1221
1139 1222 PyObject* PythonQtConv::QVariantMapToPyObject(const QVariantMap& m) {
1140 1223 PyObject* result = PyDict_New();
1141 1224 QVariantMap::const_iterator t = m.constBegin();
1142 1225 PyObject* key;
1143 1226 PyObject* val;
1144 1227 for (;t!=m.end();t++) {
1145 1228 key = QStringToPyObject(t.key());
1146 1229 val = QVariantToPyObject(t.value());
1147 1230 PyDict_SetItem(result, key, val);
1148 1231 Py_DECREF(key);
1149 1232 Py_DECREF(val);
1150 1233 }
1151 1234 return result;
1152 1235 }
1153 1236
1154 1237 PyObject* PythonQtConv::QVariantListToPyObject(const QVariantList& l) {
1155 1238 PyObject* result = PyTuple_New(l.count());
1156 1239 int i = 0;
1157 1240 QVariant v;
1158 1241 Q_FOREACH (v, l) {
1159 1242 PyTuple_SET_ITEM(result, i, PythonQtConv::QVariantToPyObject(v));
1160 1243 i++;
1161 1244 }
1162 1245 // why is the error state bad after this?
1163 1246 PyErr_Clear();
1164 1247 return result;
1165 1248 }
1166 1249
1167 1250 PyObject* PythonQtConv::ConvertQListOfPointerTypeToPythonList(QList<void*>* list, const QByteArray& typeName)
1168 1251 {
1169 1252 PyObject* result = PyTuple_New(list->count());
1170 1253 int i = 0;
1171 1254 Q_FOREACH (void* value, *list) {
1172 1255 PyTuple_SET_ITEM(result, i, PythonQt::priv()->wrapPtr(value, typeName));
1173 1256 i++;
1174 1257 }
1175 1258 return result;
1176 1259 }
1177 1260
1178 1261 bool PythonQtConv::ConvertPythonListToQListOfPointerType(PyObject* obj, QList<void*>* list, const QByteArray& type, bool /*strict*/)
1179 1262 {
1180 1263 bool result = false;
1181 1264 if (PySequence_Check(obj)) {
1182 1265 result = true;
1183 1266 int count = PySequence_Size(obj);
1184 1267 PyObject* value;
1185 1268 for (int i = 0;i<count;i++) {
1186 1269 value = PySequence_GetItem(obj,i);
1187 1270 if (PyObject_TypeCheck(value, &PythonQtInstanceWrapper_Type)) {
1188 1271 PythonQtInstanceWrapper* wrap = (PythonQtInstanceWrapper*)value;
1189 1272 bool ok;
1190 1273 void* object = castWrapperTo(wrap, type, ok);
1191 1274 if (ok) {
1192 1275 list->append(object);
1193 1276 } else {
1194 1277 result = false;
1195 1278 break;
1196 1279 }
1197 1280 }
1198 1281 }
1199 1282 }
1200 1283 return result;
1201 1284 }
1202 1285
1203 1286 int PythonQtConv::getInnerTemplateMetaType(const QByteArray& typeName)
1204 1287 {
1205 1288 int idx = typeName.indexOf("<");
1206 1289 if (idx>0) {
1207 1290 int idx2 = typeName.indexOf(">");
1208 1291 if (idx2>0) {
1209 1292 QByteArray innerType = typeName.mid(idx+1,idx2-idx-1);
1210 1293 return QMetaType::type(innerType.constData());
1211 1294 }
1212 1295 }
1213 1296 return QMetaType::Void;
1214 1297 }
1215 1298
1216 1299
1217 1300 QString PythonQtConv::CPPObjectToString(int type, const void* data) {
1218 1301 QString r;
1219 1302 switch (type) {
1220 1303 case QVariant::Size: {
1221 1304 const QSize* s = static_cast<const QSize*>(data);
1222 1305 r = QString::number(s->width()) + ", " + QString::number(s->height());
1223 1306 }
1224 1307 break;
1225 1308 case QVariant::SizeF: {
1226 1309 const QSizeF* s = static_cast<const QSizeF*>(data);
1227 1310 r = QString::number(s->width()) + ", " + QString::number(s->height());
1228 1311 }
1229 1312 break;
1230 1313 case QVariant::Point: {
1231 1314 const QPoint* s = static_cast<const QPoint*>(data);
1232 1315 r = QString::number(s->x()) + ", " + QString::number(s->y());
1233 1316 }
1234 1317 break;
1235 1318 case QVariant::PointF: {
1236 1319 const QPointF* s = static_cast<const QPointF*>(data);
1237 1320 r = QString::number(s->x()) + ", " + QString::number(s->y());
1238 1321 }
1239 1322 break;
1240 1323 case QVariant::Rect: {
1241 1324 const QRect* s = static_cast<const QRect*>(data);
1242 1325 r = QString::number(s->x()) + ", " + QString::number(s->y());
1243 1326 r += ", " + QString::number(s->width()) + ", " + QString::number(s->height());
1244 1327 }
1245 1328 break;
1246 1329 case QVariant::RectF: {
1247 1330 const QRectF* s = static_cast<const QRectF*>(data);
1248 1331 r = QString::number(s->x()) + ", " + QString::number(s->y());
1249 1332 r += ", " + QString::number(s->width()) + ", " + QString::number(s->height());
1250 1333 }
1251 1334 break;
1252 1335 case QVariant::Date: {
1253 1336 const QDate* s = static_cast<const QDate*>(data);
1254 1337 r = s->toString(Qt::ISODate);
1255 1338 }
1256 1339 break;
1257 1340 case QVariant::DateTime: {
1258 1341 const QDateTime* s = static_cast<const QDateTime*>(data);
1259 1342 r = s->toString(Qt::ISODate);
1260 1343 }
1261 1344 break;
1262 1345 case QVariant::Time: {
1263 1346 const QTime* s = static_cast<const QTime*>(data);
1264 1347 r = s->toString(Qt::ISODate);
1265 1348 }
1266 1349 break;
1267 1350 case QVariant::Pixmap:
1268 1351 {
1269 1352 const QPixmap* s = static_cast<const QPixmap*>(data);
1270 1353 r = QString("Pixmap ") + QString::number(s->width()) + ", " + QString::number(s->height());
1271 1354 }
1272 1355 break;
1273 1356 case QVariant::Image:
1274 1357 {
1275 1358 const QImage* s = static_cast<const QImage*>(data);
1276 1359 r = QString("Image ") + QString::number(s->width()) + ", " + QString::number(s->height());
1277 1360 }
1278 1361 break;
1279 1362 case QVariant::Url:
1280 1363 {
1281 1364 const QUrl* s = static_cast<const QUrl*>(data);
1282 1365 r = s->toString();
1283 1366 }
1284 1367 break;
1285 1368 //TODO: add more printing for other variant types
1286 1369 default:
1287 1370 // this creates a copy, but that should not be expensive for typical simple variants
1288 1371 // (but we do not want to do this for our won user types!
1289 1372 if (type>0 && type < (int)QVariant::UserType) {
1290 1373 QVariant v(type, data);
1291 1374 r = v.toString();
1292 1375 }
1293 1376 }
1294 1377 return r;
1295 1378 }
@@ -1,828 +1,853
1 1 /*
2 2 *
3 3 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
4 4 *
5 5 * This library is free software; you can redistribute it and/or
6 6 * modify it under the terms of the GNU Lesser General Public
7 7 * License as published by the Free Software Foundation; either
8 8 * version 2.1 of the License, or (at your option) any later version.
9 9 *
10 10 * This library is distributed in the hope that it will be useful,
11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 13 * Lesser General Public License for more details.
14 14 *
15 15 * Further, this software is distributed without any warranty that it is
16 16 * free of the rightful claim of any third person regarding infringement
17 17 * or the like. Any license provided herein, whether implied or
18 18 * otherwise, applies only to this software file. Patent licenses, if
19 19 * any, provided herein do not apply to combinations of this program with
20 20 * other software, or any other product whatsoever.
21 21 *
22 22 * You should have received a copy of the GNU Lesser General Public
23 23 * License along with this library; if not, write to the Free Software
24 24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 25 *
26 26 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
27 27 * 28359 Bremen, Germany or:
28 28 *
29 29 * http://www.mevis.de
30 30 *
31 31 */
32 32
33 33 //----------------------------------------------------------------------------------
34 34 /*!
35 35 // \file PythonQtImporter.h
36 36 // \author Florian Link
37 37 // \author Last changed by $Author: florian $
38 38 // \date 2006-05
39 39 */
40 40 // This module was inspired by the zipimport.c module of the original
41 41 // Python distribution. Most of the functions are identical or slightly
42 42 // modified to do all the loading of Python files via an external file interface.
43 43 // In contrast to zipimport.c, this module also writes *.pyc files
44 44 // automatically if it has write access/is not inside of a zip file.
45 45 //----------------------------------------------------------------------------------
46 46
47 47 #include "PythonQtImporter.h"
48 48 #include "PythonQtImportFileInterface.h"
49 49 #include "PythonQt.h"
50 50 #include "PythonQtConversion.h"
51 51 #include <QFile>
52 52 #include <QFileInfo>
53 53
54 #if PY_MAJOR_VERSION >= 3
55 #define PY3K
56 #endif
57
54 58 #define IS_SOURCE 0x0
55 59 #define IS_BYTECODE 0x1
56 60 #define IS_PACKAGE 0x2
57 61
58 62 struct st_mlab_searchorder {
59 63 char suffix[14];
60 64 int type;
61 65 };
62 66
63 67 /* mlab_searchorder defines how we search for a module in the Zip
64 68 archive: we first search for a package __init__, then for
65 69 non-package .pyc, .pyo and .py entries. The .pyc and .pyo entries
66 70 are swapped by initmlabimport() if we run in optimized mode. Also,
67 71 '/' is replaced by SEP there. */
68 72 struct st_mlab_searchorder mlab_searchorder[] = {
69 73 {"/__init__.pyc", IS_PACKAGE | IS_BYTECODE},
70 74 {"/__init__.pyo", IS_PACKAGE | IS_BYTECODE},
71 75 {"/__init__.py", IS_PACKAGE | IS_SOURCE},
72 76 {".pyc", IS_BYTECODE},
73 77 {".pyo", IS_BYTECODE},
74 78 {".py", IS_SOURCE},
75 79 {"", 0}
76 80 };
77 81
78 82 extern PyTypeObject PythonQtImporter_Type;
79 83 PyObject *PythonQtImportError;
80 84
81 85 QString PythonQtImport::getSubName(const QString& str)
82 86 {
83 87 int idx = str.lastIndexOf('.');
84 88 if (idx!=-1) {
85 89 return str.mid(idx+1);
86 90 } else {
87 91 return str;
88 92 }
89 93 }
90 94
91 95 PythonQtImport::ModuleInfo PythonQtImport::getModuleInfo(PythonQtImporter* self, const QString& fullname)
92 96 {
93 97 ModuleInfo info;
94 98 QString subname;
95 99 struct st_mlab_searchorder *zso;
96 100
97 101 subname = getSubName(fullname);
98 102 QString path = *self->_path + "/" + subname;
99 103
100 104 QString test;
101 105 for (zso = mlab_searchorder; *zso->suffix; zso++) {
102 106 test = path + zso->suffix;
103 107 if (PythonQt::importInterface()->exists(test)) {
104 108 info.fullPath = test;
105 109 info.moduleName = subname;
106 110 info.type = (zso->type & IS_PACKAGE)?MI_PACKAGE:MI_MODULE;
107 111 return info;
108 112 }
109 113 }
110 114 // test if it is a shared library
111 115 Q_FOREACH(const QString& suffix, PythonQt::priv()->sharedLibrarySuffixes()) {
112 116 test = path+suffix;
113 117 if (PythonQt::importInterface()->exists(test)) {
114 118 info.fullPath = test;
115 119 info.moduleName = subname;
116 120 info.type = MI_SHAREDLIBRARY;
117 121 return info;
118 122 }
119 123 }
120 124 return info;
121 125 }
122 126
123 127
124 128 /* PythonQtImporter.__init__
125 129 Just store the path argument (or reject if it is in the ignorePaths list
126 130 */
127 131 int PythonQtImporter_init(PythonQtImporter *self, PyObject *args, PyObject * /*kwds*/)
128 132 {
129 133 self->_path = NULL;
130 134
131 135 const char* cpath;
132 136 if (!PyArg_ParseTuple(args, "s",
133 137 &cpath))
134 138 return -1;
135 139
136 140 QString path(cpath);
137 141 if (PythonQt::importInterface()->exists(path)) {
138 142 const QStringList& ignorePaths = PythonQt::self()->getImporterIgnorePaths();
139 143 Q_FOREACH(QString ignorePath, ignorePaths) {
140 144 if (path.startsWith(ignorePath)) {
141 145 PyErr_SetString(PythonQtImportError,
142 146 "path ignored");
143 147 return -1;
144 148 }
145 149 }
146 150
147 151 self->_path = new QString(path);
148 152 return 0;
149 153 } else {
150 154 PyErr_SetString(PythonQtImportError,
151 155 "path does not exist error");
152 156 return -1;
153 157 }
154 158 }
155 159
156 160 void
157 161 PythonQtImporter_dealloc(PythonQtImporter *self)
158 162 {
159 163 // free the stored path
160 164 if (self->_path) delete self->_path;
161 165 // free ourself
162 self->ob_type->tp_free((PyObject *)self);
166 Py_TYPE(self)->tp_free((PyObject *)self);
163 167 }
164 168
165 169
166 170 /* Check whether we can satisfy the import of the module named by
167 171 'fullname'. Return self if we can, None if we can't. */
168 172 PyObject *
169 173 PythonQtImporter_find_module(PyObject *obj, PyObject *args)
170 174 {
171 175 PythonQtImporter *self = (PythonQtImporter *)obj;
172 176 PyObject *path = NULL;
173 177 char *fullname;
174 178
175 179 if (!PyArg_ParseTuple(args, "s|O:PythonQtImporter.find_module",
176 180 &fullname, &path))
177 181 return NULL;
178 182
179 183 //qDebug() << "looking for " << fullname << " at " << *self->_path;
180 184
181 185 PythonQtImport::ModuleInfo info = PythonQtImport::getModuleInfo(self, fullname);
182 186 if (info.type != PythonQtImport::MI_NOT_FOUND) {
183 187 Py_INCREF(self);
184 188 return (PyObject *)self;
185 189 } else {
186 190 Py_INCREF(Py_None);
187 191 return Py_None;
188 192 }
189 193 }
190 194
191 195 /* Load and return the module named by 'fullname'. */
192 196 PyObject *
193 197 PythonQtImporter_load_module(PyObject *obj, PyObject *args)
194 198 {
195 199 PythonQtImporter *self = (PythonQtImporter *)obj;
196 200 PyObject *code = NULL, *mod = NULL, *dict = NULL;
197 201 char *fullname;
198 202
199 203 if (!PyArg_ParseTuple(args, "s:PythonQtImporter.load_module",
200 204 &fullname))
201 205 return NULL;
202 206
203 207 PythonQtImport::ModuleInfo info = PythonQtImport::getModuleInfo(self, fullname);
204 208 if (info.type == PythonQtImport::MI_NOT_FOUND) {
205 209 return NULL;
206 210 }
207 211
208 212 if (info.type == PythonQtImport::MI_PACKAGE || info.type == PythonQtImport::MI_MODULE) {
209 213 QString fullPath;
210 214 code = PythonQtImport::getModuleCode(self, fullname, fullPath);
211 215 if (code == NULL) {
212 216 return NULL;
213 217 }
214 218
215 219 mod = PyImport_AddModule(fullname);
216 220 if (mod == NULL) {
217 221 Py_DECREF(code);
218 222 return NULL;
219 223 }
220 224 dict = PyModule_GetDict(mod);
221 225
222 226 if (PyDict_SetItemString(dict, "__loader__", (PyObject *)self) != 0) {
223 227 Py_DECREF(code);
224 228 Py_DECREF(mod);
225 229 return NULL;
226 230 }
227 231
228 232 if (info.type == PythonQtImport::MI_PACKAGE) {
229 233 PyObject *pkgpath, *fullpath;
230 234 QString subname = info.moduleName;
231 235 int err;
232 236
237 #ifdef PY3K
238 fullpath = PyUnicode_FromFormat("%s%c%s",
239 #else
233 240 fullpath = PyString_FromFormat("%s%c%s",
241 #endif
234 242 self->_path->toLatin1().constData(),
235 243 SEP,
236 244 subname.toLatin1().constData());
237 245 if (fullpath == NULL) {
238 246 Py_DECREF(code);
239 247 Py_DECREF(mod);
240 248 return NULL;
241 249 }
242 250
243 251 pkgpath = Py_BuildValue("[O]", fullpath);
244 252 Py_DECREF(fullpath);
245 253 if (pkgpath == NULL) {
246 254 Py_DECREF(code);
247 255 Py_DECREF(mod);
248 256 return NULL;
249 257 }
250 258 err = PyDict_SetItemString(dict, "__path__", pkgpath);
251 259 Py_DECREF(pkgpath);
252 260 if (err != 0) {
253 261 Py_DECREF(code);
254 262 Py_DECREF(mod);
255 263 return NULL;
256 264 }
257 265 }
258 266
259 267 mod = PyImport_ExecCodeModuleEx(fullname, code, fullPath.toLatin1().data());
260 268
261 269 if (PythonQt::importInterface()) {
262 270 PythonQt::importInterface()->importedModule(fullname);
263 271 }
264 272
265 273 Py_DECREF(code);
266 274 if (Py_VerboseFlag) {
267 275 PySys_WriteStderr("import %s # loaded from %s\n",
268 276 fullname, fullPath.toLatin1().constData());
269 277 }
270 278 } else {
271 279 PythonQtObjectPtr imp;
272 280 imp.setNewRef(PyImport_ImportModule("imp"));
273 281
274 282 // Create a PyList with the current path as its single element,
275 283 // which is required for find_module (it won't accept a tuple...)
276 284 PythonQtObjectPtr pathList;
277 285 pathList.setNewRef(PythonQtConv::QStringListToPyList(QStringList() << *self->_path));
278 286
279 287 QVariantList args;
280 288 // Pass the module name without the package prefix
281 289 args.append(info.moduleName);
282 290 // And the path where we know that the shared library is
283 291 args.append(QVariant::fromValue(pathList));
284 292 QVariant result = imp.call("find_module", args);
285 293 if (result.isValid()) {
286 294 // This will return a tuple with (file, pathname, description=(suffix,mode,type))
287 295 QVariantList list = result.toList();
288 296 if (list.count()==3) {
289 297 // We prepend the full module name (including package prefix)
290 298 list.prepend(fullname);
291 299 #ifdef __linux
292 300 #ifdef _DEBUG
293 301 // imp_find_module() does not respect the debug suffix '_d' on Linux,
294 302 // so it does not return the correct file path and we correct it now
295 303 // find_module opened a file to the release library, but that file handle is
296 304 // ignored on Linux and Windows, maybe on MacOS also.
297 305 list[2] = info.fullPath;
298 306 #endif
299 307 #endif
300 308 // And call "load_module" with (fullname, file, pathname, description=(suffix,mode,type))
301 309 PythonQtObjectPtr module = imp.call("load_module", list);
302 310 mod = module.object();
303 311 if (mod) {
304 312 Py_INCREF(mod);
305 313 }
306 314
307 315 // Finally, we need to close the file again, which find_module opened for us
308 316 PythonQtObjectPtr file = list.at(1);
309 317 file.call("close");
310 318 }
311 319 }
312 320 }
313 321 return mod;
314 322 }
315 323
316 324
317 325 PyObject *
318 326 PythonQtImporter_get_data(PyObject* /*obj*/, PyObject* /*args*/)
319 327 {
320 328 // EXTRA, NOT YET IMPLEMENTED
321 329 return NULL;
322 330 }
323 331
324 332 PyObject *
325 333 PythonQtImporter_get_code(PyObject *obj, PyObject *args)
326 334 {
327 335 PythonQtImporter *self = (PythonQtImporter *)obj;
328 336 char *fullname;
329 337
330 338 if (!PyArg_ParseTuple(args, "s:PythonQtImporter.get_code", &fullname))
331 339 return NULL;
332 340
333 341 QString notused;
334 342 return PythonQtImport::getModuleCode(self, fullname, notused);
335 343 }
336 344
337 345 PyObject *
338 346 PythonQtImporter_get_source(PyObject * /*obj*/, PyObject * /*args*/)
339 347 {
340 348 // EXTRA, NOT YET IMPLEMENTED
341 349 return NULL;
342 350 }
343 351
344 352 PyDoc_STRVAR(doc_find_module,
345 353 "find_module(fullname, path=None) -> self or None.\n\
346 354 \n\
347 355 Search for a module specified by 'fullname'. 'fullname' must be the\n\
348 356 fully qualified (dotted) module name. It returns the PythonQtImporter\n\
349 357 instance itself if the module was found, or None if it wasn't.\n\
350 358 The optional 'path' argument is ignored -- it's there for compatibility\n\
351 359 with the importer protocol.");
352 360
353 361 PyDoc_STRVAR(doc_load_module,
354 362 "load_module(fullname) -> module.\n\
355 363 \n\
356 364 Load the module specified by 'fullname'. 'fullname' must be the\n\
357 365 fully qualified (dotted) module name. It returns the imported\n\
358 366 module, or raises PythonQtImportError if it wasn't found.");
359 367
360 368 PyDoc_STRVAR(doc_get_data,
361 369 "get_data(pathname) -> string with file data.\n\
362 370 \n\
363 371 Return the data associated with 'pathname'. Raise IOError if\n\
364 372 the file wasn't found.");
365 373
366 374 PyDoc_STRVAR(doc_get_code,
367 375 "get_code(fullname) -> code object.\n\
368 376 \n\
369 377 Return the code object for the specified module. Raise PythonQtImportError\n\
370 378 is the module couldn't be found.");
371 379
372 380 PyDoc_STRVAR(doc_get_source,
373 381 "get_source(fullname) -> source string.\n\
374 382 \n\
375 383 Return the source code for the specified module. Raise PythonQtImportError\n\
376 384 is the module couldn't be found, return None if the archive does\n\
377 385 contain the module, but has no source for it.");
378 386
379 387 PyMethodDef PythonQtImporter_methods[] = {
380 388 {"find_module", PythonQtImporter_find_module, METH_VARARGS,
381 389 doc_find_module},
382 390 {"load_module", PythonQtImporter_load_module, METH_VARARGS,
383 391 doc_load_module},
384 392 {"get_data", PythonQtImporter_get_data, METH_VARARGS,
385 393 doc_get_data},
386 394 {"get_code", PythonQtImporter_get_code, METH_VARARGS,
387 395 doc_get_code},
388 396 {"get_source", PythonQtImporter_get_source, METH_VARARGS,
389 397 doc_get_source},
390 398 {NULL, NULL, 0 , NULL} /* sentinel */
391 399 };
392 400
393 401
394 402 PyDoc_STRVAR(PythonQtImporter_doc,
395 403 "PythonQtImporter(path) -> PythonQtImporter object\n\
396 404 \n\
397 405 Create a new PythonQtImporter instance. 'path' must be a valid path on disk/or inside of a zip file known to MeVisLab\n\
398 406 . Every path is accepted.");
399 407
400 408 #define DEFERRED_ADDRESS(ADDR) 0
401 409
402 410 PyTypeObject PythonQtImporter_Type = {
403 PyObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type))
404 0,
411 PyVarObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type), 0)
405 412 "PythonQtImport.PythonQtImporter",
406 413 sizeof(PythonQtImporter),
407 414 0, /* tp_itemsize */
408 415 (destructor)PythonQtImporter_dealloc, /* tp_dealloc */
409 416 0, /* tp_print */
410 417 0, /* tp_getattr */
411 418 0, /* tp_setattr */
412 419 0, /* tp_compare */
413 420 0, /* tp_repr */
414 421 0, /* tp_as_number */
415 422 0, /* tp_as_sequence */
416 423 0, /* tp_as_mapping */
417 424 0, /* tp_hash */
418 425 0, /* tp_call */
419 426 0, /* tp_str */
420 427 PyObject_GenericGetAttr, /* tp_getattro */
421 428 0, /* tp_setattro */
422 429 0, /* tp_as_buffer */
423 430 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE , /* tp_flags */
424 431 PythonQtImporter_doc, /* tp_doc */
425 432 0, /* tp_traverse */
426 433 0, /* tp_clear */
427 434 0, /* tp_richcompare */
428 435 0, /* tp_weaklistoffset */
429 436 0, /* tp_iter */
430 437 0, /* tp_iternext */
431 438 PythonQtImporter_methods, /* tp_methods */
432 439 0, /* tp_members */
433 440 0, /* tp_getset */
434 441 0, /* tp_base */
435 442 0, /* tp_dict */
436 443 0, /* tp_descr_get */
437 444 0, /* tp_descr_set */
438 445 0, /* tp_dictoffset */
439 446 (initproc)PythonQtImporter_init, /* tp_init */
440 447 PyType_GenericAlloc, /* tp_alloc */
441 448 PyType_GenericNew, /* tp_new */
442 449 PyObject_Del, /* tp_free */
443 450 };
444 451
445 452
446 453 /* Given a buffer, return the long that is represented by the first
447 454 4 bytes, encoded as little endian. This partially reimplements
448 455 marshal.c:r_long() */
449 456 long
450 457 PythonQtImport::getLong(unsigned char *buf)
451 458 {
452 459 long x;
453 460 x = buf[0];
454 461 x |= (long)buf[1] << 8;
455 462 x |= (long)buf[2] << 16;
456 463 x |= (long)buf[3] << 24;
457 464 #if SIZEOF_LONG > 4
458 465 /* Sign extension for 64-bit machines */
459 466 x |= -(x & 0x80000000L);
460 467 #endif
461 468 return x;
462 469 }
463 470
464 471 FILE *
465 472 open_exclusive(const QString& filename)
466 473 {
467 474 #if defined(O_EXCL)&&defined(O_CREAT)&&defined(O_WRONLY)&&defined(O_TRUNC)
468 475 /* Use O_EXCL to avoid a race condition when another process tries to
469 476 write the same file. When that happens, our open() call fails,
470 477 which is just fine (since it's only a cache).
471 478 XXX If the file exists and is writable but the directory is not
472 479 writable, the file will never be written. Oh well.
473 480 */
474 481 QFile::remove(filename);
475 482
476 483 int fd;
477 484 int flags = O_EXCL|O_CREAT|O_WRONLY|O_TRUNC;
478 485 #ifdef O_BINARY
479 486 flags |= O_BINARY; /* necessary for Windows */
480 487 #endif
481 488 #ifdef WIN32
482 489 fd = _wopen(filename.ucs2(), flags, 0666);
483 490 #else
484 491 fd = open(filename.local8Bit(), flags, 0666);
485 492 #endif
486 493 if (fd < 0)
487 494 return NULL;
488 495 return fdopen(fd, "wb");
489 496 #else
490 497 /* Best we can do -- on Windows this can't happen anyway */
491 498 return fopen(filename.toLocal8Bit().constData(), "wb");
492 499 #endif
493 500 }
494 501
495 502
496 503 void PythonQtImport::writeCompiledModule(PyCodeObject *co, const QString& filename, long mtime)
497 504 {
498 505 FILE *fp;
499 506 // we do not want to write Qt resources to disk, do we?
500 507 if (filename.startsWith(":")) {
501 508 return;
502 509 }
503 510 fp = open_exclusive(filename);
504 511 if (fp == NULL) {
505 512 if (Py_VerboseFlag)
506 513 PySys_WriteStderr(
507 514 "# can't create %s\n", filename.toLatin1().constData());
508 515 return;
509 516 }
510 517 #if PY_VERSION_HEX < 0x02040000
511 518 PyMarshal_WriteLongToFile(PyImport_GetMagicNumber(), fp);
512 519 #else
513 520 PyMarshal_WriteLongToFile(PyImport_GetMagicNumber(), fp, Py_MARSHAL_VERSION);
514 521 #endif
515 522 /* First write a 0 for mtime */
516 523 #if PY_VERSION_HEX < 0x02040000
517 524 PyMarshal_WriteLongToFile(0L, fp);
518 525 #else
519 526 PyMarshal_WriteLongToFile(0L, fp, Py_MARSHAL_VERSION);
520 527 #endif
521 528 #if PY_VERSION_HEX < 0x02040000
522 529 PyMarshal_WriteObjectToFile((PyObject *)co, fp);
523 530 #else
524 531 PyMarshal_WriteObjectToFile((PyObject *)co, fp, Py_MARSHAL_VERSION);
525 532 #endif
526 533 if (ferror(fp)) {
527 534 if (Py_VerboseFlag)
528 535 PySys_WriteStderr("# can't write %s\n", filename.toLatin1().constData());
529 536 /* Don't keep partial file */
530 537 fclose(fp);
531 538 QFile::remove(filename);
532 539 return;
533 540 }
534 541 /* Now write the true mtime */
535 542 fseek(fp, 4L, 0);
536 543 #if PY_VERSION_HEX < 0x02040000
537 544 PyMarshal_WriteLongToFile(mtime, fp);
538 545 #else
539 546 PyMarshal_WriteLongToFile(mtime, fp, Py_MARSHAL_VERSION);
540 547 #endif
541 548 fflush(fp);
542 549 fclose(fp);
543 550 if (Py_VerboseFlag)
544 551 PySys_WriteStderr("# wrote %s\n", filename.toLatin1().constData());
545 552 //#ifdef macintosh
546 553 // PyMac_setfiletype(cpathname, 'Pyth', 'PYC ');
547 554 //#endif
548 555 }
549 556
550 557 /* Given the contents of a .py[co] file in a buffer, unmarshal the data
551 558 and return the code object. Return None if it the magic word doesn't
552 559 match (we do this instead of raising an exception as we fall back
553 560 to .py if available and we don't want to mask other errors).
554 561 Returns a new reference. */
555 562 PyObject *
556 563 PythonQtImport::unmarshalCode(const QString& path, const QByteArray& data, time_t mtime)
557 564 {
558 565 PyObject *code;
559 566 // ugly cast, but Python API is not const safe
560 567 char *buf = (char*) data.constData();
561 568 int size = data.size();
562 569
563 570 if (size <= 9) {
564 571 PySys_WriteStderr("# %s has bad pyc data\n",
565 572 path.toLatin1().constData());
566 573 Py_INCREF(Py_None);
567 574 return Py_None;
568 575 }
569 576
570 577 if (getLong((unsigned char *)buf) != PyImport_GetMagicNumber()) {
571 578 if (Py_VerboseFlag)
572 579 PySys_WriteStderr("# %s has bad magic\n",
573 580 path.toLatin1().constData());
574 581 Py_INCREF(Py_None);
575 582 return Py_None;
576 583 }
577 584
578 585 if (mtime != 0) {
579 586 time_t timeDiff = getLong((unsigned char *)buf + 4) - mtime;
580 587 if (timeDiff<0) { timeDiff = -timeDiff; }
581 588 if (timeDiff > 1) {
582 589 if (Py_VerboseFlag)
583 590 PySys_WriteStderr("# %s has bad mtime\n",
584 591 path.toLatin1().constData());
585 592 Py_INCREF(Py_None);
586 593 return Py_None;
587 594 }
588 595 }
589 596
590 597 code = PyMarshal_ReadObjectFromString(buf + 8, size - 8);
591 598 if (code == NULL)
592 599 return NULL;
593 600 if (!PyCode_Check(code)) {
594 601 Py_DECREF(code);
595 602 PyErr_Format(PyExc_TypeError,
596 603 "compiled module %.200s is not a code object",
597 604 path.toLatin1().constData());
598 605 return NULL;
599 606 }
600 607 return code;
601 608 }
602 609
603 610
604 611 /* Given a string buffer containing Python source code, compile it
605 612 return and return a code object as a new reference. */
606 613 PyObject *
607 614 PythonQtImport::compileSource(const QString& path, const QByteArray& data)
608 615 {
609 616 PyObject *code;
610 617 QByteArray data1 = data;
611 618 // in qt4, data is null terminated
612 619 // data1.resize(data.size()+1);
613 620 // data1.data()[data.size()-1] = 0;
614 621 code = Py_CompileString(data.data(), path.toLatin1().constData(),
615 622 Py_file_input);
616 623 return code;
617 624 }
618 625
619 626
620 627 /* Return the code object for the module named by 'fullname' from the
621 628 Zip archive as a new reference. */
622 629 PyObject *
623 630 PythonQtImport::getCodeFromData(const QString& path, int isbytecode,int /*ispackage*/, time_t mtime)
624 631 {
625 632 PyObject *code;
626 633
627 634 QByteArray qdata;
628 635 if (!isbytecode) {
629 636 // mlabDebugConst("MLABPython", "reading source " << path);
630 637 bool ok;
631 638 qdata = PythonQt::importInterface()->readSourceFile(path, ok);
632 639 if (!ok) {
633 640 // mlabErrorConst("PythonQtImporter","File could not be verified" << path);
634 641 return NULL;
635 642 }
636 643 if (qdata == " ") {
637 644 qdata.clear();
638 645 }
639 646 } else {
640 647 qdata = PythonQt::importInterface()->readFileAsBytes(path);
641 648 }
642 649
643 650 if (isbytecode) {
644 651 // mlabDebugConst("MLABPython", "reading bytecode " << path);
645 652 code = unmarshalCode(path, qdata, mtime);
646 653 }
647 654 else {
648 655 // mlabDebugConst("MLABPython", "compiling source " << path);
649 656 code = compileSource(path, qdata);
650 657 if (code) {
651 658 // save a pyc file if possible
652 659 QDateTime time;
653 660 time = PythonQt::importInterface()->lastModifiedDate(path);
654 661 writeCompiledModule((PyCodeObject*)code, path+"c", time.toTime_t());
655 662 }
656 663 }
657 664 return code;
658 665 }
659 666
660 667 time_t
661 668 PythonQtImport::getMTimeOfSource(const QString& path)
662 669 {
663 670 time_t mtime = 0;
664 671 QString path2 = path;
665 672 path2.truncate(path.length()-1);
666 673
667 674 if (PythonQt::importInterface()->exists(path2)) {
668 675 QDateTime t = PythonQt::importInterface()->lastModifiedDate(path2);
669 676 if (t.isValid()) {
670 677 mtime = t.toTime_t();
671 678 }
672 679 }
673 680
674 681 return mtime;
675 682 }
676 683
677 684 /* Get the code object associated with the module specified by
678 685 'fullname'. */
679 686 PyObject *
680 687 PythonQtImport::getModuleCode(PythonQtImporter *self, const char* fullname, QString& modpath)
681 688 {
682 689 QString subname;
683 690 struct st_mlab_searchorder *zso;
684 691
685 692 subname = getSubName(fullname);
686 693 QString path = *self->_path + "/" + subname;
687 694
688 695 QString test;
689 696 for (zso = mlab_searchorder; *zso->suffix; zso++) {
690 697 PyObject *code = NULL;
691 698 test = path + zso->suffix;
692 699
693 700 if (Py_VerboseFlag > 1)
694 701 PySys_WriteStderr("# trying %s\n",
695 702 test.toLatin1().constData());
696 703 if (PythonQt::importInterface()->exists(test)) {
697 704 time_t mtime = 0;
698 705 int ispackage = zso->type & IS_PACKAGE;
699 706 int isbytecode = zso->type & IS_BYTECODE;
700 707
701 708 // if ignoreUpdatedPythonSourceFiles() returns true, then mtime stays 0
702 709 // and unmarshalCode() in getCodeFromData() will always read an existing *.pyc file,
703 710 // even if a newer *.py file exists. This is a release optimization where
704 711 // typically only *.pyc files are delivered without *.py files and reading file
705 712 // modification time is slow.
706 713 if (isbytecode && !PythonQt::importInterface()->ignoreUpdatedPythonSourceFiles()) {
707 714 mtime = getMTimeOfSource(test);
708 715 }
709 716 code = getCodeFromData(test, isbytecode, ispackage, mtime);
710 717 if (code == Py_None) {
711 718 Py_DECREF(code);
712 719 continue;
713 720 }
714 721 if (code != NULL) {
715 722 modpath = test;
716 723 }
717 724 return code;
718 725 }
719 726 }
720 727 PyErr_Format(PythonQtImportError, "can't find module '%.200s'", fullname);
721 728
722 729 return NULL;
723 730 }
724 731
725 732 QString PythonQtImport::replaceExtension(const QString& str, const QString& ext)
726 733 {
727 734 QString r;
728 735 int i = str.lastIndexOf('.');
729 736 if (i!=-1) {
730 737 r = str.mid(0,i) + "." + ext;
731 738 } else {
732 739 r = str + "." + ext;
733 740 }
734 741 return r;
735 742 }
736 743
737 744 PyObject* PythonQtImport::getCodeFromPyc(const QString& file)
738 745 {
739 746 PyObject* code;
740 747 const static QString pycStr("pyc");
741 748 QString pyc = replaceExtension(file, pycStr);
742 749 if (PythonQt::importInterface()->exists(pyc)) {
743 750 time_t mtime = 0;
744 751 // if ignoreUpdatedPythonSourceFiles() returns true, then mtime stays 0
745 752 // and unmarshalCode() in getCodeFromData() will always read an existing *.pyc file,
746 753 // even if a newer *.py file exists. This is a release optimization where
747 754 // typically only *.pyc files are delivered without *.py files and reading file
748 755 // modification time is slow.
749 756 if (!PythonQt::importInterface()->ignoreUpdatedPythonSourceFiles()) {
750 757 mtime = getMTimeOfSource(pyc);
751 758 }
752 759 code = getCodeFromData(pyc, true, false, mtime);
753 760 if (code != Py_None && code != NULL) {
754 761 return code;
755 762 }
756 763 if (code) {
757 764 Py_DECREF(code);
758 765 }
759 766 }
760 767 code = getCodeFromData(file,false,false,0);
761 768 return code;
762 769 }
763 770
764 771 /* Module init */
765 772
766 773 PyDoc_STRVAR(mlabimport_doc,
767 774 "Imports python files into PythonQt, completely replaces internal python import");
768 775
776 #ifdef PY3K
777 static struct PyModuleDef PythonQtImport_def = {
778 PyModuleDef_HEAD_INIT,
779 "PythonQtImport", /* m_name */
780 mlabimport_doc, /* m_doc */
781 -1, /* m_size */
782 NULL, /* m_methods */
783 NULL, /* m_reload */
784 NULL, /* m_traverse */
785 NULL, /* m_clear */
786 NULL /* m_free */
787 };
788 #endif
789
769 790 void PythonQtImport::init()
770 791 {
771 792 static bool first = true;
772 793 if (!first) {
773 794 return;
774 795 }
775 796 first = false;
776 797
777 798 PyObject *mod;
778 799
779 800 if (PyType_Ready(&PythonQtImporter_Type) < 0)
780 801 return;
781 802
782 803 /* Correct directory separator */
783 804 mlab_searchorder[0].suffix[0] = SEP;
784 805 mlab_searchorder[1].suffix[0] = SEP;
785 806 mlab_searchorder[2].suffix[0] = SEP;
786 807 if (Py_OptimizeFlag) {
787 808 /* Reverse *.pyc and *.pyo */
788 809 struct st_mlab_searchorder tmp;
789 810 tmp = mlab_searchorder[0];
790 811 mlab_searchorder[0] = mlab_searchorder[1];
791 812 mlab_searchorder[1] = tmp;
792 813 tmp = mlab_searchorder[3];
793 814 mlab_searchorder[3] = mlab_searchorder[4];
794 815 mlab_searchorder[4] = tmp;
795 816 }
796 817
818 #ifdef PY3K
819 mod = PyModule_Create(&PythonQtImport_def);
820 #else
797 821 mod = Py_InitModule4("PythonQtImport", NULL, mlabimport_doc,
798 822 NULL, PYTHON_API_VERSION);
823 #endif
799 824
800 825 PythonQtImportError = PyErr_NewException(const_cast<char*>("PythonQtImport.PythonQtImportError"),
801 826 PyExc_ImportError, NULL);
802 827 if (PythonQtImportError == NULL)
803 828 return;
804 829
805 830 Py_INCREF(PythonQtImportError);
806 831 if (PyModule_AddObject(mod, "PythonQtImportError",
807 832 PythonQtImportError) < 0)
808 833 return;
809 834
810 835 Py_INCREF(&PythonQtImporter_Type);
811 836 if (PyModule_AddObject(mod, "PythonQtImporter",
812 837 (PyObject *)&PythonQtImporter_Type) < 0)
813 838 return;
814 839
815 840 // set our importer into the path_hooks to handle all path on sys.path
816 841 PyObject* classobj = PyDict_GetItemString(PyModule_GetDict(mod), "PythonQtImporter");
817 842 PyObject* path_hooks = PySys_GetObject(const_cast<char*>("path_hooks"));
818 843 PyList_Append(path_hooks, classobj);
819 844
820 845 #ifndef WIN32
821 846 // reload the encodings module, because it might fail to custom import requirements (e.g. encryption).
822 847 PyObject* modules = PyImport_GetModuleDict();
823 848 PyObject* encodingsModule = PyDict_GetItemString(modules, "encodings");
824 849 if (encodingsModule != NULL) {
825 850 PyImport_ReloadModule(encodingsModule);
826 851 }
827 852 #endif
828 853 }
@@ -1,774 +1,848
1 1 /*
2 2 *
3 3 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
4 4 *
5 5 * This library is free software; you can redistribute it and/or
6 6 * modify it under the terms of the GNU Lesser General Public
7 7 * License as published by the Free Software Foundation; either
8 8 * version 2.1 of the License, or (at your option) any later version.
9 9 *
10 10 * This library is distributed in the hope that it will be useful,
11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 13 * Lesser General Public License for more details.
14 14 *
15 15 * Further, this software is distributed without any warranty that it is
16 16 * free of the rightful claim of any third person regarding infringement
17 17 * or the like. Any license provided herein, whether implied or
18 18 * otherwise, applies only to this software file. Patent licenses, if
19 19 * any, provided herein do not apply to combinations of this program with
20 20 * other software, or any other product whatsoever.
21 21 *
22 22 * You should have received a copy of the GNU Lesser General Public
23 23 * License along with this library; if not, write to the Free Software
24 24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 25 *
26 26 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
27 27 * 28359 Bremen, Germany or:
28 28 *
29 29 * http://www.mevis.de
30 30 *
31 31 */
32 32
33 33 //----------------------------------------------------------------------------------
34 34 /*!
35 35 // \file PythonQtInstanceWrapper.cpp
36 36 // \author Florian Link
37 37 // \author Last changed by $Author: florian $
38 38 // \date 2006-05
39 39 */
40 40 //----------------------------------------------------------------------------------
41 41
42 42 #include "PythonQtInstanceWrapper.h"
43 43 #include <QObject>
44 44 #include "PythonQt.h"
45 45 #include "PythonQtSlot.h"
46 46 #include "PythonQtSignal.h"
47 47 #include "PythonQtClassInfo.h"
48 48 #include "PythonQtConversion.h"
49 49 #include "PythonQtClassWrapper.h"
50 50
51 #if PY_MAJOR_VERSION >= 3
52 #define PY3K
53 #endif
54
51 55 PythonQtClassInfo* PythonQtInstanceWrapperStruct::classInfo()
52 56 {
53 57 // take the class info from our type object
54 return ((PythonQtClassWrapper*)ob_type)->_classInfo;
58 return ((PythonQtClassWrapper*)Py_TYPE(this))->_classInfo;
55 59 }
56 60
57 61 static void PythonQtInstanceWrapper_deleteObject(PythonQtInstanceWrapper* self, bool force = false) {
58 62
59 63 // is this a C++ wrapper?
60 64 if (self->_wrappedPtr) {
61 65 //mlabDebugConst("Python","c++ wrapper removed " << self->_wrappedPtr << " " << self->_obj->className() << " " << self->classInfo()->wrappedClassName().latin1());
62 66
63 67 PythonQt::priv()->removeWrapperPointer(self->_wrappedPtr);
64 68 // we own our qobject, so we delete it now:
65 69 delete self->_obj;
66 70 self->_obj = NULL;
67 71 if (force || self->_ownedByPythonQt) {
68 72 int type = self->classInfo()->metaTypeId();
69 73 if (self->_useQMetaTypeDestroy && type>=0) {
70 74 // use QMetaType to destroy the object
71 75 QMetaType::destroy(type, self->_wrappedPtr);
72 76 } else {
73 77 PythonQtSlotInfo* slot = self->classInfo()->destructor();
74 78 if (slot) {
75 79 void* args[2];
76 80 args[0] = NULL;
77 81 args[1] = &self->_wrappedPtr;
78 82 slot->decorator()->qt_metacall(QMetaObject::InvokeMetaMethod, slot->slotIndex(), args);
79 83 self->_wrappedPtr = NULL;
80 84 } else {
81 85 if (type>=0) {
82 86 // use QMetaType to destroy the object
83 87 QMetaType::destroy(type, self->_wrappedPtr);
84 88 } else {
85 89 // TODO: warn about not being able to destroy the object?
86 90 }
87 91 }
88 92 }
89 93 }
90 94 } else {
91 95 //mlabDebugConst("Python","qobject wrapper removed " << self->_obj->className() << " " << self->classInfo()->wrappedClassName().latin1());
92 96 if (self->_objPointerCopy) {
93 97 PythonQt::priv()->removeWrapperPointer(self->_objPointerCopy);
94 98 }
95 99 if (self->_obj) {
96 100 if (force || self->_ownedByPythonQt) {
97 101 if (force || !self->_obj->parent()) {
98 102 delete self->_obj;
99 103 }
100 104 } else {
101 105 if (self->_obj->parent()==NULL) {
102 106 // tell someone who is interested that the qobject is no longer wrapped, if it has no parent
103 107 PythonQt::qObjectNoLongerWrappedCB(self->_obj);
104 108 }
105 109 }
106 110 }
107 111 }
108 112 self->_obj = NULL;
109 113 }
110 114
111 115 static void PythonQtInstanceWrapper_dealloc(PythonQtInstanceWrapper* self)
112 116 {
113 117 PythonQtInstanceWrapper_deleteObject(self);
114 118 self->_obj.~QPointer<QObject>();
115 self->ob_type->tp_free((PyObject*)self);
119 Py_TYPE(self)->tp_free((PyObject*)self);
116 120 }
117 121
118 122 static PyObject* PythonQtInstanceWrapper_new(PyTypeObject *type, PyObject * /*args*/, PyObject * /*kwds*/)
119 123 {
120 124 //PythonQtClassWrapper *classType = (PythonQtClassWrapper*)type;
121 125 PythonQtInstanceWrapper *self;
122 126 static PyObject* emptyTuple = NULL;
123 127 if (emptyTuple==NULL) {
124 128 emptyTuple = PyTuple_New(0);
125 129 }
126 130
127 131 self = (PythonQtInstanceWrapper*)PyBaseObject_Type.tp_new(type, emptyTuple, NULL);
128 132
129 133 if (self != NULL) {
130 134 new (&self->_obj) QPointer<QObject>();
131 135 self->_wrappedPtr = NULL;
132 136 self->_ownedByPythonQt = false;
133 137 self->_useQMetaTypeDestroy = false;
134 138 self->_isShellInstance = false;
135 139 }
136 140 return (PyObject *)self;
137 141 }
138 142
139 143 int PythonQtInstanceWrapper_init(PythonQtInstanceWrapper * self, PyObject * args, PyObject * kwds)
140 144 {
141 145 if (args == PythonQtPrivate::dummyTuple()) {
142 146 // we are called from the internal PythonQt API, so our data will be filled later on...
143 147 return 0;
144 148 }
145 149
146 150 // we are called from python, try to construct our object
147 151 if (self->classInfo()->constructors()) {
148 152 void* directCPPPointer = NULL;
149 153 PythonQtSlotFunction_CallImpl(self->classInfo(), NULL, self->classInfo()->constructors(), args, kwds, NULL, &directCPPPointer);
150 154 if (PyErr_Occurred()) {
151 155 return -1;
152 156 }
153 157 if (directCPPPointer) {
154 158 // change ownershipflag to be owned by PythonQt
155 159 self->_ownedByPythonQt = true;
156 160 self->_useQMetaTypeDestroy = false;
157 161 if (self->classInfo()->isCPPWrapper()) {
158 162 self->_wrappedPtr = directCPPPointer;
159 163 // TODO xxx: if there is a wrapper factory, we might want to generate a wrapper for our class?!
160 164 } else {
161 165 self->setQObject((QObject*)directCPPPointer);
162 166 }
163 167 // register with PythonQt
164 168 PythonQt::priv()->addWrapperPointer(directCPPPointer, self);
165 169
166 170 PythonQtShellSetInstanceWrapperCB* cb = self->classInfo()->shellSetInstanceWrapperCB();
167 171 if (cb) {
168 172 // if we are a derived python class, we set the wrapper
169 173 // to activate the shell class, otherwise we just ignore that it is a shell...
170 174 // we detect it be checking if the type does not have PythonQtInstanceWrapper_Type as direct base class,
171 175 // which is the case for all non-python derived types
172 176 if (((PyObject*)self)->ob_type->tp_base != &PythonQtInstanceWrapper_Type) {
173 177 // set the wrapper and remember that we have a shell instance!
174 178 (*cb)(directCPPPointer, self);
175 179 self->_isShellInstance = true;
176 180 }
177 181 }
178 182 }
179 183 } else {
180 184 QString error = QString("No constructors available for ") + self->classInfo()->className();
181 185 PyErr_SetString(PyExc_ValueError, error.toLatin1().data());
182 186 return -1;
183 187 }
184 188 return 0;
185 189 }
186 190
187 191 static PyObject *PythonQtInstanceWrapper_richcompare(PythonQtInstanceWrapper* wrapper, PyObject* other, int code)
188 192 {
189 193 bool validPtrs = false;
190 194 bool areSamePtrs = false;
191 195 if (PyObject_TypeCheck((PyObject*)wrapper, &PythonQtInstanceWrapper_Type)) {
192 196 if (PyObject_TypeCheck(other, &PythonQtInstanceWrapper_Type)) {
193 197 validPtrs = true;
194 198 PythonQtInstanceWrapper* w1 = wrapper;
195 199 PythonQtInstanceWrapper* w2 = (PythonQtInstanceWrapper*)other;
196 200 // check pointers directly
197 201 if (w1->_wrappedPtr != NULL) {
198 202 if (w1->_wrappedPtr == w2->_wrappedPtr) {
199 203 areSamePtrs = true;
200 204 }
201 205 } else if (w1->_obj == w2->_obj) {
202 206 areSamePtrs = true;
203 207 }
204 208 } else if (other == Py_None) {
205 209 validPtrs = true;
206 210 if (wrapper->_obj || wrapper->_wrappedPtr) {
207 211 areSamePtrs = false;
208 212 } else {
209 213 areSamePtrs = true;
210 214 }
211 215 }
212 216 }
213 217
214 218 if ((wrapper->classInfo()->typeSlots() & PythonQt::Type_RichCompare) == 0) {
215 219 // shortcut if richcompare is not supported:
216 220 if (validPtrs && code == Py_EQ) {
217 221 return PythonQtConv::GetPyBool(areSamePtrs);
218 222 } else if (validPtrs && code == Py_NE) {
219 223 return PythonQtConv::GetPyBool(!areSamePtrs);
220 224 }
221 225 Py_INCREF(Py_NotImplemented);
222 226 return Py_NotImplemented;
223 227 }
224 228
225 229 QByteArray memberName;
226 230 switch (code) {
227 231 case Py_LT:
228 232 {
229 233 static QByteArray name = "__lt__";
230 234 memberName = name;
231 235 }
232 236 break;
233 237
234 238 case Py_LE:
235 239 {
236 240 static QByteArray name = "__le__";
237 241 memberName = name;
238 242 }
239 243 break;
240 244
241 245 case Py_EQ:
242 246 {
243 247 static QByteArray name = "__eq__";
244 248 memberName = name;
245 249 }
246 250 break;
247 251
248 252 case Py_NE:
249 253 {
250 254 static QByteArray name = "__ne__";
251 255 memberName = name;
252 256 }
253 257 break;
254 258
255 259 case Py_GT:
256 260 {
257 261 static QByteArray name = "__gt__";
258 262 memberName = name;
259 263 }
260 264 break;
261 265
262 266 case Py_GE:
263 267 {
264 268 static QByteArray name = "__ge__";
265 269 memberName = name;
266 270 }
267 271 break;
268 272 }
269 273
270 274 PythonQtMemberInfo opSlot = wrapper->classInfo()->member(memberName);
271 275 if (opSlot._type == PythonQtMemberInfo::Slot) {
272 276 // TODO get rid of tuple
273 277 PyObject* args = PyTuple_New(1);
274 278 Py_INCREF(other);
275 279 PyTuple_SET_ITEM(args, 0, other);
276 280 PyObject* result = PythonQtSlotFunction_CallImpl(wrapper->classInfo(), wrapper->_obj, opSlot._slot, args, NULL, wrapper->_wrappedPtr);
277 281 Py_DECREF(args);
278 282 return result;
279 283 } else {
280 284 // not implemented, let python try something else!
281 285 Py_INCREF(Py_NotImplemented);
282 286 return Py_NotImplemented;
283 287 }
284 288 }
285 289
286 290
287 291 static PyObject *PythonQtInstanceWrapper_classname(PythonQtInstanceWrapper* obj)
288 292 {
289 return PyString_FromString(obj->ob_type->tp_name);
293 #ifdef PY3K
294 return PyUnicode_FromString(Py_TYPE(obj)->tp_name);
295 #else
296 return PyString_FromString(Py_TYPE(obj)->tp_name);
297 #endif
290 298 }
291 299
292 300 PyObject *PythonQtInstanceWrapper_inherits(PythonQtInstanceWrapper* obj, PyObject *args)
293 301 {
294 302 char *name = NULL;
295 303 if (!PyArg_ParseTuple(args, "s:PythonQtInstanceWrapper.inherits",&name)) {
296 304 return NULL;
297 305 }
298 306 return PythonQtConv::GetPyBool(obj->classInfo()->inherits(name));
299 307 }
300 308
301 309 static PyObject *PythonQtInstanceWrapper_help(PythonQtInstanceWrapper* obj)
302 310 {
303 311 return PythonQt::self()->helpCalled(obj->classInfo());
304 312 }
305 313
306 314 PyObject *PythonQtInstanceWrapper_delete(PythonQtInstanceWrapper * self)
307 315 {
308 316 PythonQtInstanceWrapper_deleteObject(self, true);
309 317 Py_INCREF(Py_None);
310 318 return Py_None;
311 319 }
312 320
313 321
314 322 static PyMethodDef PythonQtInstanceWrapper_methods[] = {
315 323 {"className", (PyCFunction)PythonQtInstanceWrapper_classname, METH_NOARGS,
316 324 "Return the classname of the object"
317 325 },
318 326 {"inherits", (PyCFunction)PythonQtInstanceWrapper_inherits, METH_VARARGS,
319 327 "Returns if the class inherits or is of given type name"
320 328 },
321 329 {"help", (PyCFunction)PythonQtInstanceWrapper_help, METH_NOARGS,
322 330 "Shows the help of available methods for this class"
323 331 },
324 332 {"delete", (PyCFunction)PythonQtInstanceWrapper_delete, METH_NOARGS,
325 333 "Deletes the C++ object (at your own risk, my friend!)"
326 334 },
327 335 {NULL, NULL, 0, NULL} /* Sentinel */
328 336 };
329 337
330 338
331 339 static PyObject *PythonQtInstanceWrapper_getattro(PyObject *obj,PyObject *name)
332 340 {
333 341 const char *attributeName;
334 342 PythonQtInstanceWrapper *wrapper = (PythonQtInstanceWrapper *)obj;
335 343
344 #ifdef PY3K
345 if ((attributeName = PyUnicode_AsUTF8(name)) == NULL) {
346 #else
336 347 if ((attributeName = PyString_AsString(name)) == NULL) {
348 #endif
337 349 return NULL;
338 350 }
339 351
340 352 if (qstrcmp(attributeName, "__dict__")==0) {
341 353 PyObject* dict = PyBaseObject_Type.tp_getattro(obj, name);
342 354 dict = PyDict_Copy(dict);
343 355
344 356 if (wrapper->_obj) {
345 357 // only the properties are missing, the rest is already available from
346 358 // PythonQtClassWrapper...
347 359 QStringList l = wrapper->classInfo()->propertyList();
348 360 Q_FOREACH (QString name, l) {
349 361 PyObject* o = PyObject_GetAttrString(obj, name.toLatin1().data());
350 362 if (o) {
351 363 PyDict_SetItemString(dict, name.toLatin1().data(), o);
352 364 Py_DECREF(o);
353 365 } else {
354 366 std::cerr << "PythonQtInstanceWrapper: something is wrong, could not get attribute " << name.toLatin1().data();
355 367 }
356 368 }
357 369
358 370 QList<QByteArray> dynamicProps = wrapper->_obj->dynamicPropertyNames();
359 371 Q_FOREACH (QByteArray name, dynamicProps) {
360 372 PyObject* o = PyObject_GetAttrString(obj, name.data());
361 373 if (o) {
362 374 PyDict_SetItemString(dict, name.data(), o);
363 375 Py_DECREF(o);
364 376 } else {
365 377 std::cerr << "PythonQtInstanceWrapper: dynamic property could not be read " << name.data();
366 378 }
367 379 }
368 380 }
369 381 // Note: we do not put children into the dict, is would look confusing?!
370 382 return dict;
371 383 }
372 384
373 385 // first look in super, to return derived methods from base object first
374 386 PyObject* superAttr = PyBaseObject_Type.tp_getattro(obj, name);
375 387 if (superAttr) {
376 388 return superAttr;
377 389 }
378 390 PyErr_Clear();
379 391
380 392 // mlabDebugConst("Python","get " << attributeName);
381 393
382 394 PythonQtMemberInfo member = wrapper->classInfo()->member(attributeName);
383 395 switch (member._type) {
384 396 case PythonQtMemberInfo::Property:
385 397 if (wrapper->_obj) {
386 398 if (member._property.userType() != QVariant::Invalid) {
387 399
388 400 PythonQt::ProfilingCB* profilingCB = PythonQt::priv()->profilingCB();
389 401 if (profilingCB) {
390 402 QString methodName = "getProperty(";
391 403 methodName += attributeName;
392 404 methodName += ")";
393 405 profilingCB(PythonQt::Enter, wrapper->_obj->metaObject()->className(), methodName.toLatin1());
394 406 }
395 407
396 408 PyObject* value = PythonQtConv::QVariantToPyObject(member._property.read(wrapper->_obj));
397 409
398 410 if (profilingCB) {
399 411 profilingCB(PythonQt::Leave, NULL, NULL);
400 412 }
401 413
402 414 return value;
403 415
404 416 } else {
405 417 Py_INCREF(Py_None);
406 418 return Py_None;
407 419 }
408 420 } else {
409 421 QString error = QString("Trying to read property '") + attributeName + "' from a destroyed " + wrapper->classInfo()->className() + " object";
410 422 PyErr_SetString(PyExc_ValueError, error.toLatin1().data());
411 423 return NULL;
412 424 }
413 425 break;
414 426 case PythonQtMemberInfo::Slot:
415 427 return PythonQtSlotFunction_New(member._slot, obj, NULL);
416 428 break;
417 429 case PythonQtMemberInfo::Signal:
418 430 return PythonQtSignalFunction_New(member._slot, obj, NULL);
419 431 break;
420 432 case PythonQtMemberInfo::EnumValue:
421 433 {
422 434 PyObject* enumValue = member._enumValue;
423 435 Py_INCREF(enumValue);
424 436 return enumValue;
425 437 }
426 438 break;
427 439 case PythonQtMemberInfo::EnumWrapper:
428 440 {
429 441 PyObject* enumWrapper = member._enumWrapper;
430 442 Py_INCREF(enumWrapper);
431 443 return enumWrapper;
432 444 }
433 445 break;
434 446 case PythonQtMemberInfo::NotFound:
435 447 {
436 448 static const QByteArray getterString("py_get_");
437 449 // check for a getter slot
438 450 PythonQtMemberInfo member = wrapper->classInfo()->member(getterString + attributeName);
439 451 if (member._type == PythonQtMemberInfo::Slot) {
440 452 return PythonQtSlotFunction_CallImpl(wrapper->classInfo(), wrapper->_obj, member._slot, NULL, NULL, wrapper->_wrappedPtr);
441 453 }
442 454
443 455 // handle dynamic properties
444 456 if (wrapper->_obj) {
445 457 QVariant v = wrapper->_obj->property(attributeName);
446 458 if (v.isValid()) {
447 459 return PythonQtConv::QVariantToPyObject(v);
448 460 }
449 461 }
450 462 }
451 463 break;
452 464 default:
453 465 // is an invalid type, go on
454 466 break;
455 467 }
456 468
457 469 // look for the internal methods (className(), help())
470 #ifdef PY3K
471 PyObject* internalMethod = PyObject_GenericGetAttr(obj, name);
472 #else
458 473 PyObject* internalMethod = Py_FindMethod( PythonQtInstanceWrapper_methods, obj, (char*)attributeName);
474 #endif
459 475 if (internalMethod) {
460 476 return internalMethod;
461 477 }
462 478 PyErr_Clear();
463 479
464 480 if (wrapper->_obj) {
465 481 // look for a child
466 482 QObjectList children = wrapper->_obj->children();
467 483 for (int i = 0; i < children.count(); i++) {
468 484 QObject *child = children.at(i);
469 485 if (child->objectName() == attributeName) {
470 486 return PythonQt::priv()->wrapQObject(child);
471 487 }
472 488 }
473 489 }
474 490
475 491 QString error = QString(wrapper->classInfo()->className()) + " has no attribute named '" + QString(attributeName) + "'";
476 492 PyErr_SetString(PyExc_AttributeError, error.toLatin1().data());
477 493 return NULL;
478 494 }
479 495
480 496 static int PythonQtInstanceWrapper_setattro(PyObject *obj,PyObject *name,PyObject *value)
481 497 {
482 498 QString error;
483 499 const char *attributeName;
484 500 PythonQtInstanceWrapper *wrapper = (PythonQtInstanceWrapper *)obj;
485 501
502 #ifdef PY3K
503 if ((attributeName = PyUnicode_AsUTF8(name)) == NULL)
504 #else
486 505 if ((attributeName = PyString_AsString(name)) == NULL)
506 #endif
487 507 return -1;
488 508
489 509 PythonQtMemberInfo member = wrapper->classInfo()->member(attributeName);
490 510 if (member._type == PythonQtMemberInfo::Property) {
491 511
492 512 if (!wrapper->_obj) {
493 513 error = QString("Trying to set property '") + attributeName + "' on a destroyed " + wrapper->classInfo()->className() + " object";
494 514 PyErr_SetString(PyExc_AttributeError, error.toLatin1().data());
495 515 return -1;
496 516 }
497 517
498 518 QMetaProperty prop = member._property;
499 519 if (prop.isWritable()) {
500 520 QVariant v;
501 521 if (prop.isEnumType()) {
502 522 // this will give us either a string or an int, everything else will probably be an error
503 523 v = PythonQtConv::PyObjToQVariant(value);
504 524 } else {
505 525 int t = prop.userType();
506 526 v = PythonQtConv::PyObjToQVariant(value, t);
507 527 }
508 528 bool success = false;
509 529 if (v.isValid()) {
510 530 PythonQt::ProfilingCB* profilingCB = PythonQt::priv()->profilingCB();
511 531 if (profilingCB) {
512 532 QString methodName = "setProperty(";
513 533 methodName += attributeName;
514 534 methodName += ")";
515 535 profilingCB(PythonQt::Enter, wrapper->_obj->metaObject()->className(), methodName.toLatin1());
516 536 }
517 537
518 538 success = prop.write(wrapper->_obj, v);
519 539
520 540 if (profilingCB) {
521 541 profilingCB(PythonQt::Leave, NULL, NULL);
522 542 }
523 543 }
524 544 if (success) {
525 545 return 0;
526 546 } else {
527 547 error = QString("Property '") + attributeName + "' of type '" +
528 548 prop.typeName() + "' does not accept an object of type "
529 549 + QString(value->ob_type->tp_name) + " (" + PythonQtConv::PyObjGetRepresentation(value) + ")";
530 550 }
531 551 } else {
532 552 error = QString("Property '") + attributeName + "' of " + obj->ob_type->tp_name + " object is not writable";
533 553 }
534 554 } else if (member._type == PythonQtMemberInfo::Slot) {
535 555 error = QString("Slot '") + attributeName + "' can not be overwritten on " + obj->ob_type->tp_name + " object";
536 556 } else if (member._type == PythonQtMemberInfo::Signal) {
537 557 error = QString("Signal '") + attributeName + "' can not be overwritten on " + obj->ob_type->tp_name + " object";
538 558 } else if (member._type == PythonQtMemberInfo::EnumValue) {
539 559 error = QString("EnumValue '") + attributeName + "' can not be overwritten on " + obj->ob_type->tp_name + " object";
540 560 } else if (member._type == PythonQtMemberInfo::EnumWrapper) {
541 561 error = QString("Enum '") + attributeName + "' can not be overwritten on " + obj->ob_type->tp_name + " object";
542 562 } else if (member._type == PythonQtMemberInfo::NotFound) {
543 563 // check for a setter slot
544 564 static const QByteArray setterString("py_set_");
545 565 PythonQtMemberInfo setter = wrapper->classInfo()->member(setterString + attributeName);
546 566 if (setter._type == PythonQtMemberInfo::Slot) {
547 567 // call the setter and ignore the result value
548 568 void* result;
549 569 PyObject* args = PyTuple_New(1);
550 570 Py_INCREF(value);
551 571 PyTuple_SET_ITEM(args, 0, value);
552 572 PythonQtSlotFunction_CallImpl(wrapper->classInfo(), wrapper->_obj, setter._slot, args, NULL, wrapper->_wrappedPtr, &result);
553 573 Py_DECREF(args);
554 574 return 0;
555 575 }
556 576
557 577 // handle dynamic properties
558 578 if (wrapper->_obj) {
559 579 QVariant prop = wrapper->_obj->property(attributeName);
560 580 if (prop.isValid()) {
561 581 QVariant v = PythonQtConv::PyObjToQVariant(value);
562 582 if (v.isValid()) {
563 583 wrapper->_obj->setProperty(attributeName, v);
564 584 return 0;
565 585 } else {
566 586 error = QString("Dynamic property '") + attributeName + "' does not accept an object of type "
567 587 + QString(value->ob_type->tp_name) + " (" + PythonQtConv::PyObjGetRepresentation(value) + ")";
568 588 PyErr_SetString(PyExc_AttributeError, error.toLatin1().data());
569 589 return -1;
570 590 }
571 591 }
572 592 }
573 593
574 594 // if we are a derived python class, we allow setting attributes.
575 595 // if we are a direct CPP wrapper, we do NOT allow it, since
576 596 // it would be confusing to allow it because a wrapper will go away when it is not seen by python anymore
577 597 // and when it is recreated from a CPP pointer the attributes are gone...
578 598 if (obj->ob_type->tp_base != &PythonQtInstanceWrapper_Type) {
579 599 return PyBaseObject_Type.tp_setattro(obj,name,value);
580 600 } else {
581 601 error = QString("'") + attributeName + "' does not exist on " + obj->ob_type->tp_name + " and creating new attributes on C++ objects is not allowed";
582 602 }
583 603 }
584 604
585 605 PyErr_SetString(PyExc_AttributeError, error.toLatin1().data());
586 606 return -1;
587 607 }
588 608
589 609 static QString getStringFromObject(PythonQtInstanceWrapper* wrapper) {
590 610 QString result;
591 611 if (wrapper->_wrappedPtr) {
592 612 // first try some manually string conversions for some variants
593 613 int metaid = wrapper->classInfo()->metaTypeId();
594 614 result = PythonQtConv::CPPObjectToString(metaid, wrapper->_wrappedPtr);
595 615 if (!result.isEmpty()) {
596 616 return result;
597 617 }
598 618 }
599 619 if (wrapper->_wrappedPtr || wrapper->_obj) {
600 620 // next, try to call py_toString
601 621 PythonQtMemberInfo info = wrapper->classInfo()->member("py_toString");
602 622 if (info._type == PythonQtMemberInfo::Slot) {
603 623 PyObject* resultObj = PythonQtSlotFunction_CallImpl(wrapper->classInfo(), wrapper->_obj, info._slot, NULL, NULL, wrapper->_wrappedPtr);
604 624 if (resultObj) {
605 625 // TODO this is one conversion too much, would be nicer to call the slot directly...
606 626 result = PythonQtConv::PyObjGetString(resultObj);
607 627 Py_DECREF(resultObj);
608 628 }
609 629 }
610 630 }
611 631 return result;
612 632 }
613 633
614 634 static PyObject * PythonQtInstanceWrapper_str(PyObject * obj)
615 635 {
616 636 PythonQtInstanceWrapper* wrapper = (PythonQtInstanceWrapper*)obj;
617 637
618 638 // QByteArray should be directly returned as a str
619 639 if (wrapper->classInfo()->metaTypeId()==QVariant::ByteArray) {
620 640 QByteArray* b = (QByteArray*) wrapper->_wrappedPtr;
621 641 if (b->data()) {
642 #ifdef PY3K
643 return PyUnicode_FromStringAndSize(b->data(), b->size());
644 #else
622 645 return PyString_FromStringAndSize(b->data(), b->size());
646 #endif
623 647 } else {
648 #ifdef PY3K
649 return PyUnicode_New(0, 0);
650 #else
624 651 return PyString_FromString("");
652 #endif
625 653 }
626 654 }
627 655
628 656 const char* typeName = obj->ob_type->tp_name;
629 657 QObject *qobj = wrapper->_obj;
630 658 QString str = getStringFromObject(wrapper);
631 659 if (!str.isEmpty()) {
660 #ifdef PY3K
661 return PyUnicode_FromFormat("%s", str.toLatin1().constData());
662 #else
632 663 return PyString_FromFormat("%s", str.toLatin1().constData());
664 #endif
633 665 }
634 666 if (wrapper->_wrappedPtr) {
635 667 if (wrapper->_obj) {
636 return PyString_FromFormat("%s (C++ Object %p wrapped by %s %p))", typeName, wrapper->_wrappedPtr, wrapper->_obj->metaObject()->className(), qobj);
668 #ifdef PY3K
669 return PyUnicode_FromFormat("%s (C++ Object %p wrapped by %s %p)", typeName, wrapper->_wrappedPtr, wrapper->_obj->metaObject()->className(), qobj);
670 #else
671 return PyString_FromFormat("%s (C++ Object %p wrapped by %s %p)", typeName, wrapper->_wrappedPtr, wrapper->_obj->metaObject()->className(), qobj);
672 #endif
637 673 } else {
674 #ifdef PY3K
675 return PyUnicode_FromFormat("%s (C++ Object %p)", typeName, wrapper->_wrappedPtr);
676 #else
638 677 return PyString_FromFormat("%s (C++ Object %p)", typeName, wrapper->_wrappedPtr);
678 #endif
639 679 }
640 680 } else {
681 #ifdef PY3K
682 return PyUnicode_FromFormat("%s (QObject %p)", typeName, qobj);
683 #else
641 684 return PyString_FromFormat("%s (QObject %p)", typeName, qobj);
685 #endif
642 686 }
643 687 }
644 688
645 689 static PyObject * PythonQtInstanceWrapper_repr(PyObject * obj)
646 690 {
647 691 PythonQtInstanceWrapper* wrapper = (PythonQtInstanceWrapper*)obj;
648 692 const char* typeName = obj->ob_type->tp_name;
649 693
650 694 QObject *qobj = wrapper->_obj;
651 695 QString str = getStringFromObject(wrapper);
652 696 if (!str.isEmpty()) {
653 697 if (str.startsWith(typeName)) {
698 #ifdef PY3K
699 return PyUnicode_FromFormat("%s", str.toLatin1().constData());
700 #else
654 701 return PyString_FromFormat("%s", str.toLatin1().constData());
702 #endif
655 703 } else {
704 #ifdef PY3K
705 return PyUnicode_FromFormat("%s (%s, at: %p)", typeName, str.toLatin1().constData(), wrapper->_wrappedPtr ? wrapper->_wrappedPtr : qobj);
706 #else
656 707 return PyString_FromFormat("%s (%s, at: %p)", typeName, str.toLatin1().constData(), wrapper->_wrappedPtr ? wrapper->_wrappedPtr : qobj);
708 #endif
657 709 }
658 710 }
659 711 if (wrapper->_wrappedPtr) {
660 712 if (wrapper->_obj) {
713 #ifdef PY3K
714 return PyUnicode_FromFormat("%s (C++ object at: %p wrapped by %s at: %p)", typeName, wrapper->_wrappedPtr, wrapper->_obj->metaObject()->className(), qobj);
715 #else
661 716 return PyString_FromFormat("%s (C++ object at: %p wrapped by %s at: %p)", typeName, wrapper->_wrappedPtr, wrapper->_obj->metaObject()->className(), qobj);
717 #endif
662 718 } else {
719 #ifdef PY3K
720 return PyUnicode_FromFormat("%s (C++ object at: %p)", typeName, wrapper->_wrappedPtr);
721 #else
663 722 return PyString_FromFormat("%s (C++ object at: %p)", typeName, wrapper->_wrappedPtr);
723 #endif
664 724 }
665 725 } else {
726 #ifdef PY3K
727 return PyUnicode_FromFormat("%s (%s at: %p)", typeName, wrapper->classInfo()->className(), qobj);
728 #else
666 729 return PyString_FromFormat("%s (%s at: %p)", typeName, wrapper->classInfo()->className(), qobj);
730 #endif
667 731 }
668 732 }
669 733
670 734 static int PythonQtInstanceWrapper_builtin_nonzero(PyObject *obj)
671 735 {
672 736 PythonQtInstanceWrapper* wrapper = (PythonQtInstanceWrapper*)obj;
673 737 return (wrapper->_wrappedPtr == NULL && wrapper->_obj == NULL)?0:1;
674 738 }
675 739
676 740
677 741 static long PythonQtInstanceWrapper_hash(PythonQtInstanceWrapper *obj)
678 742 {
679 743 if (obj->_wrappedPtr != NULL) {
680 744 return reinterpret_cast<long>(obj->_wrappedPtr);
681 745 } else {
682 746 QObject* qobj = obj->_obj; // get pointer from QPointer wrapper
683 747 return reinterpret_cast<long>(qobj);
684 748 }
685 749 }
686 750
687 751
688 752
689 753 // we override nb_nonzero, so that one can do 'if' expressions to test for a NULL ptr
690 754 static PyNumberMethods PythonQtInstanceWrapper_as_number = {
691 755 0, /* nb_add */
692 756 0, /* nb_subtract */
693 757 0, /* nb_multiply */
758 #ifndef PY3K
694 759 0, /* nb_divide */
760 #endif
695 761 0, /* nb_remainder */
696 762 0, /* nb_divmod */
697 763 0, /* nb_power */
698 764 0, /* nb_negative */
699 765 0, /* nb_positive */
700 766 0, /* nb_absolute */
701 PythonQtInstanceWrapper_builtin_nonzero, /* nb_nonzero */
767 PythonQtInstanceWrapper_builtin_nonzero, /* nb_nonzero / nb_bool in Py3K */
702 768 0, /* nb_invert */
703 769 0, /* nb_lshift */
704 770 0, /* nb_rshift */
705 771 0, /* nb_and */
706 772 0, /* nb_xor */
707 773 0, /* nb_or */
774 #ifndef PY3K
708 775 0, /* nb_coerce */
776 #endif
709 777 0, /* nb_int */
710 0, /* nb_long */
778 0, /* nb_long / nb_reserved in Py3K */
711 779 0, /* nb_float */
780 #ifndef PY3K
712 781 0, /* nb_oct */
713 782 0, /* nb_hex */
783 #endif
714 784 0, /* nb_inplace_add */
715 785 0, /* nb_inplace_subtract */
716 786 0, /* nb_inplace_multiply */
787 #ifndef PY3K
717 788 0, /* nb_inplace_divide */
789 #endif
718 790 0, /* nb_inplace_remainder */
719 791 0, /* nb_inplace_power */
720 792 0, /* nb_inplace_lshift */
721 793 0, /* nb_inplace_rshift */
722 794 0, /* nb_inplace_and */
723 795 0, /* nb_inplace_xor */
724 796 0, /* nb_inplace_or */
725 797 0, /* nb_floor_divide */
726 798 0, /* nb_true_divide */
727 799 0, /* nb_inplace_floor_divide */
728 800 0, /* nb_inplace_true_divide */
801 #ifdef PY3K
802 0, /* nb_index in Py3K */
803 #endif
729 804 };
730 805
731 806 PyTypeObject PythonQtInstanceWrapper_Type = {
732 PyObject_HEAD_INIT(&PythonQtClassWrapper_Type)
733 0, /*ob_size*/
807 PyVarObject_HEAD_INIT(&PythonQtClassWrapper_Type, 0)
734 808 "PythonQt.PythonQtInstanceWrapper", /*tp_name*/
735 809 sizeof(PythonQtInstanceWrapper), /*tp_basicsize*/
736 810 0, /*tp_itemsize*/
737 811 (destructor)PythonQtInstanceWrapper_dealloc, /*tp_dealloc*/
738 812 0, /*tp_print*/
739 813 0, /*tp_getattr*/
740 814 0, /*tp_setattr*/
741 815 0, /*tp_compare*/
742 816 PythonQtInstanceWrapper_repr, /*tp_repr*/
743 817 &PythonQtInstanceWrapper_as_number, /*tp_as_number*/
744 818 0, /*tp_as_sequence*/
745 819 0, /*tp_as_mapping*/
746 820 (hashfunc)PythonQtInstanceWrapper_hash, /*tp_hash */
747 821 0, /*tp_call*/
748 822 PythonQtInstanceWrapper_str, /*tp_str*/
749 823 PythonQtInstanceWrapper_getattro, /*tp_getattro*/
750 824 PythonQtInstanceWrapper_setattro, /*tp_setattro*/
751 825 0, /*tp_as_buffer*/
752 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_CHECKTYPES, /*tp_flags*/
826 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE /*| Py_TPFLAGS_CHECKTYPES FIXME Py_TPFLAGS_CHECKTYPES removal */, /*tp_flags*/
753 827 "PythonQtInstanceWrapper object", /* tp_doc */
754 828 0, /* tp_traverse */
755 829 0, /* tp_clear */
756 830 (richcmpfunc)PythonQtInstanceWrapper_richcompare, /* tp_richcompare */
757 831 0, /* tp_weaklistoffset */
758 832 0, /* tp_iter */
759 833 0, /* tp_iternext */
760 834 0, /* tp_methods */
761 835 0, /* tp_members */
762 836 0, /* tp_getset */
763 837 0, /* tp_base */
764 838 0, /* tp_dict */
765 839 0, /* tp_descr_get */
766 840 0, /* tp_descr_set */
767 841 0, /* tp_dictoffset */
768 842 (initproc)PythonQtInstanceWrapper_init, /* tp_init */
769 843 0, /* tp_alloc */
770 844 PythonQtInstanceWrapper_new, /* tp_new */
771 845 };
772 846
773 847 //-------------------------------------------------------
774 848
@@ -1,56 +1,72
1 1 /*
2 2 *
3 3 * Copyright (C) 2011 MeVis Medical Solutions AG All Rights Reserved.
4 4 *
5 5 * This library is free software; you can redistribute it and/or
6 6 * modify it under the terms of the GNU Lesser General Public
7 7 * License as published by the Free Software Foundation; either
8 8 * version 2.1 of the License, or (at your option) any later version.
9 9 *
10 10 * This library is distributed in the hope that it will be useful,
11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 13 * Lesser General Public License for more details.
14 14 *
15 15 * Further, this software is distributed without any warranty that it is
16 16 * free of the rightful claim of any third person regarding infringement
17 17 * or the like. Any license provided herein, whether implied or
18 18 * otherwise, applies only to this software file. Patent licenses, if
19 19 * any, provided herein do not apply to combinations of this program with
20 20 * other software, or any other product whatsoever.
21 21 *
22 22 * You should have received a copy of the GNU Lesser General Public
23 23 * License along with this library; if not, write to the Free Software
24 24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 25 *
26 26 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
27 27 * 28359 Bremen, Germany or:
28 28 *
29 29 * http://www.mevis.de
30 30 *
31 31 */
32 32
33 33 #ifndef __PythonQtPythonInclude_h
34 34 #define __PythonQtPythonInclude_h
35 35
36 36 // Undefine macros that Python.h defines to avoid redefinition warning.
37 37 #undef _POSIX_C_SOURCE
38 38 #undef _POSIX_THREADS
39 39 #undef _XOPEN_SOURCE
40 40
41 // Undefine Qt keywords that conflict with Python headers
42 #ifdef slots
43 #undef slots
44 #define PYTHONQT_RESTORE_KEYWORDS
45 #endif
46
41 47 // If PYTHONQT_USE_RELEASE_PYTHON_FALLBACK is enabled, try to link
42 48 // release Python DLL if it is available by undefining _DEBUG while
43 49 // including Python.h
44 50 #if defined(PYTHONQT_USE_RELEASE_PYTHON_FALLBACK) && defined(_DEBUG)
45 51 #undef _DEBUG
46 52 #if defined(_MSC_VER) && _MSC_VER >= 1400
47 53 #define _CRT_NOFORCE_MANIFEST 1
48 54 #define _STL_NOFORCE_MANIFEST 1
49 55 #endif
50 56 #include <Python.h>
51 57 #define _DEBUG
52 58 #else
53 59 #include <Python.h>
54 60 #endif
55 61
62 // get Qt keywords back
63 #ifdef PYTHONQT_RESTORE_KEYWORDS
64 #define slots Q_SLOTS
65 #undef PYTHONQT_RESTORE_KEYWORDS
66 #endif
67
68 #if PY_MAJOR_VERSION >= 3
69 #define PY3K
70 #endif
71
56 72 #endif
@@ -1,366 +1,410
1 1 /*
2 2 *
3 3 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
4 4 *
5 5 * This library is free software; you can redistribute it and/or
6 6 * modify it under the terms of the GNU Lesser General Public
7 7 * License as published by the Free Software Foundation; either
8 8 * version 2.1 of the License, or (at your option) any later version.
9 9 *
10 10 * This library is distributed in the hope that it will be useful,
11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 13 * Lesser General Public License for more details.
14 14 *
15 15 * Further, this software is distributed without any warranty that it is
16 16 * free of the rightful claim of any third person regarding infringement
17 17 * or the like. Any license provided herein, whether implied or
18 18 * otherwise, applies only to this software file. Patent licenses, if
19 19 * any, provided herein do not apply to combinations of this program with
20 20 * other software, or any other product whatsoever.
21 21 *
22 22 * You should have received a copy of the GNU Lesser General Public
23 23 * License along with this library; if not, write to the Free Software
24 24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 25 *
26 26 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
27 27 * 28359 Bremen, Germany or:
28 28 *
29 29 * http://www.mevis.de
30 30 *
31 31 */
32 32
33 33 //----------------------------------------------------------------------------------
34 34 /*!
35 35 // \file PythonQtSignal.cpp
36 36 // \author Florian Link
37 37 // \author Last changed by $Author: florian $
38 38 // \date 2012-02
39 39 */
40 40 //----------------------------------------------------------------------------------
41 41
42 42 #include "PythonQt.h"
43 43 #include "PythonQtSignal.h"
44 44 #include "PythonQtInstanceWrapper.h"
45 45 #include "PythonQtClassInfo.h"
46 46 #include "PythonQtMisc.h"
47 47 #include "PythonQtConversion.h"
48 48 #include "PythonQtSlot.h"
49 49
50 50 #include <iostream>
51 51
52 52 #include <exception>
53 53 #include <stdexcept>
54 54
55 55 #include <QByteArray>
56 56
57 57 //-----------------------------------------------------------------------------------
58 58
59 59 static PythonQtSignalFunctionObject *PythonQtSignal_free_list = NULL;
60 60
61 61 PyObject *PythonQtSignalFunction_Call(PyObject *func, PyObject *args, PyObject *kw)
62 62 {
63 63 PythonQtSignalFunctionObject* f = (PythonQtSignalFunctionObject*)func;
64 64 return PythonQtMemberFunction_Call(f->m_ml, f->m_self, args, kw);
65 65 }
66 66
67 67 PyObject *
68 68 PythonQtSignalFunction_New(PythonQtSlotInfo *ml, PyObject *self, PyObject *module)
69 69 {
70 70 PythonQtSignalFunctionObject *op;
71 71 op = PythonQtSignal_free_list;
72 72 if (op != NULL) {
73 73 PythonQtSignal_free_list = (PythonQtSignalFunctionObject *)(op->m_self);
74 74 PyObject_INIT(op, &PythonQtSignalFunction_Type);
75 75 }
76 76 else {
77 77 op = PyObject_GC_New(PythonQtSignalFunctionObject, &PythonQtSignalFunction_Type);
78 78 if (op == NULL)
79 79 return NULL;
80 80 }
81 81 op->m_ml = ml;
82 82 Py_XINCREF(self);
83 83 op->m_self = self;
84 84 Py_XINCREF(module);
85 85 op->m_module = module;
86 86 PyObject_GC_Track(op);
87 87 return (PyObject *)op;
88 88 }
89 89
90 90 /* Methods (the standard built-in methods, that is) */
91 91
92 92 static void
93 93 meth_dealloc(PythonQtSignalFunctionObject *m)
94 94 {
95 95 PyObject_GC_UnTrack(m);
96 96 Py_XDECREF(m->m_self);
97 97 Py_XDECREF(m->m_module);
98 98 m->m_self = (PyObject *)PythonQtSignal_free_list;
99 99 PythonQtSignal_free_list = m;
100 100 }
101 101
102 102 static PyObject *
103 103 meth_get__doc__(PythonQtSignalFunctionObject * /*m*/, void * /*closure*/)
104 104 {
105 105 Py_INCREF(Py_None);
106 106 return Py_None;
107 107 }
108 108
109 109 static PyObject *
110 110 meth_get__name__(PythonQtSignalFunctionObject *m, void * /*closure*/)
111 111 {
112 112 #if( QT_VERSION >= QT_VERSION_CHECK(5,0,0) )
113 #ifdef PY3K
114 return PyUnicode_FromString(m->m_ml->metaMethod()->methodSignature());
115 #else
113 116 return PyString_FromString(m->m_ml->metaMethod()->methodSignature());
117 #endif
118 #else
119 #ifdef PY3K
120 return PyUnicode_FromString(m->m_ml->metaMethod()->signature());
114 121 #else
115 122 return PyString_FromString(m->m_ml->metaMethod()->signature());
116 123 #endif
124 #endif
117 125 }
118 126
119 127 static int
120 128 meth_traverse(PythonQtSignalFunctionObject *m, visitproc visit, void *arg)
121 129 {
122 130 int err;
123 131 if (m->m_self != NULL) {
124 132 err = visit(m->m_self, arg);
125 133 if (err)
126 134 return err;
127 135 }
128 136 if (m->m_module != NULL) {
129 137 err = visit(m->m_module, arg);
130 138 if (err)
131 139 return err;
132 140 }
133 141 return 0;
134 142 }
135 143
136 144 static PyObject *
137 145 meth_get__self__(PythonQtSignalFunctionObject *m, void * /*closure*/)
138 146 {
139 147 PyObject *self;
148 #ifndef PY3K
140 149 if (PyEval_GetRestricted()) {
141 150 PyErr_SetString(PyExc_RuntimeError,
142 151 "method.__self__ not accessible in restricted mode");
143 152 return NULL;
144 153 }
154 #endif
145 155 self = m->m_self;
146 156 if (self == NULL)
147 157 self = Py_None;
148 158 Py_INCREF(self);
149 159 return self;
150 160 }
151 161
152 162 static PyGetSetDef meth_getsets [] = {
153 163 {const_cast<char*>("__doc__"), (getter)meth_get__doc__, NULL, NULL},
154 164 {const_cast<char*>("__name__"), (getter)meth_get__name__, NULL, NULL},
155 165 {const_cast<char*>("__self__"), (getter)meth_get__self__, NULL, NULL},
156 166 {NULL, NULL, NULL,NULL},
157 167 };
158 168
159 169 #if PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION < 6
160 170 #define PY_WRITE_RESTRICTED WRITE_RESTRICTED
161 171 #endif
162 172
163 173 #define OFF(x) offsetof(PythonQtSignalFunctionObject, x)
164 174
165 175 static PyMemberDef meth_members[] = {
166 176 {const_cast<char*>("__module__"), T_OBJECT, OFF(m_module), PY_WRITE_RESTRICTED},
167 177 {NULL}
168 178 };
169 179
170 180 static PyObject *PythonQtSignalFunction_parameterTypes(PythonQtSignalFunctionObject* type)
171 181 {
172 182 return PythonQtMemberFunction_parameterTypes(type->m_ml);
173 183 }
174 184
175 185 static PyObject *PythonQtSignalFunction_parameterNames(PythonQtSignalFunctionObject* type)
176 186 {
177 187 return PythonQtMemberFunction_parameterNames(type->m_ml);
178 188 }
179 189
180 190 static PyObject *PythonQtSignalFunction_typeName(PythonQtSignalFunctionObject* type)
181 191 {
182 192 return PythonQtMemberFunction_typeName(type->m_ml);
183 193 }
184 194
185 195 static PyObject *PythonQtSignalFunction_connect(PythonQtSignalFunctionObject* type, PyObject *args)
186 196 {
187 197 if (PyObject_TypeCheck(type->m_self, &PythonQtInstanceWrapper_Type)) {
188 198 PythonQtInstanceWrapper* self = (PythonQtInstanceWrapper*) type->m_self;
189 199 if (self->_obj) {
190 200 Py_ssize_t argc = PyTuple_Size(args);
191 201 if (argc==1) {
192 202 // connect with Python callable
193 203 PyObject* callable = PyTuple_GET_ITEM(args, 0);
194 204 #if( QT_VERSION >= QT_VERSION_CHECK(5,0,0) )
195 205 bool result = PythonQt::self()->addSignalHandler(self->_obj, QByteArray("2") + type->m_ml->metaMethod()->methodSignature(), callable);
196 206 #else
197 207 bool result = PythonQt::self()->addSignalHandler(self->_obj, QByteArray("2") + type->m_ml->metaMethod()->signature(), callable);
198 208 #endif
199 209 return PythonQtConv::GetPyBool(result);
200 210 } else {
201 211 PyErr_SetString(PyExc_ValueError, "Called connect with wrong number of arguments");
202 212 }
203 213 }
204 214 }
205 215 return NULL;
206 216 }
207 217
208 218 static PyObject *PythonQtSignalFunction_disconnect(PythonQtSignalFunctionObject* type, PyObject *args)
209 219 {
210 220 if (PyObject_TypeCheck(type->m_self, &PythonQtInstanceWrapper_Type)) {
211 221 PythonQtInstanceWrapper* self = (PythonQtInstanceWrapper*) type->m_self;
212 222 if (self->_obj) {
213 223 Py_ssize_t argc = PyTuple_Size(args);
214 224 #if( QT_VERSION >= QT_VERSION_CHECK(5,0,0) )
215 225 QByteArray signal = QByteArray("2") + type->m_ml->metaMethod()->methodSignature();
216 226 #else
217 227 QByteArray signal = QByteArray("2") + type->m_ml->metaMethod()->signature();
218 228 #endif
219 229 if (argc==1) {
220 230 // disconnect with Python callable
221 231 PyObject* callable = PyTuple_GET_ITEM(args, 0);
222 232 bool result = PythonQt::self()->removeSignalHandler(self->_obj, signal, callable);
223 233 return PythonQtConv::GetPyBool(result);
224 234 } else if (argc==0) {
225 235 bool result = PythonQt::self()->removeSignalHandler(self->_obj, signal, NULL);
226 236 result |= QObject::disconnect(self->_obj, signal, NULL, NULL);
227 237 return PythonQtConv::GetPyBool(result);
228 238 } else {
229 239 PyErr_SetString(PyExc_ValueError, "Called disconnect with wrong number of arguments");
230 240 }
231 241 }
232 242 }
233 243 return NULL;
234 244 }
235 245
236 246 static PyObject *PythonQtSignalFunction_emit(PythonQtSignalFunctionObject* func, PyObject *args)
237 247 {
238 248 PythonQtSignalFunctionObject* f = (PythonQtSignalFunctionObject*)func;
239 249 return PythonQtMemberFunction_Call(f->m_ml, f->m_self, args, NULL);
240 250 }
241 251
242 252 static PyMethodDef meth_methods[] = {
243 253 {"parameterTypes", (PyCFunction)PythonQtSignalFunction_parameterTypes, METH_NOARGS,
244 254 "Returns a tuple of tuples of the C++ parameter types for all overloads of the signal"
245 255 },
246 256 {"parameterNames", (PyCFunction)PythonQtSignalFunction_parameterNames, METH_NOARGS,
247 257 "Returns a tuple of tuples of the C++ parameter type names (if available), for all overloads of the signal"
248 258 },
249 259 {"typeName", (PyCFunction)PythonQtSignalFunction_typeName, METH_NOARGS,
250 260 "Returns a tuple of the C++ return value types of each signal overload"
251 261 },
252 262 {"connect", (PyCFunction)PythonQtSignalFunction_connect, METH_VARARGS,
253 263 "Connects the signal to the Python callable"
254 264 },
255 265 {"disconnect", (PyCFunction)PythonQtSignalFunction_disconnect, METH_VARARGS,
256 266 "Disconnects the signal from the given Python callable or disconnects all if no argument is passed."
257 267 },
258 268 {"emit", (PyCFunction)PythonQtSignalFunction_emit, METH_VARARGS,
259 269 "Emits the signal with given arguments"
260 270 },
261 271 {NULL, NULL, 0 , NULL} /* Sentinel */
262 272 };
263 273
264 274 static PyObject *
265 275 meth_repr(PythonQtSignalFunctionObject *f)
266 276 {
267 277 if (f->m_self->ob_type == &PythonQtClassWrapper_Type) {
268 278 PythonQtClassWrapper* self = (PythonQtClassWrapper*) f->m_self;
279 #ifdef PY3K
280 return PyUnicode_FromFormat("<unbound qt signal %s of %s type>",
281 #else
269 282 return PyString_FromFormat("<unbound qt signal %s of %s type>",
283 #endif
270 284 f->m_ml->slotName().data(),
271 285 self->classInfo()->className());
272 286 } else {
287 #ifdef PY3K
288 return PyUnicode_FromFormat("<qt signal %s of %s instance at %p>",
289 #else
273 290 return PyString_FromFormat("<qt signal %s of %s instance at %p>",
291 #endif
274 292 f->m_ml->slotName().data(),
275 293 f->m_self->ob_type->tp_name,
276 294 f->m_self);
277 295 }
278 296 }
279 297
280 298 static int
281 299 meth_compare(PythonQtSignalFunctionObject *a, PythonQtSignalFunctionObject *b)
282 300 {
283 301 if (a->m_self != b->m_self)
284 302 return (a->m_self < b->m_self) ? -1 : 1;
285 303 if (a->m_ml == b->m_ml)
286 304 return 0;
287 305 #if( QT_VERSION >= QT_VERSION_CHECK(5,0,0) )
288 306 if (strcmp(a->m_ml->metaMethod()->methodSignature(), b->m_ml->metaMethod()->methodSignature()) < 0)
289 307 #else
290 308 if (strcmp(a->m_ml->metaMethod()->signature(), b->m_ml->metaMethod()->signature()) < 0)
291 309 #endif
292 310 return -1;
293 311 else
294 312 return 1;
295 313 }
296 314
297 315 static long
298 316 meth_hash(PythonQtSignalFunctionObject *a)
299 317 {
300 318 long x,y;
301 319 if (a->m_self == NULL)
302 320 x = 0;
303 321 else {
304 322 x = PyObject_Hash(a->m_self);
305 323 if (x == -1)
306 324 return -1;
307 325 }
308 326 y = _Py_HashPointer((void*)(a->m_ml));
309 327 if (y == -1)
310 328 return -1;
311 329 x ^= y;
312 330 if (x == -1)
313 331 x = -2;
314 332 return x;
315 333 }
316 334
335 // for python 3.x
336 static PyObject*
337 meth_richcompare(PythonQtSignalFunctionObject *a, PythonQtSignalFunctionObject *b, int op)
338 {
339 int x = meth_compare(a, b);
340 bool r;
341 if (op == Py_LT)
342 r = x < 0;
343 else if (op == Py_LE)
344 r = x < 1;
345 else if (op == Py_EQ)
346 r = x == 0;
347 else if (op == Py_NE)
348 r = x != 0;
349 else if (op == Py_GE)
350 r = x > -1;
351 else if (op == Py_GT)
352 r = x > 0;
353 if (r)
354 Py_RETURN_TRUE;
355 else
356 Py_RETURN_FALSE;
357 }
317 358
318 359 PyTypeObject PythonQtSignalFunction_Type = {
319 PyObject_HEAD_INIT(&PyType_Type)
320 0,
360 PyVarObject_HEAD_INIT(&PyType_Type, 0)
321 361 "builtin_qt_signal",
322 362 sizeof(PythonQtSignalFunctionObject),
323 363 0,
324 364 (destructor)meth_dealloc, /* tp_dealloc */
325 365 0, /* tp_print */
326 366 0, /* tp_getattr */
327 367 0, /* tp_setattr */
368 #ifdef PY3K
369 0,
370 #else
328 371 (cmpfunc)meth_compare, /* tp_compare */
372 #endif
329 373 (reprfunc)meth_repr, /* tp_repr */
330 374 0, /* tp_as_number */
331 375 0, /* tp_as_sequence */
332 376 // TODO: implement tp_as_mapping to support overload resolution on the signal
333 377 0, /* tp_as_mapping */
334 378 (hashfunc)meth_hash, /* tp_hash */
335 379 PythonQtSignalFunction_Call, /* tp_call */
336 380 0, /* tp_str */
337 381 PyObject_GenericGetAttr, /* tp_getattro */
338 382 0, /* tp_setattro */
339 383 0, /* tp_as_buffer */
340 384 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */
341 385 0, /* tp_doc */
342 386 (traverseproc)meth_traverse, /* tp_traverse */
343 387 0, /* tp_clear */
344 0, /* tp_richcompare */
388 (richcmpfunc)meth_richcompare, /* tp_richcompare */
345 389 0, /* tp_weaklistoffset */
346 390 0, /* tp_iter */
347 391 0, /* tp_iternext */
348 392 meth_methods, /* tp_methods */
349 393 meth_members, /* tp_members */
350 394 meth_getsets, /* tp_getset */
351 395 0, /* tp_base */
352 396 0, /* tp_dict */
353 397 };
354 398
355 399 /* Clear out the free list */
356 400
357 401 void
358 402 PythonQtSignalFunction_Fini(void)
359 403 {
360 404 while (PythonQtSignal_free_list) {
361 405 PythonQtSignalFunctionObject *v = PythonQtSignal_free_list;
362 406 PythonQtSignal_free_list = (PythonQtSignalFunctionObject *)(v->m_self);
363 407 PyObject_GC_Del(v);
364 408 }
365 409 }
366 410
@@ -1,273 +1,277
1 1 /*
2 2 *
3 3 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
4 4 *
5 5 * This library is free software; you can redistribute it and/or
6 6 * modify it under the terms of the GNU Lesser General Public
7 7 * License as published by the Free Software Foundation; either
8 8 * version 2.1 of the License, or (at your option) any later version.
9 9 *
10 10 * This library is distributed in the hope that it will be useful,
11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 13 * Lesser General Public License for more details.
14 14 *
15 15 * Further, this software is distributed without any warranty that it is
16 16 * free of the rightful claim of any third person regarding infringement
17 17 * or the like. Any license provided herein, whether implied or
18 18 * otherwise, applies only to this software file. Patent licenses, if
19 19 * any, provided herein do not apply to combinations of this program with
20 20 * other software, or any other product whatsoever.
21 21 *
22 22 * You should have received a copy of the GNU Lesser General Public
23 23 * License along with this library; if not, write to the Free Software
24 24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 25 *
26 26 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
27 27 * 28359 Bremen, Germany or:
28 28 *
29 29 * http://www.mevis.de
30 30 *
31 31 */
32 32
33 33 //----------------------------------------------------------------------------------
34 34 /*!
35 35 // \file PythonQtSignalReceiver.cpp
36 36 // \author Florian Link
37 37 // \author Last changed by $Author: florian $
38 38 // \date 2006-05
39 39 */
40 40 //----------------------------------------------------------------------------------
41 41
42 42 #include "PythonQtSignalReceiver.h"
43 43 #include "PythonQtClassInfo.h"
44 44 #include "PythonQtMethodInfo.h"
45 45 #include "PythonQtConversion.h"
46 46 #include <QMetaObject>
47 47 #include <QMetaMethod>
48 48 #include "funcobject.h"
49 49
50 50 // use -2 to signal that the variable is uninitialized
51 51 int PythonQtSignalReceiver::_destroyedSignal1Id = -2;
52 52 int PythonQtSignalReceiver::_destroyedSignal2Id = -2;
53 53
54 54 void PythonQtSignalTarget::call(void **arguments) const {
55 55 PyObject* result = call(_callable, methodInfo(), arguments);
56 56 if (result) {
57 57 Py_DECREF(result);
58 58 }
59 59 }
60 60
61 61 PyObject* PythonQtSignalTarget::call(PyObject* callable, const PythonQtMethodInfo* methodInfos, void **arguments, bool skipFirstArgumentOfMethodInfo)
62 62 {
63 63 Q_UNUSED(skipFirstArgumentOfMethodInfo)
64 64
65 65 // Note: we check if the callable is a PyFunctionObject and has a fixed number of arguments
66 66 // if that is the case, we only pass these arguments to python and skip the additional arguments from the signal
67 67
68 68 int numPythonArgs = -1;
69 69 if (PyFunction_Check(callable)) {
70 70 PyObject* o = callable;
71 71 PyFunctionObject* func = (PyFunctionObject*)o;
72 72 PyCodeObject* code = (PyCodeObject*)func->func_code;
73 73 if (!(code->co_flags & CO_VARARGS)) {
74 74 numPythonArgs = code->co_argcount;
75 75 } else {
76 76 // variable numbers of arguments allowed
77 77 }
78 78 } else if (PyMethod_Check(callable)) {
79 79 PyObject* o = callable;
80 80 PyMethodObject* method = (PyMethodObject*)o;
81 81 if (PyFunction_Check(method->im_func)) {
82 82 PyFunctionObject* func = (PyFunctionObject*)method->im_func;
83 83 PyCodeObject* code = (PyCodeObject*)func->func_code;
84 84 if (!(code->co_flags & CO_VARARGS)) {
85 85 numPythonArgs = code->co_argcount - 1; // we subtract one because the first is "self"
86 86 } else {
87 87 // variable numbers of arguments allowed
88 88 }
89 89 }
90 90 }
91 91
92 92 const PythonQtMethodInfo* m = methodInfos;
93 93 // parameterCount includes return value:
94 94 int count = m->parameterCount();
95 95 if (numPythonArgs!=-1) {
96 96 if (count>numPythonArgs+1) {
97 97 // take less arguments
98 98 count = numPythonArgs+1;
99 99 }
100 100 }
101 101
102 102 PyObject* pargs = NULL;
103 103 if (count>1) {
104 104 pargs = PyTuple_New(count-1);
105 105 }
106 106 bool err = false;
107 107 // transform Qt values to Python
108 108 const QList<PythonQtMethodInfo::ParameterInfo>& params = m->parameters();
109 109 for (int i = 1; i < count; i++) {
110 110 const PythonQtMethodInfo::ParameterInfo& param = params.at(i);
111 111 PyObject* arg = PythonQtConv::ConvertQtValueToPython(param, arguments[i]);
112 112 if (arg) {
113 113 // steals reference, no unref
114 114 PyTuple_SetItem(pargs, i-1,arg);
115 115 } else {
116 116 err = true;
117 117 break;
118 118 }
119 119 }
120 120
121 121 PyObject* result = NULL;
122 122 if (!err) {
123 123 PyErr_Clear();
124 124 result = PyObject_CallObject(callable, pargs);
125 125 if (result) {
126 126 // ok
127 127 } else {
128 128 PythonQt::self()->handleError();
129 129 }
130 130 }
131 131 if (pargs) {
132 132 // free the arguments again
133 133 Py_DECREF(pargs);
134 134 }
135 135
136 136 return result;
137 137 }
138 138
139 139 bool PythonQtSignalTarget::isSame( int signalId, PyObject* callable ) const
140 140 {
141 #ifdef PY3K
142 return PyObject_RichCompareBool(callable, _callable, Py_EQ) && signalId == _signalId;
143 #else
141 144 return PyObject_Compare(callable, _callable) == 0 && signalId==_signalId;
145 #endif
142 146 }
143 147
144 148 //------------------------------------------------------------------------------
145 149
146 150 PythonQtSignalReceiver::PythonQtSignalReceiver(QObject* obj):PythonQtSignalReceiverBase(obj)
147 151 {
148 152 if (_destroyedSignal1Id == -2) {
149 153 // initialize these once
150 154 _destroyedSignal1Id = QObject::staticMetaObject.indexOfSignal("destroyed()");
151 155 _destroyedSignal2Id = QObject::staticMetaObject.indexOfSignal("destroyed(QObject*)");
152 156 if (_destroyedSignal1Id == -1 || _destroyedSignal2Id == -1) {
153 157 std::cerr << "PythonQt: could not find destroyed signal index, should never happen!" << std::endl;
154 158 }
155 159 }
156 160
157 161 _destroyedSignalCount = 0;
158 162 _obj = obj;
159 163
160 164 // fetch the class info for object, since we will need to for correct enum resolution in
161 165 // signals
162 166 _objClassInfo = PythonQt::priv()->getClassInfo(obj->metaObject());
163 167 if (!_objClassInfo || !_objClassInfo->isQObject()) {
164 168 PythonQt::self()->registerClass(obj->metaObject());
165 169 _objClassInfo = PythonQt::priv()->getClassInfo(obj->metaObject());
166 170 }
167 171 // force decorator/enum creation
168 172 _objClassInfo->decorator();
169 173
170 174 _slotCount = staticMetaObject.methodOffset();
171 175 }
172 176
173 177 PythonQtSignalReceiver::~PythonQtSignalReceiver()
174 178 {
175 179 PythonQt::priv()->removeSignalEmitter(_obj);
176 180 }
177 181
178 182
179 183 bool PythonQtSignalReceiver::addSignalHandler(const char* signal, PyObject* callable)
180 184 {
181 185 bool flag = false;
182 186 int sigId = getSignalIndex(signal);
183 187 if (sigId>=0) {
184 188 // create PythonQtMethodInfo from signal
185 189 QMetaMethod meta = _obj->metaObject()->method(sigId);
186 190 const PythonQtMethodInfo* signalInfo = PythonQtMethodInfo::getCachedMethodInfo(meta, _objClassInfo);
187 191 PythonQtSignalTarget t(sigId, signalInfo, _slotCount, callable);
188 192 _targets.append(t);
189 193 // now connect to ourselves with the new slot id
190 194 QMetaObject::connect(_obj, sigId, this, _slotCount, Qt::AutoConnection, 0);
191 195
192 196 _slotCount++;
193 197 flag = true;
194 198
195 199 if (sigId == _destroyedSignal1Id || sigId == _destroyedSignal2Id) {
196 200 _destroyedSignalCount++;
197 201 if (_destroyedSignalCount==1) {
198 202 // make ourself parent of PythonQt, to not get deleted as a child of the QObject we are
199 203 // listening to, since we do that manually when we receive the destroyed signal
200 204 this->setParent(PythonQt::priv());
201 205 }
202 206 }
203 207 }
204 208 return flag;
205 209 }
206 210
207 211 bool PythonQtSignalReceiver::removeSignalHandler(const char* signal, PyObject* callable)
208 212 {
209 213 int foundCount = 0;
210 214 int sigId = getSignalIndex(signal);
211 215 if (sigId>=0) {
212 216 QMutableListIterator<PythonQtSignalTarget> i(_targets);
213 217 if (callable) {
214 218 while (i.hasNext()) {
215 219 if (i.next().isSame(sigId, callable)) {
216 220 i.remove();
217 221 foundCount++;
218 222 break;
219 223 }
220 224 }
221 225 } else {
222 226 while (i.hasNext()) {
223 227 if (i.next().signalId() == sigId) {
224 228 i.remove();
225 229 foundCount++;
226 230 }
227 231 }
228 232 }
229 233 }
230 234 if ((foundCount>0) && (sigId == _destroyedSignal1Id) || (sigId == _destroyedSignal2Id)) {
231 235 _destroyedSignalCount -= foundCount;
232 236 if (_destroyedSignalCount==0) {
233 237 // make ourself child of QObject again, to get deleted when the object gets deleted
234 238 this->setParent(_obj);
235 239 }
236 240 }
237 241 return foundCount>0;
238 242 }
239 243
240 244 int PythonQtSignalReceiver::getSignalIndex(const char* signal)
241 245 {
242 246 int sigId = _obj->metaObject()->indexOfSignal(signal+1);
243 247 if (sigId<0) {
244 248 QByteArray tmpSig = QMetaObject::normalizedSignature(signal+1);
245 249 sigId = _obj->metaObject()->indexOfSignal(tmpSig);
246 250 }
247 251 return sigId;
248 252 }
249 253
250 254 int PythonQtSignalReceiver::qt_metacall(QMetaObject::Call c, int id, void **arguments)
251 255 {
252 256 // mlabDebugConst("PythonQt", "PythonQtSignalReceiver invoke " << _obj->className() << " " << _obj->name() << " " << id);
253 257 if (c != QMetaObject::InvokeMetaMethod) {
254 258 QObject::qt_metacall(c, id, arguments);
255 259 }
256 260
257 261 Q_FOREACH(const PythonQtSignalTarget& t, _targets) {
258 262 if (t.slotId() == id) {
259 263 t.call(arguments);
260 264 // if the signal is the last destroyed signal, we delete ourselves
261 265 int sigId = t.signalId();
262 266 if ((sigId == _destroyedSignal1Id) || (sigId == _destroyedSignal2Id)) {
263 267 _destroyedSignalCount--;
264 268 if (_destroyedSignalCount == 0) {
265 269 delete this;
266 270 }
267 271 }
268 272 break;
269 273 }
270 274 }
271 275 return 0;
272 276 }
273 277
@@ -1,670 +1,735
1 1 /*
2 2 *
3 3 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
4 4 *
5 5 * This library is free software; you can redistribute it and/or
6 6 * modify it under the terms of the GNU Lesser General Public
7 7 * License as published by the Free Software Foundation; either
8 8 * version 2.1 of the License, or (at your option) any later version.
9 9 *
10 10 * This library is distributed in the hope that it will be useful,
11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 13 * Lesser General Public License for more details.
14 14 *
15 15 * Further, this software is distributed without any warranty that it is
16 16 * free of the rightful claim of any third person regarding infringement
17 17 * or the like. Any license provided herein, whether implied or
18 18 * otherwise, applies only to this software file. Patent licenses, if
19 19 * any, provided herein do not apply to combinations of this program with
20 20 * other software, or any other product whatsoever.
21 21 *
22 22 * You should have received a copy of the GNU Lesser General Public
23 23 * License along with this library; if not, write to the Free Software
24 24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 25 *
26 26 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
27 27 * 28359 Bremen, Germany or:
28 28 *
29 29 * http://www.mevis.de
30 30 *
31 31 */
32 32
33 33 //----------------------------------------------------------------------------------
34 34 /*!
35 35 // \file PythonQtSlot.cpp
36 36 // \author Florian Link
37 37 // \author Last changed by $Author: florian $
38 38 // \date 2006-05
39 39 */
40 40 //----------------------------------------------------------------------------------
41 41
42 42 #include "PythonQt.h"
43 43 #include "PythonQtSlot.h"
44 44 #include "PythonQtInstanceWrapper.h"
45 45 #include "PythonQtClassInfo.h"
46 46 #include "PythonQtMisc.h"
47 47 #include "PythonQtConversion.h"
48 48 #include <iostream>
49 49
50 50 #include <exception>
51 51 #include <stdexcept>
52 52
53 53 #include <QByteArray>
54 54
55 #if PY_MAJOR_VERSION >= 3
56 #define PY3K
57 #endif
58
55 59 #define PYTHONQT_MAX_ARGS 32
56 60
57 61
58 62 bool PythonQtCallSlot(PythonQtClassInfo* classInfo, QObject* objectToCall, PyObject* args, bool strict, PythonQtSlotInfo* info, void* firstArgument, PyObject** pythonReturnValue, void** directReturnValuePointer)
59 63 {
60 64 static unsigned int recursiveEntry = 0;
61 65
62 66 if (directReturnValuePointer) {
63 67 *directReturnValuePointer = NULL;
64 68 }
65 69 // store the current storage position, so that we can get back to this state after a slot is called
66 70 // (do this locally, so that we have all positions on the stack
67 71 PythonQtValueStoragePosition globalValueStoragePos;
68 72 PythonQtValueStoragePosition globalPtrStoragePos;
69 73 PythonQtValueStoragePosition globalVariantStoragePos;
70 74 PythonQtConv::global_valueStorage.getPos(globalValueStoragePos);
71 75 PythonQtConv::global_ptrStorage.getPos(globalPtrStoragePos);
72 76 PythonQtConv::global_variantStorage.getPos(globalVariantStoragePos);
73 77
74 78 recursiveEntry++;
75 79
76 80 // the arguments that are passed to qt_metacall
77 81 void* argList[PYTHONQT_MAX_ARGS];
78 82 PyObject* result = NULL;
79 83 int argc = info->parameterCount();
80 84 const QList<PythonQtSlotInfo::ParameterInfo>& params = info->parameters();
81 85
82 86 const PythonQtSlotInfo::ParameterInfo& returnValueParam = params.at(0);
83 87 // set return argument to NULL
84 88 argList[0] = NULL;
85 89
86 90 bool ok = true;
87 91 bool skipFirst = false;
88 92 if (info->isInstanceDecorator()) {
89 93 skipFirst = true;
90 94
91 95 // for decorators on CPP objects, we take the cpp ptr, for QObjects we take the QObject pointer
92 96 void* arg1 = firstArgument;
93 97 if (!arg1) {
94 98 arg1 = objectToCall;
95 99 }
96 100 if (arg1) {
97 101 // upcast to correct parent class
98 102 arg1 = ((char*)arg1)+info->upcastingOffset();
99 103 }
100 104
101 105 argList[1] = &arg1;
102 106 if (ok) {
103 107 for (int i = 2; i<argc && ok; i++) {
104 108 const PythonQtSlotInfo::ParameterInfo& param = params.at(i);
105 109 argList[i] = PythonQtConv::ConvertPythonToQt(param, PyTuple_GET_ITEM(args, i-2), strict, classInfo);
106 110 if (argList[i]==NULL) {
107 111 ok = false;
108 112 break;
109 113 }
110 114 }
111 115 }
112 116 } else {
113 117 for (int i = 1; i<argc && ok; i++) {
114 118 const PythonQtSlotInfo::ParameterInfo& param = params.at(i);
115 119 argList[i] = PythonQtConv::ConvertPythonToQt(param, PyTuple_GET_ITEM(args, i-1), strict, classInfo);
116 120 if (argList[i]==NULL) {
117 121 ok = false;
118 122 break;
119 123 }
120 124 }
121 125 }
122 126
123 127 if (ok) {
124 128 // parameters are ok, now create the qt return value which is assigned to by metacall
125 129 if (returnValueParam.typeId != QMetaType::Void) {
126 130 // create empty default value for the return value
127 131 if (!directReturnValuePointer) {
128 132 // create empty default value for the return value
129 133 argList[0] = PythonQtConv::CreateQtReturnValue(returnValueParam);
130 134 if (argList[0]==NULL) {
131 135 // return value could not be created, maybe we have a registered class with a default constructor, so that we can construct the pythonqt wrapper object and
132 136 // pass its internal pointer
133 137 PythonQtClassInfo* info = PythonQt::priv()->getClassInfo(returnValueParam.name);
134 138 if (info && info->pythonQtClassWrapper()) {
135 139 PyObject* emptyTuple = PyTuple_New(0);
136 140 // 1) default construct an empty object as python object (owned by PythonQt), by calling the meta class with empty arguments
137 141 result = PyObject_Call((PyObject*)info->pythonQtClassWrapper(), emptyTuple, NULL);
138 142 if (result) {
139 143 argList[0] = ((PythonQtInstanceWrapper*)result)->_wrappedPtr;
140 144 }
141 145 Py_DECREF(emptyTuple);
142 146 }
143 147 }
144 148 } else {
145 149 // we can use our pointer directly!
146 150 argList[0] = directReturnValuePointer;
147 151 }
148 152 }
149 153
150 154
151 155 PythonQt::ProfilingCB* profilingCB = PythonQt::priv()->profilingCB();
152 156 if (profilingCB) {
153 157 const char* className = NULL;
154 158 if (info->decorator()) {
155 159 className = info->decorator()->metaObject()->className();
156 160 } else {
157 161 className = objectToCall->metaObject()->className();
158 162 }
159 163
160 164 #if( QT_VERSION >= QT_VERSION_CHECK(5,0,0) )
161 165 profilingCB(PythonQt::Enter, className, info->metaMethod()->methodSignature());
162 166 #else
163 167 profilingCB(PythonQt::Enter, className, info->metaMethod()->signature());
164 168 #endif
165 169 }
166 170
167 171 // invoke the slot via metacall
168 172 bool hadException = false;
169 173 QObject* obj = info->decorator()?info->decorator():objectToCall;
170 174 if (!obj) {
171 175 hadException = true;
172 176 PyErr_SetString(PyExc_RuntimeError, "Trying to call a slot on a deleted QObject!");
173 177 } else {
174 178 try {
175 179 obj->qt_metacall(QMetaObject::InvokeMetaMethod, info->slotIndex(), argList);
176 180 } catch (std::bad_alloc & e) {
177 181 hadException = true;
178 182 QByteArray what("std::bad_alloc: ");
179 183 what += e.what();
180 184 PyErr_SetString(PyExc_MemoryError, what.constData());
181 185 } catch (std::runtime_error & e) {
182 186 hadException = true;
183 187 QByteArray what("std::runtime_error: ");
184 188 what += e.what();
185 189 PyErr_SetString(PyExc_RuntimeError, what.constData());
186 190 } catch (std::logic_error & e) {
187 191 hadException = true;
188 192 QByteArray what("std::logic_error: ");
189 193 what += e.what();
190 194 PyErr_SetString(PyExc_RuntimeError, what.constData());
191 195 } catch (std::exception& e) {
192 196 hadException = true;
193 197 QByteArray what("std::exception: ");
194 198 what += e.what();
199 #ifdef PY3K
200 PyErr_SetString(PyExc_RuntimeError, what.constData());
201 #else
195 202 PyErr_SetString(PyExc_StandardError, what.constData());
203 #endif
196 204 }
197 205 }
198 206
199 207 if (profilingCB) {
200 208 profilingCB(PythonQt::Leave, NULL, NULL);
201 209 }
202 210
203 211 // handle the return value (which in most cases still needs to be converted to a Python object)
204 212 if (!hadException) {
205 213 if (argList[0] || returnValueParam.typeId == QMetaType::Void) {
206 214 if (directReturnValuePointer) {
207 215 result = NULL;
208 216 } else {
209 217 // the resulting object maybe present already, because we created it above at 1)...
210 218 if (!result) {
211 219 result = PythonQtConv::ConvertQtValueToPython(returnValueParam, argList[0]);
212 220 }
213 221 }
214 222 } else {
215 223 QString e = QString("Called ") + info->fullSignature() + ", return type '" + returnValueParam.name + "' is ignored because it is unknown to PythonQt. Probably you should register it using qRegisterMetaType() or add a default constructor decorator to the class.";
216 224 PyErr_SetString(PyExc_ValueError, e.toLatin1().data());
217 225 result = NULL;
218 226 }
219 227 } else {
220 228 result = NULL;
221 229 }
222 230 }
223 231 recursiveEntry--;
224 232
225 233 // reset the parameter storage position to the stored pos to "pop" the parameter stack
226 234 PythonQtConv::global_valueStorage.setPos(globalValueStoragePos);
227 235 PythonQtConv::global_ptrStorage.setPos(globalPtrStoragePos);
228 236 PythonQtConv::global_variantStorage.setPos(globalVariantStoragePos);
229 237
230 238 *pythonReturnValue = result;
231 239 // NOTE: it is important to only return here, otherwise the stack will not be popped!!!
232 240 return result || (directReturnValuePointer && *directReturnValuePointer);
233 241 }
234 242
235 243 //-----------------------------------------------------------------------------------
236 244
237 245 static PythonQtSlotFunctionObject *pythonqtslot_free_list = NULL;
238 246
239 247 PyObject *PythonQtSlotFunction_Call(PyObject *func, PyObject *args, PyObject *kw)
240 248 {
241 249 PythonQtSlotFunctionObject* f = (PythonQtSlotFunctionObject*)func;
242 250 return PythonQtMemberFunction_Call(f->m_ml, f->m_self, args, kw);
243 251 }
244 252
245 253 PyObject *PythonQtMemberFunction_Call(PythonQtSlotInfo* info, PyObject* m_self, PyObject *args, PyObject *kw)
246 254 {
247 255 if (PyObject_TypeCheck(m_self, &PythonQtInstanceWrapper_Type)) {
248 256 PythonQtInstanceWrapper* self = (PythonQtInstanceWrapper*) m_self;
249 257 if (!info->isClassDecorator() && (self->_obj==NULL && self->_wrappedPtr==NULL)) {
250 258 QString error = QString("Trying to call '") + info->slotName() + "' on a destroyed " + self->classInfo()->className() + " object";
251 259 PyErr_SetString(PyExc_ValueError, error.toLatin1().data());
252 260 return NULL;
253 261 } else {
254 262 return PythonQtSlotFunction_CallImpl(self->classInfo(), self->_obj, info, args, kw, self->_wrappedPtr);
255 263 }
256 264 } else if (m_self->ob_type == &PythonQtClassWrapper_Type) {
257 265 PythonQtClassWrapper* type = (PythonQtClassWrapper*) m_self;
258 266 if (info->isClassDecorator()) {
259 267 return PythonQtSlotFunction_CallImpl(type->classInfo(), NULL, info, args, kw);
260 268 } else {
261 269 // otherwise, it is an unbound call and we have an instanceDecorator or normal slot...
262 270 Py_ssize_t argc = PyTuple_Size(args);
263 271 if (argc>0) {
264 272 PyObject* firstArg = PyTuple_GET_ITEM(args, 0);
265 273 if (PyObject_TypeCheck(firstArg, (PyTypeObject*)&PythonQtInstanceWrapper_Type)
266 274 && ((PythonQtInstanceWrapper*)firstArg)->classInfo()->inherits(type->classInfo())) {
267 275 PythonQtInstanceWrapper* self = (PythonQtInstanceWrapper*)firstArg;
268 276 if (!info->isClassDecorator() && (self->_obj==NULL && self->_wrappedPtr==NULL)) {
269 277 QString error = QString("Trying to call '") + info->slotName() + "' on a destroyed " + self->classInfo()->className() + " object";
270 278 PyErr_SetString(PyExc_ValueError, error.toLatin1().data());
271 279 return NULL;
272 280 }
273 281 // strip the first argument...
274 282 PyObject* newargs = PyTuple_GetSlice(args, 1, argc);
275 283 PyObject* result = PythonQtSlotFunction_CallImpl(self->classInfo(), self->_obj, info, newargs, kw, self->_wrappedPtr);
276 284 Py_DECREF(newargs);
277 285 return result;
278 286 } else {
279 287 // first arg is not of correct type!
280 288 QString error = "slot " + info->fullSignature() + " requires " + type->classInfo()->className() + " instance as first argument, got " + firstArg->ob_type->tp_name;
281 289 PyErr_SetString(PyExc_ValueError, error.toLatin1().data());
282 290 return NULL;
283 291 }
284 292 } else {
285 293 // wrong number of args
286 294 QString error = "slot " + info->fullSignature() + " requires " + type->classInfo()->className() + " instance as first argument.";
287 295 PyErr_SetString(PyExc_ValueError, error.toLatin1().data());
288 296 return NULL;
289 297 }
290 298 }
291 299 }
292 300 return NULL;
293 301 }
294 302
295 303 PyObject *PythonQtSlotFunction_CallImpl(PythonQtClassInfo* classInfo, QObject* objectToCall, PythonQtSlotInfo* info, PyObject *args, PyObject * /*kw*/, void* firstArg, void** directReturnValuePointer)
296 304 {
297 305 int argc = args?PyTuple_Size(args):0;
298 306
299 307 #ifdef PYTHONQT_DEBUG
300 308 std::cout << "called " << info->metaMethod()->typeName() << " " << info->metaMethod()->signature() << std::endl;
301 309 #endif
302 310
303 311 PyObject* r = NULL;
304 312 bool ok = false;
305 313 if (directReturnValuePointer) {
306 314 *directReturnValuePointer = NULL;
307 315 }
308 316 if (info->nextInfo()) {
309 317 // overloaded slot call, try on all slots with strict conversion first
310 318 bool strict = true;
311 319 PythonQtSlotInfo* i = info;
312 320 while (i) {
313 321 bool skipFirst = i->isInstanceDecorator();
314 322 if (i->parameterCount()-1-(skipFirst?1:0) == argc) {
315 323 PyErr_Clear();
316 324 ok = PythonQtCallSlot(classInfo, objectToCall, args, strict, i, firstArg, &r, directReturnValuePointer);
317 325 if (PyErr_Occurred() || ok) break;
318 326 }
319 327 i = i->nextInfo();
320 328 if (!i) {
321 329 if (strict) {
322 330 // one more run without being strict
323 331 strict = false;
324 332 i = info;
325 333 }
326 334 }
327 335 }
328 336 if (!ok && !PyErr_Occurred()) {
329 337 QString e = QString("Could not find matching overload for given arguments:\n" + PythonQtConv::PyObjGetString(args) + "\n The following slots are available:\n");
330 338 PythonQtSlotInfo* i = info;
331 339 while (i) {
332 340 e += QString(i->fullSignature()) + "\n";
333 341 i = i->nextInfo();
334 342 }
335 343 PyErr_SetString(PyExc_ValueError, e.toLatin1().data());
336 344 }
337 345 } else {
338 346 // simple (non-overloaded) slot call
339 347 bool skipFirst = info->isInstanceDecorator();
340 348 if (info->parameterCount()-1-(skipFirst?1:0) == argc) {
341 349 PyErr_Clear();
342 350 ok = PythonQtCallSlot(classInfo, objectToCall, args, false, info, firstArg, &r, directReturnValuePointer);
343 351 if (!ok && !PyErr_Occurred()) {
344 352 QString e = QString("Called ") + info->fullSignature() + " with wrong arguments: " + PythonQtConv::PyObjGetString(args);
345 353 PyErr_SetString(PyExc_ValueError, e.toLatin1().data());
346 354 }
347 355 } else {
348 356 QString e = QString("Called ") + info->fullSignature() + " with wrong number of arguments: " + PythonQtConv::PyObjGetString(args);
349 357 PyErr_SetString(PyExc_ValueError, e.toLatin1().data());
350 358 }
351 359 }
352 360
353 361 return r;
354 362 }
355 363
356 364 PyObject *
357 365 PythonQtSlotFunction_New(PythonQtSlotInfo *ml, PyObject *self, PyObject *module)
358 366 {
359 367 PythonQtSlotFunctionObject *op;
360 368 op = pythonqtslot_free_list;
361 369 if (op != NULL) {
362 370 pythonqtslot_free_list = (PythonQtSlotFunctionObject *)(op->m_self);
363 371 PyObject_INIT(op, &PythonQtSlotFunction_Type);
364 372 }
365 373 else {
366 374 op = PyObject_GC_New(PythonQtSlotFunctionObject, &PythonQtSlotFunction_Type);
367 375 if (op == NULL)
368 376 return NULL;
369 377 }
370 378 op->m_ml = ml;
371 379 Py_XINCREF(self);
372 380 op->m_self = self;
373 381 Py_XINCREF(module);
374 382 op->m_module = module;
375 383 PyObject_GC_Track(op);
376 384 return (PyObject *)op;
377 385 }
378 386
379 387 PythonQtSlotInfo*
380 388 PythonQtSlotFunction_GetSlotInfo(PyObject *op)
381 389 {
382 390 if (!PythonQtSlotFunction_Check(op)) {
383 391 PyErr_Format(PyExc_SystemError, "%s:%d: bad argument to internal function", __FILE__, __LINE__);
384 392 return NULL;
385 393 }
386 394 return ((PythonQtSlotFunctionObject *)op) -> m_ml;
387 395 }
388 396
389 397 PyObject *
390 398 PythonQtSlotFunction_GetSelf(PyObject *op)
391 399 {
392 400 if (!PythonQtSlotFunction_Check(op)) {
393 401 PyErr_Format(PyExc_SystemError, "%s:%d: bad argument to internal function", __FILE__, __LINE__);
394 402 return NULL;
395 403 }
396 404 return ((PythonQtSlotFunctionObject *)op) -> m_self;
397 405 }
398 406
399 407 /* Methods (the standard built-in methods, that is) */
400 408
401 409 static void
402 410 meth_dealloc(PythonQtSlotFunctionObject *m)
403 411 {
404 412 PyObject_GC_UnTrack(m);
405 413 Py_XDECREF(m->m_self);
406 414 Py_XDECREF(m->m_module);
407 415 m->m_self = (PyObject *)pythonqtslot_free_list;
408 416 pythonqtslot_free_list = m;
409 417 }
410 418
411 419 static PyObject *
412 420 meth_get__doc__(PythonQtSlotFunctionObject * /*m*/, void * /*closure*/)
413 421 {
414 422 Py_INCREF(Py_None);
415 423 return Py_None;
416 424 }
417 425
418 426 static PyObject *
419 427 meth_get__name__(PythonQtSlotFunctionObject *m, void * /*closure*/)
420 428 {
421 429 #if( QT_VERSION >= QT_VERSION_CHECK(5,0,0) )
430 #ifdef PY3K
431 return PyUnicode_FromString(m->m_ml->metaMethod()->methodSignature());
432 #else
422 433 return PyString_FromString(m->m_ml->metaMethod()->methodSignature());
434 #endif
435 #else
436 #ifdef PY3K
437 return PyUnicode_FromString(m->m_ml->metaMethod()->signature());
423 438 #else
424 439 return PyString_FromString(m->m_ml->metaMethod()->signature());
425 440 #endif
441 #endif
426 442 }
427 443
428 444 static int
429 445 meth_traverse(PythonQtSlotFunctionObject *m, visitproc visit, void *arg)
430 446 {
431 447 int err;
432 448 if (m->m_self != NULL) {
433 449 err = visit(m->m_self, arg);
434 450 if (err)
435 451 return err;
436 452 }
437 453 if (m->m_module != NULL) {
438 454 err = visit(m->m_module, arg);
439 455 if (err)
440 456 return err;
441 457 }
442 458 return 0;
443 459 }
444 460
445 461 static PyObject *
446 462 meth_get__self__(PythonQtSlotFunctionObject *m, void * /*closure*/)
447 463 {
448 464 PyObject *self;
465 #ifndef PY3K
449 466 if (PyEval_GetRestricted()) {
450 467 PyErr_SetString(PyExc_RuntimeError,
451 468 "method.__self__ not accessible in restricted mode");
452 469 return NULL;
453 470 }
471 #endif
454 472 self = m->m_self;
455 473 if (self == NULL)
456 474 self = Py_None;
457 475 Py_INCREF(self);
458 476 return self;
459 477 }
460 478
461 479 static PyGetSetDef meth_getsets [] = {
462 480 {const_cast<char*>("__doc__"), (getter)meth_get__doc__, NULL, NULL},
463 481 {const_cast<char*>("__name__"), (getter)meth_get__name__, NULL, NULL},
464 482 {const_cast<char*>("__self__"), (getter)meth_get__self__, NULL, NULL},
465 483 {NULL, NULL, NULL,NULL},
466 484 };
467 485
468 486 #if PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION < 6
469 487 #define PY_WRITE_RESTRICTED WRITE_RESTRICTED
470 488 #endif
471 489
472 490 #define OFF(x) offsetof(PythonQtSlotFunctionObject, x)
473 491
474 492 static PyMemberDef meth_members[] = {
475 493 {const_cast<char*>("__module__"), T_OBJECT, OFF(m_module), PY_WRITE_RESTRICTED},
476 494 {NULL}
477 495 };
478 496
479 497 static PyObject *PythonQtSlotFunction_parameterTypes(PythonQtSlotFunctionObject* type)
480 498 {
481 499 return PythonQtMemberFunction_parameterTypes(type->m_ml);
482 500 }
483 501
484 502 static PyObject *PythonQtSlotFunction_parameterNames(PythonQtSlotFunctionObject* type)
485 503 {
486 504 return PythonQtMemberFunction_parameterNames(type->m_ml);
487 505 }
488 506
489 507 static PyObject *PythonQtSlotFunction_typeName(PythonQtSlotFunctionObject* type)
490 508 {
491 509 return PythonQtMemberFunction_typeName(type->m_ml);
492 510 }
493 511
494 512 PyObject *PythonQtMemberFunction_parameterTypes(PythonQtSlotInfo* theInfo)
495 513 {
496 514 PythonQtSlotInfo* info = theInfo;
497 515 int count = 0;
498 516 while (info) {
499 517 info = info->nextInfo();
500 518 count++;
501 519 }
502 520 info = theInfo;
503 521 PyObject* result = PyTuple_New(count);
504 522 for (int j = 0;j<count;j++) {
505 523 QList<QByteArray> types = info->metaMethod()->parameterTypes();
506 524 PyObject* tuple = PyTuple_New(types.count());
507 525 for (int i = 0; i<types.count();i++) {
526 #ifdef PY3K
527 PyTuple_SET_ITEM(tuple, i, PyUnicode_FromString(types.at(i).constData()));
528 #else
508 529 PyTuple_SET_ITEM(tuple, i, PyString_FromString(types.at(i).constData()));
530 #endif
509 531 }
510 532 info = info->nextInfo();
511 533 PyTuple_SET_ITEM(result, j, tuple);
512 534 }
513 535 return result;
514 536 }
515 537
516 538 PyObject *PythonQtMemberFunction_parameterNames(PythonQtSlotInfo* theInfo)
517 539 {
518 540 PythonQtSlotInfo* info = theInfo;
519 541 int count = 0;
520 542 while (info) {
521 543 info = info->nextInfo();
522 544 count++;
523 545 }
524 546 info = theInfo;
525 547 PyObject* result = PyTuple_New(count);
526 548 for (int j = 0;j<count;j++) {
527 549 QList<QByteArray> names = info->metaMethod()->parameterNames();
528 550 PyObject* tuple = PyTuple_New(names.count());
529 551 for (int i = 0; i<names.count();i++) {
552 #ifdef PY3K
553 PyTuple_SET_ITEM(tuple, i, PyUnicode_FromString(names.at(i).constData()));
554 #else
530 555 PyTuple_SET_ITEM(tuple, i, PyString_FromString(names.at(i).constData()));
556 #endif
531 557 }
532 558 info = info->nextInfo();
533 559 PyTuple_SET_ITEM(result, j, tuple);
534 560 }
535 561 return result;
536 562 }
537 563
538 564 PyObject *PythonQtMemberFunction_typeName(PythonQtSlotInfo* theInfo)
539 565 {
540 566 PythonQtSlotInfo* info = theInfo;
541 567 int count = 0;
542 568 while (info) {
543 569 info = info->nextInfo();
544 570 count++;
545 571 }
546 572 info = theInfo;
547 573 PyObject* result = PyTuple_New(count);
548 574 for (int j = 0;j<count;j++) {
549 575 QByteArray name = info->metaMethod()->typeName();
576 #ifdef PY3K
577 PyTuple_SET_ITEM(result, j, PyUnicode_FromString(name.constData()));
578 #else
550 579 PyTuple_SET_ITEM(result, j, PyString_FromString(name.constData()));
580 #endif
551 581 info = info->nextInfo();
552 582 }
553 583 return result;
554 584 }
555 585
556 586 static PyMethodDef meth_methods[] = {
557 587 {"parameterTypes", (PyCFunction)PythonQtSlotFunction_parameterTypes, METH_NOARGS,
558 588 "Returns a tuple of tuples of the C++ parameter types for all overloads of the slot"
559 589 },
560 590 {"parameterNames", (PyCFunction)PythonQtSlotFunction_parameterNames, METH_NOARGS,
561 591 "Returns a tuple of tuples of the C++ parameter type names (if available), for all overloads of the slot"
562 592 },
563 593 {"typeName", (PyCFunction)PythonQtSlotFunction_typeName, METH_NOARGS,
564 594 "Returns a tuple of the C++ return value types of each slot overload"
565 595 },
566 596 {NULL, NULL, 0 , NULL} /* Sentinel */
567 597 };
568 598
569 599 static PyObject *
570 600 meth_repr(PythonQtSlotFunctionObject *f)
571 601 {
572 602 if (f->m_self->ob_type == &PythonQtClassWrapper_Type) {
573 603 PythonQtClassWrapper* self = (PythonQtClassWrapper*) f->m_self;
604 #ifdef PY3K
605 return PyUnicode_FromFormat("<unbound qt slot %s of %s type>",
606 #else
574 607 return PyString_FromFormat("<unbound qt slot %s of %s type>",
608 #endif
575 609 f->m_ml->slotName().data(),
576 610 self->classInfo()->className());
577 611 } else {
612 #ifdef PY3K
613 return PyUnicode_FromFormat("<qt slot %s of %s instance at %p",
614 #else
578 615 return PyString_FromFormat("<qt slot %s of %s instance at %p>",
616 #endif
579 617 f->m_ml->slotName().data(),
580 618 f->m_self->ob_type->tp_name,
581 619 f->m_self);
582 620 }
583 621 }
584 622
585 623 static int
586 624 meth_compare(PythonQtSlotFunctionObject *a, PythonQtSlotFunctionObject *b)
587 625 {
588 626 if (a->m_self != b->m_self)
589 627 return (a->m_self < b->m_self) ? -1 : 1;
590 628 if (a->m_ml == b->m_ml)
591 629 return 0;
592 630 #if( QT_VERSION >= QT_VERSION_CHECK(5,0,0) )
593 631 if (strcmp(a->m_ml->metaMethod()->methodSignature(), b->m_ml->metaMethod()->methodSignature()) < 0)
594 632 #else
595 633 if (strcmp(a->m_ml->metaMethod()->signature(), b->m_ml->metaMethod()->signature()) < 0)
596 634 #endif
597 635 return -1;
598 636 else
599 637 return 1;
600 638 }
601 639
602 640 static long
603 641 meth_hash(PythonQtSlotFunctionObject *a)
604 642 {
605 643 long x,y;
606 644 if (a->m_self == NULL)
607 645 x = 0;
608 646 else {
609 647 x = PyObject_Hash(a->m_self);
610 648 if (x == -1)
611 649 return -1;
612 650 }
613 651 y = _Py_HashPointer((void*)(a->m_ml));
614 652 if (y == -1)
615 653 return -1;
616 654 x ^= y;
617 655 if (x == -1)
618 656 x = -2;
619 657 return x;
620 658 }
621 659
660 // for python 3.x
661 static PyObject*
662 meth_richcompare(PythonQtSlotFunctionObject *a, PythonQtSlotFunctionObject *b, int op)
663 {
664 int x = meth_compare(a, b);
665 bool r;
666 if (op == Py_LT)
667 r = x < 0;
668 else if (op == Py_LE)
669 r = x < 1;
670 else if (op == Py_EQ)
671 r = x == 0;
672 else if (op == Py_NE)
673 r = x != 0;
674 else if (op == Py_GE)
675 r = x > -1;
676 else if (op == Py_GT)
677 r = x > 0;
678 if (r)
679 Py_RETURN_TRUE;
680 else
681 Py_RETURN_FALSE;
682 }
683
622 684
623 685 PyTypeObject PythonQtSlotFunction_Type = {
624 PyObject_HEAD_INIT(&PyType_Type)
625 0,
686 PyVarObject_HEAD_INIT(&PyType_Type, 0)
626 687 "builtin_qt_slot",
627 688 sizeof(PythonQtSlotFunctionObject),
628 689 0,
629 690 (destructor)meth_dealloc, /* tp_dealloc */
630 691 0, /* tp_print */
631 692 0, /* tp_getattr */
632 693 0, /* tp_setattr */
694 #ifdef PY3K
695 0,
696 #else
633 697 (cmpfunc)meth_compare, /* tp_compare */
698 #endif
634 699 (reprfunc)meth_repr, /* tp_repr */
635 700 0, /* tp_as_number */
636 701 0, /* tp_as_sequence */
637 702 0, /* tp_as_mapping */
638 703 (hashfunc)meth_hash, /* tp_hash */
639 704 PythonQtSlotFunction_Call, /* tp_call */
640 705 0, /* tp_str */
641 706 PyObject_GenericGetAttr, /* tp_getattro */
642 707 0, /* tp_setattro */
643 708 0, /* tp_as_buffer */
644 709 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */
645 710 0, /* tp_doc */
646 711 (traverseproc)meth_traverse, /* tp_traverse */
647 712 0, /* tp_clear */
648 0, /* tp_richcompare */
713 (richcmpfunc)meth_richcompare, /* tp_richcompare */
649 714 0, /* tp_weaklistoffset */
650 715 0, /* tp_iter */
651 716 0, /* tp_iternext */
652 717 meth_methods, /* tp_methods */
653 718 meth_members, /* tp_members */
654 719 meth_getsets, /* tp_getset */
655 720 0, /* tp_base */
656 721 0, /* tp_dict */
657 722 };
658 723
659 724 /* Clear out the free list */
660 725
661 726 void
662 727 PythonQtSlotFunction_Fini(void)
663 728 {
664 729 while (pythonqtslot_free_list) {
665 730 PythonQtSlotFunctionObject *v = pythonqtslot_free_list;
666 731 pythonqtslot_free_list = (PythonQtSlotFunctionObject *)(v->m_self);
667 732 PyObject_GC_Del(v);
668 733 }
669 734 }
670 735
@@ -1,327 +1,342
1 1 /*
2 2 *
3 3 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
4 4 *
5 5 * This library is free software; you can redistribute it and/or
6 6 * modify it under the terms of the GNU Lesser General Public
7 7 * License as published by the Free Software Foundation; either
8 8 * version 2.1 of the License, or (at your option) any later version.
9 9 *
10 10 * This library is distributed in the hope that it will be useful,
11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 13 * Lesser General Public License for more details.
14 14 *
15 15 * Further, this software is distributed without any warranty that it is
16 16 * free of the rightful claim of any third person regarding infringement
17 17 * or the like. Any license provided herein, whether implied or
18 18 * otherwise, applies only to this software file. Patent licenses, if
19 19 * any, provided herein do not apply to combinations of this program with
20 20 * other software, or any other product whatsoever.
21 21 *
22 22 * You should have received a copy of the GNU Lesser General Public
23 23 * License along with this library; if not, write to the Free Software
24 24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 25 *
26 26 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
27 27 * 28359 Bremen, Germany or:
28 28 *
29 29 * http://www.mevis.de
30 30 *
31 31 */
32 32
33 33 //----------------------------------------------------------------------------------
34 34 /*!
35 35 // \file PythonQtStdDecorators.cpp
36 36 // \author Florian Link
37 37 // \author Last changed by $Author: florian $
38 38 // \date 2007-04
39 39 */
40 40 //----------------------------------------------------------------------------------
41 41
42 42 #include "PythonQtStdDecorators.h"
43 43 #include "PythonQt.h"
44 44 #include "PythonQtClassInfo.h"
45 45 #include <QCoreApplication>
46 46
47 47 bool PythonQtStdDecorators::connect(QObject* sender, const QByteArray& signal, PyObject* callable)
48 48 {
49 49 bool result = false;
50 50 QByteArray signalTmp;
51 51 char first = signal.at(0);
52 52 if (first>='0' && first<='9') {
53 53 signalTmp = signal;
54 54 } else {
55 55 signalTmp = "2" + signal;
56 56 }
57 57
58 58 if (sender) {
59 59 result = PythonQt::self()->addSignalHandler(sender, signalTmp, callable);
60 60 if (!result) {
61 61 if (sender->metaObject()->indexOfSignal(QMetaObject::normalizedSignature(signalTmp.constData()+1)) == -1) {
62 62 qWarning("PythonQt: QObject::connect() signal '%s' does not exist on %s", signal.constData(), sender->metaObject()->className());
63 63 }
64 64 }
65 65 }
66 66 return result;
67 67 }
68 68
69 69 bool PythonQtStdDecorators::connect(QObject* sender, const QByteArray& signal, QObject* receiver, const QByteArray& slot, Qt::ConnectionType type)
70 70 {
71 71 bool r = false;
72 72 if (sender && receiver) {
73 73 QByteArray signalTmp;
74 74 char first = signal.at(0);
75 75 if (first>='0' && first<='9') {
76 76 signalTmp = signal;
77 77 } else {
78 78 signalTmp = "2" + signal;
79 79 }
80 80
81 81 QByteArray slotTmp;
82 82 first = slot.at(0);
83 83 if (first>='0' && first<='9') {
84 84 slotTmp = slot;
85 85 } else {
86 86 slotTmp = "1" + slot;
87 87 }
88 88 r = QObject::connect(sender, signalTmp, receiver, slotTmp, type);
89 89 }
90 90 return r;
91 91 }
92 92
93 93 bool PythonQtStdDecorators::disconnect(QObject* sender, const QByteArray& signal, PyObject* callable)
94 94 {
95 95 bool result = false;
96 96 QByteArray signalTmp;
97 97 char first = signal.at(0);
98 98 if (first>='0' && first<='9') {
99 99 signalTmp = signal;
100 100 } else {
101 101 signalTmp = "2" + signal;
102 102 }
103 103 if (sender) {
104 104 result = PythonQt::self()->removeSignalHandler(sender, signalTmp, callable);
105 105 if (callable == NULL) {
106 106 result |= QObject::disconnect(sender, signalTmp, NULL, NULL);
107 107 }
108 108 if (!result) {
109 109 if (sender->metaObject()->indexOfSignal(QMetaObject::normalizedSignature(signalTmp.constData()+1)) == -1) {
110 110 qWarning("PythonQt: QObject::disconnect() signal '%s' does not exist on %s", signal.constData(), sender->metaObject()->className());
111 111 }
112 112 }
113 113 }
114 114 return result;
115 115 }
116 116
117 117 bool PythonQtStdDecorators::disconnect(QObject* sender, const QByteArray& signal, QObject* receiver, const QByteArray& slot)
118 118 {
119 119 bool r = false;
120 120 if (sender && receiver) {
121 121 QByteArray signalTmp;
122 122 char first = signal.at(0);
123 123 if (first>='0' && first<='9') {
124 124 signalTmp = signal;
125 125 } else {
126 126 signalTmp = "2" + signal;
127 127 }
128 128
129 129 QByteArray slotTmp;
130 130 first = slot.at(0);
131 131 if (first>='0' && first<='9') {
132 132 slotTmp = slot;
133 133 } else {
134 134 slotTmp = "1" + slot;
135 135 }
136 136
137 137 r = QObject::disconnect(sender, signalTmp, receiver, slotTmp);
138 138 }
139 139 return r;
140 140 }
141 141
142 142 QObject* PythonQtStdDecorators::parent(QObject* o) {
143 143 return o->parent();
144 144 }
145 145
146 146 void PythonQtStdDecorators::setParent(QObject* o, QObject* parent)
147 147 {
148 148 o->setParent(parent);
149 149 }
150 150
151 151 const QObjectList* PythonQtStdDecorators::children(QObject* o)
152 152 {
153 153 return &o->children();
154 154 }
155 155
156 156 bool PythonQtStdDecorators::setProperty(QObject* o, const char* name, const QVariant& value)
157 157 {
158 158 return o->setProperty(name, value);
159 159 }
160 160
161 161 QVariant PythonQtStdDecorators::property(QObject* o, const char* name)
162 162 {
163 163 return o->property(name);
164 164 }
165 165
166 166 QString PythonQtStdDecorators::tr(QObject* obj, const QByteArray& text, const QByteArray& ambig, int n)
167 167 {
168 168 #if( QT_VERSION >= QT_VERSION_CHECK(5,0,0) )
169 169 return QCoreApplication::translate(obj->metaObject()->className(), text.constData(), ambig.constData(), n);
170 170 #else
171 171 return QCoreApplication::translate(obj->metaObject()->className(), text.constData(), ambig.constData(), QCoreApplication::CodecForTr, n);
172 172 #endif
173 173 }
174 174
175 175 QObject* PythonQtStdDecorators::findChild(QObject* parent, PyObject* type, const QString& name)
176 176 {
177 177 const QMetaObject* meta = NULL;
178 178 const char* typeName = NULL;
179 179
180 180 if (PyObject_TypeCheck(type, &PythonQtClassWrapper_Type)) {
181 181 meta = ((PythonQtClassWrapper*)type)->classInfo()->metaObject();
182 182 } else if (PyObject_TypeCheck(type, &PythonQtInstanceWrapper_Type)) {
183 183 meta = ((PythonQtInstanceWrapper*)type)->classInfo()->metaObject();
184 #ifdef PY3K
185 } else if (PyUnicode_Check(type)) {
186 typeName = PyUnicode_AsUTF8(type);
187 #else
184 188 } else if (PyString_Check(type)) {
185 189 typeName = PyString_AsString(type);
190 #endif
186 191 }
187 192
188 193 if (!typeName && !meta)
189 194 return NULL;
190 195
191 196 return findChild(parent, typeName, meta, name);
192 197 }
193 198
194 199 QList<QObject*> PythonQtStdDecorators::findChildren(QObject* parent, PyObject* type, const QString& name)
195 200 {
196 201 const QMetaObject* meta = NULL;
197 202 const char* typeName = NULL;
198 203
199 204 if (PyObject_TypeCheck(type, &PythonQtClassWrapper_Type)) {
200 205 meta = ((PythonQtClassWrapper*)type)->classInfo()->metaObject();
201 206 } else if (PyObject_TypeCheck(type, &PythonQtInstanceWrapper_Type)) {
202 207 meta = ((PythonQtInstanceWrapper*)type)->classInfo()->metaObject();
208 #ifdef PY3K
209 } else if (PyUnicode_Check(type)) {
210 typeName = PyUnicode_AsUTF8(type);
211 #else
203 212 } else if (PyString_Check(type)) {
204 213 typeName = PyString_AsString(type);
214 #endif
205 215 }
206 216
207 217 QList<QObject*> list;
208 218
209 219 if (!typeName && !meta)
210 220 return list;
211 221
212 222 findChildren(parent, typeName, meta, name, list);
213 223
214 224 return list;
215 225 }
216 226
217 227 QList<QObject*> PythonQtStdDecorators::findChildren(QObject* parent, PyObject* type, const QRegExp& regExp)
218 228 {
219 229 const QMetaObject* meta = NULL;
220 230 const char* typeName = NULL;
221 231
222 232 if (PyObject_TypeCheck(type, &PythonQtClassWrapper_Type)) {
223 233 meta = ((PythonQtClassWrapper*)type)->classInfo()->metaObject();
224 234 } else if (PyObject_TypeCheck(type, &PythonQtInstanceWrapper_Type)) {
225 235 meta = ((PythonQtInstanceWrapper*)type)->classInfo()->metaObject();
236 #ifdef PY3K
237 } else if (PyUnicode_Check(type)) {
238 typeName = PyUnicode_AsUTF8(type);
239 #else
226 240 } else if (PyString_Check(type)) {
227 241 typeName = PyString_AsString(type);
242 #endif
228 243 }
229 244
230 245 QList<QObject*> list;
231 246
232 247 if (!typeName && !meta)
233 248 return list;
234 249
235 250 findChildren(parent, typeName, meta, regExp, list);
236 251
237 252 return list;
238 253 }
239 254
240 255 QObject* PythonQtStdDecorators::findChild(QObject* parent, const char* typeName, const QMetaObject* meta, const QString& name)
241 256 {
242 257 const QObjectList &children = parent->children();
243 258
244 259 int i;
245 260 for (i = 0; i < children.size(); ++i) {
246 261 QObject* obj = children.at(i);
247 262
248 263 if (!obj)
249 264 return NULL;
250 265
251 266 // Skip if the name doesn't match.
252 267 if (!name.isNull() && obj->objectName() != name)
253 268 continue;
254 269
255 270 if ((typeName && obj->inherits(typeName)) ||
256 271 (meta && meta->cast(obj)))
257 272 return obj;
258 273 }
259 274
260 275 for (i = 0; i < children.size(); ++i) {
261 276 QObject* obj = findChild(children.at(i), typeName, meta, name);
262 277
263 278 if (obj != NULL)
264 279 return obj;
265 280 }
266 281
267 282 return NULL;
268 283 }
269 284
270 285 int PythonQtStdDecorators::findChildren(QObject* parent, const char* typeName, const QMetaObject* meta, const QString& name, QList<QObject*>& list)
271 286 {
272 287 const QObjectList& children = parent->children();
273 288 int i;
274 289
275 290 for (i = 0; i < children.size(); ++i) {
276 291 QObject* obj = children.at(i);
277 292
278 293 if (!obj)
279 294 return -1;
280 295
281 296 // Skip if the name doesn't match.
282 297 if (!name.isNull() && obj->objectName() != name)
283 298 continue;
284 299
285 300 if ((typeName && obj->inherits(typeName)) ||
286 301 (meta && meta->cast(obj))) {
287 302 list += obj;
288 303 }
289 304
290 305 if (findChildren(obj, typeName, meta, name, list) < 0)
291 306 return -1;
292 307 }
293 308
294 309 return 0;
295 310 }
296 311
297 312 int PythonQtStdDecorators::findChildren(QObject* parent, const char* typeName, const QMetaObject* meta, const QRegExp& regExp, QList<QObject*>& list)
298 313 {
299 314 const QObjectList& children = parent->children();
300 315 int i;
301 316
302 317 for (i = 0; i < children.size(); ++i) {
303 318 QObject* obj = children.at(i);
304 319
305 320 if (!obj)
306 321 return -1;
307 322
308 323 // Skip if the name doesn't match.
309 324 if (regExp.indexIn(obj->objectName()) == -1)
310 325 continue;
311 326
312 327 if ((typeName && obj->inherits(typeName)) ||
313 328 (meta && meta->cast(obj))) {
314 329 list += obj;
315 330 }
316 331
317 332 if (findChildren(obj, typeName, meta, regExp, list) < 0)
318 333 return -1;
319 334 }
320 335
321 336 return 0;
322 337 }
323 338
324 339 const QMetaObject* PythonQtStdDecorators::metaObject( QObject* obj )
325 340 {
326 341 return obj->metaObject();
327 342 }
@@ -1,118 +1,117
1 1 /*
2 2 *
3 3 * Copyright (C) 2011 MeVis Medical Solutions AG All Rights Reserved.
4 4 *
5 5 * This library is free software; you can redistribute it and/or
6 6 * modify it under the terms of the GNU Lesser General Public
7 7 * License as published by the Free Software Foundation; either
8 8 * version 2.1 of the License, or (at your option) any later version.
9 9 *
10 10 * This library is distributed in the hope that it will be useful,
11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 13 * Lesser General Public License for more details.
14 14 *
15 15 * Further, this software is distributed without any warranty that it is
16 16 * free of the rightful claim of any third person regarding infringement
17 17 * or the like. Any license provided herein, whether implied or
18 18 * otherwise, applies only to this software file. Patent licenses, if
19 19 * any, provided herein do not apply to combinations of this program with
20 20 * other software, or any other product whatsoever.
21 21 *
22 22 * You should have received a copy of the GNU Lesser General Public
23 23 * License along with this library; if not, write to the Free Software
24 24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 25 *
26 26 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
27 27 * 28359 Bremen, Germany or:
28 28 *
29 29 * http://www.mevis.de
30 30 *
31 31 */
32 32
33 33 //----------------------------------------------------------------------------------
34 34 /*!
35 35 // \file PythonQtStdIn.cpp
36 36 // \author Jean-Christophe Fillion-Robin
37 37 // \author Last changed by $Author: jcfr $
38 38 // \date 2011
39 39 */
40 40 //----------------------------------------------------------------------------------
41 41
42 42 #include "PythonQtStdIn.h"
43 43
44 44 static PyObject *PythonQtStdInRedirect_new(PyTypeObject *type, PyObject * /*args*/, PyObject * /*kwds*/)
45 45 {
46 46 PythonQtStdInRedirect *self;
47 47 self = (PythonQtStdInRedirect *)type->tp_alloc(type, 0);
48 48 self->_cb = NULL;
49 49 self->_callData = NULL;
50 50
51 51 return (PyObject *)self;
52 52 }
53 53
54 54 static PyObject *PythonQtStdInRedirect_readline(PyObject * self, PyObject * args)
55 55 {
56 56 PythonQtStdInRedirect* s = (PythonQtStdInRedirect*)self;
57 57 QString string;
58 58 if (s->_cb) {
59 59 string = (*s->_cb)(s->_callData);
60 60 }
61 61 #if( QT_VERSION >= QT_VERSION_CHECK(5,0,0) )
62 62 return Py_BuildValue(const_cast<char*>("s"), const_cast<char*>(string.toLatin1().data()));
63 63 #else
64 64 return Py_BuildValue(const_cast<char*>("s"), const_cast<char*>(string.toAscii().data()));
65 65 #endif
66 66 }
67 67
68 68 static PyMethodDef PythonQtStdInRedirect_methods[] = {
69 69 {"readline", (PyCFunction)PythonQtStdInRedirect_readline, METH_VARARGS,
70 70 "read input line"},
71 71 {NULL, NULL, 0 , NULL} /* sentinel */
72 72 };
73 73
74 74 static PyMemberDef PythonQtStdInRedirect_members[] = {
75 75 {NULL} /* Sentinel */
76 76 };
77 77
78 78 PyTypeObject PythonQtStdInRedirectType = {
79 PyObject_HEAD_INIT(NULL)
80 0, /*ob_size*/
79 PyVarObject_HEAD_INIT(NULL, 0)
81 80 "PythonQtStdInRedirect", /*tp_name*/
82 81 sizeof(PythonQtStdInRedirect), /*tp_basicsize*/
83 82 0, /*tp_itemsize*/
84 83 0, /*tp_dealloc*/
85 84 0, /*tp_print*/
86 85 0, /*tp_getattr*/
87 86 0, /*tp_setattr*/
88 87 0, /*tp_compare*/
89 88 0, /*tp_repr*/
90 89 0, /*tp_as_number*/
91 90 0, /*tp_as_sequence*/
92 91 0, /*tp_as_mapping*/
93 92 0, /*tp_hash */
94 93 0, /*tp_call*/
95 94 0, /*tp_str*/
96 95 0, /*tp_getattro*/
97 96 0, /*tp_setattro*/
98 97 0, /*tp_as_buffer*/
99 98 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
100 99 "PythonQtStdInRedirect", /* tp_doc */
101 100 0, /* tp_traverse */
102 101 0, /* tp_clear */
103 102 0, /* tp_richcompare */
104 103 0, /* tp_weaklistoffset */
105 104 0, /* tp_iter */
106 105 0, /* tp_iternext */
107 106 PythonQtStdInRedirect_methods, /* tp_methods */
108 107 PythonQtStdInRedirect_members, /* tp_members */
109 108 0, /* tp_getset */
110 109 0, /* tp_base */
111 110 0, /* tp_dict */
112 111 0, /* tp_descr_get */
113 112 0, /* tp_descr_set */
114 113 0, /* tp_dictoffset */
115 114 0, /* tp_init */
116 115 0, /* tp_alloc */
117 116 PythonQtStdInRedirect_new, /* tp_new */
118 117 };
@@ -1,159 +1,164
1 1 /*
2 2 *
3 3 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
4 4 *
5 5 * This library is free software; you can redistribute it and/or
6 6 * modify it under the terms of the GNU Lesser General Public
7 7 * License as published by the Free Software Foundation; either
8 8 * version 2.1 of the License, or (at your option) any later version.
9 9 *
10 10 * This library is distributed in the hope that it will be useful,
11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 13 * Lesser General Public License for more details.
14 14 *
15 15 * Further, this software is distributed without any warranty that it is
16 16 * free of the rightful claim of any third person regarding infringement
17 17 * or the like. Any license provided herein, whether implied or
18 18 * otherwise, applies only to this software file. Patent licenses, if
19 19 * any, provided herein do not apply to combinations of this program with
20 20 * other software, or any other product whatsoever.
21 21 *
22 22 * You should have received a copy of the GNU Lesser General Public
23 23 * License along with this library; if not, write to the Free Software
24 24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 25 *
26 26 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
27 27 * 28359 Bremen, Germany or:
28 28 *
29 29 * http://www.mevis.de
30 30 *
31 31 */
32 32
33 33 //----------------------------------------------------------------------------------
34 34 /*!
35 35 // \file PythonQtStdOut.cpp
36 36 // \author Florian Link
37 37 // \author Last changed by $Author: florian $
38 38 // \date 2006-05
39 39 */
40 40 //----------------------------------------------------------------------------------
41 41
42 42 #include "PythonQtStdOut.h"
43 43
44 44 static PyObject *PythonQtStdOutRedirect_new(PyTypeObject *type, PyObject * /*args*/, PyObject * /*kwds*/)
45 45 {
46 46 PythonQtStdOutRedirect *self;
47 47 self = (PythonQtStdOutRedirect *)type->tp_alloc(type, 0);
48 48
49 49 self->softspace = 0;
50 50 self->_cb = NULL;
51 51
52 52 return (PyObject *)self;
53 53 }
54 54
55 55 static PyObject *PythonQtStdOutRedirect_write(PyObject *self, PyObject *args)
56 56 {
57 57 PythonQtStdOutRedirect* s = (PythonQtStdOutRedirect*)self;
58 58 if (s->_cb) {
59 59 QString output;
60 60 if (PyTuple_GET_SIZE(args)>=1) {
61 61 PyObject* obj = PyTuple_GET_ITEM(args,0);
62 62 if (PyUnicode_Check(obj)) {
63 #ifdef PY3K
64 Py_UCS4 *x = PyUnicode_AsUCS4Copy(obj);
65 output = QString::fromUcs4(x, PyUnicode_GetLength(obj));
66 PyMem_Free(x);
67 #else
63 68 PyObject *tmp = PyUnicode_AsUTF8String(obj);
64 69 if(tmp) {
65 70 output = QString::fromUtf8(PyString_AS_STRING(tmp));
66 71 Py_DECREF(tmp);
67 72 } else {
68 73 return NULL;
69 74 }
75 #endif
70 76 } else {
71 77 char *string;
72 78 if (!PyArg_ParseTuple(args, "s", &string)) {
73 79 return NULL;
74 80 }
75 81 output = QString::fromLatin1(string);
76 82 }
77 83 }
78 84
79 85 if (s->softspace > 0) {
80 86 (*s->_cb)(QString(""));
81 87 s->softspace = 0;
82 88 }
83 89
84 90 (*s->_cb)(output);
85 91 }
86 92 return Py_BuildValue("");
87 93 }
88 94
89 95 static PyObject *PythonQtStdOutRedirect_flush(PyObject * /*self*/, PyObject * /*args*/)
90 96 {
91 97 return Py_BuildValue("");
92 98 }
93 99
94 100 static PyObject *PythonQtStdOutRedirect_isatty(PyObject * /*self*/, PyObject * /*args*/)
95 101 {
96 102 Py_INCREF(Py_False);
97 103 return Py_False;
98 104 }
99 105
100 106 static PyMethodDef PythonQtStdOutRedirect_methods[] = {
101 107 {"write", (PyCFunction)PythonQtStdOutRedirect_write, METH_VARARGS,
102 108 "redirect the writing to a callback"},
103 109 {"flush", (PyCFunction)PythonQtStdOutRedirect_flush, METH_VARARGS,
104 110 "flush the output, currently not implemented but needed for logging framework"
105 111 },
106 112 {"isatty", (PyCFunction)PythonQtStdOutRedirect_isatty, METH_NOARGS,
107 113 "return False since this object is not a tty-like device. Needed for logging framework"
108 114 },
109 115 {NULL, NULL, 0 , NULL} /* sentinel */
110 116 };
111 117
112 118 static PyMemberDef PythonQtStdOutRedirect_members[] = {
113 119 {const_cast<char*>("softspace"), T_INT, offsetof(PythonQtStdOutRedirect, softspace), 0,
114 120 const_cast<char*>("soft space flag")
115 121 },
116 122 {NULL} /* Sentinel */
117 123 };
118 124
119 125 PyTypeObject PythonQtStdOutRedirectType = {
120 PyObject_HEAD_INIT(NULL)
121 0, /*ob_size*/
126 PyVarObject_HEAD_INIT(NULL, 0)
122 127 "PythonQtStdOutRedirect", /*tp_name*/
123 128 sizeof(PythonQtStdOutRedirect), /*tp_basicsize*/
124 129 0, /*tp_itemsize*/
125 130 0, /*tp_dealloc*/
126 131 0, /*tp_print*/
127 132 0, /*tp_getattr*/
128 133 0, /*tp_setattr*/
129 134 0, /*tp_compare*/
130 135 0, /*tp_repr*/
131 136 0, /*tp_as_number*/
132 137 0, /*tp_as_sequence*/
133 138 0, /*tp_as_mapping*/
134 139 0, /*tp_hash */
135 140 0, /*tp_call*/
136 141 0, /*tp_str*/
137 142 0, /*tp_getattro*/
138 143 0, /*tp_setattro*/
139 144 0, /*tp_as_buffer*/
140 145 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
141 146 "PythonQtStdOutRedirect", /* tp_doc */
142 147 0, /* tp_traverse */
143 148 0, /* tp_clear */
144 149 0, /* tp_richcompare */
145 150 0, /* tp_weaklistoffset */
146 151 0, /* tp_iter */
147 152 0, /* tp_iternext */
148 153 PythonQtStdOutRedirect_methods, /* tp_methods */
149 154 PythonQtStdOutRedirect_members, /* tp_members */
150 155 0, /* tp_getset */
151 156 0, /* tp_base */
152 157 0, /* tp_dict */
153 158 0, /* tp_descr_get */
154 159 0, /* tp_descr_set */
155 160 0, /* tp_dictoffset */
156 161 0, /* tp_init */
157 162 0, /* tp_alloc */
158 163 PythonQtStdOutRedirect_new, /* tp_new */
159 164 };
General Comments 0
You need to be logged in to leave comments. Login now