90
|
1 |
/*
|
97
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
90
|
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 |
|
97
|
21 |
// ---------------------------------------------------------------------------
|
|
22 |
//
|
|
23 |
// ---------------------------------------------------------------------------
|
|
24 |
//
|
90
|
25 |
TestWidget::TestWidget(QGraphicsItem *parent, Qt::WindowFlags flags)
|
|
26 |
: HbWidget(parent, flags)
|
|
27 |
{
|
|
28 |
setPreferredSize(100, 100);
|
|
29 |
}
|
|
30 |
|
97
|
31 |
// ---------------------------------------------------------------------------
|
|
32 |
//
|
|
33 |
// ---------------------------------------------------------------------------
|
|
34 |
//
|
90
|
35 |
TestWidget::~TestWidget()
|
|
36 |
{
|
|
37 |
}
|
|
38 |
|
97
|
39 |
// ---------------------------------------------------------------------------
|
|
40 |
//
|
|
41 |
// ---------------------------------------------------------------------------
|
|
42 |
//
|
90
|
43 |
void TestWidget::onInitialize()
|
|
44 |
{
|
|
45 |
}
|
|
46 |
|
97
|
47 |
// ---------------------------------------------------------------------------
|
|
48 |
//
|
|
49 |
// ---------------------------------------------------------------------------
|
|
50 |
//
|
90
|
51 |
void TestWidget::onShow()
|
|
52 |
{
|
|
53 |
}
|
|
54 |
|
97
|
55 |
// ---------------------------------------------------------------------------
|
|
56 |
//
|
|
57 |
// ---------------------------------------------------------------------------
|
|
58 |
//
|
90
|
59 |
void TestWidget::onHide()
|
|
60 |
{
|
|
61 |
}
|
|
62 |
|
97
|
63 |
// ---------------------------------------------------------------------------
|
|
64 |
//
|
|
65 |
// ---------------------------------------------------------------------------
|
|
66 |
//
|
90
|
67 |
void TestWidget::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
|
68 |
{
|
|
69 |
Q_UNUSED(option)
|
|
70 |
Q_UNUSED(widget)
|
|
71 |
painter->drawRect(rect());
|
|
72 |
}
|
|
73 |
|
97
|
74 |
// ---------------------------------------------------------------------------
|
|
75 |
//
|
|
76 |
// ---------------------------------------------------------------------------
|
|
77 |
//
|
90
|
78 |
QRectF TestWidget::boundingRect() const
|
|
79 |
{
|
|
80 |
return rect();
|
|
81 |
}
|
|
82 |
|
97
|
83 |
// ---------------------------------------------------------------------------
|
|
84 |
//
|
|
85 |
// ---------------------------------------------------------------------------
|
|
86 |
//
|
90
|
87 |
QPainterPath TestWidget::shape() const
|
|
88 |
{
|
|
89 |
QPainterPath path;
|
|
90 |
path.addRect(rect());
|
|
91 |
return path;
|
|
92 |
}
|