cpsecplugins/simpincodeplugin/src/seccodeedit.cpp
branchRCL_3
changeset 50 03674e5abf46
parent 49 09b1ac925e3f
child 54 94da73d93b58
equal deleted inserted replaced
49:09b1ac925e3f 50:03674e5abf46
     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 // System includes
       
    19 #include <QGraphicsSceneMouseEvent>
       
    20 
       
    21 // User includes
       
    22 #include "seccodeedit.h"
       
    23 #include <../../inc/cpsecplugins.h>
       
    24 
       
    25 // ======== MEMBER FUNCTIONS ========
       
    26 
       
    27 /*!
       
    28     Constructor
       
    29 */
       
    30 SecCodeEdit::SecCodeEdit(const QString &text, QGraphicsItem *parent/*= 0*/)
       
    31     : HbLineEdit(text, parent)
       
    32 {
       
    33 }
       
    34 
       
    35 /*!
       
    36     Destructor
       
    37 */
       
    38 SecCodeEdit::~SecCodeEdit()
       
    39 {
       
    40 }
       
    41 
       
    42 /*!
       
    43     Mouse Press Event
       
    44 */
       
    45 void SecCodeEdit::mousePressEvent(QGraphicsSceneMouseEvent *event)
       
    46 {
       
    47 		RDEBUG("0", 0);
       
    48     if (event->button() != Qt::LeftButton) {
       
    49         event->ignore();
       
    50         return;
       
    51     }
       
    52 
       
    53     if (rect().contains(event->pos())) {
       
    54         emit clicked();
       
    55         event->accept();
       
    56     } else {
       
    57         event->ignore();
       
    58     }
       
    59 }