ui/detailscustomwidget/detailscustomwidgets/glxdetailstextedit.cpp
changeset 52 a3a4c0de738e
child 58 383b67fbdb11
equal deleted inserted replaced
50:a0f57508af73 52:a3a4c0de738e
       
     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:   This is custom widget for details view in photos for displaying the description of image .
       
    15 *
       
    16 */
       
    17  
       
    18 
       
    19 
       
    20 #include "glxdetailstextedit.h"
       
    21 #include <hbeditorinterface>
       
    22 #include <QEvent>
       
    23 
       
    24 
       
    25 
       
    26 //--------------------------------------------------------------------------------------------------------------------------------------------
       
    27 //focusInEvent
       
    28 //--------------------------------------------------------------------------------------------------------------------------------------------
       
    29 void  GlxDetailsTextEdit::focusInEvent (QFocusEvent *event)
       
    30     {
       
    31     if(event->reason() == Qt::MouseFocusReason )
       
    32         {
       
    33           event->setAccepted(TRUE);
       
    34           emit labelPressed();
       
    35         }
       
    36     
       
    37     }
       
    38     
       
    39     
       
    40 //--------------------------------------------------------------------------------------------------------------------------------------------
       
    41 //focusOutEvent
       
    42 //--------------------------------------------------------------------------------------------------------------------------------------------
       
    43 void  GlxDetailsTextEdit::focusOutEvent (QFocusEvent *event) 
       
    44     {
       
    45      event->setAccepted(TRUE);    
       
    46     }
       
    47 
       
    48 
       
    49 //--------------------------------------------------------------------------------------------------------------------------------------------
       
    50 //GlxDetailsTextEdit
       
    51 //--------------------------------------------------------------------------------------------------------------------------------------------
       
    52 GlxDetailsTextEdit::GlxDetailsTextEdit(QGraphicsItem *parent) : HbTextEdit( parent )
       
    53 {
       
    54    setAlignment(Qt::AlignLeft);
       
    55    mDesc = new HbEditorInterface(this);
       
    56    mDesc->setInputConstraints (HbEditorConstraintIgnoreFocus);
       
    57 }
       
    58 
       
    59 //--------------------------------------------------------------------------------------------------------------------------------------------
       
    60 //~GlxDetailsTextEdit
       
    61 //--------------------------------------------------------------------------------------------------------------------------------------------
       
    62 GlxDetailsTextEdit::~GlxDetailsTextEdit()
       
    63 {
       
    64   delete mDesc;
       
    65    mDesc = NULL;
       
    66 }
       
    67 
       
    68 //--------------------------------------------------------------------------------------------------------------------------------------------
       
    69 //setItemText
       
    70 //--------------------------------------------------------------------------------------------------------------------------------------------
       
    71 void GlxDetailsTextEdit::setItemText( const QString &text )
       
    72 {
       
    73     setPlainText( text );
       
    74 }