locationsystemui/locationsysui/possettings/possettingsengine/src/checkcustomviewitem.cpp
changeset 25 73f6c2762ffe
equal deleted inserted replaced
22:4c4ed41530db 25:73f6c2762ffe
       
     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 #include "checkcustomviewitem.h"
       
    19 #include <hbdataformmodelitem.h>
       
    20 #include <hbdataformmodel.h>
       
    21 #include <hbabstractitemview.h>
       
    22 #include <QMetaProperty>
       
    23 
       
    24 
       
    25 CheckCustomViewItem::CheckCustomViewItem(QGraphicsItem *parent )
       
    26 																: HbDataFormViewItem(parent)
       
    27 
       
    28 {
       
    29 }
       
    30 CheckCustomViewItem::~CheckCustomViewItem()
       
    31 {
       
    32 }
       
    33 HbAbstractViewItem* CheckCustomViewItem::createItem()
       
    34 {
       
    35 	return new CheckCustomViewItem(*this);
       
    36 }
       
    37 bool CheckCustomViewItem::canSetModelIndex(const QModelIndex &index) const
       
    38 {
       
    39     int type = index.data(HbDataFormModelItem::ItemTypeRole).toInt();
       
    40     if ( type == HbDataFormModelItem::CheckBoxItem ) {
       
    41             return true;
       
    42     }
       
    43     else {
       
    44             return false;
       
    45     }
       
    46 }