phonebookui/pbkcommonui/src/cntimagelabel.cpp
changeset 27 de1630741fbe
child 37 fd64c38c277d
equal deleted inserted replaced
25:76a2435edfd4 27:de1630741fbe
       
     1 /*
       
     2 * Copyright (c) 2009 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 "cntimagelabel.h"
       
    19 
       
    20 #include <hbinstantfeedback.h>
       
    21 #include <QGraphicsSceneMouseEvent>
       
    22 
       
    23 CntImageLabel::CntImageLabel(QGraphicsItem *parent) :
       
    24     HbLabel(parent)
       
    25 {
       
    26 
       
    27 }
       
    28 
       
    29 CntImageLabel::~CntImageLabel()
       
    30 {
       
    31 
       
    32 }
       
    33 
       
    34 void CntImageLabel::mousePressEvent(QGraphicsSceneMouseEvent *event)
       
    35 {
       
    36     HbInstantFeedback::play(HbFeedback::Basic);
       
    37     event->accept();
       
    38 }
       
    39 
       
    40 void CntImageLabel::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
       
    41 {
       
    42     if (rect().contains(event->pos()))
       
    43     {
       
    44         emit iconClicked();
       
    45     }
       
    46     event->accept();
       
    47 }