90
|
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: Mocked Mocked widget plugin, which trys
|
|
15 |
* to changes it's size illegally.
|
|
16 |
*
|
|
17 |
*/
|
|
18 |
|
|
19 |
#include <qserviceinterfacedescriptor.h>
|
|
20 |
#include <qabstractsecuritysession.h>
|
|
21 |
#include <qservicecontext.h>
|
|
22 |
|
|
23 |
#include "mockwidgetcheater.h"
|
|
24 |
|
|
25 |
MockWidgetCheater::MockWidgetCheater():HbWidget()
|
|
26 |
{
|
|
27 |
setProperty("my_preference1",QString("sun"));
|
|
28 |
setProperty("my_preference2",QString("moon"));
|
|
29 |
setProperty("my_preference3",QString("earth"));
|
|
30 |
}
|
|
31 |
|
|
32 |
MockWidgetCheater::MockWidgetCheater(QSizeF widgetSize):HbWidget()
|
|
33 |
{
|
|
34 |
setProperty("my_preference1",QString("sun"));
|
|
35 |
setProperty("my_preference2",QString("moon"));
|
|
36 |
setProperty("my_preference3",QString("earth"));
|
|
37 |
|
|
38 |
resize(widgetSize);
|
|
39 |
}
|
|
40 |
|
|
41 |
void MockWidgetCheater::onInitialize()
|
|
42 |
{
|
|
43 |
emit initializeCalled();
|
|
44 |
}
|
|
45 |
|
|
46 |
void MockWidgetCheater::onShow()
|
|
47 |
{
|
|
48 |
setProperty("testProperty",QString("dynamic_widget_property"));
|
|
49 |
emit showCalled();
|
|
50 |
}
|
|
51 |
|
|
52 |
void MockWidgetCheater::onHide()
|
|
53 |
{
|
|
54 |
emit hideCalled();
|
|
55 |
}
|
|
56 |
|
|
57 |
void MockWidgetCheater::onUninitialize()
|
|
58 |
{
|
|
59 |
emit uninitializeCalled();
|
|
60 |
}
|
|
61 |
|
|
62 |
QPainterPath MockWidgetCheater::shape() const
|
|
63 |
{
|
|
64 |
QPainterPath path;
|
|
65 |
QRectF currentRect(rect());
|
|
66 |
currentRect.setHeight(currentRect.height() + 10);
|
|
67 |
path.addRect(currentRect);
|
|
68 |
return path;
|
|
69 |
}
|