homescreenapp/stateplugins/hshomescreenstateplugin/tsrc/t_hshomescreenstateplugin/src/testwidget.cpp
changeset 90 3ac3aaebaee5
equal deleted inserted replaced
86:e4f038c420f7 90:3ac3aaebaee5
       
     1 /*
       
     2 * Copyright (c) 2008 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 <QPainter>
       
    19 #include "testwidget.h"
       
    20 
       
    21 TestWidget::TestWidget(QGraphicsItem *parent, Qt::WindowFlags flags)
       
    22   : HbWidget(parent, flags)     
       
    23 {
       
    24     setPreferredSize(100, 100);
       
    25 }
       
    26 
       
    27 TestWidget::~TestWidget()
       
    28 {
       
    29 }
       
    30 
       
    31 void TestWidget::onInitialize()
       
    32 {
       
    33 }
       
    34 
       
    35 void TestWidget::onShow()
       
    36 {
       
    37 }
       
    38 
       
    39 void TestWidget::onHide()
       
    40 {
       
    41 }
       
    42 
       
    43 void TestWidget::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
       
    44 {
       
    45     Q_UNUSED(option)
       
    46     Q_UNUSED(widget)
       
    47     painter->drawRect(rect());
       
    48 }
       
    49 
       
    50 QRectF TestWidget::boundingRect() const
       
    51 {
       
    52     return rect();
       
    53 }
       
    54 
       
    55 QPainterPath TestWidget::shape() const
       
    56 {
       
    57     QPainterPath path;
       
    58     path.addRect(rect());
       
    59     return path;
       
    60 }