activityfw/testapplications/activitytestletter/italicwidget.cpp
changeset 117 c63ee96dbe5f
equal deleted inserted replaced
115:3ab5c078b490 117:c63ee96dbe5f
       
     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:
       
    15 *
       
    16 */
       
    17 #include "italicwidget.h"
       
    18 #include <QRect>
       
    19 #include <QPainter>
       
    20 #include <QPolygon>
       
    21 
       
    22 const QString KButtonString("to bold");
       
    23 
       
    24 italicwidget::italicwidget(QGraphicsItem *parent)
       
    25     : letterwidget(parent)
       
    26 {    
       
    27     mGridLayout->addItem(mBold, 2, 0, 1, 1);
       
    28     mGridLayout->addItem(mUnderline, 2, 1, 1, 1);    
       
    29 
       
    30     mColor = "green";   
       
    31     mNameCombo->addItem("Italic");
       
    32     
       
    33     delete mItalic;
       
    34     mItalic = NULL;
       
    35 }
       
    36 
       
    37 italicwidget::~italicwidget()
       
    38 {
       
    39     
       
    40 }
       
    41 
       
    42 void italicwidget::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
       
    43 {
       
    44     letterwidget::paint(painter, option, widget);
       
    45     QFont font;
       
    46     font.setPointSize(45);
       
    47     font.setItalic(true);
       
    48     painter->setFont(font);
       
    49     painter->drawText(10, 140, "Italic");
       
    50 }
       
    51 
       
    52 
       
    53