66
|
1 |
#include <e32debug.h>
|
|
2 |
|
|
3 |
#include "modelfactory.h"
|
|
4 |
|
|
5 |
#include <hbnamespace.h>
|
|
6 |
#include <hbicon.h>
|
|
7 |
|
|
8 |
#include <QStandardItemModel>
|
|
9 |
|
|
10 |
void insertMixedItems(QStandardItem *parent)
|
|
11 |
{
|
|
12 |
QString longSecondaryText;
|
|
13 |
for (int i = 0; i < 20; ++i) {
|
|
14 |
longSecondaryText.append("Second text ");
|
|
15 |
}
|
|
16 |
|
|
17 |
HbIcon icon(QString(":/demo/generic"));
|
|
18 |
|
|
19 |
QVariantList strings;
|
|
20 |
QVariantList icons;
|
|
21 |
|
|
22 |
// text
|
|
23 |
QStandardItem *child = new QStandardItem();
|
|
24 |
strings << "text-1";
|
|
25 |
child->setData(strings, Qt::DisplayRole);
|
|
26 |
parent->appendRow(child);
|
|
27 |
|
|
28 |
strings.clear();
|
|
29 |
icons.clear();
|
|
30 |
|
|
31 |
// text + icon
|
|
32 |
child = new QStandardItem();
|
|
33 |
strings << "text-1+icon-2";
|
|
34 |
icons << QVariant() << icon;
|
|
35 |
child->setData(strings, Qt::DisplayRole);
|
|
36 |
child->setData(icons, Qt::DecorationRole);
|
|
37 |
parent->appendRow(child);
|
|
38 |
|
|
39 |
strings.clear();
|
|
40 |
icons.clear();
|
|
41 |
|
|
42 |
// icon + text
|
|
43 |
child = new QStandardItem();
|
|
44 |
strings << "icon-1+text-1";
|
|
45 |
icons << icon;
|
|
46 |
child->setData(strings, Qt::DisplayRole);
|
|
47 |
child->setData(icons, Qt::DecorationRole);
|
|
48 |
parent->appendRow(child);
|
|
49 |
|
|
50 |
strings.clear();
|
|
51 |
icons.clear();
|
|
52 |
|
|
53 |
// icon + text + icon
|
|
54 |
child = new QStandardItem();
|
|
55 |
strings << "icon-1+text-1+icon-2";
|
|
56 |
icons << icon << icon;
|
|
57 |
child->setData(strings, Qt::DisplayRole);
|
|
58 |
child->setData(icons, Qt::DecorationRole);
|
|
59 |
parent->appendRow(child);
|
|
60 |
|
|
61 |
strings.clear();
|
|
62 |
icons.clear();
|
|
63 |
|
|
64 |
// text + text
|
|
65 |
child = new QStandardItem();
|
|
66 |
strings << "text-1+text-3" << QVariant() << "third text";
|
|
67 |
child->setData(strings, Qt::DisplayRole);
|
|
68 |
child->setData(icons, Qt::DecorationRole);
|
|
69 |
parent->appendRow(child);
|
|
70 |
|
|
71 |
strings.clear();
|
|
72 |
icons.clear();
|
|
73 |
|
|
74 |
// text + text + icon
|
|
75 |
child = new QStandardItem();
|
|
76 |
strings << "text-1+text-3+icon-2" << QVariant() << "third text";
|
|
77 |
icons << QVariant() << icon;
|
|
78 |
child->setData(strings, Qt::DisplayRole);
|
|
79 |
child->setData(icons, Qt::DecorationRole);
|
|
80 |
parent->appendRow(child);
|
|
81 |
|
|
82 |
strings.clear();
|
|
83 |
icons.clear();
|
|
84 |
|
|
85 |
// icon + text + text
|
|
86 |
child = new QStandardItem();
|
|
87 |
strings << "icon-1+text-1+text-3" << QVariant() << "third text";
|
|
88 |
icons << icon;
|
|
89 |
child->setData(strings, Qt::DisplayRole);
|
|
90 |
child->setData(icons, Qt::DecorationRole);
|
|
91 |
parent->appendRow(child);
|
|
92 |
|
|
93 |
strings.clear();
|
|
94 |
icons.clear();
|
|
95 |
|
|
96 |
// icon + text + text + icon
|
|
97 |
child = new QStandardItem();
|
|
98 |
strings << "icon-1+text-1+text-3+icon-2" << QVariant() << "third text";
|
|
99 |
icons << icon << icon;
|
|
100 |
child->setData(strings, Qt::DisplayRole);
|
|
101 |
child->setData(icons, Qt::DecorationRole);
|
|
102 |
parent->appendRow(child);
|
|
103 |
|
|
104 |
strings.clear();
|
|
105 |
icons.clear();
|
|
106 |
|
|
107 |
// 2 texts
|
|
108 |
child = new QStandardItem();
|
|
109 |
strings << "text-1+text-2" << longSecondaryText;
|
|
110 |
child->setData(strings, Qt::DisplayRole);
|
|
111 |
child->setData(icons, Qt::DecorationRole);
|
|
112 |
parent->appendRow(child);
|
|
113 |
|
|
114 |
strings.clear();
|
|
115 |
icons.clear();
|
|
116 |
|
|
117 |
// 2 texts + icon
|
|
118 |
child = new QStandardItem();
|
|
119 |
strings << "text-1+text-2+icon-2" << longSecondaryText;
|
|
120 |
icons << QVariant() << icon;
|
|
121 |
child->setData(strings, Qt::DisplayRole);
|
|
122 |
child->setData(icons, Qt::DecorationRole);
|
|
123 |
parent->appendRow(child);
|
|
124 |
|
|
125 |
strings.clear();
|
|
126 |
icons.clear();
|
|
127 |
|
|
128 |
// icon + 2 texts
|
|
129 |
child = new QStandardItem();
|
|
130 |
strings << "icon-1+text-1+text-2" << longSecondaryText;
|
|
131 |
icons << icon;
|
|
132 |
child->setData(strings, Qt::DisplayRole);
|
|
133 |
child->setData(icons, Qt::DecorationRole);
|
|
134 |
parent->appendRow(child);
|
|
135 |
|
|
136 |
strings.clear();
|
|
137 |
icons.clear();
|
|
138 |
|
|
139 |
// icon + 2 texts + icon
|
|
140 |
child = new QStandardItem();
|
|
141 |
strings << "icon-1+text-1+text-2+icon-2" << longSecondaryText;
|
|
142 |
icons << icon << icon;
|
|
143 |
child->setData(strings, Qt::DisplayRole);
|
|
144 |
child->setData(icons, Qt::DecorationRole);
|
|
145 |
parent->appendRow(child);
|
|
146 |
|
|
147 |
strings.clear();
|
|
148 |
icons.clear();
|
|
149 |
|
|
150 |
// 3 texts
|
|
151 |
child = new QStandardItem();
|
|
152 |
strings << "text-1+text-2+text-3" << longSecondaryText << "third text";
|
|
153 |
child->setData(strings, Qt::DisplayRole);
|
|
154 |
child->setData(icons, Qt::DecorationRole);
|
|
155 |
parent->appendRow(child);
|
|
156 |
|
|
157 |
strings.clear();
|
|
158 |
icons.clear();
|
|
159 |
|
|
160 |
// 3 texts + icon
|
|
161 |
child = new QStandardItem();
|
|
162 |
strings << "text-1+text-2+text-3+icon-2" << longSecondaryText << "third text";
|
|
163 |
icons << QVariant() << icon;
|
|
164 |
child->setData(strings, Qt::DisplayRole);
|
|
165 |
child->setData(icons, Qt::DecorationRole);
|
|
166 |
parent->appendRow(child);
|
|
167 |
|
|
168 |
strings.clear();
|
|
169 |
icons.clear();
|
|
170 |
|
|
171 |
// icon + 3 texts
|
|
172 |
child = new QStandardItem();
|
|
173 |
strings << "icon-1+text-1+text-2+text-3" << longSecondaryText << "third text";
|
|
174 |
icons << icon;
|
|
175 |
child->setData(strings, Qt::DisplayRole);
|
|
176 |
child->setData(icons, Qt::DecorationRole);
|
|
177 |
parent->appendRow(child);
|
|
178 |
|
|
179 |
strings.clear();
|
|
180 |
icons.clear();
|
|
181 |
|
|
182 |
// icon + 3 texts + icon
|
|
183 |
child = new QStandardItem();
|
|
184 |
strings << "icon-1+text-1+text-2+text-3+icon-2" << longSecondaryText << "third text";
|
|
185 |
icons << icon << icon;
|
|
186 |
child->setData(strings, Qt::DisplayRole);
|
|
187 |
child->setData(icons, Qt::DecorationRole);
|
|
188 |
parent->appendRow(child);
|
|
189 |
|
|
190 |
strings.clear();
|
|
191 |
icons.clear();
|
|
192 |
|
|
193 |
// separator
|
|
194 |
child = new QStandardItem();
|
|
195 |
strings << "Separator";
|
|
196 |
child->setData(strings, Qt::DisplayRole);
|
|
197 |
child->setData(icons, Qt::DecorationRole);
|
|
198 |
child->setData(Hb::SeparatorItem, Hb::ItemTypeRole);
|
|
199 |
child->setEnabled(false);
|
|
200 |
parent->appendRow(child);
|
|
201 |
|
|
202 |
strings.clear();
|
|
203 |
icons.clear();
|
|
204 |
|
|
205 |
// disabled
|
|
206 |
child = new QStandardItem();
|
|
207 |
strings << "Disabled item" << longSecondaryText << "third text";
|
|
208 |
icons << icon << icon;
|
|
209 |
child->setData(strings, Qt::DisplayRole);
|
|
210 |
child->setData(icons, Qt::DecorationRole);
|
|
211 |
child->setEnabled(false);
|
|
212 |
parent->appendRow(child);
|
|
213 |
|
|
214 |
strings.clear();
|
|
215 |
icons.clear();
|
|
216 |
|
|
217 |
// disabled parent item
|
|
218 |
child = new QStandardItem();
|
|
219 |
strings << "Disabled parent item";
|
|
220 |
child->setData(strings, Qt::DisplayRole);
|
|
221 |
child->setData(Hb::ParentItem, Hb::ItemTypeRole);
|
|
222 |
child->setEnabled(false);
|
|
223 |
parent->appendRow(child);
|
|
224 |
|
|
225 |
strings.clear();
|
|
226 |
icons.clear();
|
|
227 |
|
|
228 |
// disabled parent item's child
|
|
229 |
QStandardItem *child2 = new QStandardItem();
|
|
230 |
strings << "Disabled parent item's child";
|
|
231 |
child2->setData(strings, Qt::DisplayRole);
|
|
232 |
child2->setEnabled(false);
|
|
233 |
child->appendRow(child2);
|
|
234 |
|
|
235 |
}
|
|
236 |
|
|
237 |
QStandardItemModel *ModelFactory::populateTreeModelMail()
|
|
238 |
{
|
|
239 |
QStandardItemModel* model = new QStandardItemModel();
|
|
240 |
|
|
241 |
//________________________________________
|
|
242 |
int messageRole = Qt::UserRole+1;
|
|
243 |
int dateRole = Qt::UserRole+2;
|
|
244 |
|
|
245 |
QStandardItem *date = new QStandardItem;
|
|
246 |
date->setData(QString("27. lokakuuta 2009"), dateRole);
|
|
247 |
model->appendRow(date);
|
|
248 |
|
|
249 |
QStandardItem *message = new QStandardItem;
|
|
250 |
QStringList data;
|
|
251 |
data << "Fotonetti.com" << "19:51:14" << "Fotonetti Pro";
|
|
252 |
message->setData(data, messageRole);
|
|
253 |
date->appendRow(message);
|
|
254 |
|
|
255 |
date = new QStandardItem;
|
|
256 |
date->setData(QString("25. lokakuuta 2009"), dateRole);
|
|
257 |
model->appendRow(date);
|
|
258 |
|
|
259 |
message = new QStandardItem;
|
|
260 |
data.clear();
|
|
261 |
data << "Amazon.co.uk" << "5:51:52" << "Your Amazon Order # 123-3456789-0123 ";
|
|
262 |
message->setData(data, messageRole);
|
|
263 |
date->appendRow(message);
|
|
264 |
|
|
265 |
date = new QStandardItem;
|
|
266 |
date->setData(QString("23. lokakuuta 2009"), dateRole);
|
|
267 |
model->appendRow(date);
|
|
268 |
|
|
269 |
message = new QStandardItem;
|
|
270 |
data.clear();
|
|
271 |
data << "MBnet" << "12:12:12" << "MBnetin pullopostia 43/2009: Aurinkoa odotellessa... ";
|
|
272 |
message->setData(data, messageRole);
|
|
273 |
date->appendRow(message);
|
|
274 |
|
|
275 |
date = new QStandardItem;
|
|
276 |
date->setData(QString("21. lokakuuta 2009"), dateRole);
|
|
277 |
model->appendRow(date);
|
|
278 |
|
|
279 |
message = new QStandardItem;
|
|
280 |
data.clear();
|
|
281 |
data << "Skype" << "21:59:20" << "Skype 4.1 - Too late";
|
|
282 |
message->setData(data, messageRole);
|
|
283 |
date->appendRow(message);
|
|
284 |
|
|
285 |
message = new QStandardItem;
|
|
286 |
data.clear();
|
|
287 |
data << "Skype" << "20:58:19" << "Skype 4.1 - Act now";
|
|
288 |
message->setData(data, messageRole);
|
|
289 |
date->appendRow(message);
|
|
290 |
|
|
291 |
message = new QStandardItem;
|
|
292 |
data.clear();
|
|
293 |
data << "Skype" << "19:57:18" << "Skype 4.1 - Time to act";
|
|
294 |
message->setData(data, messageRole);
|
|
295 |
date->appendRow(message);
|
|
296 |
|
|
297 |
message = new QStandardItem;
|
|
298 |
data.clear();
|
|
299 |
data << "Skype" << "18:56:17" << "Skype 4.1 - New release";
|
|
300 |
message->setData(data, messageRole);
|
|
301 |
date->appendRow(message);
|
|
302 |
|
|
303 |
date = new QStandardItem;
|
|
304 |
date->setData(QString("5. lokakuuta 2009"), dateRole);
|
|
305 |
model->appendRow(date);
|
|
306 |
|
|
307 |
message = new QStandardItem;
|
|
308 |
data.clear();
|
|
309 |
data << "Hit Booster" << "21:12:00" << "Have your own website traffic generator ";
|
|
310 |
message->setData(data, messageRole);
|
|
311 |
date->appendRow(message);
|
|
312 |
|
|
313 |
message = new QStandardItem;
|
|
314 |
data.clear();
|
|
315 |
data << "noreply@helsinkiexpert.fi" << "11:08:01" << "Terveisiä Helsinki Expertiltä";
|
|
316 |
message->setData(data, messageRole);
|
|
317 |
date->appendRow(message);
|
|
318 |
|
|
319 |
|
|
320 |
return model;
|
|
321 |
}
|
|
322 |
|
|
323 |
|
|
324 |
QStandardItemModel *ModelFactory::populateTreeModelDefault()
|
|
325 |
{
|
|
326 |
QStandardItemModel* model = new QStandardItemModel();
|
|
327 |
|
|
328 |
//________________________________________
|
|
329 |
|
|
330 |
QStandardItem *paintDevice = new QStandardItem;
|
|
331 |
paintDevice->setText(QString("QPaintDevice"));
|
|
332 |
model->appendRow(paintDevice);
|
|
333 |
|
|
334 |
QStandardItem *pixmap = new QStandardItem;
|
|
335 |
pixmap->setText(QString("QPixmap"));
|
|
336 |
paintDevice->appendRow(pixmap);
|
|
337 |
|
|
338 |
QStandardItem *bitmap = new QStandardItem;
|
|
339 |
bitmap->setText(QString("QBitmap"));
|
|
340 |
pixmap->appendRow(bitmap);
|
|
341 |
|
|
342 |
QStandardItem *customRasterPaintDevice = new QStandardItem;
|
|
343 |
customRasterPaintDevice->setText(QString("QCustomRasterPaintDevice"));
|
|
344 |
paintDevice->appendRow(customRasterPaintDevice);
|
|
345 |
|
|
346 |
QStandardItem *glPixelBuffer = new QStandardItem;
|
|
347 |
glPixelBuffer->setText(QString("QGLPixelBuffer"));
|
|
348 |
paintDevice->appendRow(glPixelBuffer);
|
|
349 |
|
|
350 |
QStandardItem *image = new QStandardItem;
|
|
351 |
image->setText(QString("QImage"));
|
|
352 |
paintDevice->appendRow(image);
|
|
353 |
|
|
354 |
QStandardItem *picture = new QStandardItem;
|
|
355 |
picture->setText(QString("QPicture"));
|
|
356 |
paintDevice->appendRow(picture);
|
|
357 |
|
|
358 |
QStandardItem *printer = new QStandardItem;
|
|
359 |
printer->setText(QString("QPrinter"));
|
|
360 |
paintDevice->appendRow(printer);
|
|
361 |
|
|
362 |
QStandardItem *svgGenerator = new QStandardItem;
|
|
363 |
svgGenerator->setText(QString("QSvgGenerator"));
|
|
364 |
paintDevice->appendRow(svgGenerator);
|
|
365 |
|
|
366 |
//________________________________________
|
|
367 |
|
|
368 |
QStandardItem *object = new QStandardItem;
|
|
369 |
object->setText(QString("QObject"));
|
|
370 |
model->appendRow(object);
|
|
371 |
|
|
372 |
QStandardItem *widget = new QStandardItem;
|
|
373 |
widget->setText(QString("QWidget"));
|
|
374 |
object->appendRow(widget);
|
|
375 |
|
|
376 |
QStandardItem *absItemModel = new QStandardItem;
|
|
377 |
absItemModel->setText(QString("QAbstractItemModel"));
|
|
378 |
object->appendRow(absItemModel);
|
|
379 |
|
|
380 |
QStandardItem *absListModel = new QStandardItem;
|
|
381 |
absListModel->setText(QString("QAbstractListModel"));
|
|
382 |
absItemModel->appendRow(absListModel);
|
|
383 |
|
|
384 |
QStandardItem *strListModel = new QStandardItem;
|
|
385 |
strListModel->setText(QString("QStringListModel"));
|
|
386 |
absListModel->appendRow(strListModel);
|
|
387 |
|
|
388 |
QStandardItem *absProxyModel = new QStandardItem;
|
|
389 |
absProxyModel->setText(QString("QAbstractProxyModel"));
|
|
390 |
absItemModel->appendRow(absProxyModel);
|
|
391 |
|
|
392 |
QStandardItem *sFilterProxyModel = new QStandardItem;
|
|
393 |
sFilterProxyModel->setText(QString("QSortFilterProxyModel"));
|
|
394 |
absProxyModel->appendRow(sFilterProxyModel);
|
|
395 |
|
|
396 |
QStandardItem *absTableModel = new QStandardItem;
|
|
397 |
absTableModel->setText(QString("QAbstractTableModel"));
|
|
398 |
absItemModel->appendRow(absTableModel);
|
|
399 |
|
|
400 |
QStandardItem *sqlQueryModel = new QStandardItem;
|
|
401 |
sqlQueryModel->setText(QString("QSqlQueryModel"));
|
|
402 |
absTableModel->appendRow(sqlQueryModel);
|
|
403 |
|
|
404 |
QStandardItem *sqlTableModel = new QStandardItem;
|
|
405 |
sqlTableModel->setText(QString("QSqlTableModel"));
|
|
406 |
sqlQueryModel->appendRow(sqlTableModel);
|
|
407 |
|
|
408 |
QStandardItem *sqlRTableModel = new QStandardItem;
|
|
409 |
sqlRTableModel->setText(QString("QSqlRelationalTableModel"));
|
|
410 |
sqlTableModel->appendRow(sqlRTableModel);
|
|
411 |
|
|
412 |
QStandardItem *dirModel = new QStandardItem;
|
|
413 |
dirModel->setText(QString("QDirModel"));
|
|
414 |
absItemModel->appendRow(dirModel);
|
|
415 |
|
|
416 |
QStandardItem *proxyModel = new QStandardItem;
|
|
417 |
proxyModel->setText(QString("QProxyModel"));
|
|
418 |
absItemModel->appendRow(proxyModel);
|
|
419 |
|
|
420 |
QStandardItem *stanItemModel = new QStandardItem;
|
|
421 |
stanItemModel->setText(QString("QStandardItemModel"));
|
|
422 |
absItemModel->appendRow(stanItemModel);
|
|
423 |
|
|
424 |
QStandardItem *ioDevice = new QStandardItem;
|
|
425 |
ioDevice->setText(QString("QIODevice"));
|
|
426 |
object->appendRow(ioDevice);
|
|
427 |
|
|
428 |
QStandardItem *absSocket = new QStandardItem;
|
|
429 |
absSocket->setText(QString("QAbstractSocket"));
|
|
430 |
ioDevice->appendRow(absSocket);
|
|
431 |
|
|
432 |
QStandardItem *topSocket = new QStandardItem;
|
|
433 |
topSocket->setText(QString("QTopSocket"));
|
|
434 |
absSocket->appendRow(topSocket);
|
|
435 |
|
|
436 |
QStandardItem *sslSocket = new QStandardItem;
|
|
437 |
sslSocket->setText(QString("QSslSocket"));
|
|
438 |
topSocket->appendRow(sslSocket);
|
|
439 |
|
|
440 |
QStandardItem *udpSocket = new QStandardItem;
|
|
441 |
udpSocket->setText(QString("QUdpSocket"));
|
|
442 |
absSocket->appendRow(udpSocket);
|
|
443 |
|
|
444 |
QStandardItem *file = new QStandardItem;
|
|
445 |
file->setText(QString("QFile"));
|
|
446 |
ioDevice->appendRow(file);
|
|
447 |
|
|
448 |
QStandardItem *tmpFile = new QStandardItem;
|
|
449 |
tmpFile->setText(QString("QTemporaryFile"));
|
|
450 |
file->appendRow(tmpFile);
|
|
451 |
|
|
452 |
QStandardItem *buffer = new QStandardItem;
|
|
453 |
buffer->setText(QString("QBuffer"));
|
|
454 |
ioDevice->appendRow(buffer);
|
|
455 |
|
|
456 |
QStandardItem *process = new QStandardItem;
|
|
457 |
process->setText(QString("QProcess"));
|
|
458 |
ioDevice->appendRow(process);
|
|
459 |
|
|
460 |
QStandardItem *validator = new QStandardItem;
|
|
461 |
validator->setText(QString("QValidator"));
|
|
462 |
object->appendRow(validator);
|
|
463 |
|
|
464 |
QStandardItem *dValidator = new QStandardItem;
|
|
465 |
dValidator->setText(QString("QDoubleValidator"));
|
|
466 |
validator->appendRow(dValidator);
|
|
467 |
|
|
468 |
QStandardItem *intValidator = new QStandardItem;
|
|
469 |
intValidator->setText(QString("QIntValidator"));
|
|
470 |
validator->appendRow(intValidator);
|
|
471 |
|
|
472 |
QStandardItem *rgValidator = new QStandardItem;
|
|
473 |
rgValidator->setText(QString("QRegExpValidator"));
|
|
474 |
validator->appendRow(rgValidator);
|
|
475 |
|
|
476 |
QStandardItem *action = new QStandardItem;
|
|
477 |
action->setText(QString("QAction"));
|
|
478 |
object->appendRow(action);
|
|
479 |
|
|
480 |
QStandardItem *menuItem = new QStandardItem;
|
|
481 |
menuItem->setText(QString("QMenuItem"));
|
|
482 |
action->appendRow(menuItem);
|
|
483 |
|
|
484 |
QStandardItem *widgetAction = new QStandardItem;
|
|
485 |
widgetAction->setText(QString("QWidgetAction"));
|
|
486 |
action->appendRow(widgetAction);
|
|
487 |
|
|
488 |
QStandardItem *dBusAbsInterface = new QStandardItem;
|
|
489 |
dBusAbsInterface->setText(QString("QDBusAbstractInterface"));
|
|
490 |
object->appendRow(dBusAbsInterface);
|
|
491 |
|
|
492 |
QStandardItem *dBusConInterface = new QStandardItem;
|
|
493 |
dBusConInterface->setText(QString("QDBusConnectionInterface"));
|
|
494 |
dBusAbsInterface->appendRow(dBusConInterface);
|
|
495 |
|
|
496 |
QStandardItem *dBusInterface = new QStandardItem;
|
|
497 |
dBusInterface->setText(QString("QDBusInterface"));
|
|
498 |
dBusAbsInterface->appendRow(dBusInterface);
|
|
499 |
|
|
500 |
QStandardItem *textObject = new QStandardItem;
|
|
501 |
textObject->setText(QString("QTextObject"));
|
|
502 |
object->appendRow(textObject);
|
|
503 |
|
|
504 |
QStandardItem *textBlockGroup = new QStandardItem;
|
|
505 |
textBlockGroup->setText(QString("QTextBlockGroup"));
|
|
506 |
textObject->appendRow(textBlockGroup);
|
|
507 |
|
|
508 |
QStandardItem *textList = new QStandardItem;
|
|
509 |
textList->setText(QString("QTextList"));
|
|
510 |
textBlockGroup->appendRow(textList);
|
|
511 |
|
|
512 |
QStandardItem *textFrame = new QStandardItem;
|
|
513 |
textFrame->setText(QString("QTextFrame"));
|
|
514 |
textObject->appendRow(textFrame);
|
|
515 |
|
|
516 |
QStandardItem *textTable = new QStandardItem;
|
|
517 |
textTable->setText(QString("QTextTable"));
|
|
518 |
textFrame->appendRow(textTable);
|
|
519 |
|
|
520 |
QStandardItem *absItemDelegate = new QStandardItem;
|
|
521 |
absItemDelegate->setText(QString("QAbstractItemDelegate"));
|
|
522 |
object->appendRow(absItemDelegate);
|
|
523 |
|
|
524 |
QStandardItem *itemDelegate = new QStandardItem;
|
|
525 |
itemDelegate->setText(QString("QItemDelegate"));
|
|
526 |
absItemDelegate->appendRow(itemDelegate);
|
|
527 |
|
|
528 |
QStandardItem *sqlRelationalDelegate = new QStandardItem;
|
|
529 |
sqlRelationalDelegate->setText(QString("QSqlRelationalDelegate"));
|
|
530 |
itemDelegate->appendRow(sqlRelationalDelegate);
|
|
531 |
|
|
532 |
//________________________________________
|
|
533 |
|
|
534 |
QStandardItem *layoutItem = new QStandardItem;
|
|
535 |
layoutItem->setText(QString("QLayoutItem"));
|
|
536 |
model->appendRow(layoutItem);
|
|
537 |
|
|
538 |
QStandardItem *layout = new QStandardItem;
|
|
539 |
layout->setText(QString("QLayout"));
|
|
540 |
layoutItem->appendRow(layout);
|
|
541 |
|
|
542 |
QStandardItem *boxLayout = new QStandardItem;
|
|
543 |
boxLayout->setText(QString("QBoxLayout"));
|
|
544 |
layout->appendRow(boxLayout);
|
|
545 |
|
|
546 |
QStandardItem *hBoxLayout = new QStandardItem;
|
|
547 |
hBoxLayout->setText(QString("QHBoxLayout"));
|
|
548 |
boxLayout->appendRow(hBoxLayout);
|
|
549 |
|
|
550 |
QStandardItem *vBoxLayout = new QStandardItem;
|
|
551 |
vBoxLayout->setText(QString("QVBoxLayout"));
|
|
552 |
boxLayout->appendRow(vBoxLayout);
|
|
553 |
|
|
554 |
QStandardItem *gridLayout = new QStandardItem;
|
|
555 |
gridLayout->setText(QString("QGridLayout"));
|
|
556 |
layout->appendRow(gridLayout);
|
|
557 |
|
|
558 |
QStandardItem *stackedLayout = new QStandardItem;
|
|
559 |
stackedLayout->setText(QString("QStackedLayout"));
|
|
560 |
layout->appendRow(stackedLayout);
|
|
561 |
|
|
562 |
QStandardItem *spacerItem = new QStandardItem;
|
|
563 |
spacerItem->setText(QString("QSpacerItem"));
|
|
564 |
layoutItem->appendRow(spacerItem);
|
|
565 |
|
|
566 |
QStandardItem *widgetItem = new QStandardItem;
|
|
567 |
widgetItem->setText(QString("QWidgetItem"));
|
|
568 |
layoutItem->appendRow(widgetItem);
|
|
569 |
|
|
570 |
//________________________________________
|
|
571 |
|
|
572 |
QStandardItem *axBase = new QStandardItem;
|
|
573 |
axBase->setText(QString("QAxBase"));
|
|
574 |
model->appendRow(axBase);
|
|
575 |
|
|
576 |
QStandardItem *axWidget = new QStandardItem;
|
|
577 |
axWidget->setText(QString("QAxWidget"));
|
|
578 |
axBase->appendRow(axWidget);
|
|
579 |
|
|
580 |
QStandardItem *axObject = new QStandardItem;
|
|
581 |
axObject->setText(QString("QAxObject"));
|
|
582 |
axBase->appendRow(axObject);
|
|
583 |
|
|
584 |
QStandardItem *axScriptEngine = new QStandardItem;
|
|
585 |
axScriptEngine->setText(QString("QAxScriptEngine"));
|
|
586 |
axObject->appendRow(axScriptEngine);
|
|
587 |
|
|
588 |
//________________________________________
|
|
589 |
|
|
590 |
QStandardItem *absFormBuilder = new QStandardItem;
|
|
591 |
absFormBuilder->setText(QString("QAbstractFormBuilder"));
|
|
592 |
model->appendRow(absFormBuilder);
|
|
593 |
|
|
594 |
QStandardItem *formBuilder = new QStandardItem;
|
|
595 |
formBuilder->setText(QString("QFormBuilder"));
|
|
596 |
absFormBuilder->appendRow(formBuilder);
|
|
597 |
|
|
598 |
//________________________________________
|
|
599 |
|
|
600 |
QStandardItem *domNote = new QStandardItem;
|
|
601 |
domNote->setText(QString("QDomNote"));
|
|
602 |
model->appendRow(domNote);
|
|
603 |
|
|
604 |
QStandardItem *domCharData = new QStandardItem;
|
|
605 |
domCharData->setText(QString("QDomCharacterData"));
|
|
606 |
domNote->appendRow(domCharData);
|
|
607 |
|
|
608 |
QStandardItem *domText = new QStandardItem;
|
|
609 |
domText->setText(QString("QDomText"));
|
|
610 |
domCharData->appendRow(domText);
|
|
611 |
|
|
612 |
QStandardItem *domCDATASection = new QStandardItem;
|
|
613 |
domCDATASection->setText(QString("QDomCDATASection"));
|
|
614 |
domText->appendRow(domCDATASection);
|
|
615 |
|
|
616 |
QStandardItem *domComment = new QStandardItem;
|
|
617 |
domComment->setText(QString("QDomComment"));
|
|
618 |
domCharData->appendRow(domComment);
|
|
619 |
|
|
620 |
QStandardItem *domAttr = new QStandardItem;
|
|
621 |
domAttr->setText(QString("QDomAttr"));
|
|
622 |
domNote->appendRow(domAttr);
|
|
623 |
|
|
624 |
QStandardItem *domDoc = new QStandardItem;
|
|
625 |
domDoc->setText(QString("QDomDocument"));
|
|
626 |
domNote->appendRow(domDoc);
|
|
627 |
|
|
628 |
QStandardItem *domDocFrag = new QStandardItem;
|
|
629 |
domDocFrag->setText(QString("QDomDocumentFragment"));
|
|
630 |
domNote->appendRow(domDocFrag);
|
|
631 |
|
|
632 |
QStandardItem *domDocType = new QStandardItem;
|
|
633 |
domDocType->setText(QString("QDomDocumentType"));
|
|
634 |
domNote->appendRow(domDocType);
|
|
635 |
|
|
636 |
QStandardItem *domElement = new QStandardItem;
|
|
637 |
domElement->setText(QString("QDomElement"));
|
|
638 |
domNote->appendRow(domElement);
|
|
639 |
|
|
640 |
QStandardItem *domEntity = new QStandardItem;
|
|
641 |
domEntity->setText(QString("QDomEntity"));
|
|
642 |
domNote->appendRow(domEntity);
|
|
643 |
|
|
644 |
QStandardItem *domEntityRef = new QStandardItem;
|
|
645 |
domEntityRef->setText(QString("QDomEntityReference"));
|
|
646 |
domNote->appendRow(domEntityRef);
|
|
647 |
|
|
648 |
QStandardItem *domNotation = new QStandardItem;
|
|
649 |
domNotation->setText(QString("QDomNotation"));
|
|
650 |
domNote->appendRow(domNotation);
|
|
651 |
|
|
652 |
QStandardItem *domProcInst = new QStandardItem;
|
|
653 |
domProcInst->setText(QString("QDomProcessingInstruction"));
|
|
654 |
domNote->appendRow(domProcInst);
|
|
655 |
|
|
656 |
//________________________________________
|
|
657 |
|
|
658 |
QStandardItem *xmlContentHandler = new QStandardItem;
|
|
659 |
xmlContentHandler->setText(QString("QXmlContentHandler"));
|
|
660 |
model->appendRow(xmlContentHandler);
|
|
661 |
|
|
662 |
QStandardItem *xmlDTDHandler = new QStandardItem;
|
|
663 |
xmlDTDHandler->setText(QString("QXmlDTDHandler"));
|
|
664 |
model->appendRow(xmlDTDHandler);
|
|
665 |
|
|
666 |
QStandardItem *xmlDecHandler = new QStandardItem;
|
|
667 |
xmlDecHandler->setText(QString("QXmlDecHandler"));
|
|
668 |
model->appendRow(xmlDecHandler);
|
|
669 |
|
|
670 |
QStandardItem *xmlEntityHandler = new QStandardItem;
|
|
671 |
xmlEntityHandler->setText(QString("QXmlEntityHandler"));
|
|
672 |
model->appendRow(xmlEntityHandler);
|
|
673 |
|
|
674 |
QStandardItem *xmlErrorHandler = new QStandardItem;
|
|
675 |
xmlErrorHandler->setText(QString("QXmlErrorHandler"));
|
|
676 |
model->appendRow(xmlErrorHandler);
|
|
677 |
|
|
678 |
QStandardItem *xmlLexicalHandler = new QStandardItem;
|
|
679 |
xmlLexicalHandler->setText(QString("QXmlLexicalHandler"));
|
|
680 |
model->appendRow(xmlLexicalHandler);
|
|
681 |
|
|
682 |
QStandardItem *xmlDefaultHandler = new QStandardItem;
|
|
683 |
xmlDefaultHandler->setText(QString("QXmlDefaultHandler"));
|
|
684 |
xmlContentHandler->appendRow(xmlDefaultHandler);
|
|
685 |
|
|
686 |
//________________________________________
|
|
687 |
|
|
688 |
QStandardItem *xmlReader = new QStandardItem;
|
|
689 |
xmlReader->setText(QString("QXmlReader"));
|
|
690 |
model->appendRow(xmlReader);
|
|
691 |
|
|
692 |
QStandardItem *xmlSimpleReader = new QStandardItem;
|
|
693 |
xmlSimpleReader->setText(QString("QXmlSimpleReader"));
|
|
694 |
xmlReader->appendRow(xmlSimpleReader);
|
|
695 |
|
|
696 |
//________________________________________
|
|
697 |
|
|
698 |
QStandardItem *absFileEngine = new QStandardItem;
|
|
699 |
absFileEngine->setText(QString("QAbstractFileEngine"));
|
|
700 |
model->appendRow(absFileEngine);
|
|
701 |
|
|
702 |
QStandardItem *fsFileEngine = new QStandardItem;
|
|
703 |
fsFileEngine->setText(QString("QFSFileEngine"));
|
|
704 |
absFileEngine->appendRow(fsFileEngine);
|
|
705 |
|
|
706 |
//________________________________________
|
|
707 |
|
|
708 |
QStandardItem *genArg = new QStandardItem;
|
|
709 |
genArg->setText(QString("QGenericArgument"));
|
|
710 |
model->appendRow(genArg);
|
|
711 |
|
|
712 |
QStandardItem *genRetArg = new QStandardItem;
|
|
713 |
genRetArg->setText(QString("QGenericReturnArgument"));
|
|
714 |
genArg->appendRow(genRetArg);
|
|
715 |
|
|
716 |
//________________________________________
|
|
717 |
|
|
718 |
QStandardItem *textStream = new QStandardItem;
|
|
719 |
textStream->setText(QString("QTextStream"));
|
|
720 |
model->appendRow(textStream);
|
|
721 |
|
|
722 |
QStandardItem *textIStream = new QStandardItem;
|
|
723 |
textIStream->setText(QString("QTextIStream"));
|
|
724 |
textStream->appendRow(textIStream);
|
|
725 |
|
|
726 |
QStandardItem *textOStream = new QStandardItem;
|
|
727 |
textOStream->setText(QString("QTextOStream"));
|
|
728 |
textStream->appendRow(textOStream);
|
|
729 |
|
|
730 |
//________________________________________
|
|
731 |
|
|
732 |
QStandardItem *screen = new QStandardItem;
|
|
733 |
screen->setText(QString("QScreen"));
|
|
734 |
model->appendRow(screen);
|
|
735 |
|
|
736 |
QStandardItem *vncScreen = new QStandardItem;
|
|
737 |
vncScreen->setText(QString("QVNCScreen"));
|
|
738 |
screen->appendRow(vncScreen);
|
|
739 |
|
|
740 |
//________________________________________
|
|
741 |
|
|
742 |
QStandardItem *wsMouseHandler = new QStandardItem;
|
|
743 |
wsMouseHandler->setText(QString("QWSMouseHandler"));
|
|
744 |
model->appendRow(wsMouseHandler);
|
|
745 |
|
|
746 |
QStandardItem *calWsMouseHandler = new QStandardItem;
|
|
747 |
calWsMouseHandler->setText(QString("QWSCalibratedMouseHandler"));
|
|
748 |
wsMouseHandler->appendRow(calWsMouseHandler);
|
|
749 |
|
|
750 |
//________________________________________
|
|
751 |
|
|
752 |
QStandardItem *painter = new QStandardItem;
|
|
753 |
painter->setText(QString("QPainter"));
|
|
754 |
model->appendRow(painter);
|
|
755 |
|
|
756 |
QStandardItem *sPainter = new QStandardItem;
|
|
757 |
sPainter->setText(QString("QStylePainter"));
|
|
758 |
painter->appendRow(sPainter);
|
|
759 |
|
|
760 |
//________________________________________
|
|
761 |
|
|
762 |
QStandardItem *paintEngine = new QStandardItem;
|
|
763 |
paintEngine->setText(QString("QPaintEngine"));
|
|
764 |
model->appendRow(paintEngine);
|
|
765 |
|
|
766 |
|
|
767 |
QStandardItem *paintREngine = new QStandardItem;
|
|
768 |
paintREngine->setText(QString("QRasterPaintEngine"));
|
|
769 |
paintEngine->appendRow(paintREngine);
|
|
770 |
|
|
771 |
//________________________________________
|
|
772 |
|
|
773 |
QStandardItem *palette = new QStandardItem;
|
|
774 |
palette->setText(QString("QPalette"));
|
|
775 |
model->appendRow(palette);
|
|
776 |
|
|
777 |
QStandardItem *colorGroup = new QStandardItem;
|
|
778 |
colorGroup->setText(QString("QColorGroup"));
|
|
779 |
palette->appendRow(colorGroup);
|
|
780 |
|
|
781 |
//________________________________________
|
|
782 |
|
|
783 |
QStandardItem *qevent = new QStandardItem;
|
|
784 |
qevent->setText(QString("QEvent"));
|
|
785 |
model->appendRow(qevent);
|
|
786 |
|
|
787 |
return model;
|
|
788 |
}
|
|
789 |
|
|
790 |
QStandardItemModel *ModelFactory::populateTreeModelSimple()
|
|
791 |
{
|
|
792 |
QStandardItemModel* model = new QStandardItemModel();
|
|
793 |
|
|
794 |
// =====================================================================
|
|
795 |
// Depth 1
|
|
796 |
// =====================================================================
|
|
797 |
QStandardItem *depth1_parent0 = new QStandardItem(QString("Lock"));
|
|
798 |
QStandardItem *depth1_parent1 = new QStandardItem(QString("Settings"));
|
|
799 |
QStandardItem *depth1_parent2 = new QStandardItem(QString("Handler"));
|
|
800 |
QStandardItem *depth1_parent3 = new QStandardItem(QString("Notifier"));
|
|
801 |
QStandardItem *depth1_parent4 = new QStandardItem(QString("Properties"));
|
|
802 |
QStandardItem *depth1_parent5 = new QStandardItem(QString("Repository"));
|
|
803 |
QStandardItem *depth1_parent6 = new QStandardItem(QString("Other"));
|
|
804 |
QStandardItem *depth1_parent7 = new QStandardItem(QString("KeyLockPolicy"));
|
|
805 |
QStandardItem *depth1_parent8 = new QStandardItem(QString("Schedule"));
|
|
806 |
QStandardItem *depth1_parent9 = new QStandardItem(QString("Settings2"));
|
|
807 |
|
|
808 |
depth1_parent0->setData(Hb::ParentItem, Hb::ItemTypeRole);
|
|
809 |
depth1_parent1->setData(Hb::ParentItem, Hb::ItemTypeRole);
|
|
810 |
depth1_parent2->setData(Hb::ParentItem, Hb::ItemTypeRole);
|
|
811 |
depth1_parent3->setData(Hb::ParentItem, Hb::ItemTypeRole);
|
|
812 |
depth1_parent4->setData(Hb::ParentItem, Hb::ItemTypeRole);
|
|
813 |
depth1_parent5->setData(Hb::ParentItem, Hb::ItemTypeRole);
|
|
814 |
depth1_parent6->setData(Hb::ParentItem, Hb::ItemTypeRole);
|
|
815 |
depth1_parent7->setData(Hb::ParentItem, Hb::ItemTypeRole);
|
|
816 |
depth1_parent8->setData(Hb::ParentItem, Hb::ItemTypeRole);
|
|
817 |
depth1_parent9->setData(Hb::ParentItem, Hb::ItemTypeRole);
|
|
818 |
|
|
819 |
model->setItem(0,0,depth1_parent0);
|
|
820 |
model->setItem(1,0,depth1_parent1);
|
|
821 |
model->setItem(2,0,depth1_parent2);
|
|
822 |
model->setItem(3,0,depth1_parent3);
|
|
823 |
model->setItem(4,0,depth1_parent4);
|
|
824 |
model->setItem(5,0,depth1_parent5);
|
|
825 |
model->setItem(6,0,depth1_parent6);
|
|
826 |
model->setItem(7,0,depth1_parent7);
|
|
827 |
model->setItem(8,0,depth1_parent8);
|
|
828 |
model->setItem(9,0,depth1_parent9);
|
|
829 |
|
|
830 |
|
|
831 |
RDebug::Printf( "%s %s (%u) Lock depth2-0=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
|
|
832 |
QStandardItem *depth2_item00 = new QStandardItem(QString("00:xxx"));
|
|
833 |
QStandardItem *depth2_item01 = new QStandardItem(QString("01:DeviceLockOff"));
|
|
834 |
QStandardItem *depth2_item02 = new QStandardItem(QString("02:KeyguardOn+Note"));
|
|
835 |
QStandardItem *depth2_item03 = new QStandardItem(QString("03:KeyguardOff"));
|
|
836 |
QStandardItem *depth2_item04 = new QStandardItem(QString("04:OfferDevicelock"));
|
|
837 |
QStandardItem *depth2_item05 = new QStandardItem(QString("05:KeyguardOn-Note"));
|
|
838 |
QStandardItem *depth2_item06 = new QStandardItem(QString("06:Wait20-DeviceLockOff"));
|
|
839 |
QStandardItem *depth2_item07 = new QStandardItem(QString("07:Wait20-KeyguardOff"));
|
|
840 |
QStandardItem *depth2_item08 = new QStandardItem(QString("08:Wait20-ShowKeysLockedNote"));
|
|
841 |
QStandardItem *depth2_item09 = new QStandardItem(QString("09:DeviceLockOn"));
|
|
842 |
|
|
843 |
depth1_parent0->setChild(0, 0, depth2_item00);
|
|
844 |
depth1_parent0->setChild(1, 0, depth2_item01);
|
|
845 |
depth1_parent0->setChild(2, 0, depth2_item02);
|
|
846 |
depth1_parent0->setChild(3, 0, depth2_item03);
|
|
847 |
depth1_parent0->setChild(4, 0, depth2_item04);
|
|
848 |
depth1_parent0->setChild(5, 0, depth2_item05);
|
|
849 |
depth1_parent0->setChild(6, 0, depth2_item06);
|
|
850 |
depth1_parent0->setChild(7, 0, depth2_item07);
|
|
851 |
depth1_parent0->setChild(8, 0, depth2_item08);
|
|
852 |
depth1_parent0->setChild(9, 0, depth2_item09);
|
|
853 |
|
|
854 |
RDebug::Printf( "%s %s (%u) Settings depth2-1=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
|
|
855 |
QStandardItem *depth2_item10 = new QStandardItem(QString("10:Call1"));
|
|
856 |
QStandardItem *depth2_item11 = new QStandardItem(QString("11:ChangePinL"));
|
|
857 |
QStandardItem *depth2_item12 = new QStandardItem(QString("12:IsLockEnabledL"));
|
|
858 |
QStandardItem *depth2_item13 = new QStandardItem(QString("13:AskSecCodeL"));
|
|
859 |
QStandardItem *depth2_item14 = new QStandardItem(QString("14:AskPin2L"));
|
|
860 |
QStandardItem *depth2_item15 = new QStandardItem(QString("15:GetFdnMode"));
|
|
861 |
QStandardItem *depth2_item16 = new QStandardItem(QString("16:IsUpinBlocked"));
|
|
862 |
QStandardItem *depth2_item17 = new QStandardItem(QString("17:ChangeSecCodeL"));
|
|
863 |
QStandardItem *depth2_item18 = new QStandardItem(QString("18:ChangeAutoLockPeriodL=30"));
|
|
864 |
QStandardItem *depth2_item19 = new QStandardItem(QString("19:ChangeAutoLockPeriodL=0"));
|
|
865 |
|
|
866 |
depth1_parent1->setChild(0, 0, depth2_item10);
|
|
867 |
depth1_parent1->setChild(1, 0, depth2_item11);
|
|
868 |
depth1_parent1->setChild(2, 0, depth2_item12);
|
|
869 |
depth1_parent1->setChild(3, 0, depth2_item13);
|
|
870 |
depth1_parent1->setChild(4, 0, depth2_item14);
|
|
871 |
depth1_parent1->setChild(5, 0, depth2_item15);
|
|
872 |
depth1_parent1->setChild(6, 0, depth2_item16);
|
|
873 |
depth1_parent1->setChild(7, 0, depth2_item17);
|
|
874 |
depth1_parent1->setChild(8, 0, depth2_item18);
|
|
875 |
depth1_parent1->setChild(9, 0, depth2_item19);
|
|
876 |
|
|
877 |
RDebug::Printf( "%s %s (%u) Handler depth2-2=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
|
|
878 |
QStandardItem *depth2_item20 = new QStandardItem(QString("20:Notif.EPin1Required"));
|
|
879 |
QStandardItem *depth2_item21 = new QStandardItem(QString("21:EPin1Required"));
|
|
880 |
QStandardItem *depth2_item22 = new QStandardItem(QString("22:EPin2Required"));
|
|
881 |
QStandardItem *depth2_item23 = new QStandardItem(QString("23:EPhonePasswordRequired"));
|
|
882 |
QStandardItem *depth2_item24 = new QStandardItem(QString("24:EPuk1Required"));
|
|
883 |
QStandardItem *depth2_item25 = new QStandardItem(QString("25:EPuk2Required"));
|
|
884 |
QStandardItem *depth2_item26 = new QStandardItem(QString("26:EUniversalPinRequired"));
|
|
885 |
QStandardItem *depth2_item27 = new QStandardItem(QString("27:EUniversalPukRequired"));
|
|
886 |
QStandardItem *depth2_item28 = new QStandardItem(QString("28:xxx"));
|
|
887 |
QStandardItem *depth2_item29 = new QStandardItem(QString("29:xxx"));
|
|
888 |
|
|
889 |
depth1_parent2->setChild(0, 0, depth2_item20);
|
|
890 |
depth1_parent2->setChild(1, 0, depth2_item21);
|
|
891 |
depth1_parent2->setChild(2, 0, depth2_item22);
|
|
892 |
depth1_parent2->setChild(3, 0, depth2_item23);
|
|
893 |
depth1_parent2->setChild(4, 0, depth2_item24);
|
|
894 |
depth1_parent2->setChild(5, 0, depth2_item25);
|
|
895 |
depth1_parent2->setChild(6, 0, depth2_item26);
|
|
896 |
depth1_parent2->setChild(7, 0, depth2_item27);
|
|
897 |
depth1_parent2->setChild(8, 0, depth2_item28);
|
|
898 |
depth1_parent2->setChild(9, 0, depth2_item29);
|
|
899 |
|
|
900 |
RDebug::Printf( "%s %s (%u) Notifier depth2-3=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
|
|
901 |
QStandardItem *depth2_item30 = new QStandardItem(QString("30:Op.0"));
|
|
902 |
QStandardItem *depth2_item31 = new QStandardItem(QString("31:EPin1Required"));
|
|
903 |
QStandardItem *depth2_item32 = new QStandardItem(QString("32:EPin2Required"));
|
|
904 |
QStandardItem *depth2_item33 = new QStandardItem(QString("33:EPhonePasswordRequired"));
|
|
905 |
QStandardItem *depth2_item34 = new QStandardItem(QString("34:EPuk1Required"));
|
|
906 |
QStandardItem *depth2_item35 = new QStandardItem(QString("35:EPuk2Required"));
|
|
907 |
QStandardItem *depth2_item36 = new QStandardItem(QString("36:EUniversalPinRequired"));
|
|
908 |
QStandardItem *depth2_item37 = new QStandardItem(QString("37:EUniversalPukRequired"));
|
|
909 |
QStandardItem *depth2_item38 = new QStandardItem(QString("38:Op.0x222"));
|
|
910 |
QStandardItem *depth2_item39 = new QStandardItem(QString("39:Op.0"));
|
|
911 |
|
|
912 |
depth1_parent3->setChild(0, 0, depth2_item30);
|
|
913 |
depth1_parent3->setChild(1, 0, depth2_item31);
|
|
914 |
depth1_parent3->setChild(2, 0, depth2_item32);
|
|
915 |
depth1_parent3->setChild(3, 0, depth2_item33);
|
|
916 |
depth1_parent3->setChild(4, 0, depth2_item34);
|
|
917 |
depth1_parent3->setChild(5, 0, depth2_item35);
|
|
918 |
depth1_parent3->setChild(6, 0, depth2_item36);
|
|
919 |
depth1_parent3->setChild(7, 0, depth2_item37);
|
|
920 |
depth1_parent3->setChild(8, 0, depth2_item38);
|
|
921 |
depth1_parent3->setChild(9, 0, depth2_item39);
|
|
922 |
|
|
923 |
RDebug::Printf( "%s %s (%u) Properties depth2-4=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
|
|
924 |
QStandardItem *depth2_item40 = new QStandardItem(QString("40:KAknKeyguardStatus=8"));
|
|
925 |
QStandardItem *depth2_item41 = new QStandardItem(QString("41:Pass=1234"));
|
|
926 |
QStandardItem *depth2_item42 = new QStandardItem(QString("42:Pass=12345"));
|
|
927 |
QStandardItem *depth2_item43 = new QStandardItem(QString("43:Pass=20499"));
|
|
928 |
QStandardItem *depth2_item44 = new QStandardItem(QString("44:Read-Prop"));
|
|
929 |
QStandardItem *depth2_item45 = new QStandardItem(QString("45:Read-Prop8"));
|
|
930 |
QStandardItem *depth2_item46 = new QStandardItem(QString("46:Stop-Prop8"));
|
|
931 |
QStandardItem *depth2_item47 = new QStandardItem(QString("47:EAutolockOff"));
|
|
932 |
QStandardItem *depth2_item48 = new QStandardItem(QString("48:EManualLocked"));
|
|
933 |
QStandardItem *depth2_item49 = new QStandardItem(QString("49:Uninitialized"));
|
|
934 |
|
|
935 |
depth1_parent4->setChild(0, 0, depth2_item40);
|
|
936 |
depth1_parent4->setChild(1, 0, depth2_item41);
|
|
937 |
depth1_parent4->setChild(2, 0, depth2_item42);
|
|
938 |
depth1_parent4->setChild(3, 0, depth2_item43);
|
|
939 |
depth1_parent4->setChild(4, 0, depth2_item44);
|
|
940 |
depth1_parent4->setChild(5, 0, depth2_item45);
|
|
941 |
depth1_parent4->setChild(6, 0, depth2_item46);
|
|
942 |
depth1_parent4->setChild(7, 0, depth2_item47);
|
|
943 |
depth1_parent4->setChild(8, 0, depth2_item48);
|
|
944 |
depth1_parent4->setChild(9, 0, depth2_item49);
|
|
945 |
|
|
946 |
RDebug::Printf( "%s %s (%u) Repository depth2-5=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
|
|
947 |
QStandardItem *depth2_item50 = new QStandardItem(QString("50:KeyguardTime=0s"));
|
|
948 |
QStandardItem *depth2_item51 = new QStandardItem(QString("51:KeyguardTime=10s"));
|
|
949 |
QStandardItem *depth2_item52 = new QStandardItem(QString("52:KeyguardTime=30s"));
|
|
950 |
QStandardItem *depth2_item53 = new QStandardItem(QString("53:KeyguardT=10+60s"));
|
|
951 |
QStandardItem *depth2_item54 = new QStandardItem(QString("54:AutoLockTime=0m"));
|
|
952 |
QStandardItem *depth2_item55 = new QStandardItem(QString("55:AutoLockTime=1m"));
|
|
953 |
QStandardItem *depth2_item56 = new QStandardItem(QString("56:AutoLockTime=2m"));
|
|
954 |
QStandardItem *depth2_item57 = new QStandardItem(QString("57:AutoLockT=65535m"));
|
|
955 |
QStandardItem *depth2_item58 = new QStandardItem(QString("58:read"));
|
|
956 |
QStandardItem *depth2_item59 = new QStandardItem(QString("59:xxx"));
|
|
957 |
|
|
958 |
depth1_parent5->setChild(0, 0, depth2_item50);
|
|
959 |
depth1_parent5->setChild(1, 0, depth2_item51);
|
|
960 |
depth1_parent5->setChild(2, 0, depth2_item52);
|
|
961 |
depth1_parent5->setChild(3, 0, depth2_item53);
|
|
962 |
depth1_parent5->setChild(4, 0, depth2_item54);
|
|
963 |
depth1_parent5->setChild(5, 0, depth2_item55);
|
|
964 |
depth1_parent5->setChild(6, 0, depth2_item56);
|
|
965 |
depth1_parent5->setChild(7, 0, depth2_item57);
|
|
966 |
depth1_parent5->setChild(8, 0, depth2_item58);
|
|
967 |
depth1_parent5->setChild(9, 0, depth2_item59);
|
|
968 |
|
|
969 |
RDebug::Printf( "%s %s (%u) Other depth2-6=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
|
|
970 |
QStandardItem *depth2_item60 = new QStandardItem(QString("60:Wait30+Cancel_P&S"));
|
|
971 |
QStandardItem *depth2_item61 = new QStandardItem(QString("61:Cancel_P&S"));
|
|
972 |
QStandardItem *depth2_item62 = new QStandardItem(QString("62:TSecUi::InitializeLibL"));
|
|
973 |
QStandardItem *depth2_item63 = new QStandardItem(QString("63:TSecUi::UnInitializeLib"));
|
|
974 |
QStandardItem *depth2_item64 = new QStandardItem(QString("64:Wait30+CancelSecCodeQuery"));
|
|
975 |
QStandardItem *depth2_item65 = new QStandardItem(QString("65:CancelSecCodeQuery"));
|
|
976 |
QStandardItem *depth2_item66 = new QStandardItem(QString("66:EStdKeyDeviceF"));
|
|
977 |
QStandardItem *depth2_item67 = new QStandardItem(QString("67:EKeyDeviceF"));
|
|
978 |
QStandardItem *depth2_item68 = new QStandardItem(QString("68:EKeyBell"));
|
|
979 |
QStandardItem *depth2_item69 = new QStandardItem(QString("69:Stop-iPeriodicExt"));
|
|
980 |
|
|
981 |
depth1_parent6->setChild(0, 0, depth2_item60);
|
|
982 |
depth1_parent6->setChild(1, 0, depth2_item61);
|
|
983 |
depth1_parent6->setChild(2, 0, depth2_item62);
|
|
984 |
depth1_parent6->setChild(3, 0, depth2_item63);
|
|
985 |
depth1_parent6->setChild(4, 0, depth2_item64);
|
|
986 |
depth1_parent6->setChild(5, 0, depth2_item65);
|
|
987 |
depth1_parent6->setChild(6, 0, depth2_item66);
|
|
988 |
depth1_parent6->setChild(7, 0, depth2_item67);
|
|
989 |
depth1_parent6->setChild(8, 0, depth2_item68);
|
|
990 |
depth1_parent6->setChild(9, 0, depth2_item69);
|
|
991 |
|
|
992 |
RDebug::Printf( "%s %s (%u) KeyLockPolicy depth2-7=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
|
|
993 |
QStandardItem *depth2_item70 = new QStandardItem(QString("70:KeyguardAllowed?"));
|
|
994 |
QStandardItem *depth2_item71 = new QStandardItem(QString("71:EnableKeyguardFeature"));
|
|
995 |
QStandardItem *depth2_item72 = new QStandardItem(QString("72:DisableKeyguardFeature"));
|
|
996 |
QStandardItem *depth2_item73 = new QStandardItem(QString("73:ShowErrorCodes"));
|
|
997 |
QStandardItem *depth2_item74 = new QStandardItem(QString("74:Expiration+Consecutive"));
|
|
998 |
QStandardItem *depth2_item75 = new QStandardItem(QString("75:Minlength+SpecificStrings"));
|
|
999 |
QStandardItem *depth2_item76 = new QStandardItem(QString("76:Chars_Numbers"));
|
|
1000 |
QStandardItem *depth2_item77 = new QStandardItem(QString("77:xxx"));
|
|
1001 |
QStandardItem *depth2_item78 = new QStandardItem(QString("78:xxx"));
|
|
1002 |
QStandardItem *depth2_item79 = new QStandardItem(QString("79:xxx"));
|
|
1003 |
|
|
1004 |
depth1_parent7->setChild(0, 0, depth2_item70);
|
|
1005 |
depth1_parent7->setChild(1, 0, depth2_item71);
|
|
1006 |
depth1_parent7->setChild(2, 0, depth2_item72);
|
|
1007 |
depth1_parent7->setChild(3, 0, depth2_item73);
|
|
1008 |
depth1_parent7->setChild(4, 0, depth2_item74);
|
|
1009 |
depth1_parent7->setChild(5, 0, depth2_item75);
|
|
1010 |
depth1_parent7->setChild(6, 0, depth2_item76);
|
|
1011 |
depth1_parent7->setChild(7, 0, depth2_item77);
|
|
1012 |
depth1_parent7->setChild(8, 0, depth2_item78);
|
|
1013 |
depth1_parent7->setChild(9, 0, depth2_item79);
|
|
1014 |
|
|
1015 |
RDebug::Printf( "%s %s (%u) Schedule depth2-8=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
|
|
1016 |
QStandardItem *depth2_item80 = new QStandardItem(QString("80:xxxx"));
|
|
1017 |
QStandardItem *depth2_item81 = new QStandardItem(QString("81:xxx"));
|
|
1018 |
QStandardItem *depth2_item82 = new QStandardItem(QString("82:xxx"));
|
|
1019 |
QStandardItem *depth2_item83 = new QStandardItem(QString("83:xxx"));
|
|
1020 |
QStandardItem *depth2_item84 = new QStandardItem(QString("84:xxx"));
|
|
1021 |
QStandardItem *depth2_item85 = new QStandardItem(QString("85:xxx"));
|
|
1022 |
QStandardItem *depth2_item86 = new QStandardItem(QString("86:xxx"));
|
|
1023 |
QStandardItem *depth2_item87 = new QStandardItem(QString("87:xxx"));
|
|
1024 |
QStandardItem *depth2_item88 = new QStandardItem(QString("88:xxx"));
|
|
1025 |
QStandardItem *depth2_item89 = new QStandardItem(QString("89:xxx"));
|
|
1026 |
|
|
1027 |
depth1_parent8->setChild(0, 0, depth2_item80);
|
|
1028 |
depth1_parent8->setChild(1, 0, depth2_item81);
|
|
1029 |
depth1_parent8->setChild(2, 0, depth2_item82);
|
|
1030 |
depth1_parent8->setChild(3, 0, depth2_item83);
|
|
1031 |
depth1_parent8->setChild(4, 0, depth2_item84);
|
|
1032 |
depth1_parent8->setChild(5, 0, depth2_item85);
|
|
1033 |
depth1_parent8->setChild(6, 0, depth2_item86);
|
|
1034 |
depth1_parent8->setChild(7, 0, depth2_item87);
|
|
1035 |
depth1_parent8->setChild(8, 0, depth2_item88);
|
|
1036 |
depth1_parent8->setChild(9, 0, depth2_item89);
|
|
1037 |
|
|
1038 |
RDebug::Printf( "%s %s (%u) Settings2 depth2-9=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
|
|
1039 |
QStandardItem *depth2_item90 = new QStandardItem(QString("90:ChangeSimSecurityL"));
|
|
1040 |
QStandardItem *depth2_item91 = new QStandardItem(QString("91:ChangePinRequestL"));
|
|
1041 |
QStandardItem *depth2_item92 = new QStandardItem(QString("92:ChangeUPinRequestL"));
|
|
1042 |
QStandardItem *depth2_item93 = new QStandardItem(QString("93:SwitchPinCodesL"));
|
|
1043 |
QStandardItem *depth2_item94 = new QStandardItem(QString("94:ChangePin2L"));
|
|
1044 |
QStandardItem *depth2_item95 = new QStandardItem(QString("95:SwitchPinCodesL"));
|
|
1045 |
QStandardItem *depth2_item96 = new QStandardItem(QString("96:ChangeRemoteLockStatusL"));
|
|
1046 |
QStandardItem *depth2_item97 = new QStandardItem(QString("97:ChangeRLStat-0"));
|
|
1047 |
QStandardItem *depth2_item98 = new QStandardItem(QString("98:ChangeRLStat-Off"));
|
|
1048 |
QStandardItem *depth2_item99 = new QStandardItem(QString("99:xxx"));
|
|
1049 |
|
|
1050 |
depth1_parent9->setChild(0, 0, depth2_item90);
|
|
1051 |
depth1_parent9->setChild(1, 0, depth2_item91);
|
|
1052 |
depth1_parent9->setChild(2, 0, depth2_item92);
|
|
1053 |
depth1_parent9->setChild(3, 0, depth2_item93);
|
|
1054 |
depth1_parent9->setChild(4, 0, depth2_item94);
|
|
1055 |
depth1_parent9->setChild(5, 0, depth2_item95);
|
|
1056 |
depth1_parent9->setChild(6, 0, depth2_item96);
|
|
1057 |
depth1_parent9->setChild(7, 0, depth2_item97);
|
|
1058 |
depth1_parent9->setChild(8, 0, depth2_item98);
|
|
1059 |
depth1_parent9->setChild(9, 0, depth2_item99);
|
|
1060 |
|
|
1061 |
return model;
|
|
1062 |
}
|
|
1063 |
|
|
1064 |
QStandardItemModel *ModelFactory::populateTreeModelSimpleOfSimplest()
|
|
1065 |
{
|
|
1066 |
QStandardItemModel* model = new QStandardItemModel();
|
|
1067 |
|
|
1068 |
// =====================================================================
|
|
1069 |
// Depth 1
|
|
1070 |
// =====================================================================
|
|
1071 |
QStandardItem *depth1_item0 = new QStandardItem(QString("Leaf 0"));
|
|
1072 |
//QStandardItem *depth1_item1 = new QStandardItem(QString("Leaf A-1"));
|
|
1073 |
QStandardItem *depth1_parent0 = new QStandardItem(QString("Node A"));
|
|
1074 |
QStandardItem *depth1_parent1 = new QStandardItem(QString("Node B"));
|
|
1075 |
|
|
1076 |
depth1_parent0->setData(Hb::ParentItem, Hb::ItemTypeRole);
|
|
1077 |
depth1_parent1->setData(Hb::ParentItem, Hb::ItemTypeRole);
|
|
1078 |
|
|
1079 |
model->setItem(0,0,depth1_item0);
|
|
1080 |
model->setItem(1,0,depth1_parent0);
|
|
1081 |
model->setItem(2,0,depth1_parent1);
|
|
1082 |
|
|
1083 |
// =====================================================================
|
|
1084 |
// Depth 2
|
|
1085 |
// =====================================================================
|
|
1086 |
QStandardItem *depth2_item0 = new QStandardItem(QString("Leaf A-1"));
|
|
1087 |
QStandardItem *depth2_item1 = new QStandardItem(QString("Leaf A-2"));
|
|
1088 |
QStandardItem *depth2_item2 = new QStandardItem(QString("Leaf B-1"));
|
|
1089 |
/*QStandardItem *depth2_parent0 = new QStandardItem(QString("Node B-0"));
|
|
1090 |
QStandardItem *depth2_parent1 = new QStandardItem(QString("Node B-1"));
|
|
1091 |
QStandardItem *depth2_parent2 = new QStandardItem(QString("Node B-2"));
|
|
1092 |
|
|
1093 |
depth2_parent0->setData(Hb::ParentItem, Hb::ItemTypeRole);
|
|
1094 |
depth2_parent1->setData(Hb::ParentItem, Hb::ItemTypeRole);
|
|
1095 |
depth2_parent2->setData(Hb::ParentItem, Hb::ItemTypeRole);
|
|
1096 |
*/
|
|
1097 |
depth1_parent0->setChild(0,0,depth2_item0);
|
|
1098 |
depth1_parent0->setChild(1, 0, depth2_item1);
|
|
1099 |
depth1_parent1->setChild(0, 0, depth2_item2);
|
|
1100 |
/* depth1_parent1->setChild(0, 0, depth2_parent1);
|
|
1101 |
depth1_parent1->setChild(1, 0, depth2_parent2);
|
|
1102 |
|
|
1103 |
// =====================================================================
|
|
1104 |
// Depth 3
|
|
1105 |
// =====================================================================
|
|
1106 |
QStandardItem *depth3_item0 = new QStandardItem(QString("Leaf C-0"));
|
|
1107 |
QStandardItem *depth3_item1 = new QStandardItem(QString("Leaf C-1"));
|
|
1108 |
QStandardItem *depth3_item2 = new QStandardItem(QString("Leaf C-2"));
|
|
1109 |
QStandardItem *depth3_item3 = new QStandardItem(QString("Leaf C-3"));
|
|
1110 |
QStandardItem *depth3_item4 = new QStandardItem(QString("Leaf C-4"));
|
|
1111 |
QStandardItem *depth3_item5 = new QStandardItem(QString("Leaf C-5"));
|
|
1112 |
|
|
1113 |
depth2_parent0->setChild(0, 0, depth3_item0);
|
|
1114 |
depth2_parent0->setChild(1, 0, depth3_item1);
|
|
1115 |
depth2_parent1->setChild(0, 0, depth3_item2);
|
|
1116 |
depth2_parent2->setChild(0, 0, depth3_item3);
|
|
1117 |
depth2_parent2->setChild(1, 0, depth3_item4);
|
|
1118 |
depth2_parent2->setChild(2, 0, depth3_item5);
|
|
1119 |
*/
|
|
1120 |
return model;
|
|
1121 |
}
|
|
1122 |
|
|
1123 |
QStandardItemModel *ModelFactory::populateGreenOddBrownEvenModel()
|
|
1124 |
{
|
|
1125 |
QStandardItemModel* model = new QStandardItemModel();
|
|
1126 |
|
|
1127 |
// =====================================================================
|
|
1128 |
// Depth 1
|
|
1129 |
// =====================================================================
|
|
1130 |
|
|
1131 |
QStandardItem *depth1_item0 = new QStandardItem();
|
|
1132 |
QStringList data;
|
|
1133 |
data << "Odd numbered items are green" << "Even numbered items are brown";
|
|
1134 |
depth1_item0->setData(QVariant(data), Qt::DisplayRole);
|
|
1135 |
|
|
1136 |
QStandardItem *depth1_item1 = new QStandardItem(QString("1"));
|
|
1137 |
QStandardItem *depth1_item2 = new QStandardItem(QString("Item 2"));
|
|
1138 |
QStandardItem *depth1_item3 = new QStandardItem(QString("Item 3"));
|
|
1139 |
QStandardItem *depth1_item4 = new QStandardItem(QString("4"));
|
|
1140 |
QStandardItem *depth1_item5 = new QStandardItem(QString("5"));
|
|
1141 |
QStandardItem *depth1_parent0 = new QStandardItem(QString("Parent 1"));
|
|
1142 |
QStandardItem *depth1_parent1 = new QStandardItem(QString("Parent 2"));
|
|
1143 |
|
|
1144 |
depth1_parent0->setData(Hb::ParentItem, Hb::ItemTypeRole);
|
|
1145 |
depth1_parent1->setData(Hb::ParentItem, Hb::ItemTypeRole);
|
|
1146 |
|
|
1147 |
model->setItem(0,0,depth1_item0);
|
|
1148 |
model->setItem(1,0,depth1_item1);
|
|
1149 |
model->setItem(2,0,depth1_item2);
|
|
1150 |
model->setItem(3,0,depth1_item3);
|
|
1151 |
model->setItem(4,0,depth1_parent0);
|
|
1152 |
model->setItem(5,0,depth1_parent1);
|
|
1153 |
model->setItem(6,0,depth1_item4);
|
|
1154 |
model->setItem(7,0,depth1_item5);
|
|
1155 |
|
|
1156 |
// =====================================================================
|
|
1157 |
// Depth 2
|
|
1158 |
// =====================================================================
|
|
1159 |
QStandardItem *depth2_item0 = new QStandardItem(QString("11"));
|
|
1160 |
QStandardItem *depth2_item1 = new QStandardItem(QString("12"));
|
|
1161 |
QStandardItem *depth2_item2 = new QStandardItem(QString("Item 13"));
|
|
1162 |
QStandardItem *depth2_item4 = new QStandardItem(QString("Item 14"));
|
|
1163 |
QStandardItem *depth2_item5 = new QStandardItem(QString("15"));
|
|
1164 |
QStandardItem *depth2_item6 = new QStandardItem(QString("16"));
|
|
1165 |
QStandardItem *depth2_item7 = new QStandardItem(QString("17"));
|
|
1166 |
QStandardItem *depth2_parent0 = new QStandardItem(QString("Parent 11"));
|
|
1167 |
|
|
1168 |
depth2_parent0->setData(Hb::ParentItem, Hb::ItemTypeRole);
|
|
1169 |
|
|
1170 |
depth1_parent0->setChild(0, 0, depth2_item0);
|
|
1171 |
depth1_parent0->setChild(1, 0, depth2_item1);
|
|
1172 |
depth1_parent0->setChild(2, 0, depth2_item2);
|
|
1173 |
depth1_parent0->setChild(3, 0, depth2_parent0);
|
|
1174 |
|
|
1175 |
depth1_parent1->setChild(0, 0, depth2_item4);
|
|
1176 |
depth1_parent1->setChild(1, 0, depth2_item5);
|
|
1177 |
depth1_parent1->setChild(2, 0, depth2_item6);
|
|
1178 |
depth1_parent1->setChild(3, 0, depth2_item7);
|
|
1179 |
|
|
1180 |
// =====================================================================
|
|
1181 |
// Depth 3
|
|
1182 |
// =====================================================================
|
|
1183 |
QStandardItem *depth3_item0 = new QStandardItem(QString("21"));
|
|
1184 |
QStandardItem *depth3_item1 = new QStandardItem(QString("22"));
|
|
1185 |
QStandardItem *depth3_item2 = new QStandardItem(QString("Item 23"));
|
|
1186 |
QStandardItem *depth3_item3 = new QStandardItem(QString("Item 24"));
|
|
1187 |
QStandardItem *depth3_item4 = new QStandardItem(QString("25"));
|
|
1188 |
QStandardItem *depth3_item5 = new QStandardItem(QString("26"));
|
|
1189 |
|
|
1190 |
depth2_parent0->setChild(0, 0, depth3_item0);
|
|
1191 |
depth2_parent0->setChild(1, 0, depth3_item1);
|
|
1192 |
depth2_parent0->setChild(2, 0, depth3_item2);
|
|
1193 |
depth2_parent0->setChild(3, 0, depth3_item3);
|
|
1194 |
depth2_parent0->setChild(4, 0, depth3_item4);
|
|
1195 |
depth2_parent0->setChild(5, 0, depth3_item5);
|
|
1196 |
|
|
1197 |
return model;
|
|
1198 |
}
|
|
1199 |
|
|
1200 |
|
|
1201 |
QStandardItemModel *ModelFactory::populateTreeModelDeep()
|
|
1202 |
{
|
|
1203 |
QStandardItemModel* model = new QStandardItemModel();
|
|
1204 |
|
|
1205 |
QStandardItem *root = new QStandardItem;
|
|
1206 |
model->setItem(0,0,root);
|
|
1207 |
|
|
1208 |
QStandardItem *parent = root;
|
|
1209 |
const int maxDeep = 50;
|
|
1210 |
for (int current = 1; current <= maxDeep; ++current) {
|
|
1211 |
parent->setData(Hb::ParentItem, Hb::ItemTypeRole);
|
|
1212 |
parent->setText(QString("Parent %0").arg(current));
|
|
1213 |
|
|
1214 |
for (int current2 = 0; current2 < 5; ++current2) {
|
|
1215 |
QStandardItem *item = new QStandardItem;
|
|
1216 |
item->setText(QString("Item %0").arg(current2));
|
|
1217 |
parent->setChild(current2, 0, item);
|
|
1218 |
}
|
|
1219 |
for (int current2 = 5; current2 < 10; ++current2) {
|
|
1220 |
QStandardItem *item = new QStandardItem;
|
|
1221 |
item->setText(QString("Item %0").arg(current2));
|
|
1222 |
parent->setChild(current2, 0, item);
|
|
1223 |
|
|
1224 |
QStandardItem *itemPrevious = item;
|
|
1225 |
for (int current3 = current+1; current3 < maxDeep - (current2-5)*maxDeep/5; ++current3) {
|
|
1226 |
itemPrevious->setData(Hb::ParentItem, Hb::ItemTypeRole);
|
|
1227 |
QStandardItem *item2 = new QStandardItem;
|
|
1228 |
item2->setText(QString("Folder %0").arg(current3));
|
|
1229 |
itemPrevious->setChild(0, 0, item2);
|
|
1230 |
|
|
1231 |
QStandardItem *itemTemp = new QStandardItem;
|
|
1232 |
itemTemp->setText(QString("Folder %0 item").arg(current3));
|
|
1233 |
itemPrevious->setChild(1, 0, itemTemp);
|
|
1234 |
|
|
1235 |
itemPrevious = item2;
|
|
1236 |
}
|
|
1237 |
itemPrevious->setData(Hb::ParentItem, Hb::ItemTypeRole);
|
|
1238 |
QStandardItem *itemTemp = new QStandardItem;
|
|
1239 |
itemTemp->setText(QString("Folder 9 item"));
|
|
1240 |
itemPrevious->setChild(0, 0, itemTemp);
|
|
1241 |
}
|
|
1242 |
|
|
1243 |
if(current < maxDeep) {
|
|
1244 |
QStandardItem *item = new QStandardItem;
|
|
1245 |
parent->setChild(10, 0, item);
|
|
1246 |
parent = item;
|
|
1247 |
}
|
|
1248 |
}
|
|
1249 |
return model;
|
|
1250 |
}
|
|
1251 |
|
|
1252 |
QStandardItemModel *ModelFactory::populateTreeModelFlat()
|
|
1253 |
{
|
|
1254 |
QStandardItemModel* model = new QStandardItemModel();
|
|
1255 |
for (int i = 0; i < 1000; ++i) {
|
|
1256 |
QStandardItem* item = new QStandardItem(QString("Item number %1").arg(i));
|
|
1257 |
model->appendRow(item);
|
|
1258 |
}
|
|
1259 |
return model;
|
|
1260 |
}
|
|
1261 |
|
|
1262 |
QStandardItemModel *ModelFactory::populateTreeModelMixed()
|
|
1263 |
{
|
|
1264 |
QStandardItemModel* model = new QStandardItemModel();
|
|
1265 |
|
|
1266 |
QStandardItem *parent = model->invisibleRootItem();
|
|
1267 |
insertMixedItems(parent);
|
|
1268 |
|
|
1269 |
for (int current = 1; current <= 10; ++current) {
|
|
1270 |
QStandardItem *newParent = new QStandardItem;
|
|
1271 |
parent->appendRow(newParent);
|
|
1272 |
parent = newParent;
|
|
1273 |
|
|
1274 |
parent->setData(Hb::ParentItem, Hb::ItemTypeRole);
|
|
1275 |
parent->setText(QString("Parent %0").arg(current));
|
|
1276 |
|
|
1277 |
insertMixedItems(parent);
|
|
1278 |
}
|
|
1279 |
|
|
1280 |
return model;
|
|
1281 |
}
|
|
1282 |
|
|
1283 |
|
|
1284 |
|