44
|
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 "glxdetailsdescriptionedit.h"
|
|
21 |
#include <hbeditorinterface>
|
|
22 |
#include <QEvent>
|
|
23 |
|
|
24 |
|
|
25 |
|
|
26 |
void GlxDetailsDescriptionEdit::focusInEvent (QFocusEvent *event)
|
|
27 |
{
|
|
28 |
if(event->reason() == Qt::MouseFocusReason )
|
|
29 |
{
|
|
30 |
event->setAccepted(TRUE);
|
|
31 |
emit labelPressed();
|
|
32 |
}
|
|
33 |
|
|
34 |
}
|
|
35 |
void GlxDetailsDescriptionEdit::focusOutEvent (QFocusEvent *event)
|
|
36 |
{
|
|
37 |
event->setAccepted(TRUE);
|
|
38 |
}
|
|
39 |
|
|
40 |
|
|
41 |
//--------------------------------------------------------------------------------------------------------------------------------------------
|
|
42 |
//GlxDetailsDescLabel
|
|
43 |
//--------------------------------------------------------------------------------------------------------------------------------------------
|
|
44 |
GlxDetailsDescriptionEdit::GlxDetailsDescriptionEdit(QGraphicsItem *parent) : HbTextEdit( parent )
|
|
45 |
{
|
|
46 |
setAlignment(Qt::AlignLeft);
|
|
47 |
mDesc = new HbEditorInterface(this);
|
|
48 |
mDesc->setInputConstraints (HbEditorConstraintIgnoreFocus);
|
|
49 |
}
|
|
50 |
|
|
51 |
//--------------------------------------------------------------------------------------------------------------------------------------------
|
|
52 |
//~GlxDetailsDescLabel
|
|
53 |
//--------------------------------------------------------------------------------------------------------------------------------------------
|
|
54 |
GlxDetailsDescriptionEdit::~GlxDetailsDescriptionEdit()
|
|
55 |
{
|
|
56 |
delete mDesc;
|
|
57 |
mDesc = NULL;
|
|
58 |
}
|
|
59 |
|
|
60 |
//--------------------------------------------------------------------------------------------------------------------------------------------
|
|
61 |
//setItemText
|
|
62 |
//--------------------------------------------------------------------------------------------------------------------------------------------
|
|
63 |
void GlxDetailsDescriptionEdit::setItemText( const QString &text )
|
|
64 |
{
|
|
65 |
setPlainText( text );
|
|
66 |
}
|