equal
deleted
inserted
replaced
|
1 /* |
|
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0"" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 // User includes |
|
19 #include "seccodeeditdataformviewitem.h" |
|
20 #include "seccodeedit.h" |
|
21 |
|
22 // ======== MEMBER FUNCTIONS ======== |
|
23 |
|
24 /*! |
|
25 Constructor |
|
26 */ |
|
27 SecCodeEditDataFormViewItem::SecCodeEditDataFormViewItem( |
|
28 QGraphicsItem *parent): HbDataFormViewItem(parent) |
|
29 { |
|
30 } |
|
31 |
|
32 /*! |
|
33 Destructor |
|
34 */ |
|
35 SecCodeEditDataFormViewItem::~SecCodeEditDataFormViewItem() |
|
36 { |
|
37 } |
|
38 |
|
39 /*! |
|
40 Create Item |
|
41 */ |
|
42 HbAbstractViewItem *SecCodeEditDataFormViewItem::createItem() |
|
43 { |
|
44 return new SecCodeEditDataFormViewItem( *this); |
|
45 } |
|
46 |
|
47 /*! |
|
48 Create Item |
|
49 */ |
|
50 bool SecCodeEditDataFormViewItem::canSetModelIndex( |
|
51 const QModelIndex &index) const |
|
52 { |
|
53 int type = index.data(HbDataFormModelItem::ItemTypeRole).toInt(); |
|
54 return type == SecCodeEditItem; |
|
55 } |
|
56 |
|
57 /*! |
|
58 Create Custom Widget |
|
59 */ |
|
60 HbWidget *SecCodeEditDataFormViewItem::createCustomWidget() |
|
61 { |
|
62 int type = modelIndex().data(HbDataFormModelItem::ItemTypeRole).toInt(); |
|
63 |
|
64 if (type == SecCodeEditItem) { |
|
65 SecCodeEdit *edit = new SecCodeEdit("1234"); |
|
66 edit->setEchoMode(HbLineEdit::Password); |
|
67 edit->setReadOnly(true); |
|
68 return edit; |
|
69 } |
|
70 |
|
71 return 0; |
|
72 } |