diff -r a2467631ae02 -r 1f002146abb4 vmbx/vmbxcpplugin/tsrc/src/ut_customedit.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vmbx/vmbxcpplugin/tsrc/src/ut_customedit.cpp Tue Jul 06 14:53:02 2010 +0300 @@ -0,0 +1,56 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include +#include +#include "ut_customedit.h" +#include "customedit.h" + + + +void Ut_CustomEdit::testFocusInEvent() +{ + HbMainWindow *window = new HbMainWindow; + QVERIFY(window); + + QGraphicsWidget *qGraphicsWidget = new QGraphicsWidget(); + QVERIFY(qGraphicsWidget != 0); + CustomEdit *edit = new CustomEdit(qGraphicsWidget); + QVERIFY(edit); + + QFocusEvent *event = new QFocusEvent(QEvent::FocusIn, + Qt::MouseFocusReason); + QVERIFY(event); + edit->focusInEvent(event); + delete event; + event = NULL; + + event = new QFocusEvent(QEvent::FocusOut, + Qt::MouseFocusReason); + QVERIFY(event); + edit->focusInEvent(event); + delete event; + event = NULL; + + delete edit; + edit = NULL; + QVERIFY(!edit); + + delete qGraphicsWidget; + qGraphicsWidget = NULL; +}