Differential D24817 Diff 68400 src/scripting/qtbindings/generated_cpp/com_trolltech_qt_core/qtscript_QAbstractItemModel.cpp
Changeset View
Changeset View
Standalone View
Standalone View
src/scripting/qtbindings/generated_cpp/com_trolltech_qt_core/qtscript_QAbstractItemModel.cpp
- This file was added.
1 | #include <QtScript/QScriptEngine> | ||||
---|---|---|---|---|---|
2 | #include <QtScript/QScriptContext> | ||||
3 | #include <QtScript/QScriptValue> | ||||
4 | #include <QtCore/QStringList> | ||||
5 | #include <QtCore/QDebug> | ||||
6 | #include <qmetaobject.h> | ||||
7 | #include <__package_shared.h> | ||||
8 | | ||||
9 | #include <qabstractitemmodel.h> | ||||
10 | #include <QVariant> | ||||
11 | #include <qabstractitemmodel.h> | ||||
12 | #include <qbytearray.h> | ||||
13 | #include <qcoreevent.h> | ||||
14 | #include <qlist.h> | ||||
15 | #include <qmimedata.h> | ||||
16 | #include <qobject.h> | ||||
17 | #include <qsize.h> | ||||
18 | #include <qstringlist.h> | ||||
19 | #include <qvector.h> | ||||
20 | | ||||
21 | #include "qtscriptshell_QAbstractItemModel.h" | ||||
22 | | ||||
23 | static const char * const qtscript_QAbstractItemModel_function_names[] = { | ||||
24 | "QAbstractItemModel" | ||||
25 | // static | ||||
26 | // prototype | ||||
27 | , "buddy" | ||||
28 | , "canDropMimeData" | ||||
29 | , "canFetchMore" | ||||
30 | , "columnCount" | ||||
31 | , "data" | ||||
32 | , "dropMimeData" | ||||
33 | , "fetchMore" | ||||
34 | , "flags" | ||||
35 | , "hasChildren" | ||||
36 | , "hasIndex" | ||||
37 | , "headerData" | ||||
38 | , "index" | ||||
39 | , "insertColumn" | ||||
40 | , "insertColumns" | ||||
41 | , "insertRow" | ||||
42 | , "insertRows" | ||||
43 | , "itemData" | ||||
44 | , "match" | ||||
45 | , "mimeData" | ||||
46 | , "mimeTypes" | ||||
47 | , "moveColumn" | ||||
48 | , "moveColumns" | ||||
49 | , "moveRow" | ||||
50 | , "moveRows" | ||||
51 | , "parent" | ||||
52 | , "removeColumn" | ||||
53 | , "removeColumns" | ||||
54 | , "removeRow" | ||||
55 | , "removeRows" | ||||
56 | , "roleNames" | ||||
57 | , "rowCount" | ||||
58 | , "setData" | ||||
59 | , "setHeaderData" | ||||
60 | , "setItemData" | ||||
61 | , "sibling" | ||||
62 | , "sort" | ||||
63 | , "span" | ||||
64 | , "supportedDragActions" | ||||
65 | , "supportedDropActions" | ||||
66 | , "toString" | ||||
67 | }; | ||||
68 | | ||||
69 | static const char * const qtscript_QAbstractItemModel_function_signatures[] = { | ||||
70 | "QObject parent" | ||||
71 | // static | ||||
72 | // prototype | ||||
73 | , "QModelIndex index" | ||||
74 | , "QMimeData data, DropAction action, int row, int column, QModelIndex parent" | ||||
75 | , "QModelIndex parent" | ||||
76 | , "QModelIndex parent" | ||||
77 | , "QModelIndex index, int role" | ||||
78 | , "QMimeData data, DropAction action, int row, int column, QModelIndex parent" | ||||
79 | , "QModelIndex parent" | ||||
80 | , "QModelIndex index" | ||||
81 | , "QModelIndex parent" | ||||
82 | , "int row, int column, QModelIndex parent" | ||||
83 | , "int section, Orientation orientation, int role" | ||||
84 | , "int row, int column, QModelIndex parent" | ||||
85 | , "int column, QModelIndex parent" | ||||
86 | , "int column, int count, QModelIndex parent" | ||||
87 | , "int row, QModelIndex parent" | ||||
88 | , "int row, int count, QModelIndex parent" | ||||
89 | , "QModelIndex index" | ||||
90 | , "QModelIndex start, int role, Object value, int hits, MatchFlags flags" | ||||
91 | , "List indexes" | ||||
92 | , "" | ||||
93 | , "QModelIndex sourceParent, int sourceColumn, QModelIndex destinationParent, int destinationChild" | ||||
94 | , "QModelIndex sourceParent, int sourceColumn, int count, QModelIndex destinationParent, int destinationChild" | ||||
95 | , "QModelIndex sourceParent, int sourceRow, QModelIndex destinationParent, int destinationChild" | ||||
96 | , "QModelIndex sourceParent, int sourceRow, int count, QModelIndex destinationParent, int destinationChild" | ||||
97 | , "QModelIndex child" | ||||
98 | , "int column, QModelIndex parent" | ||||
99 | , "int column, int count, QModelIndex parent" | ||||
100 | , "int row, QModelIndex parent" | ||||
101 | , "int row, int count, QModelIndex parent" | ||||
102 | , "" | ||||
103 | , "QModelIndex parent" | ||||
104 | , "QModelIndex index, Object value, int role" | ||||
105 | , "int section, Orientation orientation, Object value, int role" | ||||
106 | , "QModelIndex index, SortedMap roles" | ||||
107 | , "int row, int column, QModelIndex idx" | ||||
108 | , "int column, SortOrder order" | ||||
109 | , "QModelIndex index" | ||||
110 | , "" | ||||
111 | , "" | ||||
112 | "" | ||||
113 | }; | ||||
114 | | ||||
115 | static const int qtscript_QAbstractItemModel_function_lengths[] = { | ||||
116 | 1 | ||||
117 | // static | ||||
118 | // prototype | ||||
119 | , 1 | ||||
120 | , 5 | ||||
121 | , 1 | ||||
122 | , 1 | ||||
123 | , 2 | ||||
124 | , 5 | ||||
125 | , 1 | ||||
126 | , 1 | ||||
127 | , 1 | ||||
128 | , 3 | ||||
129 | , 3 | ||||
130 | , 3 | ||||
131 | , 2 | ||||
132 | , 3 | ||||
133 | , 2 | ||||
134 | , 3 | ||||
135 | , 1 | ||||
136 | , 5 | ||||
137 | , 1 | ||||
138 | , 0 | ||||
139 | , 4 | ||||
140 | , 5 | ||||
141 | , 4 | ||||
142 | , 5 | ||||
143 | , 1 | ||||
144 | , 2 | ||||
145 | , 3 | ||||
146 | , 2 | ||||
147 | , 3 | ||||
148 | , 0 | ||||
149 | , 1 | ||||
150 | , 3 | ||||
151 | , 4 | ||||
152 | , 2 | ||||
153 | , 3 | ||||
154 | , 2 | ||||
155 | , 1 | ||||
156 | , 0 | ||||
157 | , 0 | ||||
158 | , 0 | ||||
159 | }; | ||||
160 | | ||||
161 | static QScriptValue qtscript_QAbstractItemModel_throw_ambiguity_error_helper( | ||||
162 | QScriptContext *context, const char *functionName, const char *signatures) | ||||
163 | { | ||||
164 | QStringList lines = QString::fromLatin1(signatures).split(QLatin1Char('\n')); | ||||
165 | QStringList fullSignatures; | ||||
166 | for (int i = 0; i < lines.size(); ++i) | ||||
167 | fullSignatures.append(QString::fromLatin1("%0(%1)").arg(functionName).arg(lines.at(i))); | ||||
168 | return context->throwError(QString::fromLatin1("QAbstractItemModel::%0(): could not find a function match; candidates are:\n%1") | ||||
169 | .arg(functionName).arg(fullSignatures.join(QLatin1String("\n")))); | ||||
170 | } | ||||
171 | | ||||
172 | Q_DECLARE_METATYPE(QAbstractItemModel*) | ||||
173 | Q_DECLARE_METATYPE(QtScriptShell_QAbstractItemModel*) | ||||
174 | Q_DECLARE_METATYPE(const QMimeData*) | ||||
175 | Q_DECLARE_METATYPE(Qt::DropAction) | ||||
176 | Q_DECLARE_METATYPE(QFlags<Qt::ItemFlag>) | ||||
177 | Q_DECLARE_METATYPE(Qt::Orientation) | ||||
178 | template <> \ | ||||
179 | struct QMetaTypeId< QMap<int,QVariant > > \ | ||||
180 | { \ | ||||
181 | enum { Defined = 1 }; \ | ||||
182 | static int qt_metatype_id() \ | ||||
183 | { \ | ||||
184 | static QBasicAtomicInt metatype_id = Q_BASIC_ATOMIC_INITIALIZER(0); \ | ||||
185 | if (!metatype_id.load()) \ | ||||
186 | metatype_id.store(qRegisterMetaType< QMap<int,QVariant > >("QMap<int,QVariant >")); \ | ||||
187 | return metatype_id.load(); \ | ||||
188 | } \ | ||||
189 | }; | ||||
190 | Q_DECLARE_METATYPE(QFlags<Qt::MatchFlag>) | ||||
191 | //Q_DECLARE_METATYPE(QList<QModelIndex >) | ||||
192 | Q_DECLARE_METATYPE(QMimeData*) | ||||
193 | template <> \ | ||||
194 | struct QMetaTypeId< QHash<int,QByteArray > > \ | ||||
195 | { \ | ||||
196 | enum { Defined = 1 }; \ | ||||
197 | static int qt_metatype_id() \ | ||||
198 | { \ | ||||
199 | static QBasicAtomicInt metatype_id = Q_BASIC_ATOMIC_INITIALIZER(0); \ | ||||
200 | if (!metatype_id.load()) \ | ||||
201 | metatype_id.store(qRegisterMetaType< QHash<int,QByteArray > >("QHash<int,QByteArray >")); \ | ||||
202 | return metatype_id.load(); \ | ||||
203 | } \ | ||||
204 | }; | ||||
205 | Q_DECLARE_METATYPE(Qt::SortOrder) | ||||
206 | Q_DECLARE_METATYPE(QFlags<Qt::DropAction>) | ||||
207 | | ||||
208 | // | ||||
209 | // QAbstractItemModel | ||||
210 | // | ||||
211 | | ||||
212 | static QScriptValue qtscript_QAbstractItemModel_prototype_call(QScriptContext *context, QScriptEngine *) | ||||
213 | { | ||||
214 | #if QT_VERSION > 0x040400 | ||||
215 | Q_ASSERT(context->callee().isFunction()); | ||||
216 | uint _id = context->callee().data().toUInt32(); | ||||
217 | #else | ||||
218 | uint _id; | ||||
219 | if (context->callee().isFunction()) | ||||
220 | _id = context->callee().data().toUInt32(); | ||||
221 | else | ||||
222 | _id = 0xBABE0000 + 39; | ||||
223 | #endif | ||||
224 | Q_ASSERT((_id & 0xFFFF0000) == 0xBABE0000); | ||||
225 | _id &= 0x0000FFFF; | ||||
226 | QAbstractItemModel* _q_self = qscriptvalue_cast<QAbstractItemModel*>(context->thisObject()); | ||||
227 | if (!_q_self) { | ||||
228 | return context->throwError(QScriptContext::TypeError, | ||||
229 | QString::fromLatin1("QAbstractItemModel.%0(): this object is not a QAbstractItemModel") | ||||
230 | .arg(qtscript_QAbstractItemModel_function_names[_id+1])); | ||||
231 | } | ||||
232 | | ||||
233 | switch (_id) { | ||||
234 | case 0: | ||||
235 | if (context->argumentCount() == 1) { | ||||
236 | QModelIndex _q_arg0 = qscriptvalue_cast<QModelIndex>(context->argument(0)); | ||||
237 | QModelIndex _q_result = _q_self->buddy(_q_arg0); | ||||
238 | return qScriptValueFromValue(context->engine(), _q_result); | ||||
239 | } | ||||
240 | break; | ||||
241 | | ||||
242 | case 1: | ||||
243 | if (context->argumentCount() == 5) { | ||||
244 | const QMimeData* _q_arg0 = qscriptvalue_cast<const QMimeData*>(context->argument(0)); | ||||
245 | Qt::DropAction _q_arg1 = qscriptvalue_cast<Qt::DropAction>(context->argument(1)); | ||||
246 | int _q_arg2 = context->argument(2).toInt32(); | ||||
247 | int _q_arg3 = context->argument(3).toInt32(); | ||||
248 | QModelIndex _q_arg4 = qscriptvalue_cast<QModelIndex>(context->argument(4)); | ||||
249 | bool _q_result = _q_self->canDropMimeData(_q_arg0, _q_arg1, _q_arg2, _q_arg3, _q_arg4); | ||||
250 | return QScriptValue(context->engine(), _q_result); | ||||
251 | } | ||||
252 | break; | ||||
253 | | ||||
254 | case 2: | ||||
255 | if (context->argumentCount() == 1) { | ||||
256 | QModelIndex _q_arg0 = qscriptvalue_cast<QModelIndex>(context->argument(0)); | ||||
257 | bool _q_result = _q_self->canFetchMore(_q_arg0); | ||||
258 | return QScriptValue(context->engine(), _q_result); | ||||
259 | } | ||||
260 | break; | ||||
261 | | ||||
262 | case 3: | ||||
263 | if (context->argumentCount() == 0) { | ||||
264 | int _q_result = _q_self->columnCount(); | ||||
265 | return QScriptValue(context->engine(), _q_result); | ||||
266 | } | ||||
267 | if (context->argumentCount() == 1) { | ||||
268 | QModelIndex _q_arg0 = qscriptvalue_cast<QModelIndex>(context->argument(0)); | ||||
269 | int _q_result = _q_self->columnCount(_q_arg0); | ||||
270 | return QScriptValue(context->engine(), _q_result); | ||||
271 | } | ||||
272 | break; | ||||
273 | | ||||
274 | case 4: | ||||
275 | if (context->argumentCount() == 1) { | ||||
276 | QModelIndex _q_arg0 = qscriptvalue_cast<QModelIndex>(context->argument(0)); | ||||
277 | QVariant _q_result = _q_self->data(_q_arg0); | ||||
278 | return qScriptValueFromValue(context->engine(), _q_result); | ||||
279 | } | ||||
280 | if (context->argumentCount() == 2) { | ||||
281 | QModelIndex _q_arg0 = qscriptvalue_cast<QModelIndex>(context->argument(0)); | ||||
282 | int _q_arg1 = context->argument(1).toInt32(); | ||||
283 | QVariant _q_result = _q_self->data(_q_arg0, _q_arg1); | ||||
284 | return qScriptValueFromValue(context->engine(), _q_result); | ||||
285 | } | ||||
286 | break; | ||||
287 | | ||||
288 | case 5: | ||||
289 | if (context->argumentCount() == 5) { | ||||
290 | const QMimeData* _q_arg0 = qscriptvalue_cast<const QMimeData*>(context->argument(0)); | ||||
291 | Qt::DropAction _q_arg1 = qscriptvalue_cast<Qt::DropAction>(context->argument(1)); | ||||
292 | int _q_arg2 = context->argument(2).toInt32(); | ||||
293 | int _q_arg3 = context->argument(3).toInt32(); | ||||
294 | QModelIndex _q_arg4 = qscriptvalue_cast<QModelIndex>(context->argument(4)); | ||||
295 | bool _q_result = _q_self->dropMimeData(_q_arg0, _q_arg1, _q_arg2, _q_arg3, _q_arg4); | ||||
296 | return QScriptValue(context->engine(), _q_result); | ||||
297 | } | ||||
298 | break; | ||||
299 | | ||||
300 | case 6: | ||||
301 | if (context->argumentCount() == 1) { | ||||
302 | QModelIndex _q_arg0 = qscriptvalue_cast<QModelIndex>(context->argument(0)); | ||||
303 | _q_self->fetchMore(_q_arg0); | ||||
304 | return context->engine()->undefinedValue(); | ||||
305 | } | ||||
306 | break; | ||||
307 | | ||||
308 | case 7: | ||||
309 | if (context->argumentCount() == 1) { | ||||
310 | QModelIndex _q_arg0 = qscriptvalue_cast<QModelIndex>(context->argument(0)); | ||||
311 | QFlags<Qt::ItemFlag> _q_result = _q_self->flags(_q_arg0); | ||||
312 | return qScriptValueFromValue(context->engine(), _q_result); | ||||
313 | } | ||||
314 | break; | ||||
315 | | ||||
316 | case 8: | ||||
317 | if (context->argumentCount() == 0) { | ||||
318 | bool _q_result = _q_self->hasChildren(); | ||||
319 | return QScriptValue(context->engine(), _q_result); | ||||
320 | } | ||||
321 | if (context->argumentCount() == 1) { | ||||
322 | QModelIndex _q_arg0 = qscriptvalue_cast<QModelIndex>(context->argument(0)); | ||||
323 | bool _q_result = _q_self->hasChildren(_q_arg0); | ||||
324 | return QScriptValue(context->engine(), _q_result); | ||||
325 | } | ||||
326 | break; | ||||
327 | | ||||
328 | case 9: | ||||
329 | if (context->argumentCount() == 2) { | ||||
330 | int _q_arg0 = context->argument(0).toInt32(); | ||||
331 | int _q_arg1 = context->argument(1).toInt32(); | ||||
332 | bool _q_result = _q_self->hasIndex(_q_arg0, _q_arg1); | ||||
333 | return QScriptValue(context->engine(), _q_result); | ||||
334 | } | ||||
335 | if (context->argumentCount() == 3) { | ||||
336 | int _q_arg0 = context->argument(0).toInt32(); | ||||
337 | int _q_arg1 = context->argument(1).toInt32(); | ||||
338 | QModelIndex _q_arg2 = qscriptvalue_cast<QModelIndex>(context->argument(2)); | ||||
339 | bool _q_result = _q_self->hasIndex(_q_arg0, _q_arg1, _q_arg2); | ||||
340 | return QScriptValue(context->engine(), _q_result); | ||||
341 | } | ||||
342 | break; | ||||
343 | | ||||
344 | case 10: | ||||
345 | if (context->argumentCount() == 2) { | ||||
346 | int _q_arg0 = context->argument(0).toInt32(); | ||||
347 | Qt::Orientation _q_arg1 = qscriptvalue_cast<Qt::Orientation>(context->argument(1)); | ||||
348 | QVariant _q_result = _q_self->headerData(_q_arg0, _q_arg1); | ||||
349 | return qScriptValueFromValue(context->engine(), _q_result); | ||||
350 | } | ||||
351 | if (context->argumentCount() == 3) { | ||||
352 | int _q_arg0 = context->argument(0).toInt32(); | ||||
353 | Qt::Orientation _q_arg1 = qscriptvalue_cast<Qt::Orientation>(context->argument(1)); | ||||
354 | int _q_arg2 = context->argument(2).toInt32(); | ||||
355 | QVariant _q_result = _q_self->headerData(_q_arg0, _q_arg1, _q_arg2); | ||||
356 | return qScriptValueFromValue(context->engine(), _q_result); | ||||
357 | } | ||||
358 | break; | ||||
359 | | ||||
360 | case 11: | ||||
361 | if (context->argumentCount() == 2) { | ||||
362 | int _q_arg0 = context->argument(0).toInt32(); | ||||
363 | int _q_arg1 = context->argument(1).toInt32(); | ||||
364 | QModelIndex _q_result = _q_self->index(_q_arg0, _q_arg1); | ||||
365 | return qScriptValueFromValue(context->engine(), _q_result); | ||||
366 | } | ||||
367 | if (context->argumentCount() == 3) { | ||||
368 | int _q_arg0 = context->argument(0).toInt32(); | ||||
369 | int _q_arg1 = context->argument(1).toInt32(); | ||||
370 | QModelIndex _q_arg2 = qscriptvalue_cast<QModelIndex>(context->argument(2)); | ||||
371 | QModelIndex _q_result = _q_self->index(_q_arg0, _q_arg1, _q_arg2); | ||||
372 | return qScriptValueFromValue(context->engine(), _q_result); | ||||
373 | } | ||||
374 | break; | ||||
375 | | ||||
376 | case 12: | ||||
377 | if (context->argumentCount() == 1) { | ||||
378 | int _q_arg0 = context->argument(0).toInt32(); | ||||
379 | bool _q_result = _q_self->insertColumn(_q_arg0); | ||||
380 | return QScriptValue(context->engine(), _q_result); | ||||
381 | } | ||||
382 | if (context->argumentCount() == 2) { | ||||
383 | int _q_arg0 = context->argument(0).toInt32(); | ||||
384 | QModelIndex _q_arg1 = qscriptvalue_cast<QModelIndex>(context->argument(1)); | ||||
385 | bool _q_result = _q_self->insertColumn(_q_arg0, _q_arg1); | ||||
386 | return QScriptValue(context->engine(), _q_result); | ||||
387 | } | ||||
388 | break; | ||||
389 | | ||||
390 | case 13: | ||||
391 | if (context->argumentCount() == 2) { | ||||
392 | int _q_arg0 = context->argument(0).toInt32(); | ||||
393 | int _q_arg1 = context->argument(1).toInt32(); | ||||
394 | bool _q_result = _q_self->insertColumns(_q_arg0, _q_arg1); | ||||
395 | return QScriptValue(context->engine(), _q_result); | ||||
396 | } | ||||
397 | if (context->argumentCount() == 3) { | ||||
398 | int _q_arg0 = context->argument(0).toInt32(); | ||||
399 | int _q_arg1 = context->argument(1).toInt32(); | ||||
400 | QModelIndex _q_arg2 = qscriptvalue_cast<QModelIndex>(context->argument(2)); | ||||
401 | bool _q_result = _q_self->insertColumns(_q_arg0, _q_arg1, _q_arg2); | ||||
402 | return QScriptValue(context->engine(), _q_result); | ||||
403 | } | ||||
404 | break; | ||||
405 | | ||||
406 | case 14: | ||||
407 | if (context->argumentCount() == 1) { | ||||
408 | int _q_arg0 = context->argument(0).toInt32(); | ||||
409 | bool _q_result = _q_self->insertRow(_q_arg0); | ||||
410 | return QScriptValue(context->engine(), _q_result); | ||||
411 | } | ||||
412 | if (context->argumentCount() == 2) { | ||||
413 | int _q_arg0 = context->argument(0).toInt32(); | ||||
414 | QModelIndex _q_arg1 = qscriptvalue_cast<QModelIndex>(context->argument(1)); | ||||
415 | bool _q_result = _q_self->insertRow(_q_arg0, _q_arg1); | ||||
416 | return QScriptValue(context->engine(), _q_result); | ||||
417 | } | ||||
418 | break; | ||||
419 | | ||||
420 | case 15: | ||||
421 | if (context->argumentCount() == 2) { | ||||
422 | int _q_arg0 = context->argument(0).toInt32(); | ||||
423 | int _q_arg1 = context->argument(1).toInt32(); | ||||
424 | bool _q_result = _q_self->insertRows(_q_arg0, _q_arg1); | ||||
425 | return QScriptValue(context->engine(), _q_result); | ||||
426 | } | ||||
427 | if (context->argumentCount() == 3) { | ||||
428 | int _q_arg0 = context->argument(0).toInt32(); | ||||
429 | int _q_arg1 = context->argument(1).toInt32(); | ||||
430 | QModelIndex _q_arg2 = qscriptvalue_cast<QModelIndex>(context->argument(2)); | ||||
431 | bool _q_result = _q_self->insertRows(_q_arg0, _q_arg1, _q_arg2); | ||||
432 | return QScriptValue(context->engine(), _q_result); | ||||
433 | } | ||||
434 | break; | ||||
435 | | ||||
436 | case 16: | ||||
437 | if (context->argumentCount() == 1) { | ||||
438 | QModelIndex _q_arg0 = qscriptvalue_cast<QModelIndex>(context->argument(0)); | ||||
439 | QMap<int,QVariant > _q_result = _q_self->itemData(_q_arg0); | ||||
440 | return qScriptValueFromValue(context->engine(), _q_result); | ||||
441 | } | ||||
442 | break; | ||||
443 | | ||||
444 | case 17: | ||||
445 | if (context->argumentCount() == 3) { | ||||
446 | QModelIndex _q_arg0 = qscriptvalue_cast<QModelIndex>(context->argument(0)); | ||||
447 | int _q_arg1 = context->argument(1).toInt32(); | ||||
448 | QVariant _q_arg2 = context->argument(2).toVariant(); | ||||
449 | QList<QModelIndex > _q_result = _q_self->match(_q_arg0, _q_arg1, _q_arg2); | ||||
450 | return qScriptValueFromSequence(context->engine(), _q_result); | ||||
451 | } | ||||
452 | if (context->argumentCount() == 4) { | ||||
453 | QModelIndex _q_arg0 = qscriptvalue_cast<QModelIndex>(context->argument(0)); | ||||
454 | int _q_arg1 = context->argument(1).toInt32(); | ||||
455 | QVariant _q_arg2 = context->argument(2).toVariant(); | ||||
456 | int _q_arg3 = context->argument(3).toInt32(); | ||||
457 | QList<QModelIndex > _q_result = _q_self->match(_q_arg0, _q_arg1, _q_arg2, _q_arg3); | ||||
458 | return qScriptValueFromSequence(context->engine(), _q_result); | ||||
459 | } | ||||
460 | if (context->argumentCount() == 5) { | ||||
461 | QModelIndex _q_arg0 = qscriptvalue_cast<QModelIndex>(context->argument(0)); | ||||
462 | int _q_arg1 = context->argument(1).toInt32(); | ||||
463 | QVariant _q_arg2 = context->argument(2).toVariant(); | ||||
464 | int _q_arg3 = context->argument(3).toInt32(); | ||||
465 | QFlags<Qt::MatchFlag> _q_arg4 = qscriptvalue_cast<QFlags<Qt::MatchFlag> >(context->argument(4)); | ||||
466 | QList<QModelIndex > _q_result = _q_self->match(_q_arg0, _q_arg1, _q_arg2, _q_arg3, _q_arg4); | ||||
467 | return qScriptValueFromSequence(context->engine(), _q_result); | ||||
468 | } | ||||
469 | break; | ||||
470 | | ||||
471 | case 18: | ||||
472 | if (context->argumentCount() == 1) { | ||||
473 | QList<QModelIndex> _q_arg0; | ||||
474 | qScriptValueToSequence(context->argument(0), _q_arg0); | ||||
475 | QMimeData* _q_result = _q_self->mimeData(_q_arg0); | ||||
476 | return qScriptValueFromValue(context->engine(), _q_result); | ||||
477 | } | ||||
478 | break; | ||||
479 | | ||||
480 | case 19: | ||||
481 | if (context->argumentCount() == 0) { | ||||
482 | QStringList _q_result = _q_self->mimeTypes(); | ||||
483 | return qScriptValueFromSequence(context->engine(), _q_result); | ||||
484 | } | ||||
485 | break; | ||||
486 | | ||||
487 | case 20: | ||||
488 | if (context->argumentCount() == 4) { | ||||
489 | QModelIndex _q_arg0 = qscriptvalue_cast<QModelIndex>(context->argument(0)); | ||||
490 | int _q_arg1 = context->argument(1).toInt32(); | ||||
491 | QModelIndex _q_arg2 = qscriptvalue_cast<QModelIndex>(context->argument(2)); | ||||
492 | int _q_arg3 = context->argument(3).toInt32(); | ||||
493 | bool _q_result = _q_self->moveColumn(_q_arg0, _q_arg1, _q_arg2, _q_arg3); | ||||
494 | return QScriptValue(context->engine(), _q_result); | ||||
495 | } | ||||
496 | break; | ||||
497 | | ||||
498 | case 21: | ||||
499 | if (context->argumentCount() == 5) { | ||||
500 | QModelIndex _q_arg0 = qscriptvalue_cast<QModelIndex>(context->argument(0)); | ||||
501 | int _q_arg1 = context->argument(1).toInt32(); | ||||
502 | int _q_arg2 = context->argument(2).toInt32(); | ||||
503 | QModelIndex _q_arg3 = qscriptvalue_cast<QModelIndex>(context->argument(3)); | ||||
504 | int _q_arg4 = context->argument(4).toInt32(); | ||||
505 | bool _q_result = _q_self->moveColumns(_q_arg0, _q_arg1, _q_arg2, _q_arg3, _q_arg4); | ||||
506 | return QScriptValue(context->engine(), _q_result); | ||||
507 | } | ||||
508 | break; | ||||
509 | | ||||
510 | case 22: | ||||
511 | if (context->argumentCount() == 4) { | ||||
512 | QModelIndex _q_arg0 = qscriptvalue_cast<QModelIndex>(context->argument(0)); | ||||
513 | int _q_arg1 = context->argument(1).toInt32(); | ||||
514 | QModelIndex _q_arg2 = qscriptvalue_cast<QModelIndex>(context->argument(2)); | ||||
515 | int _q_arg3 = context->argument(3).toInt32(); | ||||
516 | bool _q_result = _q_self->moveRow(_q_arg0, _q_arg1, _q_arg2, _q_arg3); | ||||
517 | return QScriptValue(context->engine(), _q_result); | ||||
518 | } | ||||
519 | break; | ||||
520 | | ||||
521 | case 23: | ||||
522 | if (context->argumentCount() == 5) { | ||||
523 | QModelIndex _q_arg0 = qscriptvalue_cast<QModelIndex>(context->argument(0)); | ||||
524 | int _q_arg1 = context->argument(1).toInt32(); | ||||
525 | int _q_arg2 = context->argument(2).toInt32(); | ||||
526 | QModelIndex _q_arg3 = qscriptvalue_cast<QModelIndex>(context->argument(3)); | ||||
527 | int _q_arg4 = context->argument(4).toInt32(); | ||||
528 | bool _q_result = _q_self->moveRows(_q_arg0, _q_arg1, _q_arg2, _q_arg3, _q_arg4); | ||||
529 | return QScriptValue(context->engine(), _q_result); | ||||
530 | } | ||||
531 | break; | ||||
532 | | ||||
533 | case 24: | ||||
534 | if (context->argumentCount() == 1) { | ||||
535 | QModelIndex _q_arg0 = qscriptvalue_cast<QModelIndex>(context->argument(0)); | ||||
536 | QModelIndex _q_result = _q_self->parent(_q_arg0); | ||||
537 | return qScriptValueFromValue(context->engine(), _q_result); | ||||
538 | } | ||||
539 | break; | ||||
540 | | ||||
541 | case 25: | ||||
542 | if (context->argumentCount() == 1) { | ||||
543 | int _q_arg0 = context->argument(0).toInt32(); | ||||
544 | bool _q_result = _q_self->removeColumn(_q_arg0); | ||||
545 | return QScriptValue(context->engine(), _q_result); | ||||
546 | } | ||||
547 | if (context->argumentCount() == 2) { | ||||
548 | int _q_arg0 = context->argument(0).toInt32(); | ||||
549 | QModelIndex _q_arg1 = qscriptvalue_cast<QModelIndex>(context->argument(1)); | ||||
550 | bool _q_result = _q_self->removeColumn(_q_arg0, _q_arg1); | ||||
551 | return QScriptValue(context->engine(), _q_result); | ||||
552 | } | ||||
553 | break; | ||||
554 | | ||||
555 | case 26: | ||||
556 | if (context->argumentCount() == 2) { | ||||
557 | int _q_arg0 = context->argument(0).toInt32(); | ||||
558 | int _q_arg1 = context->argument(1).toInt32(); | ||||
559 | bool _q_result = _q_self->removeColumns(_q_arg0, _q_arg1); | ||||
560 | return QScriptValue(context->engine(), _q_result); | ||||
561 | } | ||||
562 | if (context->argumentCount() == 3) { | ||||
563 | int _q_arg0 = context->argument(0).toInt32(); | ||||
564 | int _q_arg1 = context->argument(1).toInt32(); | ||||
565 | QModelIndex _q_arg2 = qscriptvalue_cast<QModelIndex>(context->argument(2)); | ||||
566 | bool _q_result = _q_self->removeColumns(_q_arg0, _q_arg1, _q_arg2); | ||||
567 | return QScriptValue(context->engine(), _q_result); | ||||
568 | } | ||||
569 | break; | ||||
570 | | ||||
571 | case 27: | ||||
572 | if (context->argumentCount() == 1) { | ||||
573 | int _q_arg0 = context->argument(0).toInt32(); | ||||
574 | bool _q_result = _q_self->removeRow(_q_arg0); | ||||
575 | return QScriptValue(context->engine(), _q_result); | ||||
576 | } | ||||
577 | if (context->argumentCount() == 2) { | ||||
578 | int _q_arg0 = context->argument(0).toInt32(); | ||||
579 | QModelIndex _q_arg1 = qscriptvalue_cast<QModelIndex>(context->argument(1)); | ||||
580 | bool _q_result = _q_self->removeRow(_q_arg0, _q_arg1); | ||||
581 | return QScriptValue(context->engine(), _q_result); | ||||
582 | } | ||||
583 | break; | ||||
584 | | ||||
585 | case 28: | ||||
586 | if (context->argumentCount() == 2) { | ||||
587 | int _q_arg0 = context->argument(0).toInt32(); | ||||
588 | int _q_arg1 = context->argument(1).toInt32(); | ||||
589 | bool _q_result = _q_self->removeRows(_q_arg0, _q_arg1); | ||||
590 | return QScriptValue(context->engine(), _q_result); | ||||
591 | } | ||||
592 | if (context->argumentCount() == 3) { | ||||
593 | int _q_arg0 = context->argument(0).toInt32(); | ||||
594 | int _q_arg1 = context->argument(1).toInt32(); | ||||
595 | QModelIndex _q_arg2 = qscriptvalue_cast<QModelIndex>(context->argument(2)); | ||||
596 | bool _q_result = _q_self->removeRows(_q_arg0, _q_arg1, _q_arg2); | ||||
597 | return QScriptValue(context->engine(), _q_result); | ||||
598 | } | ||||
599 | break; | ||||
600 | | ||||
601 | case 29: | ||||
602 | if (context->argumentCount() == 0) { | ||||
603 | QHash<int,QByteArray > _q_result = _q_self->roleNames(); | ||||
604 | return qScriptValueFromValue(context->engine(), _q_result); | ||||
605 | } | ||||
606 | break; | ||||
607 | | ||||
608 | case 30: | ||||
609 | if (context->argumentCount() == 0) { | ||||
610 | int _q_result = _q_self->rowCount(); | ||||
611 | return QScriptValue(context->engine(), _q_result); | ||||
612 | } | ||||
613 | if (context->argumentCount() == 1) { | ||||
614 | QModelIndex _q_arg0 = qscriptvalue_cast<QModelIndex>(context->argument(0)); | ||||
615 | int _q_result = _q_self->rowCount(_q_arg0); | ||||
616 | return QScriptValue(context->engine(), _q_result); | ||||
617 | } | ||||
618 | break; | ||||
619 | | ||||
620 | case 31: | ||||
621 | if (context->argumentCount() == 2) { | ||||
622 | QModelIndex _q_arg0 = qscriptvalue_cast<QModelIndex>(context->argument(0)); | ||||
623 | QVariant _q_arg1 = context->argument(1).toVariant(); | ||||
624 | bool _q_result = _q_self->setData(_q_arg0, _q_arg1); | ||||
625 | return QScriptValue(context->engine(), _q_result); | ||||
626 | } | ||||
627 | if (context->argumentCount() == 3) { | ||||
628 | QModelIndex _q_arg0 = qscriptvalue_cast<QModelIndex>(context->argument(0)); | ||||
629 | QVariant _q_arg1 = context->argument(1).toVariant(); | ||||
630 | int _q_arg2 = context->argument(2).toInt32(); | ||||
631 | bool _q_result = _q_self->setData(_q_arg0, _q_arg1, _q_arg2); | ||||
632 | return QScriptValue(context->engine(), _q_result); | ||||
633 | } | ||||
634 | break; | ||||
635 | | ||||
636 | case 32: | ||||
637 | if (context->argumentCount() == 3) { | ||||
638 | int _q_arg0 = context->argument(0).toInt32(); | ||||
639 | Qt::Orientation _q_arg1 = qscriptvalue_cast<Qt::Orientation>(context->argument(1)); | ||||
640 | QVariant _q_arg2 = context->argument(2).toVariant(); | ||||
641 | bool _q_result = _q_self->setHeaderData(_q_arg0, _q_arg1, _q_arg2); | ||||
642 | return QScriptValue(context->engine(), _q_result); | ||||
643 | } | ||||
644 | if (context->argumentCount() == 4) { | ||||
645 | int _q_arg0 = context->argument(0).toInt32(); | ||||
646 | Qt::Orientation _q_arg1 = qscriptvalue_cast<Qt::Orientation>(context->argument(1)); | ||||
647 | QVariant _q_arg2 = context->argument(2).toVariant(); | ||||
648 | int _q_arg3 = context->argument(3).toInt32(); | ||||
649 | bool _q_result = _q_self->setHeaderData(_q_arg0, _q_arg1, _q_arg2, _q_arg3); | ||||
650 | return QScriptValue(context->engine(), _q_result); | ||||
651 | } | ||||
652 | break; | ||||
653 | | ||||
654 | case 33: | ||||
655 | if (context->argumentCount() == 2) { | ||||
656 | QModelIndex _q_arg0 = qscriptvalue_cast<QModelIndex>(context->argument(0)); | ||||
657 | QMap<int,QVariant> _q_arg1 = qscriptvalue_cast<QMap<int,QVariant> >(context->argument(1)); | ||||
658 | bool _q_result = _q_self->setItemData(_q_arg0, _q_arg1); | ||||
659 | return QScriptValue(context->engine(), _q_result); | ||||
660 | } | ||||
661 | break; | ||||
662 | | ||||
663 | case 34: | ||||
664 | if (context->argumentCount() == 3) { | ||||
665 | int _q_arg0 = context->argument(0).toInt32(); | ||||
666 | int _q_arg1 = context->argument(1).toInt32(); | ||||
667 | QModelIndex _q_arg2 = qscriptvalue_cast<QModelIndex>(context->argument(2)); | ||||
668 | QModelIndex _q_result = _q_self->sibling(_q_arg0, _q_arg1, _q_arg2); | ||||
669 | return qScriptValueFromValue(context->engine(), _q_result); | ||||
670 | } | ||||
671 | break; | ||||
672 | | ||||
673 | case 35: | ||||
674 | if (context->argumentCount() == 1) { | ||||
675 | int _q_arg0 = context->argument(0).toInt32(); | ||||
676 | _q_self->sort(_q_arg0); | ||||
677 | return context->engine()->undefinedValue(); | ||||
678 | } | ||||
679 | if (context->argumentCount() == 2) { | ||||
680 | int _q_arg0 = context->argument(0).toInt32(); | ||||
681 | Qt::SortOrder _q_arg1 = qscriptvalue_cast<Qt::SortOrder>(context->argument(1)); | ||||
682 | _q_self->sort(_q_arg0, _q_arg1); | ||||
683 | return context->engine()->undefinedValue(); | ||||
684 | } | ||||
685 | break; | ||||
686 | | ||||
687 | case 36: | ||||
688 | if (context->argumentCount() == 1) { | ||||
689 | QModelIndex _q_arg0 = qscriptvalue_cast<QModelIndex>(context->argument(0)); | ||||
690 | QSize _q_result = _q_self->span(_q_arg0); | ||||
691 | return qScriptValueFromValue(context->engine(), _q_result); | ||||
692 | } | ||||
693 | break; | ||||
694 | | ||||
695 | case 37: | ||||
696 | if (context->argumentCount() == 0) { | ||||
697 | QFlags<Qt::DropAction> _q_result = _q_self->supportedDragActions(); | ||||
698 | return qScriptValueFromValue(context->engine(), _q_result); | ||||
699 | } | ||||
700 | break; | ||||
701 | | ||||
702 | case 38: | ||||
703 | if (context->argumentCount() == 0) { | ||||
704 | QFlags<Qt::DropAction> _q_result = _q_self->supportedDropActions(); | ||||
705 | return qScriptValueFromValue(context->engine(), _q_result); | ||||
706 | } | ||||
707 | break; | ||||
708 | | ||||
709 | case 39: { | ||||
710 | QString result = QString::fromLatin1("QAbstractItemModel"); | ||||
711 | return QScriptValue(context->engine(), result); | ||||
712 | } | ||||
713 | | ||||
714 | default: | ||||
715 | Q_ASSERT(false); | ||||
716 | } | ||||
717 | return qtscript_QAbstractItemModel_throw_ambiguity_error_helper(context, | ||||
718 | qtscript_QAbstractItemModel_function_names[_id+1], | ||||
719 | qtscript_QAbstractItemModel_function_signatures[_id+1]); | ||||
720 | } | ||||
721 | | ||||
722 | static QScriptValue qtscript_QAbstractItemModel_static_call(QScriptContext *context, QScriptEngine *) | ||||
723 | { | ||||
724 | uint _id = context->callee().data().toUInt32(); | ||||
725 | Q_ASSERT((_id & 0xFFFF0000) == 0xBABE0000); | ||||
726 | _id &= 0x0000FFFF; | ||||
727 | switch (_id) { | ||||
728 | case 0: | ||||
729 | if (context->thisObject().strictlyEquals(context->engine()->globalObject())) { | ||||
730 | return context->throwError(QString::fromLatin1("QAbstractItemModel(): Did you forget to construct with 'new'?")); | ||||
731 | } | ||||
732 | if (context->argumentCount() == 0) { | ||||
733 | QtScriptShell_QAbstractItemModel* _q_cpp_result = new QtScriptShell_QAbstractItemModel(); | ||||
734 | QScriptValue _q_result = context->engine()->newQObject(context->thisObject(), (QAbstractItemModel*)_q_cpp_result, QScriptEngine::AutoOwnership); | ||||
735 | _q_cpp_result->__qtscript_self = _q_result; | ||||
736 | return _q_result; | ||||
737 | } else if (context->argumentCount() == 1) { | ||||
738 | QObject* _q_arg0 = context->argument(0).toQObject(); | ||||
739 | QtScriptShell_QAbstractItemModel* _q_cpp_result = new QtScriptShell_QAbstractItemModel(_q_arg0); | ||||
740 | QScriptValue _q_result = context->engine()->newQObject(context->thisObject(), (QAbstractItemModel*)_q_cpp_result, QScriptEngine::AutoOwnership); | ||||
741 | _q_cpp_result->__qtscript_self = _q_result; | ||||
742 | return _q_result; | ||||
743 | } | ||||
744 | break; | ||||
745 | | ||||
746 | default: | ||||
747 | Q_ASSERT(false); | ||||
748 | } | ||||
749 | return qtscript_QAbstractItemModel_throw_ambiguity_error_helper(context, | ||||
750 | qtscript_QAbstractItemModel_function_names[_id], | ||||
751 | qtscript_QAbstractItemModel_function_signatures[_id]); | ||||
752 | } | ||||
753 | | ||||
754 | static QScriptValue qtscript_QAbstractItemModel_toScriptValue(QScriptEngine *engine, QAbstractItemModel* const &in) | ||||
755 | { | ||||
756 | return engine->newQObject(in, QScriptEngine::QtOwnership, QScriptEngine::PreferExistingWrapperObject); | ||||
757 | } | ||||
758 | | ||||
759 | static void qtscript_QAbstractItemModel_fromScriptValue(const QScriptValue &value, QAbstractItemModel* &out) | ||||
760 | { | ||||
761 | out = qobject_cast<QAbstractItemModel*>(value.toQObject()); | ||||
762 | } | ||||
763 | | ||||
764 | QScriptValue qtscript_create_QAbstractItemModel_class(QScriptEngine *engine) | ||||
765 | { | ||||
766 | engine->setDefaultPrototype(qMetaTypeId<QAbstractItemModel*>(), QScriptValue()); | ||||
767 | QScriptValue proto = engine->newVariant(qVariantFromValue((QAbstractItemModel*)0)); | ||||
768 | proto.setPrototype(engine->defaultPrototype(qMetaTypeId<QObject*>())); | ||||
769 | for (int i = 0; i < 40; ++i) { | ||||
770 | QScriptValue fun = engine->newFunction(qtscript_QAbstractItemModel_prototype_call, qtscript_QAbstractItemModel_function_lengths[i+1]); | ||||
771 | fun.setData(QScriptValue(engine, uint(0xBABE0000 + i))); | ||||
772 | proto.setProperty(QString::fromLatin1(qtscript_QAbstractItemModel_function_names[i+1]), | ||||
773 | fun, QScriptValue::SkipInEnumeration); | ||||
774 | } | ||||
775 | | ||||
776 | qScriptRegisterMetaType<QAbstractItemModel*>(engine, qtscript_QAbstractItemModel_toScriptValue, | ||||
777 | qtscript_QAbstractItemModel_fromScriptValue, proto); | ||||
778 | | ||||
779 | QScriptValue ctor = engine->newFunction(qtscript_QAbstractItemModel_static_call, proto, qtscript_QAbstractItemModel_function_lengths[0]); | ||||
780 | ctor.setData(QScriptValue(engine, uint(0xBABE0000 + 0))); | ||||
781 | | ||||
782 | return ctor; | ||||
783 | } |