ganeswidgets/tsrc/fute/HgWidgetTest/src/hgcoveritem.cpp
changeset 2 49c70dcc3f17
child 3 c863538fcbb6
equal deleted inserted replaced
1:e48454f237ca 2:49c70dcc3f17
       
     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:  Another view for test application.
       
    15 *
       
    16 */
       
    17 #include "hgcoveritem.h"
       
    18 
       
    19 HgCoverItem::HgCoverItem(QPixmap pixmap, QGraphicsItem *parent) : HbIconItem(parent)
       
    20 {
       
    21     setIcon(HbIcon(QIcon(pixmap)));
       
    22 }
       
    23 
       
    24 void HgCoverItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
       
    25     {
       
    26     emit close();
       
    27     }
       
    28 
       
    29 HgListWidget::HgListWidget(QGraphicsItem *parent) : HbListWidget(parent)
       
    30 {
       
    31     setScrollDirections( Qt::Horizontal | Qt::Vertical );
       
    32     setHorizontalScrollBarPolicy(HbScrollArea::ScrollBarAlwaysOff);
       
    33 }
       
    34 
       
    35 void HgListWidget::leftGesture(int value)
       
    36 {
       
    37     if (value > 30) {
       
    38         emit close();
       
    39     }
       
    40 }
       
    41