1 /* |
1 /* |
2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of "Eclipse Public License v1.0" |
5 * under the terms of "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
16 */ |
16 */ |
17 |
17 |
18 #include <QPainter> |
18 #include <QPainter> |
19 #include "testwidget.h" |
19 #include "testwidget.h" |
20 |
20 |
|
21 // --------------------------------------------------------------------------- |
|
22 // |
|
23 // --------------------------------------------------------------------------- |
|
24 // |
21 TestWidget::TestWidget(QGraphicsItem *parent, Qt::WindowFlags flags) |
25 TestWidget::TestWidget(QGraphicsItem *parent, Qt::WindowFlags flags) |
22 : HbWidget(parent, flags) |
26 : HbWidget(parent, flags) |
23 { |
27 { |
24 setPreferredSize(100, 100); |
28 setPreferredSize(100, 100); |
25 } |
29 } |
26 |
30 |
|
31 // --------------------------------------------------------------------------- |
|
32 // |
|
33 // --------------------------------------------------------------------------- |
|
34 // |
27 TestWidget::~TestWidget() |
35 TestWidget::~TestWidget() |
28 { |
36 { |
29 } |
37 } |
30 |
38 |
|
39 // --------------------------------------------------------------------------- |
|
40 // |
|
41 // --------------------------------------------------------------------------- |
|
42 // |
31 void TestWidget::onInitialize() |
43 void TestWidget::onInitialize() |
32 { |
44 { |
33 } |
45 } |
34 |
46 |
|
47 // --------------------------------------------------------------------------- |
|
48 // |
|
49 // --------------------------------------------------------------------------- |
|
50 // |
35 void TestWidget::onShow() |
51 void TestWidget::onShow() |
36 { |
52 { |
37 } |
53 } |
38 |
54 |
|
55 // --------------------------------------------------------------------------- |
|
56 // |
|
57 // --------------------------------------------------------------------------- |
|
58 // |
39 void TestWidget::onHide() |
59 void TestWidget::onHide() |
40 { |
60 { |
41 } |
61 } |
42 |
62 |
|
63 // --------------------------------------------------------------------------- |
|
64 // |
|
65 // --------------------------------------------------------------------------- |
|
66 // |
43 void TestWidget::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) |
67 void TestWidget::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) |
44 { |
68 { |
45 Q_UNUSED(option) |
69 Q_UNUSED(option) |
46 Q_UNUSED(widget) |
70 Q_UNUSED(widget) |
47 painter->drawRect(rect()); |
71 painter->drawRect(rect()); |
48 } |
72 } |
49 |
73 |
|
74 // --------------------------------------------------------------------------- |
|
75 // |
|
76 // --------------------------------------------------------------------------- |
|
77 // |
50 QRectF TestWidget::boundingRect() const |
78 QRectF TestWidget::boundingRect() const |
51 { |
79 { |
52 return rect(); |
80 return rect(); |
53 } |
81 } |
54 |
82 |
|
83 // --------------------------------------------------------------------------- |
|
84 // |
|
85 // --------------------------------------------------------------------------- |
|
86 // |
55 QPainterPath TestWidget::shape() const |
87 QPainterPath TestWidget::shape() const |
56 { |
88 { |
57 QPainterPath path; |
89 QPainterPath path; |
58 path.addRect(rect()); |
90 path.addRect(rect()); |
59 return path; |
91 return path; |